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: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate BLE_ANCS_SDAPI_IRC ... more
Diff: public/GattServer.h
- Revision:
- 514:1fa338281798
- Parent:
- 511:9f5046c0f741
- Child:
- 517:3c8170ac2a7f
diff -r 0e6ad6ac1d9b -r 1fa338281798 public/GattServer.h
--- a/public/GattServer.h Fri Jun 19 15:52:05 2015 +0100
+++ b/public/GattServer.h Fri Jun 19 15:52:05 2015 +0100
@@ -21,7 +21,7 @@
#include "GattService.h"
#include "GattAttribute.h"
#include "GattServerEvents.h"
-#include "GattCallbackParamTypes.h"
+#include "GattCharacteristicCallbackParams.h"
#include "CallChainOfFunctionPointersWithContext.h"
class GattServer {
@@ -63,9 +63,9 @@
void setOnDataSent(T *objPtr, void (T::*memberPtr)(unsigned count)) {
onDataSent.add(objPtr, memberPtr);
}
- void setOnDataWritten(void (*callback)(const GattWriteCallbackParams *eventDataP)) {onDataWritten.add(callback);}
+ void setOnDataWritten(void (*callback)(const GattCharacteristicWriteCBParams *eventDataP)) {onDataWritten.add(callback);}
template <typename T>
- void setOnDataWritten(T *objPtr, void (T::*memberPtr)(const GattWriteCallbackParams *context)) {
+ void setOnDataWritten(T *objPtr, void (T::*memberPtr)(const GattCharacteristicWriteCBParams *context)) {
onDataWritten.add(objPtr, memberPtr);
}
@@ -76,7 +76,7 @@
virtual bool isOnDataReadAvailable() const {
return false;
}
- ble_error_t setOnDataRead(void (*callback)(const GattReadCallbackParams *eventDataP)) {
+ ble_error_t setOnDataRead(void (*callback)(const GattCharacteristicReadCBParams *eventDataP)) {
if (!isOnDataReadAvailable()) {
return BLE_ERROR_NOT_IMPLEMENTED;
}
@@ -85,7 +85,7 @@
return BLE_ERROR_NONE;
}
template <typename T>
- ble_error_t setOnDataRead(T *objPtr, void (T::*memberPtr)(const GattReadCallbackParams *context)) {
+ ble_error_t setOnDataRead(T *objPtr, void (T::*memberPtr)(const GattCharacteristicReadCBParams *context)) {
if (!isOnDataReadAvailable()) {
return BLE_ERROR_NOT_IMPLEMENTED;
}
@@ -98,13 +98,13 @@
void setOnConfirmationReceived(EventCallback_t callback) {onConfirmationReceived = callback;}
protected:
- void handleDataWrittenEvent(const GattWriteCallbackParams *params) {
+ void handleDataWrittenEvent(const GattCharacteristicWriteCBParams *params) {
if (onDataWritten.hasCallbacksAttached()) {
onDataWritten.call(params);
}
}
- void handleDataReadEvent(const GattReadCallbackParams *params) {
+ void handleDataReadEvent(const GattCharacteristicReadCBParams *params) {
if (onDataRead.hasCallbacksAttached()) {
onDataRead.call(params);
}
@@ -144,8 +144,8 @@
private:
CallChainOfFunctionPointersWithContext<unsigned> onDataSent;
- CallChainOfFunctionPointersWithContext<const GattWriteCallbackParams *> onDataWritten;
- CallChainOfFunctionPointersWithContext<const GattReadCallbackParams *> onDataRead;
+ CallChainOfFunctionPointersWithContext<const GattCharacteristicWriteCBParams *> onDataWritten;
+ CallChainOfFunctionPointersWithContext<const GattCharacteristicReadCBParams *> onDataRead;
EventCallback_t onUpdatesEnabled;
EventCallback_t onUpdatesDisabled;
EventCallback_t onConfirmationReceived;