Lightly modified version of the BLE stack, that doesn't bring up a DFUService by default... as we have our own.
Fork of BLE_API by
Revision 143:8bdf577b1598, committed 2014-11-21
- Comitter:
- rgrover1
- Date:
- Fri Nov 21 09:23:24 2014 +0000
- Parent:
- 142:42f038a81ea7
- Child:
- 144:c025c8839682
- Commit message:
- Synchronized with git rev d0dbe29f
Author: Rohit Grover
minor white space diffs
Changed in this revision
public/Gap.h | Show annotated file Show diff for this revision Revisions of this file |
public/GattServer.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/public/Gap.h Fri Nov 21 09:23:24 2014 +0000 +++ b/public/Gap.h Fri Nov 21 09:23:24 2014 +0000 @@ -21,15 +21,7 @@ #include "GapAdvertisingParams.h" #include "GapEvents.h" -/**************************************************************************/ -/*! - \brief - The base class used to abstract GAP functionality to a specific radio - transceiver, SOC or BLE Stack. -*/ -/**************************************************************************/ -class Gap -{ +class Gap { public: typedef enum addr_type_e { ADDR_TYPE_PUBLIC = 0, @@ -42,7 +34,7 @@ typedef uint8_t address_t[ADDR_LEN]; /** - * enumeration for disconnection reasons. The values for these reasons are + * Enumeration for disconnection reasons. The values for these reasons are * derived from Nordic's implementation; but the reasons are meant to be * independent of the transport. If you are returned a reason which is not * covered by this enumeration, then please refer to the underlying @@ -146,7 +138,7 @@ DisconnectionEventCallback_t onDisconnection; private: - /* disallow copy and assginment */ + /* disallow copy and assignment */ Gap(const Gap &); Gap& operator=(const Gap &); };
--- a/public/GattServer.h Fri Nov 21 09:23:24 2014 +0000 +++ b/public/GattServer.h Fri Nov 21 09:23:24 2014 +0000 @@ -22,15 +22,7 @@ #include "GattCharacteristicWriteCBParams.h" #include "CallChainOfFunctionPointersWithContext.h" -/**************************************************************************/ -/*! - \brief - The base class used to abstract GATT Server functionality to a specific - radio transceiver, SOC or BLE Stack. -*/ -/**************************************************************************/ -class GattServer -{ +class GattServer { public: /* Event callback handlers. */ typedef void (*EventCallback_t)(uint16_t attributeHandle); @@ -55,25 +47,15 @@ // be sure to call sd_ble_gatts_hvx() twice with notify then indicate! // Strange use case, but valid and must be covered! - void setOnDataSent(ServerEventCallbackWithCount_t callback) { - onDataSent = callback; - } - void setOnDataWritten(void (*callback)(const GattCharacteristicWriteCBParams *eventDataP)) { - onDataWritten.add(callback); - } + void setOnDataSent(ServerEventCallbackWithCount_t callback) {onDataSent = callback;} + void setOnDataWritten(void (*callback)(const GattCharacteristicWriteCBParams *eventDataP)) {onDataWritten.add(callback);} template <typename T> void setOnDataWritten(T *objPtr, void (T::*memberPtr)(const GattCharacteristicWriteCBParams *context)) { onDataWritten.add(objPtr, memberPtr); } - void setOnUpdatesEnabled(EventCallback_t callback) { - onUpdatesEnabled = callback; - } - void setOnUpdatesDisabled(EventCallback_t callback) { - onUpdatesDisabled = callback; - } - void setOnConfirmationReceived(EventCallback_t callback) { - onConfirmationReceived = callback; - } + void setOnUpdatesEnabled(EventCallback_t callback) {onUpdatesEnabled = callback;} + void setOnUpdatesDisabled(EventCallback_t callback) {onUpdatesDisabled = callback;} + void setOnConfirmationReceived(EventCallback_t callback) {onConfirmationReceived = callback;} protected: void handleDataWrittenEvent(const GattCharacteristicWriteCBParams *params) { @@ -120,7 +102,7 @@ EventCallback_t onConfirmationReceived; private: - /* disallow copy and assginment */ + /* disallow copy and assignment */ GattServer(const GattServer &); GattServer& operator=(const GattServer &); };