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: microbit-dal microbit-dal microbit-ble-open microbit-dal ... more
Fork of BLE_API by
Revision 651:34d82c1c591f, committed 2015-06-19
- Comitter:
- rgrover1
- Date:
- Fri Jun 19 15:52:59 2015 +0100
- Parent:
- 650:4f08874dec9c
- Child:
- 652:b8a596891951
- 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:58 2015 +0100
+++ b/public/DiscoveredCharacteristic.h Fri Jun 19 15:52:59 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:58 2015 +0100
+++ b/public/GattCharacteristicCallbackParams.h Fri Jun 19 15:52:59 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 {
