blob: 296edbce0382cfc0c989e0ea8507bbd13ae0f337 (
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
44
45
46
47
48
|
#include <bluetooth5.h>
#include <debugout.h>
#include <QCoreApplication>
#include <QJsonDocument>
#include <QStringList>
#include <QDebug>
#include "bluetoothplugin.h"
class BluetoothSerialClient: public AbstractBluetoothSerialProfile
{
public:
BluetoothSerialClient(): AbstractBluetoothSerialProfile("client") {}
void connected()
{
}
void disconnected()
{
}
void dataReceived(QByteArray d)
{
qDebug()<<"data: "<< d;
}
};
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
QString addy = app.arguments().at(1);
DebugOut::setDebugThreshhold(6);
qDebug()<<"connecting to: "<<addy;
BluetoothSerialClient client;
client.connect(addy.toStdString());
app.exec();
return 1;
}
|