From e34f49ff20f2227ffca0515201e7493fd55ef64a Mon Sep 17 00:00:00 2001 From: Javier Date: Sat, 26 Jul 2014 22:59:39 +0200 Subject: add "requireencryption" connection option (ABI broken!) --- gatoperipheral.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gatoperipheral.h') 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& serviceUUIDs); void discoverCharacteristics(const GatoService &service); void discoverCharacteristics(const GatoService &service, const QList& 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); -- cgit v1.2.3