ITS
SHBPacket.cpp
Go to the documentation of this file.
1 #include "SHBPacket.h"
2 
4 {
5  m_reserved = 0;
6 }
7 
9 {
10  m_reserved = 0;
11  m_soPv = lpv;
12 }
13 
15 {
16  this->m_soPv = other.soPv();
17  this->m_reserved = other.m_reserved;
18 }
19 
20 
22 {
23 }
24 
25 quint64 SHBPacket::extract(uchar* packet)
26 {
27  quint64 offset = 0;
28 
29  offset += m_soPv.extract(packet);
30  offset += get_UINT32(packet + offset, &m_reserved);
31 
32  return offset;
33 }
34 
35 QByteArray SHBPacket::toHex()
36 {
37  QByteArray hex;
38  QDataStream ds(&hex, QIODevice::WriteOnly);
39 
40  ds.writeRawData(m_soPv.toHex().data(), LongPositionVector::helper_size);
41  ds << m_reserved;
42 
43  return hex;
44 }
~SHBPacket()
~SHBPacket SHBPacket destructor.
Definition: SHBPacket.cpp:21
quint64 get_UINT32(u_char *field, quint32 *uint32)
get_UINT32 Extract an unsigned integer encoded in 32 bits from a byte array.
Definition: apiNetwork.cpp:43
SHB packet structure.
QByteArray toHex()
toHex Create a QByteArray containing the hexadecimal format of the SHBPacket.
Definition: SHBPacket.cpp:35
SHBPacket()
SHBPacket SHBPacket constructor.
Definition: SHBPacket.cpp:3
LongPositionVector m_soPv
Definition: SHBPacket.h:74
quint64 extract(uchar *packet)
extract Fill the LongPositionVector with values contained in the packet
quint64 extract(uchar *packet)
extract Extract GBC from packet.
Definition: SHBPacket.cpp:25
quint32 m_reserved
Definition: SHBPacket.h:75
QByteArray toHex()
toHex Create a QByteArray containing the hexadecimal format of the LongPositionVector.
LongPositionVector soPv() const
soPv SHB SO PV getter.
Definition: SHBPacket.h:66