allow update to txPowerMode from onDataWritten()
parent
93af1ec289
commit
9ea6d8b6c1
|
@ -301,11 +301,19 @@ private:
|
|||
} else if (params->charHandle == txPowerLevelsChar.getValueAttribute().getHandle()) {
|
||||
if (lockedState) { /* When locked, the device isn't allowed to update the characteristic. */
|
||||
/* Restore GATT database with previous value. */
|
||||
ble.updateCharacteristicValue(txPowerLevelsChar.getValueAttribute().getHandle(), reinterpret_cast<uint8_t *>(powerLevels), NUM_POWER_MODES * sizeof(int8_t));
|
||||
updateTxPowerLevelsCharacteristic();
|
||||
return;
|
||||
} else {
|
||||
memcpy(powerLevels, params->data, NUM_POWER_MODES * sizeof(int8_t));
|
||||
}
|
||||
} else if (params->charHandle == txPowerModeChar.getValueAttribute().getHandle()) {
|
||||
if (lockedState) { /* When locked, the device isn't allowed to update the characteristic. */
|
||||
/* Restore GATT database with previous value. */
|
||||
updateTxPowerModeCharacteristic();
|
||||
return;
|
||||
} else {
|
||||
txPowerMode = *reinterpret_cast<const TXPowerModes_t *>(params->data);
|
||||
}
|
||||
} else if (params->charHandle == beaconPeriodChar.getValueAttribute().getHandle()) {
|
||||
if (lockedState) { /* When locked, the device isn't allowed to update the characteristic. */
|
||||
/* Restore GATT database with previous value. */
|
||||
|
|
Loading…
Reference in New Issue