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

  • Since LESC isn't supported I guess you are not doing LESC pairing.

    Instead you are probably doing Legacy pairing with Passkey Entry. This will not result in security level 4 (BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM) but security level 3 (BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM)

  • HI Petter, Yes, I suppose it is legacy pairing. What I am not able to understand is that while both FW and the phone show that pairing is successful, the datapath is not working. The app is not able to enable notifications on device's characteristics. Is there any particular setting that is needed to ensure that LESC falls back correctly to BLE 4.1 method of display and passkey entry? thanks, Sam

  • Even if it shows successful (legacy) pairing you have characteristic values and CCCDs that require the connection to be in security level 4 (LESC pairing with MITM) before they read or written.

  • Hi Petter,

    I am using BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM for attributes and CCCDs in the tx_char_add and rx_char_add functions in ble_nus.c. If the central (iPhone 4s) does not support lesc pairing, then does it mean that we will not be able to do data transfer with that central?

    What is the provision for backward compatibility then? I do see that the iPhone 4s prompts the user to enter the 6 digit code displayed on the peripheral device (nRF52) and then show the peripheral as connected.

    What should be the settings in rx_char_add and tx_char_add of ble_nus.c to guarantee backward compatibility with phones that do not support BLE 4.2?

    thanks, Sam

  • That is exactly what it means. If you want devices that doesn't support LESC to access your attributes you cannot use BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM.

    BLE_GAP_CONN_SEC_MODE_SET_LESC_ENC_WITH_MITM is the only option that requires LESC. Use BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM if you want devices that pair with just works to access your attributes, or use BLE_GAP_CONN_SEC_MODE_SET_ENC_WITH_MITM if you only want devices that use passkey entry or OOB to access your devices.

Related