summaryrefslogtreecommitdiff
path: root/sapbtpeer.h
blob: 66f8cbbc69a8b104d978ddb189fbe7cf62724890 (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
#ifndef SAPBTPEER_H
#define SAPBTPEER_H

#include <QtCore/QObject>
#include <QtBluetooth/QBluetoothSocket>

#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