This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE Pairing through App vs Device Settings

I have been searching around, and it seems BLE devices need to be paired through their app on phones, as opposed to discovering and pairing through the phones settings menu.

Can anyone explain why we cannot pair a BLE device through a phones settings, then open up an app that will be using the BLE device?

Parents
  • This depends on what phone you are using. On Android i think you can discover and pair with most peripherals in the Bluetooth device menu. However, on iOS you will only see devices that is natively supported by iOS, e.g. HID, HRM, ANCS etc. So if you have another device you would have to connect from the app (pairing is handled by core bluetooth), note that I don't see the problem in this approach as you would anyway need an application to use services not supported by the OS.

Reply
  • This depends on what phone you are using. On Android i think you can discover and pair with most peripherals in the Bluetooth device menu. However, on iOS you will only see devices that is natively supported by iOS, e.g. HID, HRM, ANCS etc. So if you have another device you would have to connect from the app (pairing is handled by core bluetooth), note that I don't see the problem in this approach as you would anyway need an application to use services not supported by the OS.

Children
  • Im using android with nRF Master Control Panel.

    If I do the pairing through the android Bluetooth device settings, then open the nRF Master Conrol Panel app, the device will not be found. I would have to make the device advertise again, and then it would show up in the app and be able to connect, and then I would be able to read all the characteristics.

    Is there a way for the app to be able to connect to a device that has already been paired from the android Bluetooth device menu? Or is the only way for an app to be able to connect and read characteristics from a device, is for the device to be paired through the app itself?

  • Hi, On Android you should be able to pair with any device using Settings. If Android supports it (like HID) it will connect to it. Otherwise it will just bond and disconnect. In the nRF MCP 4+ you have the BONDED tab, where you can see all your bonded devices. If the device is already connected, for example using another app, you may click the CONNECT button and connect to it also from nRF MCP. If it's not connected, it has to advertise or at least listen for connect request from the phone. Usually bonded devices are advertising directly to paired device. In nRF MCP 4+ you may also discover connections made by other application. To do that you have to enable the GATT server (Configure GATT server in navigation menu). It doesn't have to have any services, but has to be enabled. Then, whenever a device connects to a phone (or phone to a device), a tab will be opened.

  • On iOS, on the other hand, as Runar wrote, the only way to bond with a device is by trying to read or write a secured characteristic or descriptor. iOS API allows apps to retrieve connected devices, but no bonded devices. I don't know how the gatt server behaves there.

  • retrieveConnectedPeripheralsWithServices: will return any connected device regardless of whether it is bonded or not.

Related