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

How to avoid reconected by the phone when i disconnected from the device. nrF52832,sdk 15.2.0,s132_nrf52_6.1.0_softdevice,ble_app_hids_keyboard example。

hi , i need help!

     when i conected to the phone(bonding),then i disconnect from the device using sd_ble_gap_disconnect(),next the device advitising again; after that the phone auto conecting to the device again 。

     but now i don’t want to reconnected by the phone ,so what should i do? 

Parents
  • Typically what I see most do is to update the BLE address whenever they want to pair with a new host (and avoid reconnect to old host). This is typically done by call sd_ble_gap_address_get(), increment the address (e.g. byte[3]), then set the new address by calling sd_ble_gap_address_set(). Then start undirected advertisement without whitelist. The peripheral will now appear as a completely new peripheral for any host. The address can be stored in flash for later use. 

    Best regards,
    Kenneth

Reply
  • Typically what I see most do is to update the BLE address whenever they want to pair with a new host (and avoid reconnect to old host). This is typically done by call sd_ble_gap_address_get(), increment the address (e.g. byte[3]), then set the new address by calling sd_ble_gap_address_set(). Then start undirected advertisement without whitelist. The peripheral will now appear as a completely new peripheral for any host. The address can be stored in flash for later use. 

    Best regards,
    Kenneth

Children
Related