arduino-BLEPeripheral
arduino-BLEPeripheral copied to clipboard
Indicate Deadlocks on nRF5
Indications will deadlock on nRF5 after N indications without any other activity. This is because the current code incorrectly considers indications to use one of the TX buffers, and they never get replenished because there is no BLE_EVT_TX_COMPLETE
.
Per documentation for the SoftDevices (S110, S130, S132) indications do not consume an application buffer, so they shouldn't be involved in the TX buffer tracking.
I have a fix in my repo (e6117755e841db643211a1836d16565eacbee4a1) but I didn't open a PR because nRF8 needs to be checked for the same issue, and I think more changes should be made to updateCharacteristicValue
, like checking the return value of sd_ble_gatts_hvx
for the possible error conditions.