Apollo 10.0
自动驾驶开放平台
wiper_rpt_234.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
18
19#include "glog/logging.h"
20
23
24namespace apollo {
25namespace canbus {
26namespace lexus {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Wiperrpt234::ID = 0x234;
32
33void Wiperrpt234::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_wiper_rpt_234()->set_vehicle_fault(
36 vehicle_fault(bytes, length));
37 chassis->mutable_wiper_rpt_234()->set_pacmod_fault(
38 pacmod_fault(bytes, length));
39 chassis->mutable_wiper_rpt_234()->set_override_active(
40 override_active(bytes, length));
41 chassis->mutable_wiper_rpt_234()->set_output_reported_fault(
42 output_reported_fault(bytes, length));
43 chassis->mutable_wiper_rpt_234()->set_input_output_fault(
44 input_output_fault(bytes, length));
45 chassis->mutable_wiper_rpt_234()->set_enabled(
46 enabled(bytes, length));
47 chassis->mutable_wiper_rpt_234()->set_command_output_fault(
48 command_output_fault(bytes, length));
49 chassis->mutable_wiper_rpt_234()->set_output_value(
50 output_value(bytes, length));
51 chassis->mutable_wiper_rpt_234()->set_commanded_value(
52 commanded_value(bytes, length));
53 chassis->mutable_wiper_rpt_234()->set_manual_input(
54 manual_input(bytes, length));
55}
56
57// config detail: {'name': 'vehicle_fault', 'offset': 0.0, 'precision': 1.0,
58// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 6,
59// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
60bool Wiperrpt234::vehicle_fault(const std::uint8_t* bytes,
61 int32_t length) const {
62 Byte t0(bytes + 0);
63 int32_t x = t0.get_byte(6, 1);
64
65 bool ret = x;
66 return ret;
67}
68
69// config detail: {'name': 'pacmod_fault', 'offset': 0.0, 'precision': 1.0,
70// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 5,
71// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
72bool Wiperrpt234::pacmod_fault(const std::uint8_t* bytes,
73 int32_t length) const {
74 Byte t0(bytes + 0);
75 int32_t x = t0.get_byte(5, 1);
76
77 bool ret = x;
78 return ret;
79}
80
81// config detail: {'name': 'override_active', 'offset': 0.0, 'precision': 1.0,
82// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
83// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
84bool Wiperrpt234::override_active(const std::uint8_t* bytes,
85 int32_t length) const {
86 Byte t0(bytes + 0);
87 int32_t x = t0.get_byte(1, 1);
88
89 bool ret = x;
90 return ret;
91}
92
93// config detail: {'name': 'output_reported_fault', 'offset': 0.0,
94// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
95// '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
96bool Wiperrpt234::output_reported_fault(const std::uint8_t* bytes,
97 int32_t length) const {
98 Byte t0(bytes + 0);
99 int32_t x = t0.get_byte(4, 1);
100
101 bool ret = x;
102 return ret;
103}
104
105// config detail: {'name': 'input_output_fault', 'offset': 0.0,
106// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
107// '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
108bool Wiperrpt234::input_output_fault(const std::uint8_t* bytes,
109 int32_t length) const {
110 Byte t0(bytes + 0);
111 int32_t x = t0.get_byte(3, 1);
112
113 bool ret = x;
114 return ret;
115}
116
117// config detail: {'name': 'enabled', 'offset': 0.0, 'precision': 1.0, 'len': 1,
118// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type': 'bool',
119// 'order': 'motorola', 'physical_unit': ''}
120bool Wiperrpt234::enabled(const std::uint8_t* bytes, int32_t length) const {
121 Byte t0(bytes + 0);
122 int32_t x = t0.get_byte(0, 1);
123
124 bool ret = x;
125 return ret;
126}
127
128// config detail: {'name': 'command_output_fault', 'offset': 0.0,
129// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
130// '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
131bool Wiperrpt234::command_output_fault(const std::uint8_t* bytes,
132 int32_t length) const {
133 Byte t0(bytes + 0);
134 int32_t x = t0.get_byte(2, 1);
135
136 bool ret = x;
137 return ret;
138}
139
140// config detail: {'name': 'output_value', 'enum': {0:
141// 'OUTPUT_VALUE_WIPERS_OFF', 1: 'OUTPUT_VALUE_INTERMITTENT_1', 2:
142// 'OUTPUT_VALUE_INTERMITTENT_2', 3: 'OUTPUT_VALUE_INTERMITTENT_3', 4:
143// 'OUTPUT_VALUE_INTERMITTENT_4', 5: 'OUTPUT_VALUE_INTERMITTENT_5', 6:
144// 'OUTPUT_VALUE_LOW', 7: 'OUTPUT_VALUE_HIGH'}, 'precision': 1.0, 'len': 8,
145// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|7]', 'bit': 31,
146// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
147Wiper_rpt_234::Output_valueType Wiperrpt234::output_value(
148 const std::uint8_t* bytes, int32_t length) const {
149 Byte t0(bytes + 3);
150 int32_t x = t0.get_byte(0, 8);
151
153 static_cast<Wiper_rpt_234::Output_valueType>(x);
154 return ret;
155}
156
157// config detail: {'name': 'commanded_value', 'enum': {0:
158// 'COMMANDED_VALUE_WIPERS_OFF', 1: 'COMMANDED_VALUE_INTERMITTENT_1', 2:
159// 'COMMANDED_VALUE_INTERMITTENT_2', 3: 'COMMANDED_VALUE_INTERMITTENT_3', 4:
160// 'COMMANDED_VALUE_INTERMITTENT_4', 5: 'COMMANDED_VALUE_INTERMITTENT_5', 6:
161// 'COMMANDED_VALUE_LOW', 7: 'COMMANDED_VALUE_HIGH'}, 'precision': 1.0, 'len':
162// 8, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|7]', 'bit':
163// 23, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
164Wiper_rpt_234::Commanded_valueType Wiperrpt234::commanded_value(
165 const std::uint8_t* bytes, int32_t length) const {
166 Byte t0(bytes + 2);
167 int32_t x = t0.get_byte(0, 8);
168
171 return ret;
172}
173
174// config detail: {'name': 'manual_input', 'enum': {0:
175// 'MANUAL_INPUT_WIPERS_OFF', 1: 'MANUAL_INPUT_INTERMITTENT_1', 2:
176// 'MANUAL_INPUT_INTERMITTENT_2', 3: 'MANUAL_INPUT_INTERMITTENT_3', 4:
177// 'MANUAL_INPUT_INTERMITTENT_4', 5: 'MANUAL_INPUT_INTERMITTENT_5', 6:
178// 'MANUAL_INPUT_LOW', 7: 'MANUAL_INPUT_HIGH'}, 'precision': 1.0, 'len': 8,
179// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|7]', 'bit': 15,
180// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
181Wiper_rpt_234::Manual_inputType Wiperrpt234::manual_input(
182 const std::uint8_t* bytes, int32_t length) const {
183 Byte t0(bytes + 1);
184 int32_t x = t0.get_byte(0, 8);
185
187 static_cast<Wiper_rpt_234::Manual_inputType>(x);
188 return ret;
189}
190} // namespace lexus
191} // namespace canbus
192} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Lexus *chassis) const override
class register implement
Definition arena_queue.h:37