parent
3baef00b9b
commit
22a54fcced
1 changed files with 7 additions and 1 deletions
|
@ -109,7 +109,7 @@ public:
|
|||
uriDataChar.setWriteAuthorizationCallback(this, &URIBeaconConfigService::uriDataWriteAuthorizationCallback);
|
||||
flagsChar.setWriteAuthorizationCallback(this, &URIBeaconConfigService::flagsAuthorizationCallback);
|
||||
txPowerLevelsChar.setWriteAuthorizationCallback(this, &URIBeaconConfigService::denyGATTWritesIfLocked);
|
||||
txPowerModeChar.setWriteAuthorizationCallback(this, &URIBeaconConfigService::denyGATTWritesIfLocked);
|
||||
txPowerModeChar.setWriteAuthorizationCallback(this, &URIBeaconConfigService::powerModeAuthorizationCallback);
|
||||
beaconPeriodChar.setWriteAuthorizationCallback(this, &URIBeaconConfigService::denyGATTWritesIfLocked);
|
||||
resetChar.setWriteAuthorizationCallback(this, &URIBeaconConfigService::denyGATTWritesIfLocked);
|
||||
|
||||
|
@ -395,6 +395,12 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
void powerModeAuthorizationCallback(GattCharacteristicWriteAuthCBParams *params) {
|
||||
if (lockedState || (*(params->data) >= NUM_POWER_MODES)) {
|
||||
params->authorizationReply = false;
|
||||
}
|
||||
}
|
||||
|
||||
void denyGATTWritesIfLocked(GattCharacteristicWriteAuthCBParams *params) {
|
||||
if (lockedState) {
|
||||
params->authorizationReply = false;
|
||||
|
|
Loading…
Reference in a new issue