Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: microbit-dal microbit-dal microbit-ble-open microbit-dal ... more
Fork of BLE_API by
Diff: services/URIBeaconConfigService.h
- Revision:
- 256:a6e651374060
- Parent:
- 255:cdb7231f83df
- Child:
- 268:bc525cdc88f7
diff -r cdb7231f83df -r a6e651374060 services/URIBeaconConfigService.h
--- a/services/URIBeaconConfigService.h Wed Jan 21 09:32:47 2015 +0000
+++ b/services/URIBeaconConfigService.h Wed Jan 21 09:32:48 2015 +0000
@@ -109,7 +109,7 @@
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 @@
}
}
+ void powerModeAuthorizationCallback(GattCharacteristicWriteAuthCBParams *params) {
+ if (lockedState || (*(params->data) >= NUM_POWER_MODES)) {
+ params->authorizationReply = false;
+ }
+ }
+
void denyGATTWritesIfLocked(GattCharacteristicWriteAuthCBParams *params) {
if (lockedState) {
params->authorizationReply = false;
