Skip to content

Commit 0cb7eb3

Browse files
author
carlescufi
committed
Move value attribute as member of the char class
1 parent 9603702 commit 0cb7eb3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

public/GattCharacteristic.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
\brief GATT characteristic
2828
*/
2929
/**************************************************************************/
30-
class GattCharacteristic : public GattAttribute
30+
class GattCharacteristic
3131
{
3232
public:
3333
enum {
@@ -322,11 +322,14 @@ class GattCharacteristic : public GattAttribute
322322
GattCharacteristic(const UUID &uuid, uint8_t *valuePtr = NULL, uint16_t initialLen = 0, uint16_t maxLen = 0,
323323
uint8_t props = BLE_GATT_CHAR_PROPERTIES_NONE,
324324
GattAttribute *descriptors[] = NULL, unsigned numDescriptors = 0) :
325-
GattAttribute(uuid, valuePtr, initialLen, maxLen), _properties(props), _descriptors(descriptors), _descriptorCount(numDescriptors) {
325+
_valueAttribute(uuid, valuePtr, initialLen, maxLen), _properties(props), _descriptors(descriptors), _descriptorCount(numDescriptors) {
326326

327327
}
328328

329329
public:
330+
GattAttribute& getValueAttribute() {
331+
return _valueAttribute;
332+
}
330333
uint8_t getProperties(void) const {
331334
return _properties;
332335
}
@@ -342,9 +345,10 @@ class GattCharacteristic : public GattAttribute
342345
}
343346

344347
private:
345-
uint8_t _properties;
346-
GattAttribute ** _descriptors;
347-
uint8_t _descriptorCount;
348+
GattAttribute _valueAttribute;
349+
uint8_t _properties;
350+
GattAttribute ** _descriptors;
351+
uint8_t _descriptorCount;
348352
};
349353

350354
#endif // ifndef __GATT_CHARACTERISTIC_H__

0 commit comments

Comments
 (0)