Connection handle out of range

I'm using nrf52840 with SDK 17.1.0. 

The relevant link_count settings are:

  • #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
  • #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 1
  • #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1

66713.sdk_config.h

I've implemented a peripheral running NUS, which looks very much like the ble_app_uart sample.

BLE_NUS_DEF(m_nus, NRF_SDH_BLE_TOTAL_LINK_COUNT);

nrf_sdh_ble_default_cfg_set() executes without error or log warnings. I will later be adding a central role, but it is not yet implemented (hence the NRF_SDH_BLE_CENTRAL_LINK_COUNT of 1).

I had expected all incoming connection handles to be in the range 0..NRF_SDH_BLE_TOTAL_LINK_COUNT-1 (so only 0).

However, the only connection handle I see is "1". This messes up ble_link_ctx_manager, which clearly expects the connection handle to be < max_links_count which is NRF_SDH_BLE_TOTAL_LINK_COUNT (1). 

Any idea why my incoming handle ID is always 1 instead of 0?

Thanks,

Chris

Related