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

Read encrypted characterisitc with peer manager failes

Hi

I've playing around with the new peer manager a while. I used the example "ble_app_hrs_rscs_relay_pca10028.uvprojx" from the SDK10. After a first fix (see Link) in the peer manager a bonding can be established successfully.

After the fix a connection with iOS is possible. The next step is to make some characteristics to require encryption. I changed the access to characteristics in the function "services_init" from BLE_GAP_CONN_SEC_MODE_SET_OPEN to BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM. The behavior i got after this change is not what i expected and it differs between iOS LightBlue App and Master Control Panel.

With Master Control Panel: I can connect the peripheral, but an attempt to bond failes after a timeout. Discovering the characterisitcs is possible, but the protected values can't be read.

With iOS: After connecting the device with LightBlue App the characteristics are visible, but the value can't be read. I would expect the iOS device to ask if i'll pair (just wurks pairing) with it as it did with device manager.

Steps to reproduce:

  1. Patch the peer manager for the Unable To Connect bug (see link above)

  2. Open the "ble_app_hrs_rscs_relay_pca10028.uvprojx" example

  3. Change the access to characteristics in the function "services_init" from BLE_GAP_CONN_SEC_MODE_SET_OPEN to BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM.

  4. Try to access the characteristics with protection level.

Best Regards Adrian

  • Hi.

    I have changed all open characteristics from BLE_GAP_CONN_SEC_MODE_SET_OPEN to BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM, in services_init().

    Then i connected with MCP for windows, and discovered services. This worked fine (as expected). Then i pressed "Enable Services". This failed since i had set up encryption requirement on the CCCD of both characteristics.

    Then i pressed the "bond" button. The bonding worked, and i was now able to enable services (write to cccd). image description

    I tried with Ligblue for iOS as well. Here i was only able to see the advertisement data. I would not emphasize results with Lightblue all too much. It has varying results from time to time.

    I guess the weird thing here is that your bonding failed with MCP. How many times did you try with the same result?

Related