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

Bonding Question

Hello,

I'm implementing bonding feature on nRF52 with SDK_0.9.2. I found a tutorial which is devzone.nordicsemi.com/.../. I followed this tutorial and then tried to implement on hrs example. then I realized that hrs example already implemented bonding features by default. Is it correct? So I didn't change the source code and just use No I/O capabilities. It seems that I can bond with my iphone(It can reconnect automatically) But when I use frontline BPA low energy sniffer to capture the heart rate data, I still can see raw data on my sniffer, ex. Heart rate 140, 150, etc... From my understanding, if two devices are bonded, they would save the LTK and encrypt data via transmission. Therefore, I shouldn't see raw data on my sniffer. I'm wondering if it's because I use "No I/O capabilities" and my sniffer listen the traffic from beginning so it can interpret the raw data? If not, do I need to add any code to implement bonding feature?

Thanks, Mich

Parents
  • Why are you using SDK 0.9.2? Do you have preview development kit? PCA10036? ble_app_hrs supports bonding yes, but the accessing the CCCD of the heart rate characteristic doesn't require the link to be encrypted. If you can see the data on the sniffer there are two possibilites, you haven't bonded, so the link is not encrypted, or the sniffer sniffed the pairing process and got the encryption keys.

    If you want the CCCD to require the link to be encrypted you can change this in services_init(). Change BLE_GAP_CONN_SEC_MODE_SET_OPEN(&hrs_init.hrs_hrm_attr_md.cccd_write_perm); to

    BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&hrs_init.hrs_hrm_attr_md.cccd_write_perm); only require Just Works pairing to access the CCCD.

    or

    BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(&hrs_init.hrs_hrm_attr_md.cccd_write_perm); requre Passkey Entry or OOB pairing to access the CCCD.

Reply
  • Why are you using SDK 0.9.2? Do you have preview development kit? PCA10036? ble_app_hrs supports bonding yes, but the accessing the CCCD of the heart rate characteristic doesn't require the link to be encrypted. If you can see the data on the sniffer there are two possibilites, you haven't bonded, so the link is not encrypted, or the sniffer sniffed the pairing process and got the encryption keys.

    If you want the CCCD to require the link to be encrypted you can change this in services_init(). Change BLE_GAP_CONN_SEC_MODE_SET_OPEN(&hrs_init.hrs_hrm_attr_md.cccd_write_perm); to

    BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&hrs_init.hrs_hrm_attr_md.cccd_write_perm); only require Just Works pairing to access the CCCD.

    or

    BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM(&hrs_init.hrs_hrm_attr_md.cccd_write_perm); requre Passkey Entry or OOB pairing to access the CCCD.

Children
Related