I'm trying to get iOS to open an L2CAP Connection Oriented Channel on the nRF52840.
I'm stuck at the nRF always rejecting the connection with result 0x0004 (Connection refused – no resources available).
On the firmware, an event BLE_L2CAP_EVT_CH_SETUP_REFUSED is raised with Source=Local, Status=BLE_L2CAP_CH_STATUS_CODE_NO_RESOURCES.
It sounds like I need to configure the stack to allocate resources for the L2CAP connection.
I've tried to set:
#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 3 #define NRF_SDH_BLE_TOTAL_LINK_COUNT 3
thinking that this could be related to the number of L2CAP channels but it made no difference.
What does the SD need to accept L2CAP connection?
Also, if I break the program in the debugger and the resume it, it tends to crash with a SD assert for PC 0x00012cfa.
I'm not sure if it's relevant, but it looks odd.