paring,bonding and whitelisting

Hello,

Is there examples of paring,bonding and whitelisting?

The pairing and bonding mode is static password.

It is best to have examples of the central and the peripheral.

Thank you.

  • Hello,

    Now I want to know how to delete the bonding information on the central and the peripheral side when

    I recieve the strings "A5". At this point, they are connected.

    I've tried this many times, but it's hard for me to disconnect and disable scanning and advertising before using delete_bonds().

    I would really appreciate it if you could provide me with the complete code, because deleting the bonding information has been bothering me for so long.

    Thank you.

  • Hi,

    It is difficult to provide the complete code as it needs to be integrated in yoru applicatioon. However, you do not need to do many things:

    1. If you only have one connection, stop that ocnnection with a call to sd_ble_gap_disconnect(). There you pass the connection handle and a disconnect reason. That would typically be BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.
    2. As a peripheral, stop advertising by calling sd_ble_gap_adv_stop() with the advertising as parameter (you got that when you configured the advertiser). As a central, stop scanning with sd_ble_gap_scan_stop(). This does not take any parameters.
    3. Call pm_peers_delete() to delete the bonds.
Related