BLE_API_Tiny_BLE

Dependents:   CSSE4011_BLE_IMU

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Feb 13 13:00:41 2015 +0000
Parent:
281:e459c5be1a10
Child:
283:bef53917ea82
Commit message:
Synchronized with git rev 2a4e05c7
Author: Bill Schilit
Review comments

Changed in this revision

services/URIBeaconConfigService.h Show annotated file Show diff for this revision Revisions of this file
--- a/services/URIBeaconConfigService.h	Fri Feb 13 13:00:41 2015 +0000
+++ b/services/URIBeaconConfigService.h	Fri Feb 13 13:00:41 2015 +0000
@@ -17,10 +17,6 @@
 #ifndef SERVICES_URIBEACONCONFIGSERVICE_H_
 #define SERVICES_URIBEACONCONFIGSERVICE_H_
 
-#include "BLEDevice.h"
-#include "GattCharacteristic.h"
-#include "mbed.h"
-
 #define UUID_URI_BEACON(FIRST, SECOND) { \
         0xee, 0x0c, FIRST, SECOND, 0x87, 0x86, 0x40, 0xba,       \
         0xab, 0x96, 0x99, 0xb9, 0x1a, 0xc9, 0x81, 0xd8,          \
@@ -157,6 +153,7 @@
 
 
   private:
+    // True if the lock bits are non-zero
     bool isLocked() {
         Lock_t testLock;
         memset(testLock, 0, sizeof(Lock_t));
@@ -174,7 +171,8 @@
         if (handle == lockChar.getValueHandle()) {
             // Validated earlier
             memcpy(params.lock, writeParams->data, sizeof(Lock_t));
-            lockedState = true;
+            // use isLocked() in case bits are being set to all 0's
+            lockedState = isLocked();
         } else if (handle == unlockChar.getValueHandle()) {
             // Validated earlier
             memset(params.lock, 0, sizeof(Lock_t));