How to prevent ble_app_UART that implements pairing from connecting to ble_app_uart_c that does not implement pairing

Module: nRF52832

Implemented pairing for ble_app_UART (NUS).
However, I can connect with ble_app_uart_c, which does not have pairing implemented.
Please tell me how to prevent the ble_app_UART that implements pairing from being connected to ble_app_uart_c that does not implement pairing.

Parents Reply
  • Hi,

    Aha, so you have an existing bond, and only want to allow the bonded device to connect? If so, that is very standard, and the concept of whitelisting in Bluetooth is for this exact use case. Then you start advertising with a whitelist which only includes the bonded peer, and only that will be allowed to connect. Any other connection attempts will be ignored by the Bluetooth stack.

    You can refer to for instance the ANCS example to see how whitelisting is used.

Children
Related