what API to use for automatic connection to a peer device at power on?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am trying to realize a feature where once the BLE device is powered up, it will connect automatically to a peer device whose address has been stored when it had been connected before.

   

the BLE device that I am developing acts are a peripheral.

   

Of course, at the very first time it turns on, it would have no history of a device address to connect to. However, when connected to some peer device, it will store its device address(or something else to identify the partner) in the flash.

   

In that way, even after a power cycle, my BLE device will load the target device address from flash and try to connect to it.

   

 

   

So far, digging in to the API documents, I've found that the 'whitelist' seems to be one way to realize my objective.

   

However, I'm curious about a few things here:

   

Q1. Is whitelist the only chance for me to achieve my goal?

   

Q2. Connection is made when both the peripheral and central both interact with each other. Therefore I'm assuming that trying to do something on the peripheral side alone is not enough to achieve my goal. Am I right to think that I need to make changes in the central BLE device too?

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

1) the whitelist has nothing to do with automated connection. It allows you to connect only to know devices, instead of every central device that tries to.

   

2) yes. The BLE peripheral is only advertising. Its the central device thats actually starting he connection process. So you need to make your central device to scan continuously (or e.g. every 10 seconds) - watch out for battery consumption!

View solution in original post

0 Likes
1 Reply
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

1) the whitelist has nothing to do with automated connection. It allows you to connect only to know devices, instead of every central device that tries to.

   

2) yes. The BLE peripheral is only advertising. Its the central device thats actually starting he connection process. So you need to make your central device to scan continuously (or e.g. every 10 seconds) - watch out for battery consumption!

0 Likes