40 namespace data_processing {
50 const std::shared_ptr<std::vector<uint8_t>
const> vec_ptr = buffer.
getBuffer();
51 std::vector<uint8_t>::const_iterator data_ptr = vec_ptr->begin();
58 std::vector<uint16_t> indices;
59 std::vector<bool> fields_valid;
60 for (uint8_t i = 0; i < 8; i++)
75 if (byte ==
'R' || byte ==
'Y')
83 std::vector<uint8_t>::const_iterator data_ptr)
const 89 const uint8_t& index)
const 95 const uint8_t& index)
const 99 return static_cast<bool>(byte & (0x01 << 0));
bool parseTCPSequence(const datastructure::PacketBuffer &buffer, datastructure::MonitoringCaseData &monitoring_case_data) const
Parses a tcp sequence and return the monitoring case data.
bool isValid(std::vector< uint8_t >::const_iterator data_ptr) const
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.
uint16_t readMonitoringCaseNumber(std::vector< uint8_t >::const_iterator data_ptr) const
void setFieldsValid(const std::vector< bool > &fields_valid)
Sets if the fields are valid.
Stores the data for the different monitoring cases.
void setMonitoringCaseNumber(const uint16_t &monitoring_case_number)
Sets the monitoring case number.
ParseMonitoringCaseData()
Constructor of the parser.
bool readFieldValid(std::vector< uint8_t >::const_iterator data_ptr, const uint8_t &index) const
uint16_t readFieldIndex(std::vector< uint8_t >::const_iterator data_ptr, const uint8_t &index) const
uint8_t readUint8(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset.
uint16_t readUint16LittleEndian(std::vector< uint8_t >::const_iterator it)
Read an unsigned 16-bit integer at offset in little endian encoding.
void setIsValid(bool is_valid)
Sets if the monitoring case data is valid.
void setFieldIndices(const std::vector< uint16_t > &field_indices)
Sets the field indices.