40 namespace data_processing {
47 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
48 std::vector<uint8_t>::const_iterator data_ptr = vec_ptr->begin();
55 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
56 std::vector<uint8_t>::const_iterator data_ptr = vec_ptr->begin();
66 std::vector<uint8_t> byte_vector =
readData(buffer);
76 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
77 std::vector<uint8_t>::const_iterator data_ptr = vec_ptr->begin();
129 return std::vector<uint8_t>();
132 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
133 return std::vector<uint8_t>(vec_ptr->begin() + 20, vec_ptr->end());
void setCommandMode(const uint8_t &command_mode)
Sets the command mode.
void setSessionID(const uint32_t &session_id)
Sets the session ID.
void setDataVector(const std::vector< uint8_t > &data)
Sets the data vector.
uint8_t readCommandMode(std::vector< uint8_t >::const_iterator data_ptr) const
bool parseTCPSequence(const datastructure::PacketBuffer &buffer, sick::cola2::Command &command) const
Parse the tcp sequence to get the header information of the cola2 protocol.
A packetbuffer for the raw data from the sensor.
std::shared_ptr< std::vector< uint8_t > const > getBuffer() const
Getter to return a copy of the data saved in the PacketBuffer.
void setRequestID(const uint16_t &request_id)
Sets the request ID of the command.
ParseTCPPacket()
Constructor of parser.
std::vector< uint8_t > readData(const datastructure::PacketBuffer &buffer) const
uint8_t readUint8BigEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset in big endian encoding.
void setCommandType(const uint8_t &command_type)
Sets the command type.
Base class for commands. Defines the base interface and does the common tasks.
uint16_t getRequestID(const datastructure::PacketBuffer &buffer) const
Gets the request ID of the incoming tcp packet.
uint32_t readUint32BigEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 32-bit integer at offset in big endian encoding.
uint16_t readErrorCode(std::vector< uint8_t >::const_iterator data_ptr) const
uint32_t getExpectedPacketLength(const datastructure::PacketBuffer &buffer)
Gets the expected packet length for a buffer.
uint16_t readUint16BigEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 16-bit integer at offset in big endian encoding.
uint8_t readCommandType(std::vector< uint8_t >::const_iterator data_ptr) const
uint8_t readNoC(std::vector< uint8_t >::const_iterator data_ptr) const
uint8_t readHubCntr(std::vector< uint8_t >::const_iterator data_ptr) const
size_t getLength() const
Returns length of the current PacketBuffer.
uint32_t readSessionID(std::vector< uint8_t >::const_iterator data_ptr) const
uint32_t readSTx(std::vector< uint8_t >::const_iterator data_ptr) const
uint32_t readLength(std::vector< uint8_t >::const_iterator data_ptr) const
void setCommandValuesFromPacket(const sick::datastructure::PacketBuffer &buffer, sick::cola2::Command &command) const
uint16_t readRequestID(std::vector< uint8_t >::const_iterator data_ptr) const