How does an iPhone know to connect to an MFi device via Bluetooth automatically? Is the Bluetooth on iPhone constantly looking for a device to hook up to? What happens if there are a few MFi (all with Bluetooth support) around?
You import ExternalAccessory/ExternalAccessory.h in your .m file(implementation) so that you can use the libraries that contains the accessory information or get available accessories around. Using this, we can also open a session with the selected accessory.
I'm not sure if you can connect to multiple bluetooth devices that are detected.
The user must go to Settings/Bluetooth or Settings/General/Bluetooth (according to which version of iOS the device runs), and wait till the MFi accessory got discovered by the iOS.
Then the user must manually connect the device for the first time. The accessory usually remembers the pairing relationship and reconnect to the iOS automatically, if the user got so lucky when the bluetooth of iOS is on.
Though I have never tried to played with connection of multiple bluetooth MFi devices, Apple's documents suggested that after iOS 5, it is supported.
Related
I am working on an audio device project with dual-mode Bluetooth. I want to create a seamless connection experience with iOS devices, so I use CTKD with iOS. This gives us the ability to connect both BR/EDR and BLE without leaving our app in the system settings.
It works perfectly if the initial pairing happened inside the app. I got both BR/EDR and BLE connected and working and only one device shows on the Bluetooth page.
But if I pair the Bluetooth(BR/EDR) first in the system settings and then go to the app to pair BLE. The app initiated a new CTKD process, which creates a new BLE connection beside the BR/EDR connection.
My question is if I pair BR/EDR first in the Bluetooth settings, is there a way that I can only pair BLE and didn't trigger the CTKD while keeping the one device displayed on the Bluetooth settings page? Or anything else that can get the same result?
We are working in Blood pressure monitor project . we have implemented GATT protocol in our device to communicate with iphone / iPad . so far we are using Core bluetooth framework to communicate with our device ,Its working fine in data transmitting.
But our device is not visible / listing in iPhone Bluetooth in the settings page.
please note that we are not using any MFI chip.
Please advice what we needs to be done to make our device visible in iphone's bluetooth settings page without using MFI chip.
In order for your BLE device to show up in iOS Bluetooth settings, it has to have gone through the pairing process, as stated by Larme.
To do so, the device must have one or more characteristics that are encrypted. When your app tries to read/write/indicate on that characteristic, the read will fail with an Insufficient Authentication error code, which will then should start the pairing process. See section 25.10 in Apple's Accessory Design Guidelines - https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf
Once the user has selected to Pair in the dialog, keys are exchanged to finish the pairing process. Your device will show up in Bluetooth settings at that point.
Is there a specific reason that you want the device to show up in Bluetooth settings?
I am using EASession (External Accessory) library to integrate with my Non-BLE Bluetooth device. I am looking for a way to pair my device automatically without the need to go to the: iPhone Settings->Bluetooth->select my device->and manually click on the device.
is there a way I can get the list of all Bluetooth devices which already paired and send a connection command?
Objective-C answer will be appreciated
We are building a custom Bluetooth device that supports both Bluetooth Classic for Handsfree as well as Bluetooth LE for other features. I am able to connect and communicate with the device via Bluetooth LE however, right now the user must manually pair with the device from Settings in order for the handsfree stuff to work. Like the Apple Watch, is it possible to automatically pair with the device via Bluetooth Classic when the device is selected from the Bluetooth LE list of available devices?
Basically, here is how we want it to work.
User launches application for the first time.
User is redirected to registration screen and registers their phone with our environment.
User is taken to the applications Dashboard and then clicks the applications Settings button.
In Settings, the user clicks Bluetooth Peripherals and is taken to a screen with a list of the BLE devices in range.
Here is where the new magic needs to happen:
User chooses BLE device, the devices is discovered and connected to via BLE.
After the devices characteristics have been discovered, the application should pair with the device via Bluetooth Classic for the handsfree stuff to work such as the microphone and speaker.
Any help is appreciated.
I have looked into the External Accessory framework however, I was unable to get it to even work properly. The application kept failing telling me "init" was not available or something.
Thank you.
We're trying to do the same thing and it looks like you can only pair a hands-free device working via HFP profile if leaving your app, going to Bluetooth settings in Settings.app and tapping the device there. From the app it's absolutely impossible. All the hands-free vendors I checked recently (Jabra, Parrot, etc.) do it this way.
The only thing I can think about would be pair via BLE, send the iPhone name to your hands-free accessory via BLE open Bluetooth settings screen in the Settings.app and wait for the accessory to discover the iPhone and connect to it from its side. This will save your user a tap, but he will still have to open the Settings.app (manually, bloody hell, not even via a system alert).
ExternalAccessory.framework is used to connect with devices registered in MFi program. It has absolutely nothing to do with hands-free devices working with HFP profile.
I'm working on iOS development for a bluetooth peripheral. We want the (already paired) device to connect when a button is pressed on it, and this will cause the app to execute some code. Is it possible for the app to detect that the device is connected, even while in the background?
Also, is it possible for the app to bring itself into the foreground when this is detected? Would I need to be a member of the MFi program to do either of these things?
You will be able to detect that the device is connected in the background using Bluetooth 2.0, however you must include the App communicates with an accessory string under Required Background Modes in the app's plist.
So yes, the first part of your question is doable. However when you say: "We want the (already paired) device to connect when a button is pressed on it", it is important to note that this functionality must be built into the device's firmware. The app can always be searching for it, but the device will not be able to communicate with the phone until it connects. Therefore, the button must wake up the device and signal that it now wants to connect.
For the third part of your question, you will not be able to bring the app into the foreground without the user opening the app.
Btw, CoreBluetooth is the Bluetooth Low Energy framework for iOS. It is completely different from Bluetooth 2.0.
as ttarules told you iphone can't connect automaticly to a paired device.
I don't know what kind of bluetooth receiver have you in your device but generally you can set up a method of "AUTOCALL" that automatically call a paired device (in this case an iPhone).
When you (your iPhone) come around the device it automatically establish a connection!
If you set all the parameters correctly in the bluetooth module you can make sure that the iPhone shows a message like this: "YourDevice would like access to YourApplication" when the connection is established.
this way helps the user to use your application and you can run the code you mentioned above when the app start.