From 47ada94baa424e56d2ded256fddc91e6aa4d3090 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Tue, 3 Dec 2013 03:05:47 +0100 Subject: initial import --- gatocharacteristic.h | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 gatocharacteristic.h (limited to 'gatocharacteristic.h') diff --git a/gatocharacteristic.h b/gatocharacteristic.h new file mode 100644 index 0000000..2b2f457 --- /dev/null +++ b/gatocharacteristic.h @@ -0,0 +1,69 @@ +#ifndef GATOCHARACTERISTIC_H +#define GATOCHARACTERISTIC_H + +#include +#include + +#include "gatouuid.h" + +class GatoCharacteristicPrivate; +class GatoDescriptor; + +class LIBGATO_EXPORT GatoCharacteristic +{ + Q_GADGET + Q_FLAGS(CharacteristicProperties) + +public: + enum Property { + PropertyBroadcast = 0x1, + PropertyRead = 0x2, + PropertyWriteWithoutResponse = 0x4, + PropertyWrite = 0x5, + PropertyNotify = 0x10, + PropertyIndicate = 0x20, + PropertyAuthenticatedSignedWrites = 0x40, + PropertyExtendedProperties = 0x80 + }; + Q_DECLARE_FLAGS(Properties, Property) + + GatoCharacteristic(); + GatoCharacteristic(const GatoCharacteristic &o); + ~GatoCharacteristic(); + + bool isNull() const; + + GatoUUID uuid() const; + void setUuid(const GatoUUID &uuid); + + Properties properties() const; + void setProperties(Properties props); + + GatoHandle startHandle() const; + void setStartHandle(GatoHandle handle); + + GatoHandle endHandle() const; + void setEndHandle(GatoHandle handle); + + GatoHandle valueHandle() const; + void setValueHandle(GatoHandle handle); + + QList descriptors() const; + bool containsDescriptor(const GatoDescriptor& descriptor) const; + bool containsDescriptor(GatoUUID uuid) const; + bool containsDescriptor(GatoHandle handle) const; + GatoDescriptor getDescriptor(GatoUUID uuid) const; + GatoDescriptor getDescriptor(GatoHandle handle) const; + void addDescriptor(const GatoDescriptor& descriptor); + void removeDescriptor(const GatoDescriptor& descriptor); + void clearDescriptors(); + + GatoCharacteristic &operator=(const GatoCharacteristic &o); + +private: + QSharedDataPointer d; +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(GatoCharacteristic::Properties) + +#endif // GATOCHARACTERISTIC_H -- cgit v1.2.3