summaryrefslogtreecommitdiff
path: root/gatocentralmanager.h
diff options
context:
space:
mode:
Diffstat (limited to 'gatocentralmanager.h')
-rw-r--r--gatocentralmanager.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/gatocentralmanager.h b/gatocentralmanager.h
new file mode 100644
index 0000000..00225a0
--- /dev/null
+++ b/gatocentralmanager.h
@@ -0,0 +1,44 @@
+#ifndef GATOCENTRALMANAGER_H
+#define GATOCENTRALMANAGER_H
+
+#include <QtCore/QObject>
+#include "libgato_global.h"
+#include "gatouuid.h"
+
+class GatoPeripheral;
+class GatoCentralManagerPrivate;
+
+class LIBGATO_EXPORT GatoCentralManager : public QObject
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(GatoCentralManager)
+ Q_FLAGS(PeripheralScanOptions)
+
+public:
+ enum PeripheralScanOption {
+ PeripheralScanOptionActive = 1 << 0,
+ PeripheralScanOptionAllowDuplicates = 1 << 1
+ };
+ Q_DECLARE_FLAGS(PeripheralScanOptions, PeripheralScanOption)
+
+ explicit GatoCentralManager(QObject *parent = 0);
+ ~GatoCentralManager();
+
+public slots:
+ void scanForPeripherals(PeripheralScanOptions options = 0);
+ void scanForPeripheralsWithServices(const QList<GatoUUID>& uuids, PeripheralScanOptions options = 0);
+ void stopScan();
+
+signals:
+ void discoveredPeripheral(GatoPeripheral *peripheral, int rssi);
+
+private slots:
+ void _q_readNotify();
+
+private:
+ GatoCentralManagerPrivate *const d_ptr;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(GatoCentralManager::PeripheralScanOptions)
+
+#endif // GATOCENTRALMANAGER_H