ITS
HistoryPacketBuffer.cpp
Go to the documentation of this file.
1 #include "HistoryPacketBuffer.h"
2 
4 {
5  m_gnAddr = gnAddr;
6 }
7 
9 {
10  for(int i = 0; i < NB_PACKET_TYPE; i++)
11  this->m_historyPacketBuffer[i] = other.m_historyPacketBuffer[i];
12  for(int i = 0; i < NB_PACKET_TYPE-2; i++)
14 }
15 
17 {
18  if(packet.soPv().gnAddr() == *m_gnAddr)
19  {
22  }
23 }
24 
26 {
27  if(packet.soPv().gnAddr() == *m_gnAddr)
28  {
31  }
32 }
33 
35 {
36  if(packet.soPv().gnAddr() == *m_gnAddr)
37  {
40  }
41 }
42 
44 {
45  if(packet.soPv().gnAddr() == *m_gnAddr)
46  {
49  }
50 }
51 
53 {
54  if(packet.soPv().gnAddr() == *m_gnAddr)
55  {
58  }
59 }
60 
62 {
63  if(packet.soPv().gnAddr() == *m_gnAddr)
64  {
67  }
68 }
69 
71 {
72  if(packet.soPv().gnAddr() == *m_gnAddr)
74 }
75 
77 {
78  if(packet.soPv().gnAddr() == *m_gnAddr)
80 }
81 
83 {
84  if(packet.soPv().gnAddr() == *m_gnAddr)
86  else
87  return false;
88 }
89 
91 {
92  if(packet.soPv().gnAddr() == *m_gnAddr)
94  else
95  return false;
96 }
97 
99 {
100  if(packet.soPv().gnAddr() == *m_gnAddr)
102  else
103  return false;
104 }
105 
107 {
108  if(packet.soPv().gnAddr() == *m_gnAddr)
110  else
111  return false;
112 }
113 
115 {
116  if(packet.soPv().gnAddr() == *m_gnAddr)
118  else
119  return false;
120 }
121 
123 {
124  if(packet.soPv().gnAddr() == *m_gnAddr)
126  else
127  return false;
128 }
129 
131 {
132  if(packet.soPv().gnAddr() == *m_gnAddr)
134  else
135  return false;
136 }
137 
139 {
140  if(packet.soPv().gnAddr() == *m_gnAddr)
142  else
143  return false;
144 }
145 
147 {
148  for(int i = 0; i < NB_PACKET_TYPE; i++)
149  m_historyPacketBuffer[i] = 0;
150  for(int i = 0; i < NB_PACKET_TYPE-2; i++)
152 }
Buffer used to store sent and received packets.
#define LSREQUEST
#define GAC
#define NB_PACKET_TYPE
bool isDuplicateTimestamp(BeaconPacket packet)
isDuplicateTimestamp Check is the packet is duplicate.
LongPositionVector soPv() const
soPv TSB SO PV getter.
Definition: TSBPacket.h:73
#define LSREPLY
LongPositionVector soPv() const
soPv SO PV getter.
Definition: GBCPacket.h:95
#define SHB
quint32 timestamp() const
timestamp Timestamp field getter
quint16 sequenceNumber() const
sequenceNumber Sequence number getter.
Definition: GBCPacket.h:90
GnAddr gnAddr() const
gnAddr GnAddr field getter
bool isDuplicatePacketDetectionTimestampSN(quint32 lastReceivedTimestamp, quint32 nowReceivedTimestamp, quint16 lastReceivedSN, quint16 nowReceivedSN)
isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp and th...
Definition: apiNetwork.cpp:104
quint32 m_historyPacketBuffer[NB_PACKET_TYPE]
void clear()
clear Clear the buffer.
#define GUC
#define BEACON
HistoryPacketBuffer(GnAddr *gnAddr)
HistoryPacketBuffer Default constructor.
quint16 sequenceNumber() const
sequenceNumber TSB sequence number getter.
Definition: TSBPacket.h:68
#define GBC
Definition: GnAddr.h:28
quint16 m_historyPacketBufferSN[NB_PACKET_TYPE-2]
#define TSB
bool isDuplicatePacketDetectionTimestamp(quint32 lastReceivedTimestamp, quint32 nowReceivedTimestamp)
isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp of the...
Definition: apiNetwork.cpp:95
quint16 sequenceNumber() const
sequenceNumber GUC sequence number getter.
Definition: GUCPacket.h:72
void addPacket(BeaconPacket packet)
addPacket Add packet to the buffer.
LongPositionVector soPv() const
soPv SHB SO PV getter.
Definition: SHBPacket.h:66
LongPositionVector soPv() const
soPv GUC SO PV getter.
Definition: GUCPacket.h:77
LongPositionVector soPv() const
soPv SO PV getter.
Definition: BeaconPacket.h:63