High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Files at this revision

API Documentation at this revision

Comitter:
Rohit Grover
Date:
Thu Jun 05 11:38:21 2014 +0100
Parent:
69:2fd349295d2c
Child:
71:ff3e3bdf4514
Commit message:
make GattService members private; add accessors

Changed in this revision

GattService.h Show annotated file Show diff for this revision Revisions of this file
--- a/GattService.h	Thu Jun 05 10:36:50 2014 +0100
+++ b/GattService.h	Thu Jun 05 11:38:21 2014 +0100
@@ -37,11 +37,6 @@
     GattService(UUID uuid);
     virtual ~GattService(void);
 
-    UUID                primaryServiceID;
-    uint8_t             characteristicCount;
-    GattCharacteristic *characteristics[BLE_SERVICE_MAX_CHARACTERISTICS];
-    uint16_t            handle;
-
     ble_error_t         addCharacteristic(GattCharacteristic &);
 
     enum {
@@ -64,6 +59,31 @@
         UUID_SCAN_PARAMETERS_SERVICE        = 0x1813,
         UUID_TX_POWER_SERVICE               = 0x1804
     };
+
+    const UUID &getUUID(void) const {
+        return primaryServiceID;
+    }
+    uint16_t *getHandlePtr(void) {
+        return &handle;
+    }
+    uint16_t getHandle(void) const {
+        return handle;
+    }
+    uint8_t getCharacteristicCount(void) const {
+        return characteristicCount;
+    }
+    GattCharacteristic *getCharacteristic(uint8_t index) {
+        if (index >= characteristicCount) {
+            return NULL;
+        }
+        return characteristics[index];
+    }
+
+private:
+    UUID                primaryServiceID;
+    uint8_t             characteristicCount;
+    GattCharacteristic *characteristics[BLE_SERVICE_MAX_CHARACTERISTICS];
+    uint16_t            handle;
 };
 
 #endif // ifndef __GATT_SERVICE_H__