Bill Schilit / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Committer:
ktownsend
Date:
Tue Dec 17 17:28:41 2013 +0000
Revision:
11:200931be5617
Parent:
2:ffc5216bd2cc
Child:
23:f19c60478e1b
Added debug info to nrf51822.cpp

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ktownsend 2:ffc5216bd2cc 1 #ifndef __GATT_SERVICE_H__
ktownsend 2:ffc5216bd2cc 2 #define __GATT_SERVICE_H__
ktownsend 2:ffc5216bd2cc 3
ktownsend 2:ffc5216bd2cc 4 #include "blecommon.h"
ktownsend 2:ffc5216bd2cc 5 #include "uuid.h"
ktownsend 2:ffc5216bd2cc 6 #include "GattCharacteristic.h"
ktownsend 2:ffc5216bd2cc 7
ktownsend 2:ffc5216bd2cc 8 #define BLE_SERVICE_MAX_CHARACTERISTICS (5)
ktownsend 2:ffc5216bd2cc 9
ktownsend 2:ffc5216bd2cc 10 class GattService
ktownsend 2:ffc5216bd2cc 11 {
ktownsend 2:ffc5216bd2cc 12 private:
ktownsend 2:ffc5216bd2cc 13
ktownsend 2:ffc5216bd2cc 14 public:
ktownsend 2:ffc5216bd2cc 15 typedef struct
ktownsend 2:ffc5216bd2cc 16 {
ktownsend 2:ffc5216bd2cc 17 uint16_t id;
ktownsend 2:ffc5216bd2cc 18 uint16_t lenMin;
ktownsend 2:ffc5216bd2cc 19 uint16_t lenMax;
ktownsend 2:ffc5216bd2cc 20 uint8_t properties;
ktownsend 2:ffc5216bd2cc 21 uint8_t reserved;
ktownsend 2:ffc5216bd2cc 22 } serialisedChar_t;
ktownsend 2:ffc5216bd2cc 23
ktownsend 2:ffc5216bd2cc 24 GattService(uint8_t[16]); /* 128-bit Base UUID */
ktownsend 2:ffc5216bd2cc 25 GattService(uint16_t); /* 16-bit BLE UUID */
ktownsend 2:ffc5216bd2cc 26 virtual ~GattService(void);
ktownsend 2:ffc5216bd2cc 27
ktownsend 2:ffc5216bd2cc 28 UUID primaryServiceID;
ktownsend 2:ffc5216bd2cc 29 uint8_t characteristicCount;
ktownsend 2:ffc5216bd2cc 30 serialisedChar_t characteristics[BLE_SERVICE_MAX_CHARACTERISTICS];
ktownsend 11:200931be5617 31 uint8_t handle;
ktownsend 2:ffc5216bd2cc 32
ktownsend 2:ffc5216bd2cc 33 ble_error_t addCharacteristic(GattCharacteristic &);
ktownsend 2:ffc5216bd2cc 34 };
ktownsend 2:ffc5216bd2cc 35
ktownsend 2:ffc5216bd2cc 36 #endif