extend
Fork of BLE_API by
Diff: public/DiscoveredCharacteristic.h
- Revision:
- 497:926d444599e8
- Parent:
- 494:2e4af47b00a8
- Child:
- 499:db9bc083f91e
--- a/public/DiscoveredCharacteristic.h Fri Jun 19 15:52:03 2015 +0100 +++ b/public/DiscoveredCharacteristic.h Fri Jun 19 15:52:03 2015 +0100 @@ -18,8 +18,10 @@ #define __DISCOVERED_CHARACTERISTIC_H__ #include "UUID.h" +#include "Gap.h" #include "GattAttribute.h" -#include "GattClient.h" + +class GattClient; /* forward declaration */ /** * Structure for holding information about the service and the characteristics @@ -69,13 +71,7 @@ * BLE_STACK_BUSY if some client procedure already in progress, or * BLE_ERROR_OPERATION_NOT_PERMITTED due to the characteristic's properties. */ - ble_error_t read(uint16_t offset = 0) const { - if (!props.read()) { - return BLE_ERROR_OPERATION_NOT_PERMITTED; - } - - return gattc->read(connHandle, valueHandle, offset); - } + ble_error_t read(uint16_t offset = 0) const; /** * Perform a write without response procedure. @@ -97,14 +93,7 @@ * BLE_ERROR_NO_MEM if there are no available buffers left to process the request, or * BLE_ERROR_OPERATION_NOT_PERMITTED due to the characteristic's properties. */ - ble_error_t writeWoResponse(uint16_t length, const uint8_t *value) const { - if (!props.writeWoResp()) { - return BLE_ERROR_OPERATION_NOT_PERMITTED; - } - - return BLE_ERROR_NONE; - // return (ble.getGattClient())->write(BLE_GATT_OP_WRITE_CMD, connHandle, length, value); - } + ble_error_t writeWoResponse(uint16_t length, const uint8_t *value) const; static void setupOnDataRead(ReadCallback_t callback) { onDataReadCallback = callback;