make GattService members private; add accessors

master
Rohit Grover 2014-06-05 11:38:21 +01:00
parent 0307439450
commit e013eff2f0
1 changed files with 25 additions and 5 deletions

View File

@ -37,11 +37,6 @@ public:
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 @@ public:
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__