diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2013-12-03 03:05:47 +0100 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2013-12-03 03:05:47 +0100 |
commit | 47ada94baa424e56d2ded256fddc91e6aa4d3090 (patch) | |
tree | 46fd1da4c5fe29694aea0d05b70fe7db2ba7fa88 /gatocentralmanager.h | |
download | libgato-47ada94baa424e56d2ded256fddc91e6aa4d3090.tar.gz libgato-47ada94baa424e56d2ded256fddc91e6aa4d3090.zip |
initial import
Diffstat (limited to 'gatocentralmanager.h')
-rw-r--r-- | gatocentralmanager.h | 44 |
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 |