blob: a59a5e1977b8fa243cf3c67c0d163887a72f6e7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#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();
void handleNudgeError(QBluetoothSocket::SocketError error);
private:
QRfcommServer *_server;
QBluetoothServiceInfo _service;
};
#endif // SAPBTLISTENER_H
|