Skip to content

Commit ae89290

Browse files
lemreyeivindj-nordic
authored andcommitted
sdh: ble: add assert condition when pulling BLE events
When an SoC event triggers the SoftDevice handler to pull events, if BLE is not enabled, sd_ble_evt_get() can return an undocumented error code: BLE_ERROR_NOT_ENABLED. In that case, we don't want to assert. Signed-off-by: Emanuele Di Santo <[email protected]>
1 parent 8f0ab45 commit ae89290

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/softdevice_handler/nrf_sdh_ble.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@ static void ble_evt_poll(void *context)
318318
}
319319
}
320320

321-
__ASSERT(err == NRF_ERROR_NOT_FOUND,
321+
/* An SoC event may have triggered this round of polling, and BLE may not be enabled */
322+
__ASSERT((err == NRF_ERROR_NOT_FOUND) || (err == BLE_ERROR_NOT_ENABLED),
322323
"Failed to receive SoftDevice event, nrf_error %#x", err);
323324
}
324325

0 commit comments

Comments
 (0)