High level Bluetooth Low Energy API and radio abstraction layer

Dependents:   BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate BLE_ANCS_SDAPI_IRC ... more

Overview

The BLE_API is a high level abstraction for using Bluetooth Low Energy on multiple platforms. For details and examples using the BLE_API please see the BLE_API Summary Page. Or click on the API Documentation tab above.

Supported Services

Supported services can be found in the BLE_API/services folder.

Revision:
722:eab9499e4250
Parent:
712:b04b5db36865
Child:
723:71507679c9b2
--- a/ble/services/URIBeaconConfigService.h	Thu Jul 02 09:06:12 2015 +0100
+++ b/ble/services/URIBeaconConfigService.h	Thu Jul 02 09:06:12 2015 +0100
@@ -267,7 +267,7 @@
                     paramsUpdated = true;
                 }
                 if (paramsUpdated) {
-                    ble.updateCharacteristicValue(beaconPeriodChar.getValueHandle(), reinterpret_cast<uint8_t *>(&params.beaconPeriod), sizeof(uint16_t));
+                    ble.gattServer().write(beaconPeriodChar.getValueHandle(), reinterpret_cast<uint8_t *>(&params.beaconPeriod), sizeof(uint16_t));
                 }
             }
         } else if (handle == resetChar.getValueHandle()) {
@@ -295,13 +295,13 @@
      * change to the internal state of the service object.
      */
     void updateCharacteristicValues(void) {
-        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(),
+        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(),
                                       reinterpret_cast<uint8_t *>(&params.beaconPeriod), sizeof(uint16_t));
-        ble.updateCharacteristicValue(txPowerModeChar.getValueHandle(), &params.txPowerMode, 1);
-        ble.updateCharacteristicValue(advPowerLevelsChar.getValueHandle(),
+        ble.gattServer().write(txPowerModeChar.getValueHandle(), &params.txPowerMode, 1);
+        ble.gattServer().write(advPowerLevelsChar.getValueHandle(),
                                       reinterpret_cast<uint8_t *>(params.advPowerLevels), sizeof(PowerLevels_t));
     }