00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 00003 // -- BEGIN LICENSE BLOCK ---------------------------------------------- 00004 00024 // -- END LICENSE BLOCK ------------------------------------------------ 00025 00026 //---------------------------------------------------------------------- 00033 //---------------------------------------------------------------------- 00034 00035 #include <sick_safetyscanners/data_processing/ParseMeasurementCurrentConfigData.h> 00036 00037 #include <sick_safetyscanners/cola2/Command.h> 00038 00039 namespace sick { 00040 namespace data_processing { 00041 00042 ParseMeasurementCurrentConfigData::ParseMeasurementCurrentConfigData() 00043 { 00044 m_reader_ptr = std::make_shared<sick::data_processing::ReadWriteHelper>(); 00045 } 00046 00047 00048 bool ParseMeasurementCurrentConfigData::parseTCPSequence( 00049 const datastructure::PacketBuffer& buffer, datastructure::ConfigData& config_data) const 00050 { 00051 const uint8_t* data_ptr(buffer.getBuffer().data()); 00052 config_data.setStartAngle(readStartAngle(data_ptr)); 00053 config_data.setAngularBeamResolution(readAngularBeamResolution(data_ptr)); 00054 return true; 00055 } 00056 00057 uint32_t ParseMeasurementCurrentConfigData::readStartAngle(const uint8_t* data_ptr) const 00058 { 00059 return m_reader_ptr->readuint32_tLittleEndian(data_ptr, 36); 00060 } 00061 00062 uint32_t ParseMeasurementCurrentConfigData::readAngularBeamResolution(const uint8_t* data_ptr) const 00063 { 00064 return m_reader_ptr->readuint32_tLittleEndian(data_ptr, 40); 00065 } 00066 00067 } // namespace data_processing 00068 } // namespace sick