measurement_report_config.h
Go to the documentation of this file.
1 
26 #ifndef OMRON_OS32C_DRIVER_MEASUREMENT_REPORT_CONFIG_H
27 #define OMRON_OS32C_DRIVER_MEASUREMENT_REPORT_CONFIG_H
28 
29 #include <string>
30 
35 
36 using std::string;
40 
41 namespace omron_os32c_driver {
42 
48 {
49 public:
55 
56  MeasurementReportConfig() : sequence_num(1), trigger(3), range_report_format(1), reflectivity_report_format(2)
57  {
58  memset(beam_selection_mask, 0, sizeof(beam_selection_mask));
59  }
60 
64  virtual size_t getLength() const
65  {
66  return 110;
67  }
68 
75  virtual Writer& serialize(Writer& writer) const
76  {
77  EIP_UINT reserved = 0;
78  writer.write(sequence_num);
79  writer.write(trigger);
80  writer.write(range_report_format);
81  writer.write(reflectivity_report_format);
82  writer.write(reserved);
83  writer.write(reserved);
84  writer.write(reserved);
85  writer.write(reserved);
86  writer.write(reserved);
87  writer.write(reserved);
88  writer.writeBytes(beam_selection_mask, sizeof(beam_selection_mask));
89  return writer;
90  }
91 
95  virtual Reader& deserialize(Reader& reader, size_t length)
96  {
97  return deserialize(reader);
98  }
99 
106  virtual Reader& deserialize(Reader& reader)
107  {
108  reader.read(sequence_num);
109  reader.read(trigger);
110  reader.read(range_report_format);
111  reader.read(reflectivity_report_format);
112  reader.skip(12);
113  reader.readBytes(beam_selection_mask, sizeof(beam_selection_mask));
114  return reader;
115  }
116 };
117 
118 } // namespace omron_os32c_driver
119 
120 #endif // OMRON_OS32C_DRIVER_MEASUREMENT_REPORT_CONFIG_H
void write(const T &v)
virtual Reader & deserialize(Reader &reader, size_t length)
virtual Writer & serialize(Writer &writer) const
virtual void skip(size_t n)=0
uint8_t EIP_BYTE
uint16_t EIP_UINT
uint32_t EIP_UDINT
virtual void writeBytes(const void *p, size_t n)=0
virtual void readBytes(void *buf, size_t n)=0


omron_os32c_driver
Author(s): Kareem Shehata
autogenerated on Fri Nov 27 2020 03:06:12