Lancaster University's fork of the mbed BLE API. Lives on github, https://github.com/lancaster-university/BLE_API

Dependents:   microbit-dal microbit-dal microbit-ble-open microbit-dal ... more

Fork of BLE_API by Bluetooth Low Energy

Revision:
727:1a1f5c5aedfe
Parent:
723:71507679c9b2
Child:
728:997ba5e7b3b6
diff -r 6884e374e2eb -r 1a1f5c5aedfe ble/services/URIBeaconConfigService.h
--- a/ble/services/URIBeaconConfigService.h	Thu Jul 02 09:06:12 2015 +0100
+++ b/ble/services/URIBeaconConfigService.h	Mon Jul 06 10:10:34 2015 +0100
@@ -267,7 +267,7 @@
                     paramsUpdated = true;
                 }
                 if (paramsUpdated) {
-                    ble.gattServer().write(beaconPeriodChar.getValueHandle(), reinterpret_cast<uint8_t *>(&params.beaconPeriod), sizeof(uint16_t));
+                    ble.updateCharacteristicValue(beaconPeriodChar.getValueHandle(), reinterpret_cast<uint8_t *>(&params.beaconPeriod), sizeof(uint16_t));
                 }
             }
         } else if (handle == resetChar.getValueHandle()) {
@@ -295,17 +295,17 @@
      * change to the internal state of the service object.
      */
     void updateCharacteristicValues(void) {
-        ble.gattServer().write(lockedStateChar.getValueHandle(), &lockedState, 1);
-        ble.gattServer().write(uriDataChar.getValueHandle(), params.uriData, params.uriDataLength);
-        ble.gattServer().write(flagsChar.getValueHandle(), &params.flags, 1);
-        ble.gattServer().write(beaconPeriodChar.getValueHandle(),
+        ble.updateCharacteristicValue(lockedStateChar.getValueHandle(), &lockedState, 1);
+        ble.updateCharacteristicValue(uriDataChar.getValueHandle(), params.uriData, params.uriDataLength);
+        ble.updateCharacteristicValue(flagsChar.getValueHandle(), &params.flags, 1);
+        ble.updateCharacteristicValue(beaconPeriodChar.getValueHandle(),
                                       reinterpret_cast<uint8_t *>(&params.beaconPeriod), sizeof(uint16_t));
-        ble.gattServer().write(txPowerModeChar.getValueHandle(), &params.txPowerMode, 1);
-        ble.gattServer().write(advPowerLevelsChar.getValueHandle(),
+        ble.updateCharacteristicValue(txPowerModeChar.getValueHandle(), &params.txPowerMode, 1);
+        ble.updateCharacteristicValue(advPowerLevelsChar.getValueHandle(),
                                       reinterpret_cast<uint8_t *>(params.advPowerLevels), sizeof(PowerLevels_t));
     }
 
-protected:
+private:
     void lockAuthorizationCallback(GattWriteAuthCallbackParams *authParams) {
         if (lockedState) {
             authParams->authorizationReply = AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION;