blob: ee2fb7e6c40f67d1e4629d85c49dac8fe8d71448 (
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
|
#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
|