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.
Dependencies: nrf51-sdk
Dependents: microbit-dal microbit-ble-open microbit-dal-eddystone microbit-dal-ble-accelerometer-example ... more
Diff: nRF51GattServer.cpp
- Revision:
- 11:6277845e1cc5
- Parent:
- 8:2214f1df6a6a
- Child:
- 12:e151f55035b8
--- a/nRF51GattServer.cpp Thu May 29 08:07:04 2014 +0100
+++ b/nRF51GattServer.cpp Thu May 29 08:24:36 2014 +0100
@@ -45,21 +45,11 @@
/* ToDo: Basic validation */
/* Add the service to the nRF51 */
- ble_uuid_t uuid;
-
- if (service.primaryServiceID.type == UUID::UUID_TYPE_SHORT) {
- /* 16-bit BLE UUID */
- uuid.type = BLE_UUID_TYPE_BLE;
- } else {
- /* 128-bit Custom UUID */
- uuid.type = custom_add_uuid_base( service.primaryServiceID.base );
- }
-
- uuid.uuid = service.primaryServiceID.value;
-
+ ble_uuid_t nordicUUID;
+ nordicUUID = custom_convert_to_transport_uuid(service.primaryServiceID);
ASSERT( ERROR_NONE ==
sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,
- &uuid,
+ &nordicUUID,
&service.handle),
BLE_ERROR_PARAM_OUT_OF_RANGE );
@@ -67,11 +57,11 @@
for (uint8_t i = 0; i < service.characteristicCount; i++) {
GattCharacteristic *p_char = service.characteristics[i];
- uuid = custom_convert_to_transport_uuid(p_char->uuid);
+ nordicUUID = custom_convert_to_transport_uuid(p_char->uuid);
ASSERT ( ERROR_NONE ==
custom_add_in_characteristic(service.handle,
- &uuid,
+ &nordicUUID,
p_char->properties,
NULL,
p_char->lenMin,