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

Connection after disconnect

Hello. I created some HID device based ble_app_hrs_pairing_nfc example on NRF52. And I have a questions:

1.I need to automatically reconnect to bonded device after reboot, but I don't need to start advertising again if I have bonded device. Can I use whitelist for this or no? And how? Or I should save peer adress in storage and read this address when system is starting and run advertising direct? I use peer manager enstead device manager.

I have 2 variants. After master disconnected and try connect again I should automaticaly connect to him. How I can do this? Adverrtising in example start working when NFC field detected. second vaiant: after restarting my device I should automatically connect too. Shouls I use advertising girect?

Parents
  • This is a peripheral? What kind of central is it connecting to? It is the central that decided what peripheral to connect to, so the autoconnect has to be configured in the central. You have to advertise for a central to be able to connect. A whitelist filter out connection requests from centrals you don't want to connect to, is this something you want? You can do directed advertising, but the central still has to initiate the connection.

    You can use the disconnect event to trigger the start of advertising. You can use directed advertising, but then you should also be sure that the central is scanning.

Reply
  • This is a peripheral? What kind of central is it connecting to? It is the central that decided what peripheral to connect to, so the autoconnect has to be configured in the central. You have to advertise for a central to be able to connect. A whitelist filter out connection requests from centrals you don't want to connect to, is this something you want? You can do directed advertising, but the central still has to initiate the connection.

    You can use the disconnect event to trigger the start of advertising. You can use directed advertising, but then you should also be sure that the central is scanning.

Children
No Data
Related