From d8d8fc7a0d139e7b864eee3b573bd208f823ad4f Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 19 Oct 2014 18:45:03 +0200 Subject: initial import, no crypto --- sapbtpeer.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 sapbtpeer.h (limited to 'sapbtpeer.h') diff --git a/sapbtpeer.h b/sapbtpeer.h new file mode 100644 index 0000000..cc060f8 --- /dev/null +++ b/sapbtpeer.h @@ -0,0 +1,42 @@ +#ifndef SAPBTPEER_H +#define SAPBTPEER_H + +#include + +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +QT_USE_NAMESPACE_BLUETOOTH +#else +#include +QTM_USE_NAMESPACE +#endif + +#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 handleAuthenticationFrame(const QByteArray &data); + +private: + QBluetoothSocket *_socket; + uint _curFrameLength; + bool _peerDescriptionExchangeDone : 1; + bool _authenticationDone : 1; +}; + +#endif // SAPBTPEER_H -- cgit v1.2.3