The packet class for network layer packets. More...
#include <Packet.h>
Public Member Functions | |
bool | addFrame (RoutedFrame frame) |
bool | frameAlreadyExsits (RoutedFrame f) |
std::string | getPayload () |
unsigned long | getSize () |
bool | isMcFrame () |
bool | isNack () |
Packet (RoutedFrame frame) | |
Packet () | |
void | refreshLists () |
void | refreshMissingFramesList () |
void | requestMissingFrames () |
void | sortFrameList () |
virtual | ~Packet () |
Public Attributes | |
uint8_t | data_type_ |
std::list< RoutedFrame > | frames_l_ |
uint32_t | highest_seq |
std::string | hostname_source_ |
hostname of the source | |
uint32_t | id_ |
Packet ID. | |
std::string | mc_group_ |
name of the mc group | |
std::list< uint32_t > | missed_sequences_l_ |
A list with all lost pending frames. | |
uint32_t | size_ |
Size of packet in bytes. | |
std::string | topic_ |
ROS topic on which to publish. | |
unsigned long | ts_ |
unsigned long | ts_last_frame_request |
bool | wrong_sequence_ |
Static Public Attributes | |
static int | NACK_THRESHOLD = 10 |
The packet class for network layer packets.
The packet class implements all functions required to build a network layer packet.
Packet::Packet | ( | RoutedFrame | frame | ) |
Packet constructor. Constructor initializes basic members.
packet_id | The ID of the packet. |
packet_size | The size of the packet in bytes. |
payload_data_type | Defines which type the payload is |
source | The host name of the source |
topic | The ROS topic name on which to publish |
Definition at line 18 of file Packet.cpp.
Packet::Packet | ( | ) |
Definition at line 37 of file Packet.cpp.
Packet::~Packet | ( | ) | [virtual] |
Definition at line 33 of file Packet.cpp.
bool Packet::addFrame | ( | RoutedFrame | frame | ) |
Add the frame to the frame list of the packet, if the frame belongs to the packet. This method is needed to build up the packet on the receiver side. This method also checks if all frames are received and the packet is complete.
frame | The frame that should be added |
Definition at line 195 of file Packet.cpp.
bool Packet::frameAlreadyExsits | ( | RoutedFrame | f | ) |
Definition at line 60 of file Packet.cpp.
std::string Packet::getPayload | ( | ) |
Returns the packet's payload.
Definition at line 301 of file Packet.cpp.
unsigned long Packet::getSize | ( | ) |
Definition at line 41 of file Packet.cpp.
bool Packet::isMcFrame | ( | ) | [inline] |
Definition at line 185 of file Packet.cpp.
bool Packet::isNack | ( | ) | [inline] |
Definition at line 190 of file Packet.cpp.
void Packet::refreshLists | ( | ) |
Definition at line 130 of file Packet.cpp.
void Packet::refreshMissingFramesList | ( | ) |
void Packet::requestMissingFrames | ( | ) |
void Packet::sortFrameList | ( | ) |
Definition at line 74 of file Packet.cpp.
uint8_t Packet::data_type_ |
std::list<RoutedFrame> Packet::frames_l_ |
uint32_t Packet::highest_seq |
std::string Packet::hostname_source_ |
uint32_t Packet::id_ |
std::string Packet::mc_group_ |
std::list<uint32_t> Packet::missed_sequences_l_ |
int Packet::NACK_THRESHOLD = 10 [static] |
uint32_t Packet::size_ |
std::string Packet::topic_ |
unsigned long Packet::ts_ |
unsigned long Packet::ts_last_frame_request |