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

Device manager: How to identify between already bonded phones with new phones?

Hi, I am developing a firmware using nrf51822xxaa s130 SDK 10.0. I am using device manager to exchange the security keys and storing the bond information. For my project, I need the firmware to connect to the phone that is already paired with the device (before power cycle of the device). In other words, I should be able to identify if the app has already bonded with me before or not. Also, I need to identify if this is the first time the app is bonding with me. [I remember I saw an event which would occur only the very first time when a device and app would bond and that event would not occur in the subsequent connects (because it is already bonded before). I cant remember which event is that.] The project is in its final stages and at this stage we cannot afford to make a transition to SDK 11.0 or later versions: please consider this. Please help. Thanks.

Parents
  • Hi Nordicdev,

    You can have a look at the device_manager.h and look for "Link Status Events", you can find the list of event regarding security process. You can also have a look here to see what happens under the hood between the softdevice and device manager.

    Basically you receive DM_EVT_LINK_SECURED after the link is encrypted (regardless it's a new central or not)

    You receive DM_EVT_SECURITY_SETUP if there is a bonding request

    You receive DM_EVT_SECURITY_SETUP_COMPLETE if it's a new bond or a refreshed bond (master require the new keys to be exchanged, rarely happens)

    If you want something more than that, you may need to look into the device manager code to extract information about if the central is bonded or not (check BLE_GAP_EVT_CONNECTED event in dm_ble_evt_handler() ).

  • Also, for Android, when the nrf51 bonds with the phone for the first time, I receive DM_EVT_SECURITY_SETUP_COMPLETE, but I don't receive this when pairing with iOS? In other words, I am repeating the same original question (how to find if it is a new bond and how to find if the connected phone has previously been bonded with the nrf51 device) but for iOS smart devices. With Android, the answer that you have given works fine.

Reply
  • Also, for Android, when the nrf51 bonds with the phone for the first time, I receive DM_EVT_SECURITY_SETUP_COMPLETE, but I don't receive this when pairing with iOS? In other words, I am repeating the same original question (how to find if it is a new bond and how to find if the connected phone has previously been bonded with the nrf51 device) but for iOS smart devices. With Android, the answer that you have given works fine.

Children
No Data
Related