Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
bleservice.h@1:fd3ec64b2345, 2013-12-04 (annotated)
- Committer:
- ktownsend
- Date:
- Wed Dec 04 07:20:24 2013 +0000
- Revision:
- 1:fd3ec64b2345
- Parent:
- 0:ace2e8d3ce79
Added LPC1768 pinout
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ktownsend | 0:ace2e8d3ce79 | 1 | #ifndef __BLE_SERVICE_H__ |
| ktownsend | 0:ace2e8d3ce79 | 2 | #define __BLE_SERVICE_H__ |
| ktownsend | 0:ace2e8d3ce79 | 3 | |
| ktownsend | 0:ace2e8d3ce79 | 4 | #include "blecommon.h" |
| ktownsend | 0:ace2e8d3ce79 | 5 | #include "uuid.h" |
| ktownsend | 0:ace2e8d3ce79 | 6 | #include "blecharacteristic.h" |
| ktownsend | 0:ace2e8d3ce79 | 7 | |
| ktownsend | 0:ace2e8d3ce79 | 8 | #define BLE_SERVICE_MAX_CHARACTERISTICS (5) |
| ktownsend | 0:ace2e8d3ce79 | 9 | |
| ktownsend | 0:ace2e8d3ce79 | 10 | class BLEService |
| ktownsend | 0:ace2e8d3ce79 | 11 | { |
| ktownsend | 0:ace2e8d3ce79 | 12 | private: |
| ktownsend | 0:ace2e8d3ce79 | 13 | |
| ktownsend | 0:ace2e8d3ce79 | 14 | public: |
| ktownsend | 0:ace2e8d3ce79 | 15 | typedef struct |
| ktownsend | 0:ace2e8d3ce79 | 16 | { |
| ktownsend | 0:ace2e8d3ce79 | 17 | uint16_t id; |
| ktownsend | 0:ace2e8d3ce79 | 18 | uint16_t lenMin; |
| ktownsend | 0:ace2e8d3ce79 | 19 | uint16_t lenMax; |
| ktownsend | 0:ace2e8d3ce79 | 20 | uint8_t properties; |
| ktownsend | 0:ace2e8d3ce79 | 21 | uint8_t reserved; |
| ktownsend | 0:ace2e8d3ce79 | 22 | } serialisedChar_t; |
| ktownsend | 0:ace2e8d3ce79 | 23 | |
| ktownsend | 0:ace2e8d3ce79 | 24 | BLEService(uint8_t[16]); /* 128-bit Base UUID */ |
| ktownsend | 0:ace2e8d3ce79 | 25 | BLEService(uint16_t); /* 16-bit BLE UUID */ |
| ktownsend | 0:ace2e8d3ce79 | 26 | virtual ~BLEService(void); |
| ktownsend | 0:ace2e8d3ce79 | 27 | |
| ktownsend | 0:ace2e8d3ce79 | 28 | UUID primaryServiceID; |
| ktownsend | 0:ace2e8d3ce79 | 29 | uint8_t characteristicCount; |
| ktownsend | 0:ace2e8d3ce79 | 30 | serialisedChar_t characteristics[BLE_SERVICE_MAX_CHARACTERISTICS]; |
| ktownsend | 0:ace2e8d3ce79 | 31 | uint8_t index; |
| ktownsend | 0:ace2e8d3ce79 | 32 | |
| ktownsend | 0:ace2e8d3ce79 | 33 | ble_error_t addCharacteristic(BLECharacteristic &); |
| ktownsend | 0:ace2e8d3ce79 | 34 | }; |
| ktownsend | 0:ace2e8d3ce79 | 35 | |
| ktownsend | 0:ace2e8d3ce79 | 36 | #endif |
