Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

BLE_GAP_EVT_CONNECTED followed by BLE_GAP_EVT_DISCONNECTED with 0x3E reason

Hi,

Occasionally my event BLE_GAP_EVT_CONNECTED are followed by BLE_GAP_EVT_DISCONNECTED with 0x3E reason (BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED).

I'm a little bit confused with this nomenclature because i was assuming that connection was establish with the event BLE_GAP_EVT_CONNECTED .

What are really meaning the event "BLE_GAP_EVT_CONNECTED" ?  

Best regards,

Julien

  • Hi Julien,

    In BLE the central sends a connection indication, and that is by definition the start of the connection. So on a central, you will get BLE_GAP_EVT_CONNECTED event as soon as the connect packet has been sent. And on a peripheral, you will get it as soon as it has been received. However, it could be that the peripheral never got the packet or never replies, or the reply is lost. There is a short timeout for this initial exchange of packets, and if that happens, you will get a BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED disconnect reason. See this post for more details.

Related