Improve readability with getHandle inline
Fork of BLE_API by
Revision 205:c957765916e2, committed 2014-12-01
- Comitter:
- rgrover1
- Date:
- Mon Dec 01 14:31:17 2014 +0000
- Parent:
- 204:479f81fd5d3b
- Child:
- 206:49646c933822
- Commit message:
- Synchronized with git rev da859491
Author: Rohit Grover
add saveDefaults()
Changed in this revision
services/URIBeacon2Service.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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));