diff options
Diffstat (limited to 'sapbtlistener.h')
-rw-r--r-- | sapbtlistener.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sapbtlistener.h b/sapbtlistener.h new file mode 100644 index 0000000..ee2fb7e --- /dev/null +++ b/sapbtlistener.h @@ -0,0 +1,42 @@ +#ifndef SAPBTLISTENER_H +#define SAPBTLISTENER_H + +#include <QtCore/QObject> + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include <QtBluetooth/QRfcommServer> +#include <QtBluetooth/QBluetoothServiceInfo> +QT_USE_NAMESPACE_BLUETOOTH +#else +#include <QtConnectivity/QRfcommServer> +#include <QtConnectivity/QBluetoothServiceInfo> +QTM_USE_NAMESPACE +#endif + +class SAPBTListener : public QObject +{ + Q_OBJECT +public: + explicit SAPBTListener(QObject *parent = 0); + ~SAPBTListener(); + +signals: + +public slots: + void start(); + void stop(); + + void nudge(const QBluetoothAddress &address); + +private: + +private slots: + void acceptConnection(); + + +private: + QRfcommServer *_server; + QBluetoothServiceInfo _service; +}; + +#endif // SAPBTLISTENER_H |