-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathadu.h
39 lines (31 loc) · 814 Bytes
/
adu.h
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
36
37
38
39
#ifndef ADU_H
#define ADU_H
#include <QtCore>
#include <QTcpSocket>
#include "pdu.h"
class ADU : public PDU
{
public:
ADU();
ADU(QTcpSocket * const socket, const QByteArray & aduRequest);
~ADU();
QTcpSocket * getSocket() { return mSocket.data(); }
void setReplyData(const QByteArray &replyData) { mReplyData = replyData; }
uint getTransID() const { return mTransID; }
uint getProdID() const { return mProdID; }
uint getLength() const { return mLength; }
uint getUnitID() const { return mUnitID; }
void setTransID(uint id) { mTransID = id; }
QByteArray toQByteArray() const;
// Helpers
QString aduToString() const;
private:
QPointer<QTcpSocket> mSocket;
QByteArray mReplyData;
// MBAP Header members
quint16 mTransID;
quint16 mProdID;
quint16 mLength;
quint8 mUnitID;
};
#endif // ADU_H