High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
Revision 506:be938b716fe8, committed 2015-06-19
- Comitter:
- rgrover1
- Date:
- Fri Jun 19 15:52:04 2015 +0100
- Parent:
- 505:ac825d37e8f2
- Child:
- 507:77c551e72d06
- Commit message:
- Synchronized with git rev 248c63d7
Author: Rohit Grover
GattCharacteristicReadCBParams::len isn't a pointer. And data is const.
Changed in this revision
--- a/public/DiscoveredCharacteristic.h Fri Jun 19 15:52:04 2015 +0100 +++ b/public/DiscoveredCharacteristic.h Fri Jun 19 15:52:04 2015 +0100 @@ -87,6 +87,27 @@ */ ble_error_t writeWoResponse(uint16_t length, const uint8_t *value) const; + /** + * Perform a write procedure. + * + * @param length + * The amount of data being written. + * @param value + * The bytes being written. + * + * @note It is important to note that a write without response will generate + * an onDataSent() callback when the packet has been transmitted. There + * will be a BLE-stack specific limit to the number of pending + * writeWoResponse operations; the user may want to use the onDataSent() + * callback for flow-control. + * + * @retval BLE_ERROR_NONE Successfully started the Write procedure, else + * BLE_ERROR_INVALID_STATE if some internal state about the connection is invalid, or + * BLE_STACK_BUSY if some client procedure already in progress, or + * 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 write(uint16_t length, const uint8_t *value) const; static void setupOnDataRead(GattClient::ReadCallback_t callback) { onDataReadCallback = callback;
--- a/public/GattCharacteristicCallbackParams.h Fri Jun 19 15:52:04 2015 +0100 +++ b/public/GattCharacteristicCallbackParams.h Fri Jun 19 15:52:04 2015 +0100 @@ -40,8 +40,8 @@ GATTS_CHAR_OP_READ_REQ = 0x0A, /**< Read Request. */ } op; /**< Type of write operation, */ uint16_t offset; /**< Offset for the read operation. */ - uint16_t *len; /**< Length of the outgoing data. */ - uint8_t *data; /**< Outgoing data, variable length. */ + uint16_t len; + const uint8_t *data; /* @note: data might not persist beyond the callback; make a local copy if needed. */ }; enum GattCharacteristicAuthCBReply_t {