This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to save bonding data and reuse it at power-on

Hi,

I am developing an application on nrf51822 chip. I have set

#define SEC_PARAM_MITM 0
#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE

Also i am developing an iOS application to talk to this device. When my application is running and try to connect with the iOS app it asks for pairing. Now my device is paired with iOS. If i restart my nrf51822 chip again iOS app doesnt ask for pairing but it communicates with the last paired information. This way the communication doesnt work between my device and iOS app. I need to manually Forget Device in iPhone to make the communication work. Hence i was thinking whether i can store the bonding data while pairing. I have an EEPROM memory on my board. Can someone please tell me what data i need to store during pairing and what i need to update at power on.

Parents
  • Hi SumitS,

    Could you let me know why don't you want to store the bond information on the nRF51 flash ? instead of your external EEPROM ?

    If you want to handle the data yourself, please have a look at the ble_app_template in nRF51 SDK v8.0 where we handle bonding without the device manager/peer manager. But in that example we don't store the data in flash though.

    You should store p_sec_keyset, which is the keyset you provide when you call sd_ble_gap_sec_params_reply() in BLE_GAP_EVT_SEC_PARAMS_REQUEST.The p_sec_keyset will get the keys when the bonding process finished, BLE_GAP_EVT_AUTH_STATUS event. You should store the keys after you receive this event.

    After your reboot, you should read the keys out from flash and feed the keys to sd_ble_gap_sec_info_reply() call when the previously bonded central re-connect and re-bond (BLE_GAP_EVT_SEC_INFO_REQUEST event).

  • Thanks. I can use the device manager as it is. Currently i am using the sample ble_gls code. In that it is not storing the bond information. Is there any sample code or example which shows how to use the p_storage. Or what changes i need to make in the existing code.

Reply
  • Thanks. I can use the device manager as it is. Currently i am using the sample ble_gls code. In that it is not storing the bond information. Is there any sample code or example which shows how to use the p_storage. Or what changes i need to make in the existing code.

Children
No Data
Related