Openwear requires RC oscillator to be used

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
Rohit Grover
Date:
Fri Jun 13 11:21:09 2014 +0100
Parent:
30:85305292b44f
Child:
32:84dea0924a63
Commit message:
GattServer::readValue() should return the length of data read

Changed in this revision

nRF51GattServer.cpp Show annotated file Show diff for this revision Revisions of this file
nRF51GattServer.h Show annotated file Show diff for this revision Revisions of this file
--- a/nRF51GattServer.cpp	Wed Jun 11 14:52:13 2014 +0100
+++ b/nRF51GattServer.cpp	Fri Jun 13 11:21:09 2014 +0100
@@ -112,12 +112,10 @@
     @endcode
 */
 /**************************************************************************/
-ble_error_t nRF51GattServer::readValue(uint16_t charHandle,
-                                       uint8_t  buffer[],
-                                       uint16_t len)
+ble_error_t nRF51GattServer::readValue(uint16_t charHandle, uint8_t buffer[], uint16_t *const lengthP)
 {
     ASSERT( ERROR_NONE ==
-            sd_ble_gatts_value_get(nrfCharacteristicHandles[charHandle].value_handle, 0, &len, buffer),
+            sd_ble_gatts_value_get(nrfCharacteristicHandles[charHandle].value_handle, 0, lengthP, buffer),
             BLE_ERROR_PARAM_OUT_OF_RANGE);
 
     return BLE_ERROR_NONE;
--- a/nRF51GattServer.h	Wed Jun 11 14:52:13 2014 +0100
+++ b/nRF51GattServer.h	Fri Jun 13 11:21:09 2014 +0100
@@ -41,7 +41,7 @@
 
     /* Functions that must be implemented from GattServer */
     virtual ble_error_t addService(GattService &);
-    virtual ble_error_t readValue(uint16_t, uint8_t[], uint16_t);
+    virtual ble_error_t readValue(uint16_t handle, uint8_t buffer[], uint16_t *const lengthP);
     virtual ble_error_t updateValue(uint16_t, uint8_t[], uint16_t, bool localOnly = false);
 
     /* nRF51 Functions */