fork BLE_API to add update adv payload API
Fork of BLE_API by
Diff: ble/GattServer.h
- Revision:
- 727:1a1f5c5aedfe
- Parent:
- 725:f4a355b35cf8
- Child:
- 728:997ba5e7b3b6
--- a/ble/GattServer.h Thu Jul 02 09:06:12 2015 +0100 +++ b/ble/GattServer.h Mon Jul 06 10:10:34 2015 +0100 @@ -53,7 +53,7 @@ * characteristics contained within. */ virtual ble_error_t addService(GattService &) { - return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */ + return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */ } /** @@ -72,7 +72,7 @@ * @return BLE_ERROR_NONE if a value was read successfully into the buffer. */ virtual ble_error_t read(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP) { - return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */ + return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */ } /** @@ -97,7 +97,7 @@ * attribtues (such as the CCCDs). */ virtual ble_error_t read(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t *buffer, uint16_t *lengthP) { - return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */ + return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */ } /** @@ -119,7 +119,7 @@ * @return BLE_ERROR_NONE if we have successfully set the value of the attribute. */ virtual ble_error_t write(GattAttribute::Handle_t, const uint8_t *, uint16_t, bool localOnly = false) { - return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */ + return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */ } /** @@ -145,38 +145,7 @@ * @return BLE_ERROR_NONE if we have successfully set the value of the attribute. */ virtual ble_error_t write(Gap::Handle_t connectionHandle, GattAttribute::Handle_t, const uint8_t *, uint16_t, bool localOnly = false) { - return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */ - } - - /** - * Determine the updates-enabled status (notification/indication) for the current connection from a characteristic's CCCD. - * - * @param characteristic - * The characteristic - * @param[out] enabledP - * Upon return, *enabledP is true if updates are enabled, else false. - * - * @return BLE_ERROR_NONE if the connection and handle are found. false otherwise. - */ - virtual ble_error_t areUpdatesEnabled(const GattCharacteristic &characteristic, bool *enabledP) { - return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */ - } - - /** - * Determine the connection-specific updates-enabled status (notification/indication) from a characteristic's CCCD. - * - * @param connectionHandle - * The connection handle - * @param[out] enabledP - * Upon return, *enabledP is true if updates are enabled, else false. - * - * @param characteristic - * The characteristic - * - * @return BLE_ERROR_NONE if the connection and handle are found. false otherwise. - */ - virtual ble_error_t areUpdatesEnabled(Gap::Handle_t connectionHandle, const GattCharacteristic &characteristic, bool *enabledP) { - return BLE_ERROR_NOT_IMPLEMENTED; /* Requesting action from porter(s): override this API if this capability is supported. */ + return BLE_ERROR_NOT_IMPLEMENTED; /* default implementation; override this API if this capability is supported. */ } /** @@ -298,21 +267,21 @@ } } - void handleEvent(GattServerEvents::gattEvent_e type, GattAttribute::Handle_t attributeHandle) { + void handleEvent(GattServerEvents::gattEvent_e type, GattAttribute::Handle_t charHandle) { switch (type) { case GattServerEvents::GATT_EVENT_UPDATES_ENABLED: if (updatesEnabledCallback) { - updatesEnabledCallback(attributeHandle); + updatesEnabledCallback(charHandle); } break; case GattServerEvents::GATT_EVENT_UPDATES_DISABLED: if (updatesDisabledCallback) { - updatesDisabledCallback(attributeHandle); + updatesDisabledCallback(charHandle); } break; case GattServerEvents::GATT_EVENT_CONFIRMATION_RECEIVED: if (confirmationReceivedCallback) { - confirmationReceivedCallback(attributeHandle); + confirmationReceivedCallback(charHandle); } break; default: