High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 275:4abc3126f1e1, committed 2015-01-21
- Comitter:
- rgrover1
- Date:
- Wed Jan 21 09:32:53 2015 +0000
- Parent:
- 274:f540619754bb
- Child:
- 276:daa42f59bdb8
- Commit message:
- Synchronized with git rev 540c8c2b
Author: Rohit Grover
Release 0.2.10
=============
Enhancements
~~~~~~~~~~~~
* BLEDevice::onDataSent() now appends to a callChain. This means we can string
together multiple onDataSent() callbacks.
* rename GattCharacteristicWriteCBParams.h as GattCharacteristicCallbackParams.h.
* Added optional data and length fields to the return structure for
readAuthorization so a new 'value' can be provided for each individual
authorization.
* Several improvements to URIBeaconConfigService:
** ServiceDataPayload can have a maximum of 18 bytes of URIData.
** Add lock and unlock characteristics; and use 'pstorage' to make their
values persist.
* Remove minor warnings seen with GCC ARM toolchain.
Bugfixes
~~~~~~~~
Compatibility
~~~~~~~~~~~~~
This release is API compatible with 0.2.4.
Changed in this revision
services/URIBeaconConfigService.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/services/URIBeaconConfigService.h Wed Jan 21 09:32:53 2015 +0000 +++ b/services/URIBeaconConfigService.h Wed Jan 21 09:32:53 2015 +0000 @@ -225,6 +225,12 @@ memcpy(lockBitsOut, lockBits, SIZEOF_LOCK_BITS); } + void resetLockBits(void) { + lockedState = false; + memset(lockBits, 0, SIZEOF_LOCK_BITS); + storage_saveLockBits(); + } + /** * APIs around making lockBits persistent. */ @@ -404,18 +410,13 @@ * Reset the default values. */ void resetDefaults(void) { - lockedState = false; - memset(lockBits, 0, SIZEOF_LOCK_BITS); uriDataLength = 0; memset(uriData, 0, MAX_SIZE_URI_DATA_CHAR_VALUE); flags = 0; memset(powerLevels, 0, sizeof(powerLevels)); txPowerMode = TX_POWER_MODE_LOW; beaconPeriod = 0; - - if (storage_haveSavedLockBits()) { - storage_saveLockBits(); - } + resetLockBits(); updateGATT(); }