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

Bluetooth Long Range and encryption

I am using NRF Connect SDK on NRF52840 Dongle and I have written two programs. First acts as bluetooth peripherial device, second acts as bluetooth centeral devices. I have implemented my own service and characteristics. For that characteristics I set permission bit = BT_GATT_PERM_READ_ENCRYPT or BT_GATT_PERM_WRITE_ENCRYPT, it works fine.

Recently I tried to upgrade my programs to support Bluetooth Long Range based on following examples:

https://github.com/nrfconnect/sdk-nrf/tree/master/samples/bluetooth/peripheral_hr_coded

https://github.com/nrfconnect/sdk-nrf/tree/master/samples/bluetooth/central_hr_coded

It works only when permission bit is set to BT_GATT_PERM_READ or BT_GATT_PERM_WRITE, but when I set BT_GATT_PERM_READ_ENCRYPT or BT_GATT_PERM_WRITE_ENCRYPT flag it hands on characteristic read/write.

So, is it possible to use encryption in Long Range mode?

If yes, could you provide any working example?

Parents Reply
  • I forgot that the LBS sample was configured to support passkey pairing/bonding by default. The BT_SECURITY_ERR_AUTH_FAIL  error is probably a result of the central not inserting the passkey displayed by the peripheral. Unless you have you implemented support for passkey entry? Anyway, it's easier implement support for "just works" which does not require any user input.

    I tested "just works" bonding now by modifiying the hr_coded samples available in NCS SDK (tested with v1.4.0-rc2), and it worked.

    hr coded central+peripheral with bonding

    0245.coded_phy_and_bonding.zip

Children
Related