ITS
GBCPacket.h
Go to the documentation of this file.
1 
18 #ifndef GBCPACKET_H
19 #define GBCPACKET_H
20 
21 #include <QObject>
22 #include <constantes.h>
23 #include <LongPositionVector.h>
24 #include <CommonHeader.h>
25 #include <DestinationArea.h>
26 
27 class GBCPacket
28 {
29 public:
33  enum e_helper
34  {
36  };
37 
41  GBCPacket();
53  GBCPacket(const GBCPacket& other);
57  ~GBCPacket();
58 
64  GBCPacket operator=(const GBCPacket& other);
70  bool operator==(const GBCPacket& other);
71 
77  quint64 extract(uchar* packet);
78 
79  /* API */
84  QByteArray toHex();
85 
90  quint16 sequenceNumber() const {return m_sequenceNumber;}
95  LongPositionVector soPv() const {return m_soPv;}
101 
106  void setSoPv(LongPositionVector lpv) {m_soPv = lpv;}
111  void setSN(quint16 sn) {m_sequenceNumber = sn;}
112 
113 protected:
115  quint16 m_reserved;
118 };
119 
120 #endif // GBCPACKET_H
Common Header structure.
bool operator==(const GBCPacket &other)
operator== GBCPacket equal operator.
Definition: GBCPacket.cpp:33
quint64 extract(uchar *packet)
extract Extract GBC from packet.
Definition: GBCPacket.cpp:43
LongPositionVector soPv() const
soPv SO PV getter.
Definition: GBCPacket.h:95
void setSN(quint16 sn)
setSN Sequence number setter.
Definition: GBCPacket.h:111
quint16 sequenceNumber() const
sequenceNumber Sequence number getter.
Definition: GBCPacket.h:90
GBCPacket()
GBCPacket GBCPacket constructor.
Definition: GBCPacket.cpp:3
void setSoPv(LongPositionVector lpv)
setSoPv SO PV setter.
Definition: GBCPacket.h:106
LongPositionVector m_soPv
Definition: GBCPacket.h:116
Destination area structure.
quint16 m_reserved
Definition: GBCPacket.h:115
DestinationArea m_destinationArea
Definition: GBCPacket.h:117
Constantes used everywhere.
GBCPacket operator=(const GBCPacket &other)
operator= GBCPacket affectation operator.
Definition: GBCPacket.cpp:24
quint16 m_sequenceNumber
Definition: GBCPacket.h:114
~GBCPacket()
~GBCPacket The GBCPacket destructor.
Definition: GBCPacket.cpp:39
e_helper
The e_helper enum is used to help to have sizes.
Definition: GBCPacket.h:33
LPV definition.
DestinationArea destinationArea() const
destinationArea Destination area getter.
Definition: GBCPacket.h:100
QByteArray toHex()
toHex Create a QByteArray containing the hexadecimal format of the GBCPacket.
Definition: GBCPacket.cpp:55