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

  • thank you for your replied。i changed the mac addr and it work。but the problem i encount is that i don't want to changed the addr,the reson show below:

    after i disconnect from the device then i advising and don't want to auto reconnect by the phone. until i press  the connect button on the phone ,then can connect to the device again。

    i try one method which i advising without whitelist but the phone also auto reconnect to the device。so what should i do?

    is it work when i advising without whitelist?

Reply
  • thank you for your replied。i changed the mac addr and it work。but the problem i encount is that i don't want to changed the addr,the reson show below:

    after i disconnect from the device then i advising and don't want to auto reconnect by the phone. until i press  the connect button on the phone ,then can connect to the device again。

    i try one method which i advising without whitelist but the phone also auto reconnect to the device。so what should i do?

    is it work when i advising without whitelist?

Children
Related