Parser for an incoming TCP packet. More...
#include <ParseTCPPacket.h>
Public Member Functions | |
uint32_t | getExpectedPacketLength (const datastructure::PacketBuffer &buffer) |
Gets the expected packet length for a buffer. | |
uint16_t | getRequestID (const datastructure::PacketBuffer &buffer) const |
Gets the request ID of the incoming tcp packet. | |
ParseTCPPacket () | |
Constructor of parser. | |
bool | parseTCPSequence (const datastructure::PacketBuffer &buffer, sick::cola2::Command &command) const |
Parse the tcp sequence to get the header information of the cola2 protocol. | |
Private Member Functions | |
uint8_t | readCommandMode (const uint8_t *&data_ptr) const |
uint8_t | readCommandType (const uint8_t *&data_ptr) const |
void | readData (const datastructure::PacketBuffer &buffer, std::vector< uint8_t > &byteVector) const |
uint16_t | readErrorCode (const uint8_t *&data_ptr) const |
uint8_t | readHubCntr (const uint8_t *&data_ptr) const |
uint32_t | readLength (const uint8_t *&data_ptr) const |
uint8_t | readNoC (const uint8_t *&data_ptr) const |
uint16_t | readRequestID (const uint8_t *&data_ptr) const |
uint32_t | readSessionID (const uint8_t *&data_ptr) const |
uint32_t | readSTx (const uint8_t *&data_ptr) const |
void | setCommandValuesFromPacket (const sick::datastructure::PacketBuffer &buffer, sick::cola2::Command &command) const |
Private Attributes | |
std::shared_ptr < sick::data_processing::ReadWriteHelper > | m_reader_ptr |
Parser for an incoming TCP packet.
Definition at line 59 of file ParseTCPPacket.h.
Constructor of parser.
Definition at line 42 of file ParseTCPPacket.cpp.
uint32_t sick::data_processing::ParseTCPPacket::getExpectedPacketLength | ( | const datastructure::PacketBuffer & | buffer | ) |
Gets the expected packet length for a buffer.
buffer | The incoming tcp packet. |
Definition at line 47 of file ParseTCPPacket.cpp.
uint16_t sick::data_processing::ParseTCPPacket::getRequestID | ( | const datastructure::PacketBuffer & | buffer | ) | const |
Gets the request ID of the incoming tcp packet.
buffer | The incoming tcp packet. |
Definition at line 53 of file ParseTCPPacket.cpp.
bool sick::data_processing::ParseTCPPacket::parseTCPSequence | ( | const datastructure::PacketBuffer & | buffer, |
sick::cola2::Command & | command | ||
) | const |
Parse the tcp sequence to get the header information of the cola2 protocol.
buffer | The incoming tcp connection. |
command | Reference to the command and set the returned method type and mode and the data. |
Definition at line 60 of file ParseTCPPacket.cpp.
uint8_t sick::data_processing::ParseTCPPacket::readCommandMode | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 114 of file ParseTCPPacket.cpp.
uint8_t sick::data_processing::ParseTCPPacket::readCommandType | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 110 of file ParseTCPPacket.cpp.
void sick::data_processing::ParseTCPPacket::readData | ( | const datastructure::PacketBuffer & | buffer, |
std::vector< uint8_t > & | byteVector | ||
) | const [private] |
Definition at line 123 of file ParseTCPPacket.cpp.
uint16_t sick::data_processing::ParseTCPPacket::readErrorCode | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 118 of file ParseTCPPacket.cpp.
uint8_t sick::data_processing::ParseTCPPacket::readHubCntr | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 92 of file ParseTCPPacket.cpp.
uint32_t sick::data_processing::ParseTCPPacket::readLength | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 87 of file ParseTCPPacket.cpp.
uint8_t sick::data_processing::ParseTCPPacket::readNoC | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 96 of file ParseTCPPacket.cpp.
uint16_t sick::data_processing::ParseTCPPacket::readRequestID | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 105 of file ParseTCPPacket.cpp.
uint32_t sick::data_processing::ParseTCPPacket::readSessionID | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 100 of file ParseTCPPacket.cpp.
uint32_t sick::data_processing::ParseTCPPacket::readSTx | ( | const uint8_t *& | data_ptr | ) | const [private] |
Definition at line 82 of file ParseTCPPacket.cpp.
void sick::data_processing::ParseTCPPacket::setCommandValuesFromPacket | ( | const sick::datastructure::PacketBuffer & | buffer, |
sick::cola2::Command & | command | ||
) | const [private] |
Definition at line 72 of file ParseTCPPacket.cpp.
std::shared_ptr<sick::data_processing::ReadWriteHelper> sick::data_processing::ParseTCPPacket::m_reader_ptr [private] |
Definition at line 97 of file ParseTCPPacket.h.