Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE_GAP_EVT_LESC_DHKEY_REQUEST error 0x16

52840 sdk 15.3

// <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
#endif

// <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
#endif

// <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count.
// <i> Maximum number of total concurrent connections using the default configuration.

#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 2
#endif

In the function on_dhkey_request at line #376     m_peer_keys[conn_handle].is_requested = true;

I have only 2 links one peripheral and one central.

The error comes from the connection handle passed to this function hase the value of 3.

Then in the nrf_ble_lesc_request_handler function the line# 315 only loops thru the 2 NRF_BLE_LESC_LINK_COUNT entries never getting to the connection handle array entry.

Please offer me somewhere to look as to why I am getting the connection handle of 3 and information on how to move forward on this issue.  I thought I understood that the peripheral connection handle started automaticially after the central handle count or in this case should be conn_handle 1?

Related