Bruno Horta / DOOR_BLE_API

Dependents:   DOOR_BLE_PROGRAM

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Nov 28 14:11:21 2014 +0000
Parent:
163:8bd70d17589f
Child:
165:ca406c1d0399
Commit message:
Synchronized with git rev f5827433
Author: Rohit Grover
restore uriData characteristic upon receiving a write if locked.

Changed in this revision

services/URIBeacon2Service.h Show annotated file Show diff for this revision Revisions of this file
--- a/services/URIBeacon2Service.h	Fri Nov 28 14:11:21 2014 +0000
+++ b/services/URIBeacon2Service.h	Fri Nov 28 14:11:21 2014 +0000
@@ -77,6 +77,11 @@
      */
     virtual void onDataWritten(const GattCharacteristicWriteCBParams *params) {
         if (params->charHandle == uriDataChar.getValueAttribute().getHandle()) {
+            if (lockedState) { /* when locked, the device isn't allowed to update the uriData characteristic */
+                ble.updateCharacteristicValue(uriDataChar.getValueAttribute().getHandle(), uriDataValue, uriDataLength);
+                return;
+            }
+
             /* we don't handle very large writes at the moment. */
             if ((params->offset != 0) || (params->len > MAX_SIZE_URI_DATA_CHAR_VALUE)) {
                 return;