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: BLE_ANCS_SDAPI BLE_temperature BLE_HeartRate writable_gatt ... more
Diff: btle/btle_discovery.h
- Revision:
- 312:d55797e0d632
- Parent:
- 311:5d5abc30e3a8
- Child:
- 315:044071756a8d
--- a/btle/btle_discovery.h Fri Jun 19 15:55:30 2015 +0100
+++ b/btle/btle_discovery.h Fri Jun 19 15:55:30 2015 +0100
@@ -58,9 +58,19 @@
* BLE_STACK_BUSY if some client procedure already in progress.
*/
virtual ble_error_t read(uint16_t offset = 0) {
- // sd_ble_gattc_read()
- // SVCALL(SD_BLE_GATTC_READ, uint32_t, sd_ble_gattc_read(uint16_t conn_handle, uint16_t handle, uint16_t offset));
- return BLE_ERROR_NONE;
+ uint32_t rc = sd_ble_gattc_read(connHandle, valueHandle, offset);
+ if (rc == NRF_SUCCESS) {
+ return BLE_ERROR_NONE;
+ }
+ switch (rc) {
+ case NRF_ERROR_BUSY:
+ return BLE_STACK_BUSY;
+ case BLE_ERROR_INVALID_CONN_HANDLE:
+ case NRF_ERROR_INVALID_STATE:
+ case NRF_ERROR_INVALID_ADDR:
+ default:
+ return BLE_ERROR_INVALID_STATE;
+ }
}
};

