Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

calling sd_ble_gap_disconnect() from BLE_GATTC_EVT_READ_RSP in ble_evt_handler resets device

Hello,

I have one central and one peripheral device connected over BLE. The peripheral has a custom service characteristic containing the firmware Version value. After connecting, the central device is discovering the service via ble_db_discovery_start() and after finding it, the characteristic is read by calling sd_ble_gattc_read(). When the BLE_GATTC_EVT_READ_RSP event is triggered, I'm checking the firmware version, and if it does not match I want to disconnect the device by calling sd_ble_gap_disconnect(). My problem is, that calling the disconnect function leads to a reset of the device. How can I fix this? I'm using SDK Version 17.1 and the Softdevice is S140.

Thanks

Related