Nordic stack and drivers for the mbed BLE API
Fork of nRF51822 by
Revision 108:27213b9fd4f9, committed 2015-04-15
- Comitter:
- rgrover1
- Date:
- Wed Apr 15 08:59:24 2015 +0100
- Parent:
- 107:55302fd80c35
- Child:
- 109:425faebc8201
- Commit message:
- Synchronized with git rev ab5d4cf0
Author: Rohit Grover
adding const to an argument of GattServer::updateValue()
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 Apr 15 08:59:24 2015 +0100 +++ b/nRF51GattServer.cpp Wed Apr 15 08:59:24 2015 +0100 @@ -173,7 +173,7 @@ @endcode */ /**************************************************************************/ -ble_error_t nRF51GattServer::updateValue(GattAttribute::Handle_t charHandle, uint8_t buffer[], uint16_t len, bool localOnly) +ble_error_t nRF51GattServer::updateValue(GattAttribute::Handle_t charHandle, const uint8_t buffer[], uint16_t len, bool localOnly) { uint16_t gapConnectionHandle = nRF51Gap::getInstance().getConnectionHandle(); ble_error_t returnValue = BLE_ERROR_NONE; @@ -199,7 +199,7 @@ GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY) ? BLE_GATT_HVX_NOTIFICATION : BLE_GATT_HVX_INDICATION; hvx_params.offset = 0; - hvx_params.p_data = buffer; + hvx_params.p_data = const_cast<uint8_t *>(buffer); hvx_params.p_len = &len; error_t error = (error_t) sd_ble_gatts_hvx(gapConnectionHandle, &hvx_params);
--- a/nRF51GattServer.h Wed Apr 15 08:59:24 2015 +0100 +++ b/nRF51GattServer.h Wed Apr 15 08:59:24 2015 +0100 @@ -34,7 +34,7 @@ /* Functions that must be implemented from GattServer */ virtual ble_error_t addService(GattService &); virtual ble_error_t readValue(GattAttribute::Handle_t handle, uint8_t buffer[], uint16_t *const lengthP); - virtual ble_error_t updateValue(GattAttribute::Handle_t, uint8_t[], uint16_t, bool localOnly = false); + virtual ble_error_t updateValue(GattAttribute::Handle_t, const uint8_t[], uint16_t, bool localOnly = false); virtual ble_error_t initializeGATTDatabase(void); /* nRF51 Functions */