Skip to content

Commit e611775

Browse files
committed
Fix indication deadlock
1 parent 53c8add commit e611775

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/nRF51822.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -1081,15 +1081,9 @@ bool nRF51822::updateCharacteristicValue(BLECharacteristic& characteristic) {
10811081
}
10821082

10831083
if (localCharacteristicInfo->indicateSubscribed) {
1084-
if (this->_txBufferCount > 0) {
1085-
this->_txBufferCount--;
1084+
hvxParams.type = BLE_GATT_HVX_INDICATION;
10861085

1087-
hvxParams.type = BLE_GATT_HVX_INDICATION;
1088-
1089-
sd_ble_gatts_hvx(this->_connectionHandle, &hvxParams);
1090-
} else {
1091-
success = false;
1092-
}
1086+
success = sd_ble_gatts_hvx(this->_connectionHandle, &hvxParams) == NRF_SUCCESS;
10931087
}
10941088
}
10951089
}
@@ -1140,7 +1134,7 @@ bool nRF51822::canNotifyCharacteristic(BLECharacteristic& /*characteristic*/) {
11401134
}
11411135

11421136
bool nRF51822::canIndicateCharacteristic(BLECharacteristic& /*characteristic*/) {
1143-
return (this->_txBufferCount > 0);
1137+
return true;
11441138
}
11451139

11461140
bool nRF51822::canReadRemoteCharacteristic(BLERemoteCharacteristic& characteristic) {

0 commit comments

Comments
 (0)