ITS
apiNetwork.h File Reference
#include <QObject>
#include <api.h>
Include dependency graph for apiNetwork.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TST_MAX   4294967295
 Network library. More...
 
#define SN_MAX   65535
 

Functions

quint64 get_INT64 (u_char *field, qint64 *int64)
 get_INT64 Extract an integer encoded in 64 bits from a byte array. More...
 
quint64 get_UINT64 (u_char *field, quint64 *uint64)
 get_UINT64 Extract an unsigned integer encoded in 64 bits from a byte array. More...
 
quint64 get_INT32 (u_char *field, qint32 *int32)
 get_INT32 Extract an integer encoded in 32 bits from a byte array. More...
 
quint64 get_UINT32 (u_char *field, quint32 *uint32)
 get_UINT32 Extract an unsigned integer encoded in 32 bits from a byte array. More...
 
quint64 get_INT16 (u_char *field, qint16 *int16)
 get_INT16 Extract an integer encoded in 16 bits from a byte array. More...
 
quint64 get_UINT16 (u_char *field, quint16 *uint16)
 get_INT64 Extract an integer encoded in 64 bits from a byte array. More...
 
quint64 get_INT8 (u_char *field, qint8 *int8)
 get_INT8 Extract an integer encoded in 8 bits from a byte array. More...
 
quint64 get_UINT8 (u_char *field, quint8 *uint8)
 get_UINT8 Extract an unsigned integer encoded in 64 bits from a byte array. More...
 
bool isDuplicatePacketDetectionTimestamp (quint32 lastReceivedTimestamp, quint32 nowReceivedTimestamp)
 isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp of the last packet of the source More...
 
bool isDuplicatePacketDetectionTimestampSN (quint32 lastReceivedTimestamp, quint32 nowReceivedTimestamp, quint16 lastReceivedSN, quint16 nowReceivedSN)
 isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp and the sequence number of the last packet of the source More...
 

Macro Definition Documentation

◆ SN_MAX

#define SN_MAX   65535

Definition at line 10 of file apiNetwork.h.

Referenced by isDuplicatePacketDetectionTimestampSN().

◆ TST_MAX

#define TST_MAX   4294967295

Network library.

Definition at line 9 of file apiNetwork.h.

Referenced by isDuplicatePacketDetectionTimestamp(), and isDuplicatePacketDetectionTimestampSN().

Function Documentation

◆ get_INT16()

quint64 get_INT16 ( u_char *  field,
qint16 *  int16 
)

get_INT16 Extract an integer encoded in 16 bits from a byte array.

Parameters
fieldThe byte array.
int16The integer to encode.
Returns
The number of read bytes.

Definition at line 55 of file apiNetwork.cpp.

Referenced by UpperTester::utChangeCurvature(), UpperTester::utChangeSpeed(), and UpperTester::utChangeYawRate().

Here is the caller graph for this function:

◆ get_INT32()

quint64 get_INT32 ( u_char *  field,
qint32 *  int32 
)

get_INT32 Extract an integer encoded in 32 bits from a byte array.

Parameters
fieldThe byte array.
int32The integer to encode.
Returns
The number of read bytes.

Definition at line 29 of file apiNetwork.cpp.

Referenced by ShortPositionVector::extract(), DestinationArea::extract(), LongPositionVector::extract(), UpperTester::sendGAC(), UpperTester::sendGBC(), and UpperTester::utChangePosition().

Here is the caller graph for this function:

◆ get_INT64()

quint64 get_INT64 ( u_char *  field,
qint64 *  int64 
)

get_INT64 Extract an integer encoded in 64 bits from a byte array.

Parameters
fieldThe byte array.
int64The integer to encode.
Returns
The number of read bytes.

Definition at line 3 of file apiNetwork.cpp.

◆ get_INT8()

quint64 get_INT8 ( u_char *  field,
qint8 *  int8 
)

get_INT8 Extract an integer encoded in 8 bits from a byte array.

Parameters
fieldThe byte array.
int8The integer to encode.
Returns
The number of read bytes.

Definition at line 81 of file apiNetwork.cpp.

Referenced by UpperTester::utChangePosition().

Here is the caller graph for this function:

◆ get_UINT16()

quint64 get_UINT16 ( u_char *  field,
quint16 *  uint16 
)

get_INT64 Extract an integer encoded in 64 bits from a byte array.

Parameters
fieldThe byte array.
int64The integer to encode.
Returns
The number of read bytes.

Definition at line 69 of file apiNetwork.cpp.

Referenced by LSRequestPacket::extract(), TSBPacket::extract(), GUCPacket::extract(), GBCPacket::extract(), GnAddr::extract(), DestinationArea::extract(), LongPositionVector::extract(), GeoNet::gacPacketProcessing(), GeoNet::gbcPacketProcessing(), GeoNet::gucPacketProcessing(), GeoNet::LSRequestPacketProcessing(), UpperTester::sendGAC(), UpperTester::sendGBC(), UpperTester::sendGUC(), UpperTester::sendSHB(), UpperTester::sendTSB(), GeoNet::shbPacketProcessing(), GeoNet::tsbPacketProcessing(), and UpperTester::utChangeHeading().

Here is the caller graph for this function:

◆ get_UINT32()

quint64 get_UINT32 ( u_char *  field,
quint32 *  uint32 
)

get_UINT32 Extract an unsigned integer encoded in 32 bits from a byte array.

Parameters
fieldThe byte array.
uint32The integer to encode.
Returns
The number of read bytes.

Definition at line 43 of file apiNetwork.cpp.

Referenced by SHBPacket::extract(), ShortPositionVector::extract(), and LongPositionVector::extract().

Here is the caller graph for this function:

◆ get_UINT64()

quint64 get_UINT64 ( u_char *  field,
quint64 *  uint64 
)

get_UINT64 Extract an unsigned integer encoded in 64 bits from a byte array.

Parameters
fieldThe byte array.
uint64The unsigned integer to encode.
Returns
The number of read bytes.

Definition at line 17 of file apiNetwork.cpp.

◆ get_UINT8()

quint64 get_UINT8 ( u_char *  field,
quint8 *  uint8 
)

get_UINT8 Extract an unsigned integer encoded in 64 bits from a byte array.

Parameters
fieldThe byte array.
uint8The integer to encode.
Returns
The number of read bytes.

Definition at line 88 of file apiNetwork.cpp.

Referenced by UpperTester::sendGAC(), UpperTester::sendGBC(), UpperTester::sendGUC(), UpperTester::sendSHB(), UpperTester::sendTSB(), UpperTester::utSetAccelerationControlStatus(), UpperTester::utSetDangerousGoods(), UpperTester::utSetDriveDirection(), UpperTester::utSetEmbarkationStatus(), UpperTester::utSetExteriorLightsStatus(), UpperTester::utSetLightBarSiren(), UpperTester::utSetPtActivation(), UpperTester::utSetStationType(), and UpperTester::utSetVehicleRole().

Here is the caller graph for this function:

◆ isDuplicatePacketDetectionTimestamp()

bool isDuplicatePacketDetectionTimestamp ( quint32  lastReceivedTimestamp,
quint32  nowReceivedTimestamp 
)

isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp of the last packet of the source

Parameters
lastReceivedTimestampFirst timestamp to compare (the timestamp carryed in the last packet of the source)
nowReceivedTimestampSecond timestamp to compare (the timestamp carryed in the packet)
Returns
false if packet are not duplicate, true if packet is duplicate

Definition at line 95 of file apiNetwork.cpp.

References TST_MAX.

Referenced by GeoNet::beaconPacketProcessing(), BroadcastForwardingPacketBuffer::isDuplicateTimestamp(), HistoryPacketBuffer::isDuplicateTimestamp(), BroadcastForwardingPacketEntry::operator==(), PacketBuffersEntry::operator==(), and GeoNet::shbPacketProcessing().

Here is the caller graph for this function:

◆ isDuplicatePacketDetectionTimestampSN()

bool isDuplicatePacketDetectionTimestampSN ( quint32  lastReceivedTimestamp,
quint32  nowReceivedTimestamp,
quint16  lastReceivedSN,
quint16  nowReceivedSN 
)

isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp and the sequence number of the last packet of the source

Parameters
lastReceivedTimestampFirst timestamp to compare (the timestamp carryed in the last packet of the source)
nowReceivedTimestampSecond timestamp to compare (the timestamp carryed in the packet)
lastReceivedSNFirst sequence number to compare (the sequence number carryed in the last packet of the source)
nowReceivedSNSecond sequence number to compare (the sequence number carryed in the packet)
Returns
false if packet are not duplicate, true if packet is duplicate

Definition at line 104 of file apiNetwork.cpp.

References SN_MAX, and TST_MAX.

Referenced by UnicastForwardingPacketBuffer::erase(), CBFPacketBuffer::erase(), GeoNet::gacPacketProcessing(), GeoNet::gbcPacketProcessing(), GeoNet::gucPacketProcessing(), UnicastForwardingPacketBuffer::isDuplicateTimestamp(), CBFPacketBuffer::isDuplicateTimestamp(), BroadcastForwardingPacketBuffer::isDuplicateTimestamp(), HistoryPacketBuffer::isDuplicateTimestamp(), GeoNet::LSReplyPacketProcessing(), GeoNet::LSRequestPacketProcessing(), UnicastForwardingPacketEntry::operator==(), GBCPacket::operator==(), BroadcastForwardingPacketEntry::operator==(), PacketBuffersEntry::operator==(), GeoNet::tsbPacketProcessing(), and CBFPacketBuffer::update().

Here is the caller graph for this function: