Class ParseTCPPacket

Class Documentation

class ParseTCPPacket

Parser for an incoming TCP packet.

Public Functions

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.

Parameters
  • buffer – The incoming tcp connection.

  • command – Reference to the command and set the returned method type and mode and the data.

Returns

If parsing was successful.

uint32_t getExpectedPacketLength(const datastructure::PacketBuffer &buffer)

Gets the expected packet length for a buffer.

Parameters

buffer – The incoming tcp packet.

Returns

Expected length of the incoming packet buffer.

uint16_t getRequestID(const datastructure::PacketBuffer &buffer) const

Gets the request ID of the incoming tcp packet.

Parameters

buffer – The incoming tcp packet.

Returns

The request ID of the incoming packet buffer.