Understanding BLE Bonding & Whitelists

  • SDK: 15.2
  • SoftDevice: s140_nrf52_6.1.0
  • FreeRTOS
  • Hardware: nRF52840 (Custom boards)

Hello,

I am having difficulty finding clear and concise information regarding BLE bonding, even on YouTube. I am hoping someone can help me answer some questions. My high-level understanding is that bonding just saves the keys exchanged during the pairing process so that the pairing process doesn't need to occur each time the devices reconnect.

  1. Can you limit the number of Central devices that can bond with a Peripheral? Ideally, I am looking to bond at most 2 Centrals to 1 Peripheral.
  2. Can you enable bonding only on specific links or from specific devices? Ie, if we have Central1, Central2, and Peripheral1, can the link between Central1 and Peripheral1 be bonded, while the link between Central2 and Peripheral1 not be bonded?
  3. Can you enable bonding for only certain BLE services or characteristics, but not all?
  4. Once a Peripheral is bonded to a Central, and the maximum number of bonds have been reached (but bonded devices may not currently be connected), will the Peripheral automatically block connection requests from non-bonded devices, or does a whitelist need to be used?
  5. Once two devices are bonded, but are disconnected, does the Peripheral still send discoverable advertising packets to allow a bonded Central to reconnect? If not, what does the connection process look like for bonded devices?
  6. From the Peripheral side, can you clear bonds for specific devices only, or are you required to clear all bonds?
  7. Do the encryption keys generated during the pairing process ever expire once bonded? Can the same keys be used for the life of the product?

If you have any documentation that covers the topics above in more detail, please feel free to link those here!

Thanks!

Derek

  • Hey Hung,

    You were correct. Some resources lead me to believe that all versions of AES require the plaintext to be padded to 16 bytes, This is not true for AES CCM and AES CTR (And maybe some others).

    I have implemented a solution based on the information above that seems to work well for the moment. Thanks!

    I have a few more questions in regard to whitelists and directed advertising. If I need to open a new ticket for this, let me know.

    1. Can a Peripheral device use both a whitelist and directed advertising at the same time?

    I have enabled both on my device with a static BLE MAC (No peer manager, just using the ble_advertising.c module with BLE_ADV_EVT_WHITELIST_REQUEST and BLE_ADV_EVT_PEER_ADDR_REQUEST respectively). Upon doing so, I notice that only BLE_ADV_EVT_DIRECTED is received and ADV_DIRECT_IND packets are received by my BLE wireshark sniffer capture. When I disable directed advertising, I see that BLE_ADV_EVT_FAST_WHITELIST is received and ADV_IND is received in the wireshark capture. This leads me to believe that the answer to this question is no.

    2. If whitelisting and directed advertising cannot be used at the same time, and assuming directed advertising takes priority, does directed advertising essentially function as a whitelist and thus block connection and scan requests from all devices except the one being directly advertised to?

    Thanks,

    Derek

  •   Should I create a new ticket for my questions above?

    Thanks!

    Derek

Related