Apollo 10.0
自动驾驶开放平台
llc_auxiliaryfeedback_120.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 transit {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Llcauxiliaryfeedback120::ID = 0x120;
32
33void Llcauxiliaryfeedback120::Parse(const std::uint8_t* bytes, int32_t length,
34 Transit* chassis) const {
35 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_inverter(
36 llc_fbk_inverter(bytes, length));
37 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch8(
38 llc_fbk_pdu_ch8(bytes, length));
39 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch7(
40 llc_fbk_pdu_ch7(bytes, length));
41 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch6(
42 llc_fbk_pdu_ch6(bytes, length));
43 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch5(
44 llc_fbk_pdu_ch5(bytes, length));
45 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch4(
46 llc_fbk_pdu_ch4(bytes, length));
47 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch3(
48 llc_fbk_pdu_ch3(bytes, length));
49 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch2(
50 llc_fbk_pdu_ch2(bytes, length));
51 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_pdu_ch1(
52 llc_fbk_pdu_ch1(bytes, length));
53 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_hazardlights(
54 llc_fbk_hazardlights(bytes, length));
55 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_ledgreenon(
56 llc_fbk_ledgreenon(bytes, length));
57 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_horn(
58 llc_fbk_horn(bytes, length));
59 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_buzzeron(
60 llc_fbk_buzzeron(bytes, length));
61 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_turnsignal(
62 llc_fbk_turnsignal(bytes, length));
63 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_lowbeam(
64 llc_fbk_lowbeam(bytes, length));
65 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_highbeam(
66 llc_fbk_highbeam(bytes, length));
67 chassis->mutable_llc_auxiliaryfeedback_120()->set_llc_fbk_ledredon(
68 llc_fbk_ledredon(bytes, length));
69 chassis->mutable_llc_auxiliaryfeedback_120()
70 ->set_llc_fbk_autonomybuttonpressed(
71 llc_fbk_autonomybuttonpressed(bytes, length));
72}
73
74// config detail: {'description': 'Inverter enabled', 'offset': 0.0,
75// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_inverter', 'is_signed_var':
76// False, 'physical_range': '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'intel',
77// 'physical_unit': 'T/F'}
78bool Llcauxiliaryfeedback120::llc_fbk_inverter(const std::uint8_t* bytes,
79 int32_t length) const {
80 Byte t0(bytes + 0);
81 int32_t x = t0.get_byte(2, 1);
82
83 bool ret = x;
84 return ret;
85}
86
87// config detail: {'description': 'PDU Channel 8 enabled', 'offset': 0.0,
88// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch8', 'is_signed_var':
89// False, 'physical_range': '[0|1]', 'bit': 15, 'type': 'bool', 'order':
90// 'intel', 'physical_unit': 'T/F'}
91bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch8(const std::uint8_t* bytes,
92 int32_t length) const {
93 Byte t0(bytes + 1);
94 int32_t x = t0.get_byte(7, 1);
95
96 bool ret = x;
97 return ret;
98}
99
100// config detail: {'description': 'PDU Channel 7 enabled', 'offset': 0.0,
101// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch7', 'is_signed_var':
102// False, 'physical_range': '[0|1]', 'bit': 14, 'type': 'bool', 'order':
103// 'intel', 'physical_unit': 'T/F'}
104bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch7(const std::uint8_t* bytes,
105 int32_t length) const {
106 Byte t0(bytes + 1);
107 int32_t x = t0.get_byte(6, 1);
108
109 bool ret = x;
110 return ret;
111}
112
113// config detail: {'description': 'PDU Channel 6 enabled', 'offset': 0.0,
114// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch6', 'is_signed_var':
115// False, 'physical_range': '[0|1]', 'bit': 13, 'type': 'bool', 'order':
116// 'intel', 'physical_unit': 'T/F'}
117bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch6(const std::uint8_t* bytes,
118 int32_t length) const {
119 Byte t0(bytes + 1);
120 int32_t x = t0.get_byte(5, 1);
121
122 bool ret = x;
123 return ret;
124}
125
126// config detail: {'description': 'PDU Channel 5 enabled', 'offset': 0.0,
127// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch5', 'is_signed_var':
128// False, 'physical_range': '[0|1]', 'bit': 12, 'type': 'bool', 'order':
129// 'intel', 'physical_unit': 'T/F'}
130bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch5(const std::uint8_t* bytes,
131 int32_t length) const {
132 Byte t0(bytes + 1);
133 int32_t x = t0.get_byte(4, 1);
134
135 bool ret = x;
136 return ret;
137}
138
139// config detail: {'description': 'PDU Channel 4 enabled', 'offset': 0.0,
140// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch4', 'is_signed_var':
141// False, 'physical_range': '[0|1]', 'bit': 11, 'type': 'bool', 'order':
142// 'intel', 'physical_unit': 'T/F'}
143bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch4(const std::uint8_t* bytes,
144 int32_t length) const {
145 Byte t0(bytes + 1);
146 int32_t x = t0.get_byte(3, 1);
147
148 bool ret = x;
149 return ret;
150}
151
152// config detail: {'description': 'PDU Channel 3 enabled', 'offset': 0.0,
153// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch3', 'is_signed_var':
154// False, 'physical_range': '[0|1]', 'bit': 10, 'type': 'bool', 'order':
155// 'intel', 'physical_unit': 'T/F'}
156bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch3(const std::uint8_t* bytes,
157 int32_t length) const {
158 Byte t0(bytes + 1);
159 int32_t x = t0.get_byte(2, 1);
160
161 bool ret = x;
162 return ret;
163}
164
165// config detail: {'description': 'PDU Channel 2 enabled', 'offset': 0.0,
166// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch2', 'is_signed_var':
167// False, 'physical_range': '[0|1]', 'bit': 9, 'type': 'bool', 'order': 'intel',
168// 'physical_unit': 'T/F'}
169bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch2(const std::uint8_t* bytes,
170 int32_t length) const {
171 Byte t0(bytes + 1);
172 int32_t x = t0.get_byte(1, 1);
173
174 bool ret = x;
175 return ret;
176}
177
178// config detail: {'description': 'PDU Channel 1 enabled', 'offset': 0.0,
179// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_pdu_ch1', 'is_signed_var':
180// False, 'physical_range': '[0|1]', 'bit': 8, 'type': 'bool', 'order': 'intel',
181// 'physical_unit': 'T/F'}
182bool Llcauxiliaryfeedback120::llc_fbk_pdu_ch1(const std::uint8_t* bytes,
183 int32_t length) const {
184 Byte t0(bytes + 1);
185 int32_t x = t0.get_byte(0, 1);
186
187 bool ret = x;
188 return ret;
189}
190
191// config detail: {'description': 'Hazard lights enabled', 'offset': 0.0,
192// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_hazardlights', 'is_signed_var':
193// False, 'physical_range': '[0|1]', 'bit': 28, 'type': 'bool', 'order':
194// 'intel', 'physical_unit': 'T/F'}
195bool Llcauxiliaryfeedback120::llc_fbk_hazardlights(const std::uint8_t* bytes,
196 int32_t length) const {
197 Byte t0(bytes + 3);
198 int32_t x = t0.get_byte(4, 1);
199
200 bool ret = x;
201 return ret;
202}
203
204// config detail: {'description': 'Autonomy indicator green LED on', 'offset':
205// 0.0, 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_ledgreenon',
206// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 17, 'type': 'bool',
207// 'order': 'intel', 'physical_unit': 'T/F'}
208bool Llcauxiliaryfeedback120::llc_fbk_ledgreenon(const std::uint8_t* bytes,
209 int32_t length) const {
210 Byte t0(bytes + 2);
211 int32_t x = t0.get_byte(1, 1);
212
213 bool ret = x;
214 return ret;
215}
216
217// config detail: {'description': 'Horn enabled', 'offset': 0.0,
218// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_horn', 'is_signed_var': False,
219// 'physical_range': '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'intel',
220// 'physical_unit': 'T/F'}
221bool Llcauxiliaryfeedback120::llc_fbk_horn(const std::uint8_t* bytes,
222 int32_t length) const {
223 Byte t0(bytes + 0);
224 int32_t x = t0.get_byte(3, 1);
225
226 bool ret = x;
227 return ret;
228}
229
230// config detail: {'description': 'Buzzer enabled', 'offset': 0.0,
231// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_buzzeron', 'is_signed_var':
232// False, 'physical_range': '[0|1]', 'bit': 19, 'type': 'bool', 'order':
233// 'intel', 'physical_unit': 'T/F'}
234bool Llcauxiliaryfeedback120::llc_fbk_buzzeron(const std::uint8_t* bytes,
235 int32_t length) const {
236 Byte t0(bytes + 2);
237 int32_t x = t0.get_byte(3, 1);
238
239 bool ret = x;
240 return ret;
241}
242
243// config detail: {'description': 'Current turn signal status', 'enum': {0:
244// 'LLC_FBK_TURNSIGNAL_NONE', 1: 'LLC_FBK_TURNSIGNAL_LEFT', 2:
245// 'LLC_FBK_TURNSIGNAL_RIGHT', 3: 'LLC_FBK_TURNSIGNAL_RESERVE'},
246// 'precision': 1.0, 'len': 2, 'name': 'llc_fbk_turnsignal', 'is_signed_var':
247// False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit': 24, 'type': 'enum',
248// 'order': 'intel', 'physical_unit': ''}
250Llcauxiliaryfeedback120::llc_fbk_turnsignal(const std::uint8_t* bytes,
251 int32_t length) const {
252 Byte t0(bytes + 3);
253 int32_t x = t0.get_byte(0, 2);
254
257 return ret;
258}
259
260// config detail: {'description': 'Low beam enabled', 'offset': 0.0,
261// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_lowbeam', 'is_signed_var':
262// False, 'physical_range': '[0|1]', 'bit': 26, 'type': 'bool', 'order':
263// 'intel', 'physical_unit': 'T/F'}
264bool Llcauxiliaryfeedback120::llc_fbk_lowbeam(const std::uint8_t* bytes,
265 int32_t length) const {
266 Byte t0(bytes + 3);
267 int32_t x = t0.get_byte(2, 1);
268
269 bool ret = x;
270 return ret;
271}
272
273// config detail: {'description': 'High beam enabled', 'offset': 0.0,
274// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_highbeam', 'is_signed_var':
275// False, 'physical_range': '[0|1]', 'bit': 27, 'type': 'bool', 'order':
276// 'intel', 'physical_unit': 'T/F'}
277bool Llcauxiliaryfeedback120::llc_fbk_highbeam(const std::uint8_t* bytes,
278 int32_t length) const {
279 Byte t0(bytes + 3);
280 int32_t x = t0.get_byte(3, 1);
281
282 bool ret = x;
283 return ret;
284}
285
286// config detail: {'description': 'Autonomy indicator red LED on', 'offset':
287// 0.0, 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_ledredon', 'is_signed_var':
288// False, 'physical_range': '[0|1]', 'bit': 18, 'type': 'bool', 'order':
289// 'intel', 'physical_unit': 'T/F'}
290bool Llcauxiliaryfeedback120::llc_fbk_ledredon(const std::uint8_t* bytes,
291 int32_t length) const {
292 Byte t0(bytes + 2);
293 int32_t x = t0.get_byte(2, 1);
294
295 bool ret = x;
296 return ret;
297}
298
299// config detail: {'description': 'Autonomy button is pressed', 'offset': 0.0,
300// 'precision': 1.0, 'len': 1, 'name': 'llc_fbk_autonomybuttonpressed',
301// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 16, 'type': 'bool',
302// 'order': 'intel', 'physical_unit': 'T/F'}
303bool Llcauxiliaryfeedback120::llc_fbk_autonomybuttonpressed(
304 const std::uint8_t* bytes, int32_t length) const {
305 Byte t0(bytes + 2);
306 int32_t x = t0.get_byte(0, 1);
307
308 bool ret = x;
309 return ret;
310}
311} // namespace transit
312} // namespace canbus
313} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Transit *chassis) const override
class register implement
Definition arena_queue.h:37