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

LESC with old phones (e.g. iPhone 4s)

Hi,

I just implemented LESC Numeric Match on the NUS service for my peripheral device (based on ble_app_multirole_lesc example). I am able to connect to my device using numeric match confirmation with iPhone 6 and iPhone SE and transfer data.

However, when I use iPhone 4S (which doesn't support Bluetooth 4.2), then I see prompt to manually enter 6 digit key on the phone. With that, the pairing/bonding seems to go fine. However, there is no data transfer.

I am using BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM for &cccd_md.write_perm and &attr_md_.read_perm and &attr_md.write_perm in rx_char_add() I am using BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM for &attr_ms.read_perm and &attr_md.write_perm in tx_char_add()

Any pointers on what might be going wrong?

Thanks, Sam

  • Thanks, Petter.

    Is there any way to change the security mode on the fly (to BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM) to allow connection and data exchange with BLE4.1 central devices (like iPhone 4s) and keep the default setting to BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM for BLE4.2 central devices?

  • Hi Sam, its not possible to modify the GATT table after you have added the services/characteristics/descriptors on the fly. in order to change the properties of the CCCD you'll have to disable the Softdevice, re-enable it and then re-add the services/characteristics/descriptors with the different configuration. I think the better option is to set the security mode to BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM to ensure that you can access the attributes with phones that does not support LESC. If the phones support LESC then you can upgrade the security mode by using pm_conn_secure with force_repairing set to true.

Related