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.
Fork of nRF51822 by
Revision 28:fdc1a88a80c8, committed 2014-06-11
- Comitter:
- Rohit Grover
- Date:
- Wed Jun 11 13:55:00 2014 +0100
- Parent:
- 27:2a1c1825b7be
- Child:
- 29:cee837a465a1
- Commit message:
- addService() should automatically set the initial values for characteristics
Changed in this revision
| nRF51GattServer.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/nRF51GattServer.cpp Wed Jun 11 08:38:55 2014 +0100
+++ b/nRF51GattServer.cpp Wed Jun 11 13:55:00 2014 +0100
@@ -70,8 +70,11 @@
BLE_ERROR_PARAM_OUT_OF_RANGE );
/* Update the characteristic handle */
- p_char->setHandle(characteristicCount);
+ uint16_t charHandle = characteristicCount;
p_characteristics[characteristicCount++] = p_char;
+
+ p_char->setHandle(charHandle);
+ updateValue(charHandle, p_char->getValuePtr(), p_char->getInitialLength(), false /* localOnly */);
}
serviceCount++;
