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
Diff: GattService.h
- Revision:
- 70:d6c0a4cedf46
- Parent:
- 69:2fd349295d2c
- Child:
- 75:d08bdef22500
diff -r 2fd349295d2c -r d6c0a4cedf46 GattService.h
--- 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__
