Nordic stack and drivers for the mbed BLE API Modified for HRM1017 for library 0.1.0

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
Rohit Grover
Date:
Thu May 29 08:24:36 2014 +0100
Parent:
10:68c0e6cabe07
Child:
12:e151f55035b8
Commit message:
serviceIDs should also go through the UUIDTable

Changed in this revision

nRF51GattServer.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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,