Fixes to BLE_API for mbedOS Alpha1 release. Mostly relating to doxygen fixes.
Fork of BLE_API by
Diff: services/URIBeacon2Service.h
- Revision:
- 205:c957765916e2
- Parent:
- 204:479f81fd5d3b
- Child:
- 206:49646c933822
diff -r 479f81fd5d3b -r c957765916e2 services/URIBeacon2Service.h --- a/services/URIBeacon2Service.h Mon Dec 01 14:31:17 2014 +0000 +++ b/services/URIBeacon2Service.h Mon Dec 01 14:31:17 2014 +0000 @@ -91,11 +91,7 @@ configure(); if (initSucceeded) { - /* Preserve the originals to be able to reset() upon request. */ - memcpy(defaultURIData, uriDataIn, MAX_SIZE_URI_DATA_CHAR_VALUE); - defaultFlags = flagsIn; - defaultEffectiveTxPower = effectiveTxPowerIn; - defaultBeaconPeriod = beaconPeriodIn; + saveDefaults(); } GattCharacteristic *charTable[] = {&lockedStateChar, &uriDataChar, &flagsChar, &txPowerLevelsChar, &beaconPeriodChar, &resetChar}; @@ -310,6 +306,14 @@ ble.setAdvertisingPayload(); } + /* Preserve the defaults to be able to reset() upon request. */ + void saveDefaults(void) { + memcpy(defaultURIData, uriData, MAX_SIZE_URI_DATA_CHAR_VALUE); + defaultFlags = flags; + defaultEffectiveTxPower = effectiveTxPower; + defaultBeaconPeriod = beaconPeriod; + } + void resetDefaults(void) { memcpy(uriData, defaultURIData, MAX_SIZE_URI_DATA_CHAR_VALUE); memset(powerLevels, 0, sizeof(powerLevels));