From a45977185a485624095bff1a15024e9199eee676 Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 1 Jan 2016 22:05:42 +0100 Subject: reorganize source files into SAP and agents --- sap/sapbtpeer.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sap/sapbtpeer.h (limited to 'sap/sapbtpeer.h') diff --git a/sap/sapbtpeer.h b/sap/sapbtpeer.h new file mode 100644 index 0000000..75af77f --- /dev/null +++ b/sap/sapbtpeer.h @@ -0,0 +1,36 @@ +#ifndef SAPBTPEER_H +#define SAPBTPEER_H + +#include +#include + +#include "sappeer.h" + +class SAPBTPeer : public SAPPeer +{ + Q_OBJECT + +public: + SAPBTPeer(SAProtocol::Role role, QBluetoothSocket *socket, QObject *parent = 0); + +protected: + void sendFrame(const QByteArray &data); + +private slots: + void handleSocketData(); + void handleSocketDisconnected(); + +private: + void handleFrame(const QByteArray &data); + void handleDataFrame(const SAProtocol::Frame &frame); + void handleControlFrame(const SAProtocol::Frame &frame); + void handleAuthenticationFrame(const QByteArray &data); + +private: + QBluetoothSocket *_socket; + uint _curFrameLength; + bool _peerDescriptionExchangeDone : 1; + bool _authenticationDone : 1; +}; + +#endif // SAPBTPEER_H -- cgit v1.2.3