Apollo 10.0
自动驾驶开放平台
hazard_lights_rpt_214.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 Hazardlightsrpt214::ID = 0x214;
32
33void Hazardlightsrpt214::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_hazard_lights_rpt_214()->set_output_value(
36 output_value(bytes, length));
37 chassis->mutable_hazard_lights_rpt_214()->set_commanded_value(
38 commanded_value(bytes, length));
39 chassis->mutable_hazard_lights_rpt_214()->set_manual_input(
40 manual_input(bytes, length));
41 chassis->mutable_hazard_lights_rpt_214()->set_vehicle_fault(
42 vehicle_fault(bytes, length));
43 chassis->mutable_hazard_lights_rpt_214()->set_pacmod_fault(
44 pacmod_fault(bytes, length));
45 chassis->mutable_hazard_lights_rpt_214()->set_override_active(
46 override_active(bytes, length));
47 chassis->mutable_hazard_lights_rpt_214()->set_output_reported_fault(
48 output_reported_fault(bytes, length));
49 chassis->mutable_hazard_lights_rpt_214()->set_input_output_fault(
50 input_output_fault(bytes, length));
51 chassis->mutable_hazard_lights_rpt_214()->set_enabled(
52 enabled(bytes, length));
53 chassis->mutable_hazard_lights_rpt_214()->set_command_output_fault(
54 command_output_fault(bytes, length));
55}
56
57// config detail: {'name': 'output_value', 'offset': 0.0, 'precision': 1.0,
58// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 24,
59// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
60bool Hazardlightsrpt214::output_value(const std::uint8_t* bytes,
61 int32_t length) const {
62 Byte t0(bytes + 3);
63 int32_t x = t0.get_byte(0, 1);
64
65 bool ret = x;
66 return ret;
67}
68
69// config detail: {'name': 'commanded_value', 'offset': 0.0, 'precision': 1.0,
70// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 16,
71// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
72bool Hazardlightsrpt214::commanded_value(const std::uint8_t* bytes,
73 int32_t length) const {
74 Byte t0(bytes + 2);
75 int32_t x = t0.get_byte(0, 1);
76
77 bool ret = x;
78 return ret;
79}
80
81// config detail: {'name': 'manual_input', 'offset': 0.0, 'precision': 1.0,
82// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 8,
83// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
84bool Hazardlightsrpt214::manual_input(const std::uint8_t* bytes,
85 int32_t length) const {
86 Byte t0(bytes + 1);
87 int32_t x = t0.get_byte(0, 1);
88
89 bool ret = x;
90 return ret;
91}
92
93// config detail: {'name': 'vehicle_fault', 'offset': 0.0, 'precision': 1.0,
94// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 6,
95// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
96bool Hazardlightsrpt214::vehicle_fault(const std::uint8_t* bytes,
97 int32_t length) const {
98 Byte t0(bytes + 0);
99 int32_t x = t0.get_byte(6, 1);
100
101 bool ret = x;
102 return ret;
103}
104
105// config detail: {'name': 'pacmod_fault', 'offset': 0.0, 'precision': 1.0,
106// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 5,
107// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
108bool Hazardlightsrpt214::pacmod_fault(const std::uint8_t* bytes,
109 int32_t length) const {
110 Byte t0(bytes + 0);
111 int32_t x = t0.get_byte(5, 1);
112
113 bool ret = x;
114 return ret;
115}
116
117// config detail: {'name': 'override_active', 'offset': 0.0, 'precision': 1.0,
118// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
119// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
120bool Hazardlightsrpt214::override_active(const std::uint8_t* bytes,
121 int32_t length) const {
122 Byte t0(bytes + 0);
123 int32_t x = t0.get_byte(1, 1);
124
125 bool ret = x;
126 return ret;
127}
128
129// config detail: {'name': 'output_reported_fault', 'offset': 0.0,
130// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
131// '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
132bool Hazardlightsrpt214::output_reported_fault(const std::uint8_t* bytes,
133 int32_t length) const {
134 Byte t0(bytes + 0);
135 int32_t x = t0.get_byte(4, 1);
136
137 bool ret = x;
138 return ret;
139}
140
141// config detail: {'name': 'input_output_fault', 'offset': 0.0,
142// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
143// '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
144bool Hazardlightsrpt214::input_output_fault(const std::uint8_t* bytes,
145 int32_t length) const {
146 Byte t0(bytes + 0);
147 int32_t x = t0.get_byte(3, 1);
148
149 bool ret = x;
150 return ret;
151}
152
153// config detail: {'name': 'enabled', 'offset': 0.0, 'precision': 1.0, 'len': 1,
154// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type': 'bool',
155// 'order': 'motorola', 'physical_unit': ''}
156bool Hazardlightsrpt214::enabled(const std::uint8_t* bytes,
157 int32_t length) const {
158 Byte t0(bytes + 0);
159 int32_t x = t0.get_byte(0, 1);
160
161 bool ret = x;
162 return ret;
163}
164
165// config detail: {'name': 'command_output_fault', 'offset': 0.0,
166// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
167// '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
168bool Hazardlightsrpt214::command_output_fault(const std::uint8_t* bytes,
169 int32_t length) const {
170 Byte t0(bytes + 0);
171 int32_t x = t0.get_byte(2, 1);
172
173 bool ret = x;
174 return ret;
175}
176} // namespace lexus
177} // namespace canbus
178} // 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