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

how to handle NRF_ERROR_INVALID_STATE of sd_ble_gap_scan_start?

Hi all,

I develop a central application, which manages multiple peripheral connections. The application often has to stop and start scanning again. In rare cases the function sd_ble_gap_scan_start() returns with “NRF_ERROR_INVALID_STATE” so the following APP_ERROR_CHECK() causes a software reset. In which cases does it come to an “invalid state”? How should I react to this? Shall I ignore this error and try to start scanning again later?

Related