Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

After a long press of a button our device will erase all bonds and start to advertise. If we were paired with a central like our Bluez linux device it will try over and over to connect with its old bond info.

Desired behavior:

After a long press of the button, my desired behavior is to erase bonds and advertise and let another central pair and bond to the device. 

After a normal press of the button my desire is to advertise without whiteslist and let another central pair and bond to the device.

Current behavior:

After a long press of a button our device will erase all bonds and start to advertise.  If we were paired with a central like our Bluez linux device it will try over and over to connect with its old bond info and fail because our device does not have the bond anymore.

After a normal press we advertise without whitelist and the paired central immediately reconnects.

We use whitelist but limit the list to only one address.  For example when a new bond is made we replace the old address in the whiltelist with the new one.

Is there a standard way make it so when the button is pushed on the device we would advertise and not have the central continue to try to reconnect until we fall back and allow it because of a reset or some other trigger.

I have seen other devices do it by changing their addresses but this feels like a hack.  Is there a better way?

Related