I use the nRF5 SDK for BLE peripheral development based on a keyboard example. After the peripheral connects and bonds with a central device, I can detect button presses. I want pressing a button to switch the peripheral back to advertising mode. How should I do this? Should I first call sd_ble_gap_disconnectto disconnect, and then directly call advertising_init()and advertising_start()?
I am encountering an issue: as a peripheral, after bonding with a central device, I unilaterally cleared the whitelist. However, when the peripheral re-enters pairing mode, the central device keeps attempting to connect and bond, causing the peripheral to repeatedly connect and then disconnect. How can I avoid this problem? The desired outcome is to prevent connection attempts from this specific central device while still allowing other central devices to scan and connect to the device.