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 499:db9bc083f91e, committed 2015-06-19
- Comitter:
- rgrover1
- Date:
- Fri Jun 19 15:52:03 2015 +0100
- Parent:
- 498:f3cd1e9e1ebc
- Child:
- 500:2625510739a6
- Commit message:
- Synchronized with git rev 92f61ed8
Author: Rohit Grover
fix API header for writeWoResponse()
Changed in this revision
--- a/common/DiscoveredCharacteristic.cpp Fri Jun 19 15:52:03 2015 +0100
+++ b/common/DiscoveredCharacteristic.cpp Fri Jun 19 15:52:03 2015 +0100
@@ -19,17 +19,6 @@
DiscoveredCharacteristic::ReadCallback_t DiscoveredCharacteristic::onDataReadCallback;
-/**
- * Initiate (or continue) a read for the value attribute, optionally at a
- * given offset. If the Characteristic or Descriptor to be read is longer
- * than ATT_MTU - 1, this function must be called multiple times with
- * appropriate offset to read the complete value.
- *
- * @return BLE_ERROR_NONE if a read has been initiated, 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_OPERATION_NOT_PERMITTED due to the characteristic's properties.
- */
ble_error_t
DiscoveredCharacteristic::read(uint16_t offset) const
{
@@ -44,26 +33,6 @@
return gattc->read(connHandle, valueHandle, offset);
}
-/**
- * Perform a write without response 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
- * <b>consume an application buffer</b>, and will therefore
- * generate a onDataSent() callback when the packet has been
- * transmitted. The application should ensure that the buffer is
- * valid until the callback.
- *
- * @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
DiscoveredCharacteristic::writeWoResponse(uint16_t length, const uint8_t *value) const
{
--- a/public/DiscoveredCharacteristic.h Fri Jun 19 15:52:03 2015 +0100
+++ b/public/DiscoveredCharacteristic.h Fri Jun 19 15:52:03 2015 +0100
@@ -81,11 +81,11 @@
* @param value
* The bytes being written.
*
- * @note It is important to note that a write without response will
- * <b>consume an application buffer</b>, and will therefore
- * generate a onDataSent() callback when the packet has been
- * transmitted. The application should ensure that the buffer is
- * valid until the callback.
+ * @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
@@ -95,6 +95,7 @@
*/
ble_error_t writeWoResponse(uint16_t length, const uint8_t *value) const;
+
static void setupOnDataRead(ReadCallback_t callback) {
onDataReadCallback = callback;
}
