This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ERROR 18 [NRF_ERROR_CONN_COUNT] crash after forcing disconnect

Hi,

I try to implement a disconnection after wrote a characteristic parameter. This byte change the working mode of my systeme.

So user connect, write the field to change mode. Then in on_write function , i close some timer and close twi module and  force disconnection with ble_conn_state_for_each_connected(disconnect, NULL);     .

Before force disconnect, i started a timer that will allow to wake up systeme each 20sec , advertise, and allow phone to get data before to enter sleep again, and this infinitely .

But after the first wake up and first advertising this error happens:

<info> app: ADVERTISING...
<error> app: ERROR 18 [NRF_ERROR_CONN_COUNT] at C:\nordic\nRF5SDK160098a08e2\examples\ble_peripheral\Firmware\main.c:918
PC at: 0x00031B91
<error> app: End of error report

Its is triggered by uint32_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
APP_ERROR_CHECK(err_code);

It seems to be related to the number of connexion. But i'm already disconnected  with the own client connected , my phone. Moreover, i remember to have set three max connexion client at a time ( even if i was only able to have only one at a time but i will investigate this further)

DO you have an idea how to manage properly disconnexion? i thought to do it well by using ble_conn_state_for_each_connected(disconnect ... 

Thank you !!!

Related