Hi - I have an application where I sometimes get an NRF_ERROR_INVALID_STATE error on disconnect when the distance between the client and server is beyond certain limits.
The flow is as follows:
Server receives an internal event and initiates advertising.
Client discovers server and connects to it.
Server sends notification enable on a client characteristic.
Client sends notification.
Server responds to notification.
Client sends disconnect.
Thereafter the client will sometimes time out on the disconnect request and a NRF_ERROR_INVALID_STATE error occurs.
I would like to preserve my state, so I do not power off but rather call idle_state_handle.
My question is - Is there a way to recover from this error so that I do not have to reset and lose state information for the next attempt.
Under normal conditions this always works, but may fail if the distance between the two is past a certain level.
Thank You