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?
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?
Background
I'm using a couple of different hobbyist BLE devices (HM-10). This particular one is an example of one of them.
It's a simple 4-pin device and I've set all the parameters on it using an Arduino Nano and I can see the data coming into it live since it is connected to USB of my computer and I'm monitoring serial data using Arduino Serial Monitor.
The device works great. I have it set to Type 3 which forces it to pair/bond (so iphone or ipad will force you to enter the 6-digit PASS code, which I've set on the device.
iPhone App Works
I have written a simple Single-View iOS app which runs on my iphone / ipad and finds local BLE peripherals.
Everything works great.
When I select the item (HM-10) shown above by name I see the iOS pairing dialog & successfully pair the item.
I can send data and everything works fine. If I go out of distance or turn off bluetooth on my device then come back into proximity or turn the device back on, then the iphone can send data again and I see it in the Serial Monitor. Works great.
** The Problem **
The problem occurs if I then pair this device with any other iphone or ipad.
After that, the new iphone / ipad can send data to the device with no problem.
However, if I then go back to my original iphone and attempt to send data again, I see the following error raised by the CBCentralManager:
"Peer removed pairing information."
After that, I cannot send data from the original iphone to the device again, unless I go to Bluetooth settings on the phone and say, "Forget this device".
Android & HC-06 Bluetooth Devices
I've developed simple Android apps which use a similar Bluetooth classic device (HC-06) and I could pair multiple devices.
Questions
Does BLE 4.0 Allow multiple devices to be paired & bonded?
Do you know why the Peripheral would remove the pairing info? (again, this only occurs if I pair the device with a new iphone / ipad).
Is there a way to send something via iOS app that would tell it to renew the pairing information?
Do you have any suggestions (code to try or other) that would allow me to definitively know that this device does or does not allow multiple phones to pair with it? (I've contacted the manufacturer also.)
Note: I also have a another BLE device here and it seems to exhibit the same behavior. This seems odd though, because I have a BLE speaker that will pair with multiple devices so it must be possible. And I understand that could depend upon the BLE hardware.
Does BLE 4.0 Allow multiple devices to be paired & bonded?
Sure. But that doesn't mean that the device does. It needs to allocate memory for it, and smaller devices often don't.
Do you know why the Peripheral would remove the pairing info? (again, this only occurs if I pair the device with a new iphone / ipad).
It doesn't remove the pairing info. It's telling you the device has removed the pairing info. Pairing info includes a shared secret, so if one side throws away their secret, there's no point in you keeping yours. You have to create a new one.
Is there a way to send something via iOS app that would tell it to renew the pairing information?
Unfortunately no. Apple doesn't give any access to the pairing experience.
There isn't any standardized way to ask devices this kind of information. Some devices support a single pairing Some support two. Some support "a few." But it's really up to the device.
It is very possible that you will get a better overall experience with a Bluetooth 4.1 or 4.2 device, because they've added better security protocols. With iOS 13, the phone also supports cross-transport key derivation, which possibly will help here (if the device also supports it). But I don't think you can improve things with a Bluetooth 4.0 device.
The actual bluetooth pair I am talking about is: let the app shows up in the searching list of Bluetooth of System Settings and other devices can pair to it (like we pair our device to Apple Air Pods).
But all articles I find online are talking about BLE/CoreBluetooth, I don't think these methods could make a device name shows up in the Bluetooth of System Settings.So how to develop an app performing an actual bluetooth pair? Any ideas?
The Bluetooth preferences screen only shows legacy Bluetooth peripherals. Devices advertising BLE services do not appear.
Apps on iOS do not have the ability to create and advertise legacy Bluetooth services.
If you create an app that acts as a BLE peripheral, using Core Bluetooth, and specify that encryption is required for a characteristic then you will trigger a pairing process when an app acting as a Bluetooth central on the other device connects and attempts to read/write that characteristic. Note that this requires cooperating apps on both devices.
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.
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.