summaryrefslogtreecommitdiff
path: root/gatoperipheral.h
diff options
context:
space:
mode:
Diffstat (limited to 'gatoperipheral.h')
-rw-r--r--gatoperipheral.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gatoperipheral.h b/gatoperipheral.h
index 4b757df..5a7f463 100644
--- a/gatoperipheral.h
+++ b/gatoperipheral.h
@@ -17,6 +17,7 @@ class LIBGATO_EXPORT GatoPeripheral : public QObject
Q_DECLARE_PRIVATE(GatoPeripheral)
Q_ENUMS(State)
Q_ENUMS(WriteType)
+ Q_FLAGS(PeripheralConnectOptions)
Q_PROPERTY(GatoAddress address READ address)
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
@@ -24,6 +25,11 @@ public:
GatoPeripheral(const GatoAddress& addr, QObject *parent = 0);
~GatoPeripheral();
+ enum PeripheralConnectOption {
+ PeripheralConnectOptionRequireEncryption = 1 << 0
+ };
+ Q_DECLARE_FLAGS(PeripheralConnectOptions, PeripheralConnectOption)
+
enum State {
StateDisconnected,
StateConnecting,
@@ -44,13 +50,15 @@ public:
bool advertisesService(const GatoUUID &uuid) const;
public slots:
- void connectPeripheral();
+ void connectPeripheral(PeripheralConnectOptions options);
void disconnectPeripheral();
+
void discoverServices();
void discoverServices(const QList<GatoUUID>& serviceUUIDs);
void discoverCharacteristics(const GatoService &service);
void discoverCharacteristics(const GatoService &service, const QList<GatoUUID>& characteristicUUIDs);
void discoverDescriptors(const GatoCharacteristic &characteristic);
+
void readValue(const GatoCharacteristic &characteristic);
void readValue(const GatoDescriptor &descriptor);
void writeValue(const GatoCharacteristic &characteristic, const QByteArray &data, WriteType type = WriteWithResponse);
@@ -60,10 +68,12 @@ public slots:
signals:
void connected();
void disconnected();
+
void nameChanged();
void servicesDiscovered();
void characteristicsDiscovered(const GatoService &service);
void descriptorsDiscovered(const GatoCharacteristic &characteristic);
+
void valueUpdated(const GatoCharacteristic &characteristic, const QByteArray &value);
void descriptorValueUpdated(const GatoDescriptor &descriptor, const QByteArray &value);