High level Bluetooth Low Energy API and radio abstraction layer

Dependencies:   nRF51822

Dependents:   LinkNode_LIS3DH

Fork of BLE_API by Bluetooth Low Energy

Revision:
2:ffc5216bd2cc
Child:
11:200931be5617
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GattService.h	Tue Dec 10 07:32:12 2013 +0000
@@ -0,0 +1,36 @@
+#ifndef __GATT_SERVICE_H__
+#define __GATT_SERVICE_H__
+
+#include "blecommon.h"
+#include "uuid.h"
+#include "GattCharacteristic.h"
+
+#define BLE_SERVICE_MAX_CHARACTERISTICS (5)
+
+class GattService
+{
+private:
+
+public:
+    typedef struct
+    {
+        uint16_t    id;
+        uint16_t    lenMin;
+        uint16_t    lenMax;
+        uint8_t     properties;
+        uint8_t     reserved;
+    } serialisedChar_t;
+    
+    GattService(uint8_t[16]);  /* 128-bit Base UUID */
+    GattService(uint16_t);     /* 16-bit BLE UUID */
+    virtual ~GattService(void);
+
+    UUID                primaryServiceID;
+    uint8_t             characteristicCount;
+    serialisedChar_t    characteristics[BLE_SERVICE_MAX_CHARACTERISTICS];
+    uint8_t             index;
+
+    ble_error_t         addCharacteristic(GattCharacteristic &);
+};
+
+#endif