diff options
author | Javier <maemo@javispedro.com> | 2014-07-26 22:59:39 +0200 |
---|---|---|
committer | Javier <maemo@javispedro.com> | 2014-07-26 22:59:39 +0200 |
commit | e34f49ff20f2227ffca0515201e7493fd55ef64a (patch) | |
tree | 486b48932015af92c9577b6cddc88834cb839df4 /gatoperipheral.h | |
parent | aaf7fb81d16018cac51c67443bd09e499dbf1e7e (diff) | |
download | libgato-e34f49ff20f2227ffca0515201e7493fd55ef64a.tar.gz libgato-e34f49ff20f2227ffca0515201e7493fd55ef64a.zip |
add "requireencryption" connection option (ABI broken!)
Diffstat (limited to 'gatoperipheral.h')
-rw-r--r-- | gatoperipheral.h | 12 |
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); |