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

Automatic connection to nrf51 when in range.

Hi NordicSemiconductor's community,

I have a basic question about connection to a BLE peripheral. I use the SDK_10.0.0 and s110_v8.0.0.

I want to know how to implement a fonctionnality in my BLE product; I want the Android smartphone connect automatically to the device when he is in range.

Now i can connect to it, by doing a scan on my application and with my peripheral advertise. But i don't have any idea about how connect to my device automatically ??

Thanks for your help, Best regards.

Parents
  • Hi, please have a look at nRF Toolbox app on GitHub. We really recommend using it as a reference design. The BleManager class has a method shouldAutoConnect(), which you may find interesting. If you want to write your own app without being it on nrf toolbox, check the connectGatt(..., autoConnect = true, ...) method from BluetoothDevice class, and connect() in BluetoothGatt. Also, please read the BLE on Android guide that you will find here on Devzone.

Reply
  • Hi, please have a look at nRF Toolbox app on GitHub. We really recommend using it as a reference design. The BleManager class has a method shouldAutoConnect(), which you may find interesting. If you want to write your own app without being it on nrf toolbox, check the connectGatt(..., autoConnect = true, ...) method from BluetoothDevice class, and connect() in BluetoothGatt. Also, please read the BLE on Android guide that you will find here on Devzone.

Children
No Data
Related