-1

We are developing an application which needs the BLE Peripheral to be automatically paired with the smartphone when the smartphone is near the BLE Peripheral.

We are using RN4871 Microchip BLE Board, First time when I pair the device from the settings, then power of the device and power on the device, it doesn't show in the Connected Device list, I mean Android doesn't automatically gets connected. Whereas this behavior is not seen in case of Bluetooth Headset.

What is the difference between a BLE Peripheral and Bluetooth Headset, how can i achieve this behavior

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
md.jamal
  • 4,067
  • 8
  • 45
  • 108

1 Answers1

1

That a device is paired (or more correct, bonded) generally just means that the central and peripheral stores keys used for encryption etc. when they later connect.

FYI Peripherals can be programmed so that they advertise with a specific Bluetooth device address as target.

Back to your question. In Android, an "application" must initiate a connection to a device to make it connected (no matter if it's paired or not). That can either be a normal app you install or the built-in HID application in the Bluetooth stack. That said, the HID application will automatically connect to enabled bonded HID devices. So basically, if no application wants the peripheral connected, it won't stay connected.

Emil
  • 16,784
  • 2
  • 41
  • 52
  • If i program my peripheral to act like a HID, will it be automatically paired when in range – md.jamal Feb 16 '19 at 15:51
  • No, the phone never connects and pair automatically with devices. Especially for HID, that would be a serious security issue if your smartphone automatically would pair with a nearby hacker's BLE keyboard... However, if you program your peripheral as a HID device, and the user manually pairs it through Bluetooth Settings, then, the phone will always listen and connect to your HID device when it's nearby and advertises. – Emil Feb 16 '19 at 17:16