Shuta Nakamae / nRF51822

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Fri Jun 19 15:55:36 2015 +0100
Parent:
353:fddee99b2fdc
Child:
355:c3637b4e7aff
Commit message:
Synchronized with git rev b7fdb260
Author: Rohit Grover
implement GattServer::read() and write()

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	Fri Jun 19 15:55:36 2015 +0100
+++ b/nRF51GattServer.cpp	Fri Jun 19 15:55:36 2015 +0100
@@ -159,12 +159,12 @@
                 Everything executed properly
 */
 /**************************************************************************/
-ble_error_t nRF51GattServer::readValue(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP)
+ble_error_t nRF51GattServer::read(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP)
 {
-    return readValue(BLE_CONN_HANDLE_INVALID, attributeHandle, buffer, lengthP);
+    return read(BLE_CONN_HANDLE_INVALID, attributeHandle, buffer, lengthP);
 }
 
-ble_error_t nRF51GattServer::readValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP)
+ble_error_t nRF51GattServer::read(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP)
 {
     ble_gatts_value_t value = {
         .len     = *lengthP,
@@ -199,12 +199,12 @@
                 Everything executed properly
 */
 /**************************************************************************/
-ble_error_t nRF51GattServer::updateValue(GattAttribute::Handle_t attributeHandle, const uint8_t buffer[], uint16_t len, bool localOnly)
+ble_error_t nRF51GattServer::write(GattAttribute::Handle_t attributeHandle, const uint8_t buffer[], uint16_t len, bool localOnly)
 {
-    return updateValue(BLE_CONN_HANDLE_INVALID, attributeHandle, buffer, len, localOnly);
+    return write(BLE_CONN_HANDLE_INVALID, attributeHandle, buffer, len, localOnly);
 }
 
-ble_error_t nRF51GattServer::updateValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const uint8_t buffer[], uint16_t len, bool localOnly)
+ble_error_t nRF51GattServer::write(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, const uint8_t buffer[], uint16_t len, bool localOnly)
 {
     uint16_t gapConnectionHandle = nRF51Gap::getInstance().getConnectionHandle();
     ble_error_t returnValue = BLE_ERROR_NONE;
--- a/nRF51GattServer.h	Fri Jun 19 15:55:36 2015 +0100
+++ b/nRF51GattServer.h	Fri Jun 19 15:55:36 2015 +0100
@@ -31,10 +31,10 @@
 
     /* Functions that must be implemented from GattServer */
     virtual ble_error_t addService(GattService &);
-    virtual ble_error_t readValue(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP);
-    virtual ble_error_t readValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP);
-    virtual ble_error_t updateValue(GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false);
-    virtual ble_error_t updateValue(Gap::Handle_t connectionHandle, GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false);
+    virtual ble_error_t read(GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP);
+    virtual ble_error_t read(Gap::Handle_t connectionHandle, GattAttribute::Handle_t attributeHandle, uint8_t buffer[], uint16_t *lengthP);
+    virtual ble_error_t write(GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false);
+    virtual ble_error_t write(Gap::Handle_t connectionHandle, GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false);
     virtual ble_error_t initializeGATTDatabase(void);
 
     /* nRF51 Functions */