40 namespace data_processing {
49 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
50 std::vector<uint8_t>::const_iterator data_ptr = vec_ptr->begin();
91 std::vector<std::string>
93 uint32_t array_length)
const 95 std::vector<std::string> result;
96 for (uint32_t i = 0; i < array_length; i++)
100 for (uint8_t j = 0; j < name_length; j++)
104 result.push_back(name);
109 std::vector<uint32_t>
111 uint32_t array_length)
const 113 std::vector<uint32_t> result;
114 for (uint32_t i = 0; i < array_length; i++)
121 uint32_t array_length)
const 123 std::vector<bool> result;
124 for (uint32_t i = 0; i < array_length; i++)
128 result.push_back(static_cast<bool>(byte & (0x01 << 0)));
void setFieldName(const std::vector< std::string > &field_name)
Sets the field name for the scanner.
uint8_t readReleaseNumber(std::vector< uint8_t >::const_iterator data_ptr) const
std::vector< uint32_t > readNameLength(std::vector< uint8_t >::const_iterator data_ptr, uint32_t array_length) const
std::string readVersionIndicator(std::vector< uint8_t >::const_iterator data_ptr) const
Class containing the field name of a laser scanner.
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.
uint8_t readMinorNumber(std::vector< uint8_t >::const_iterator data_ptr) const
void setVersionReleaseNumber(const uint8_t &version_release_number)
Sets the version release number for the scanner.
uint8_t readUint8LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset in big little encoding.
uint32_t readUint32LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 32-bit integer at offset in little endian encoding.
void setNameLength(const std::vector< uint32_t > &name_length)
Sets the length of the field name.
void setVersionCVersion(const std::string &version_c_version)
Sets the version indicator for the scanner.
std::vector< std::string > readFieldName(std::vector< uint8_t >::const_iterator data_ptr, uint32_t array_length) const
void setVersionMinorVersionNumber(const uint8_t &version_minor_version_number)
Sets the minor version number for the scanner.
void setIsDefined(const std::vector< bool > &is_defined)
Sets if the fields are defined.
bool parseTCPSequence(const datastructure::PacketBuffer &buffer, datastructure::FieldSets &field_sets) const
Parses a tcp sequence to read the field sets of the sensor.
uint8_t readUint8(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset.
std::vector< bool > readIsDefined(std::vector< uint8_t >::const_iterator data_ptr, uint32_t array_length) const
uint8_t readMajorNumber(std::vector< uint8_t >::const_iterator data_ptr) const
void setVersionMajorVersionNumber(const uint8_t &version_major_version_number)
Sets the major version number for the scanner.
uint32_t readArrayLength(std::vector< uint8_t >::const_iterator data_ptr) const
ParseFieldSetsData()
Constructor of the parser.