ParseDeviceStatus.cpp
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 
24 // -- END LICENSE BLOCK ------------------------------------------------
25 
26 //----------------------------------------------------------------------
33 //----------------------------------------------------------------------
34 
36 
38 
39 namespace sick {
40 namespace data_processing {
41 
43 
44 
46  sick::datastructure::DeviceStatus& device_status) const
47 {
48  // Keep our own copy of the shared_ptr to keep the iterators valid
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();
51  device_status.setDeviceStatus(readDeviceStatus(data_ptr));
52  return true;
53 }
54 
55 uint8_t ParseDeviceStatusData::readDeviceStatus(std::vector<uint8_t>::const_iterator data_ptr) const
56 {
57  return read_write_helper::readUint8(data_ptr + 0);
58 }
59 
60 } // namespace data_processing
61 } // namespace sick
uint8_t readDeviceStatus(std::vector< uint8_t >::const_iterator data_ptr) const
A packetbuffer for the raw data from the sensor.
Definition: PacketBuffer.h:61
std::shared_ptr< std::vector< uint8_t > const > getBuffer() const
Getter to return a copy of the data saved in the PacketBuffer.
void setDeviceStatus(const uint8_t &device_status)
Sets the device status for the scanner.
Class containing the device status of a laser scanner.
Definition: DeviceStatus.h:47
uint8_t readUint8(std::vector< uint8_t >::const_iterator it)
Read an unsigned 8-bit integer at offset.
bool parseTCPSequence(const datastructure::PacketBuffer &buffer, datastructure::DeviceStatus &device_status) const
Parses a tcp sequence to read the device status of the sensor.
ParseDeviceStatusData()
Constructor of the parser.


sick_safetyscanners
Author(s): Lennart Puck
autogenerated on Fri Apr 2 2021 02:45:41