Devices not in whitelist receiving connected event before being rejected

nRF Connect SDK Version: 2.0.2

Network core image: hci_rpmsg

I have an nRF5340 device acting as a peripheral. When I initialize advertising with the BT_LE_ADV_OPT_FILTER_CONN flag set and a single address in the filter accept list, a second nRF5340 device acting as a central, but NOT in the filter accept list attempts to connect to the peripheral and receives a "connected" event with no error set. I would expect the connection to be rejected and either no "connected" event to be received, or an error code to be returned.

Is this expected behavior? Is there some way to reliably detect a rejected connection?

Parents
  • Hi,

    Yes, this is expected behavior. There is no way to rejected a connection attempt in Bluetooth, so when a central that is not in the whitelist attempts to connect, the peripheral simply ignores it. And moreover, from the central perspective, the connection has started when the connection indication is sent. However, there is a short timeout before the first packet has been acknowledged by the peer, so you will get a disconnect with reason 0x3E, which means that the connection failed to be established.

Reply
  • Hi,

    Yes, this is expected behavior. There is no way to rejected a connection attempt in Bluetooth, so when a central that is not in the whitelist attempts to connect, the peripheral simply ignores it. And moreover, from the central perspective, the connection has started when the connection indication is sent. However, there is a short timeout before the first packet has been acknowledged by the peer, so you will get a disconnect with reason 0x3E, which means that the connection failed to be established.

Children
Related