High level Bluetooth Low Energy API and radio abstraction layer
Fork of BLE_API by
GattService.h@23:f19c60478e1b, 2014-01-07 (annotated)
- Committer:
- ktownsend
- Date:
- Tue Jan 07 19:58:06 2014 +0000
- Revision:
- 23:f19c60478e1b
- Parent:
- 11:200931be5617
- Child:
- 27:4a83843f04b0
Added GattService example
Who changed what in which revision?
User | Revision | Line number | New 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 | GattService(uint8_t[16]); /* 128-bit Base UUID */ |
ktownsend | 2:ffc5216bd2cc | 16 | GattService(uint16_t); /* 16-bit BLE UUID */ |
ktownsend | 2:ffc5216bd2cc | 17 | virtual ~GattService(void); |
ktownsend | 2:ffc5216bd2cc | 18 | |
ktownsend | 2:ffc5216bd2cc | 19 | UUID primaryServiceID; |
ktownsend | 2:ffc5216bd2cc | 20 | uint8_t characteristicCount; |
ktownsend | 23:f19c60478e1b | 21 | GattCharacteristic characteristics[BLE_SERVICE_MAX_CHARACTERISTICS]; |
ktownsend | 11:200931be5617 | 22 | uint8_t handle; |
ktownsend | 2:ffc5216bd2cc | 23 | |
ktownsend | 2:ffc5216bd2cc | 24 | ble_error_t addCharacteristic(GattCharacteristic &); |
ktownsend | 2:ffc5216bd2cc | 25 | }; |
ktownsend | 2:ffc5216bd2cc | 26 | |
ktownsend | 2:ffc5216bd2cc | 27 | #endif |