Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: microbit-dal microbit-dal microbit-ble-open microbit-dal ... more
Fork of BLE_API by
Diff: services/URIBeaconConfigService.h
- Revision:
- 669:7179b4a5aa7d
- Parent:
- 667:875aecb84719
- Child:
- 670:5e4aecd9af5b
--- a/services/URIBeaconConfigService.h Fri Jun 19 15:53:01 2015 +0100
+++ b/services/URIBeaconConfigService.h Fri Jun 19 15:53:01 2015 +0100
@@ -232,8 +232,8 @@
* characteristics of this service. Attempts to do so are also applied to
* the internal state of this service object.
*/
- void onDataWrittenCallback(const GattWriteCallbackParams *writeParams) {
- uint16_t handle = writeParams->handle;
+ void onDataWrittenCallback(const GattCharacteristicWriteCBParams *writeParams) {
+ uint16_t handle = writeParams->charHandle;
if (handle == lockChar.getValueHandle()) {
// Validated earlier
@@ -305,8 +305,8 @@
reinterpret_cast<uint8_t *>(params.advPowerLevels), sizeof(PowerLevels_t));
}
- private:
- void lockAuthorizationCallback(GattWriteAuthCallbackParams *authParams) {
+private:
+ void lockAuthorizationCallback(GattCharacteristicWriteAuthCBParams *authParams) {
if (lockedState) {
authParams->authorizationReply = AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION;
} else if (authParams->len != sizeof(Lock_t)) {
@@ -319,7 +319,7 @@
}
- void unlockAuthorizationCallback(GattWriteAuthCallbackParams *authParams) {
+ void unlockAuthorizationCallback(GattCharacteristicWriteAuthCBParams *authParams) {
if (!lockedState) {
authParams->authorizationReply = AUTH_CALLBACK_REPLY_SUCCESS;
} else if (authParams->len != sizeof(Lock_t)) {
@@ -333,7 +333,7 @@
}
}
- void uriDataWriteAuthorizationCallback(GattWriteAuthCallbackParams *authParams) {
+ void uriDataWriteAuthorizationCallback(GattCharacteristicWriteAuthCBParams *authParams) {
if (lockedState) {
authParams->authorizationReply = AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION;
} else if (authParams->offset != 0) {
@@ -343,7 +343,7 @@
}
}
- void powerModeAuthorizationCallback(GattWriteAuthCallbackParams *authParams) {
+ void powerModeAuthorizationCallback(GattCharacteristicWriteAuthCBParams *authParams) {
if (lockedState) {
authParams->authorizationReply = AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION;
} else if (authParams->len != sizeof(uint8_t)) {
@@ -358,7 +358,7 @@
}
template <typename T>
- void basicAuthorizationCallback(GattWriteAuthCallbackParams *authParams) {
+ void basicAuthorizationCallback(GattCharacteristicWriteAuthCBParams *authParams) {
if (lockedState) {
authParams->authorizationReply = AUTH_CALLBACK_REPLY_ATTERR_INSUF_AUTHORIZATION;
} else if (authParams->len != sizeof(T)) {
@@ -370,6 +370,7 @@
}
}
+protected:
BLEDevice &ble;
Params_t ¶ms;
@@ -391,7 +392,7 @@
ReadWriteGattCharacteristic<uint16_t> beaconPeriodChar;
WriteOnlyGattCharacteristic<uint8_t> resetChar;
- public:
+public:
/*
* Encode a human-readable URI into the binary format defined by URIBeacon spec (https://github.com/google/uribeacon/tree/master/specification).
*/
