Apollo 10.0
自动驾驶开放平台
vcu_vehicle_fault_response_201.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2020 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 neolix_edu {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Vcuvehiclefaultresponse201::ID = 0x201;
32
33void Vcuvehiclefaultresponse201::Parse(const std::uint8_t* bytes,
34 int32_t length,
35 Neolix_edu* chassis) const {
36 chassis->mutable_vcu_vehicle_fault_response_201()
37 ->set_vehicle_error_indicationsvcu(
38 vehicle_error_indicationsvcu(bytes, length));
39 chassis->mutable_vcu_vehicle_fault_response_201()
40 ->set_brake_system_errorehb(
41 brake_system_errorehb(bytes, length));
42 chassis->mutable_vcu_vehicle_fault_response_201()
43 ->set_eps_error(eps_error(bytes, length));
44 chassis->mutable_vcu_vehicle_fault_response_201()
45 ->set_motor_error(motor_error(bytes, length));
46 chassis->mutable_vcu_vehicle_fault_response_201()
47 ->set_epb_error(epb_error(bytes, length));
48 chassis->mutable_vcu_vehicle_fault_response_201()
49 ->set_high_voltage_battery_errorbcu(
50 high_voltage_battery_errorbcu(bytes, length));
51 chassis->mutable_vcu_vehicle_fault_response_201()
52 ->set_automode_exit_reason_losscommuni(
53 automode_exit_reason_losscommuni(bytes, length));
54 chassis->mutable_vcu_vehicle_fault_response_201()
55 ->set_automode_exit_reason_reqsignalno(
56 automode_exit_reason_reqsignalno(bytes, length));
57 chassis->mutable_vcu_vehicle_fault_response_201()
58 ->set_automode_exit_reason_low_power(
59 automode_exit_reason_low_power(bytes, length));
60 chassis->mutable_vcu_vehicle_fault_response_201()
61 ->set_automode_exit_reason_highvolt(
62 automode_exit_reason_highvolt(bytes, length));
63 chassis->mutable_vcu_vehicle_fault_response_201()
64 ->set_automode_exit_reason_vehicle_flt(
65 automode_exit_reason_vehicle_flt(bytes, length));
66 chassis->mutable_vcu_vehicle_fault_response_201()
67 ->set_automode_exit_reason_press_emerg(
68 automode_exit_reason_press_emerg(bytes, length));
69 chassis->mutable_vcu_vehicle_fault_response_201()
70 ->set_automode_exit_reason_press_remot(
71 automode_exit_reason_press_remot(bytes, length));
72 chassis->mutable_vcu_vehicle_fault_response_201()
73 ->set_automode_exit_reason_pdu_control(
74 automode_exit_reason_pdu_control(bytes, length));
75 chassis->mutable_vcu_vehicle_fault_response_201()
76 ->set_vcu_faultrept_alivecounter(
77 vcu_faultrept_alivecounter(bytes, length));
78 chassis->mutable_vcu_vehicle_fault_response_201()
79 ->set_vcu_faultrept_checksum(
80 vcu_faultrept_checksum(bytes, length));
81}
82
83// config detail: {'description': '0x0: no error;0x1: level 1 error;0x2: level 2
84// error;0x3: level 3 error;0x4: level 4 error;0x5: level 5 error', 'offset':
85// 0.0, 'precision': 1.0, 'len': 4, 'name': 'vehicle_error_indicationsvcu',
86// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 3, 'type': 'int',
87// 'order': 'motorola', 'physical_unit': ''}
88int Vcuvehiclefaultresponse201::vehicle_error_indicationsvcu(
89 const std::uint8_t* bytes, int32_t length) const {
90 Byte t0(bytes + 0);
91 int32_t x = t0.get_byte(0, 4);
92
93 int ret = x;
94 return ret;
95}
96
97// config detail: {'description': '0x0: no error;0x1: level 1 error;0x2: level 2
98// error;0x3: level 3 error;0x4: level 4 error;0x5: level 5 error', 'offset':
99// 0.0, 'precision': 1.0, 'len': 4, 'name': 'brake_system_errorehb',
100// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 7, 'type': 'int',
101// 'order': 'motorola', 'physical_unit': ''}
102int Vcuvehiclefaultresponse201::brake_system_errorehb(const std::uint8_t* bytes,
103 int32_t length) const {
104 Byte t0(bytes + 0);
105 int32_t x = t0.get_byte(4, 4);
106
107 int ret = x;
108 return ret;
109}
110
111// config detail: {'description': '0x0: no error;0x1: level 1 error;0x2: level 2
112// error;0x3: level 3 error;0x4: level 4 error;0x5: level 5 error', 'offset':
113// 0.0, 'precision': 1.0, 'len': 4, 'name': 'eps_error', 'is_signed_var': False,
114// 'physical_range': '[0|0]', 'bit': 11, 'type': 'int', 'order': 'motorola',
115// 'physical_unit': ''}
116int Vcuvehiclefaultresponse201::eps_error(const std::uint8_t* bytes,
117 int32_t length) const {
118 Byte t0(bytes + 1);
119 int32_t x = t0.get_byte(0, 4);
120
121 int ret = x;
122 return ret;
123}
124
125// config detail: {'description': '0x0: no error;0x1: level 1 error;0x2: level 2
126// error;0x3: level 3 error;0x4: level 4 error;0x5: level 5 error', 'offset':
127// 0.0, 'precision': 1.0, 'len': 4, 'name': 'motor_error', 'is_signed_var':
128// False, 'physical_range': '[0|0]', 'bit': 15, 'type': 'int', 'order':
129// 'motorola', 'physical_unit': ''}
130int Vcuvehiclefaultresponse201::motor_error(const std::uint8_t* bytes,
131 int32_t length) const {
132 Byte t0(bytes + 1);
133 int32_t x = t0.get_byte(4, 4);
134
135 int ret = x;
136 return ret;
137}
138
139// config detail: {'description': '0x0: no error;0x1: level 1 error;0x2: level 2
140// error;0x3: level 3 error;0x4: level 4 error;0x5: level 5 error', 'offset':
141// 0.0, 'precision': 1.0, 'len': 4, 'name': 'epb_error', 'is_signed_var': False,
142// 'physical_range': '[0|0]', 'bit': 19, 'type': 'int', 'order': 'motorola',
143// 'physical_unit': ''}
144int Vcuvehiclefaultresponse201::epb_error(const std::uint8_t* bytes,
145 int32_t length) const {
146 Byte t0(bytes + 2);
147 int32_t x = t0.get_byte(0, 4);
148
149 int ret = x;
150 return ret;
151}
152
153// config detail: {'description': '0x0: no error;0x1: level 1 error;0x2: level 2
154// error;0x3: level 3 error;0x4: level 4 error;0x5: level 5 error', 'offset':
155// 0.0, 'precision': 1.0, 'len': 4, 'name': 'high_voltage_battery_errorbcu',
156// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 23, 'type': 'int',
157// 'order': 'motorola', 'physical_unit': ''}
158int Vcuvehiclefaultresponse201::high_voltage_battery_errorbcu(
159 const std::uint8_t* bytes, int32_t length) const {
160 Byte t0(bytes + 2);
161 int32_t x = t0.get_byte(4, 4);
162
163 int ret = x;
164 return ret;
165}
166
167// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
168// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_losscommuni',
169// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 32, 'type': 'bool',
170// 'order': 'motorola', 'physical_unit': ''}
171bool Vcuvehiclefaultresponse201::automode_exit_reason_losscommuni(
172 const std::uint8_t* bytes, int32_t length) const {
173 Byte t0(bytes + 4);
174 int32_t x = t0.get_byte(0, 1);
175
176 bool ret = x;
177 return ret;
178}
179
180// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
181// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_reqsignalno',
182// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 33, 'type': 'bool',
183// 'order': 'motorola', 'physical_unit': ''}
184bool Vcuvehiclefaultresponse201::automode_exit_reason_reqsignalno(
185 const std::uint8_t* bytes, int32_t length) const {
186 Byte t0(bytes + 4);
187 int32_t x = t0.get_byte(1, 1);
188
189 bool ret = x;
190 return ret;
191}
192
193// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
194// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_low_power',
195// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 34, 'type': 'bool',
196// 'order': 'motorola', 'physical_unit': ''}
197bool Vcuvehiclefaultresponse201::automode_exit_reason_low_power(
198 const std::uint8_t* bytes, int32_t length) const {
199 Byte t0(bytes + 4);
200 int32_t x = t0.get_byte(2, 1);
201
202 bool ret = x;
203 return ret;
204}
205
206// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
207// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_highvolt',
208// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 35, 'type': 'bool',
209// 'order': 'motorola', 'physical_unit': ''}
210bool Vcuvehiclefaultresponse201::automode_exit_reason_highvolt(
211 const std::uint8_t* bytes, int32_t length) const {
212 Byte t0(bytes + 4);
213 int32_t x = t0.get_byte(3, 1);
214
215 bool ret = x;
216 return ret;
217}
218
219// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
220// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_vehicle_flt',
221// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 36, 'type': 'bool',
222// 'order': 'motorola', 'physical_unit': ''}
223bool Vcuvehiclefaultresponse201::automode_exit_reason_vehicle_flt(
224 const std::uint8_t* bytes, int32_t length) const {
225 Byte t0(bytes + 4);
226 int32_t x = t0.get_byte(4, 1);
227
228 bool ret = x;
229 return ret;
230}
231
232// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
233// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_press_emerg',
234// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 37, 'type': 'bool',
235// 'order': 'motorola', 'physical_unit': ''}
236bool Vcuvehiclefaultresponse201::automode_exit_reason_press_emerg(
237 const std::uint8_t* bytes, int32_t length) const {
238 Byte t0(bytes + 4);
239 int32_t x = t0.get_byte(5, 1);
240
241 bool ret = x;
242 return ret;
243}
244
245// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
246// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_press_remot',
247// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 38, 'type': 'bool',
248// 'order': 'motorola', 'physical_unit': ''}
249bool Vcuvehiclefaultresponse201::automode_exit_reason_press_remot(
250 const std::uint8_t* bytes, int32_t length) const {
251 Byte t0(bytes + 4);
252 int32_t x = t0.get_byte(6, 1);
253
254 bool ret = x;
255 return ret;
256}
257
258// config detail: {'description': '0x0:Normal;0x1:Failure', 'offset': 0.0,
259// 'precision': 1.0, 'len': 1, 'name': 'automode_exit_reason_pdu_control',
260// 'is_signed_var': False, 'physical_range': '[0|0]', 'bit': 39, 'type': 'bool',
261// 'order': 'motorola', 'physical_unit': ''}
262bool Vcuvehiclefaultresponse201::automode_exit_reason_pdu_control(
263 const std::uint8_t* bytes, int32_t length) const {
264 Byte t0(bytes + 4);
265 int32_t x = t0.get_byte(7, 1);
266
267 bool ret = x;
268 return ret;
269}
270
271// config detail: {'name': 'vcu_faultrept_alivecounter', 'offset': 0.0,
272// 'precision': 1.0, 'len': 4, 'is_signed_var': False, 'physical_range':
273// '[0|0]', 'bit': 51, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
274int Vcuvehiclefaultresponse201::vcu_faultrept_alivecounter(
275 const std::uint8_t* bytes, int32_t length) const {
276 Byte t0(bytes + 6);
277 int32_t x = t0.get_byte(0, 4);
278
279 int ret = x;
280 return ret;
281}
282
283// config detail: {'name': 'vcu_faultrept_checksum', 'offset': 0.0,
284// 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'physical_range':
285// '[0|0]', 'bit': 63, 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
286int Vcuvehiclefaultresponse201::vcu_faultrept_checksum(
287 const std::uint8_t* bytes, int32_t length) const {
288 Byte t0(bytes + 7);
289 int32_t x = t0.get_byte(0, 8);
290
291 int ret = x;
292 return ret;
293}
294} // namespace neolix_edu
295} // namespace canbus
296} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Neolix_edu *chassis) const override
class register implement
Definition arena_queue.h:37