summaryrefslogtreecommitdiff
path: root/plugins/bluetooth/testAmbBt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/bluetooth/testAmbBt.cpp')
-rw-r--r--plugins/bluetooth/testAmbBt.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/plugins/bluetooth/testAmbBt.cpp b/plugins/bluetooth/testAmbBt.cpp
index f00c0466..53b470d9 100644
--- a/plugins/bluetooth/testAmbBt.cpp
+++ b/plugins/bluetooth/testAmbBt.cpp
@@ -3,7 +3,7 @@
#include <QCoreApplication>
#include <QJsonDocument>
#include <QStringList>
-#include <QSocketNotifier>
+#include <QDebug>
#include "bluetooth5.h"
#include <serialport.hpp>
@@ -38,9 +38,14 @@ int main(int argc, char** argv)
QString addy = app.arguments().at(1);
+ DebugOut::setDebugThreshhold(6);
+
+ qDebug()<<"connecting to: "<<addy;
+
Bluetooth5 btdev;
- btdev.getDeviceForAddress(addy.toStdString(),[](int fd){
- DebugOut(0)<<"I am connected"<<endl;
+ btdev.getDeviceForAddress(addy.toStdString(),[](int fd)
+ {
+ qDebug()<<"I am connected "<<fd;
s->setDescriptor(fd);
GIOChannel *chan = g_io_channel_unix_new(s->fileDescriptor());
@@ -48,8 +53,12 @@ int main(int argc, char** argv)
g_io_channel_set_close_on_unref(chan, true);
g_io_channel_unref(chan);
- s->write("ping");
+ s->write("ping\r\n");
});
- return app.exec();
+ app.exec();
+
+ s->close();
+
+ return 1;
}