40 namespace data_processing {
44 m_reader_ptr = std::make_shared<sick::data_processing::ReadWriteHelper>();
49 const uint8_t* data_ptr(buffer.
getBuffer().data());
55 const uint8_t* data_ptr(buffer.
getBuffer().data());
65 std::vector<uint8_t> byteVector;
75 const uint8_t* data_ptr(buffer.
getBuffer().data());
102 return m_reader_ptr->readuint32_tBigEndian(data_ptr, 10);
107 return m_reader_ptr->readuint16_tBigEndian(data_ptr, 14);
112 return m_reader_ptr->readuint8_tBigEndian(data_ptr, 16);
116 return m_reader_ptr->readuint8_tBigEndian(data_ptr, 17);
120 return m_reader_ptr->readuint16_tBigEndian(data_ptr, 18);
124 std::vector<uint8_t>& byteVector)
const 132 byteVector.insert(byteVector.end(), buffer.
getBuffer().begin() + 20, buffer.
getBuffer().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.
bool parseTCPSequence(const datastructure::PacketBuffer &buffer, sick::cola2::Command &command) const
Parse the tcp sequence to get the header information of the cola2 protocol.
std::shared_ptr< sick::data_processing::ReadWriteHelper > m_reader_ptr
A packetbuffer for the raw data from the sensor.
void setRequestID(const uint16_t &request_id)
Sets the request ID of the command.
uint32_t readLength(const uint8_t *&data_ptr) const
uint32_t readSTx(const uint8_t *&data_ptr) const
ParseTCPPacket()
Constructor of parser.
uint16_t readRequestID(const uint8_t *&data_ptr) const
void setCommandType(const uint8_t &command_type)
Sets the command type.
Base class for commands. Defines the base interface and does the common tasks.
uint32_t readSessionID(const uint8_t *&data_ptr) const
uint16_t getRequestID(const datastructure::PacketBuffer &buffer) const
Gets the request ID of the incoming tcp packet.
void readData(const datastructure::PacketBuffer &buffer, std::vector< uint8_t > &byteVector) const
const VectorBuffer & getBuffer() const
Getter to return the VectorBuffer saved in the PacketBuffer.
uint32_t getExpectedPacketLength(const datastructure::PacketBuffer &buffer)
Gets the expected packet length for a buffer.
uint16_t readErrorCode(const uint8_t *&data_ptr) const
uint8_t readHubCntr(const uint8_t *&data_ptr) const
size_t getLength() const
Returns length of the current PacketBuffer.
uint8_t readCommandMode(const uint8_t *&data_ptr) const
void setCommandValuesFromPacket(const sick::datastructure::PacketBuffer &buffer, sick::cola2::Command &command) const
uint8_t readNoC(const uint8_t *&data_ptr) const
uint8_t readCommandType(const uint8_t *&data_ptr) const