Hello, I have developed a bluetooth device starting from the BLE HIDS keyboard sample. In this sample the only way to connect to a new device is to disconnect from the central device and then reconnect. For my peripheral device I would like to implement a pairing mode similar to common bluetooth headphones. The behavior should be as follows:
1. On device power up the device should start advertising and automatically be able to reconnect to the last connected device. (this functionality is currently working on my application)
2. Once put into pairing mode it should disconnect from device and start advertising.
3. In pairing mode it should be able to accept any new central device initiated pairing requests.
The problem I am running into is that upon disconnection the central device immediately attempts to reconnect to my peripheral device taking it out of advertising. The things I have tried to mitigate this is by changing the disconnect reason ( currently I am using BT_HCI_ERR_REMOTE_USER_TERM_CONN), I have tried adding a delay between the disconnection and advertising start, and I have tried deleting bonding keys. I am new to bluetooth device development and so I may be making a simple mistake but I havent been able to successfully get the described behavior.