ITS
RepetitionPacketEntry.h
Go to the documentation of this file.
1 
7 #ifndef RepetitionPacketEntry_H
8 #define RepetitionPacketEntry_H
9 
10 #include <QObject>
11 #include <QByteArray>
12 #include <QThread>
13 #include <QTimer>
14 #include <QElapsedTimer>
15 #include <GNDataRequest.h>
16 
17 class RepetitionPacketEntry : public QObject
18 {
19  Q_OBJECT
20 public:/*
21  enum e_reptitionPacketEntryError
22  {
23  reptitionPacketEntryError_success,
24  reptitionPacketEntryError_processing_bh_gnProtocolVersion,
25  reptitionPacketEntryError_processing_bh_nextHeader,
26 
27  tmp_reptitionPacketEntryError_processing_bh_securedHeader,
28  reptitionPacketEntryError_processing_ch_hopLimit,
29  reptitionPacketEntryError_processing_ch_headerType,
30  reptitionPacketEntryError_processing_ch_headerSubType,
31 
32  reptitionPacketEntryError_processing_beacon_DPD,
33  reptitionPacketEntryError_processing_beacon_DAD,
34 
35  tmp_reptitionPacketEntryError_processing_ch_headerType_geoAnycast,
36 
37  tmp_reptitionPacketEntryError_processing_ch_headerType_geoBroadcast,
38  reptitionPacketEntryError_processing_gbc_DAD,
39  reptitionPacketEntryError_processing_gbc_DPD,
40 
41  tmp_reptitionPacketEntryError_processing_ch_headerType_geoUnicast,
42 
43  tmp_reptitionPacketEntryError_processing_ch_headerType_locationService,
44 
45  tmp_reptitionPacketEntryError_processing_ch_headerType_TSB,
46  reptitionPacketEntryError_processing_shb_DPD,
47  reptitionPacketEntryError_processing_shb_DAD,
48 
49 
50  tmp_reptitionPacketEntryError_send_bh_securedPacket,
51 
52  reptitionPacketEntryError_send_ch_headerType,
53 
54  reptitionPacketEntryError_send_ch_headerType_geoAnycast,
55  tmp_reptitionPacketEntryError_send_ch_headerSubType_geoAnycast_circle,
56  tmp_reptitionPacketEntryError_send_ch_headerSubType_geoAnycast_rectangle,
57  tmp_reptitionPacketEntryError_send_ch_headerSubType_geoAnycast_ellipse,
58 
59  reptitionPacketEntryError_send_ch_headerType_geoUnicast,
60 
61  reptitionPacketEntryError_send_ch_headerType_geoBroadcast,
62  reptitionPacketEntryError_send_gbc_mhl,
63  reptitionPacketEntryError_send_gbc_noDestinationArea,
64  reptitionPacketEntryError_sending_gbc_areaSize,
65  reptitionPacketEntryError_sending_gbc_forward_areaSize,
66 
67  reptitionPacketEntryError_send_gbc_securedPacket,
68  reptitionPacketEntryError_send_gbc_unknownCommunicationProfile,
69  reptitionPacketEntryError_send_gbc_packetBuffered,
70  reptitionPacketEntryError_send_gbc_forward_packetBuffered,
71  reptitionPacketEntryError_send_gbc_packetDiscarded,
72  reptitionPacketEntryError_send_gbc_forward_packetDiscarded,
73  reptitionPacketEntryError_send_gbc_destinationAddress,
74  reptitionPacketEntryError_send_gbc_forward_destinationAddress,
75 
76  reptitionPacketEntryError_send_ch_headerType_locationService,
77  tmp_reptitionPacketEntryError_send_ch_headerSubType_LS_request,
78  tmp_reptitionPacketEntryError_send_ch_headerSubType_LS_reply,
79 
80  reptitionPacketEntryError_send_ch_headerType_TSB,
81  tmp_reptitionPacketEntryError_send_ch_headerSubType_TSB_multiHop,
82  reptitionPacketEntryError_send_shb_securedPacket,
83  reptitionPacketEntryError_send_shb_unknownCommunicationProfile,
84  tmp_reptitionPacketEntryError_send_shb_bufferedPacket
85  };
86 
87  enum e_reptitionPacketEntryNetworkError
88  {
89  reptitionPacketEntryNetworkError_success,
90  reptitionPacketEntryNetworkError_rawsocket_open,
91  reptitionPacketEntryNetworkError_rawsocket_siocgifindex,
92  reptitionPacketEntryNetworkError_rawsocket_send,
93  reptitionPacketEntryNetworkError_pcap_interfaceNotFound,
94  reptitionPacketEntryNetworkError_pcap_interfaceNotOpen,
95  reptitionPacketEntryNetworkError_pcap_ethernetHeader,
96  reptitionPacketEntryNetworkError_pcap_filtreCompile,
97  reptitionPacketEntryNetworkError_pcap_filtreInstall
98  };*/
99 
100  /* Constructors */
105 
111 
117 
123  bool operator==(const RepetitionPacketEntry &other);
130 
135  QElapsedTimer* elapsed() const{return m_elapsed;}
140  QTimer* timer() const{return m_timer;}
145  gnDataRequest_t gnDR() const{return m_gnDR;}
146 
147 signals:
151  void isOver();
156  void sendPacket(gnDataRequest_t packet);
157 
158 public slots:
162  void execute();
166  void repeat();
170  void kill();
171 
172 private :
174  QTimer* m_timer;
175  QElapsedTimer* m_elapsed;
176 };
177 
178 #endif // _RepetitionPacketEntry_H
gnDataRequest_t structure is the GN data request definition.
Definition: GNDataRequest.h:46
QElapsedTimer * elapsed() const
elapsed Time elapsed getter.
void isOver()
isOver Signal used when entry is over.
QElapsedTimer * m_elapsed
RepetitionPacketEntry & operator=(const RepetitionPacketEntry &other)
operator= RepetitionPacketEntry affectation operator.
gnDataRequest_t m_gnDR
GN data request definition.
void repeat()
repeat Slot used to repeat packet.
RepetitionPacketEntry()
RepetitionPacketEntry Default constructor.
QTimer * m_timer
gnDataRequest_t gnDR() const
gnDR Entry GN Data Request getter.
void execute()
execute Slot used to execute timers and add entries.
bool operator==(const RepetitionPacketEntry &other)
operator== RepetitionPacketEntry comparison operator.
void sendPacket(gnDataRequest_t packet)
sendPacket Signal used to send packet.
void kill()
kill Slot used to kill entry.
QTimer * timer() const
timer Entry timer getter.