summaryrefslogtreecommitdiff
path: root/saltoqd/toqconnection.h
diff options
context:
space:
mode:
Diffstat (limited to 'saltoqd/toqconnection.h')
-rw-r--r--saltoqd/toqconnection.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/saltoqd/toqconnection.h b/saltoqd/toqconnection.h
index 765c3f3..68f3445 100644
--- a/saltoqd/toqconnection.h
+++ b/saltoqd/toqconnection.h
@@ -3,6 +3,7 @@
#include <QtCore/QTimer>
#include <QtBluetooth/QBluetoothSocket>
+#include <QtBluetooth/QBluetoothServer>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
@@ -65,6 +66,7 @@ public:
public slots:
void sendMessage(const Message &msg);
+ void disconnectFromDevice();
signals:
void connected();
@@ -73,11 +75,13 @@ signals:
void connectedChanged();
private:
- Message unpackMessage(const QByteArray &data);
- QByteArray packMessage(const Message &msg);
+ static Message unpackMessage(const QByteArray &data);
+ static QByteArray packMessage(const Message &msg);
+ void setSocket(QBluetoothSocket *socket);
private slots:
void tryConnect();
+ void handleServerConnection();
void handleSocketConnected();
void handleSocketDisconnected();
void handleSocketError(QBluetoothSocket::SocketError error);
@@ -85,6 +89,7 @@ private slots:
private:
QBluetoothAddress _address;
+ QBluetoothServer *_server;
QBluetoothSocket *_socket;
QTimer *_reconnectTimer;
quint16 _lastTransactionId;