Apollo 10.0
自动驾驶开放平台
media_controls_rpt_220.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 Mediacontrolsrpt220::ID = 0x220;
32
33void Mediacontrolsrpt220::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_media_controls_rpt_220()->set_output_value(
36 output_value(bytes, length));
37 chassis->mutable_media_controls_rpt_220()->set_commanded_value(
38 commanded_value(bytes, length));
39 chassis->mutable_media_controls_rpt_220()->set_manual_input(
40 manual_input(bytes, length));
41 chassis->mutable_media_controls_rpt_220()->set_vehicle_fault(
42 vehicle_fault(bytes, length));
43 chassis->mutable_media_controls_rpt_220()->set_pacmod_fault(
44 pacmod_fault(bytes, length));
45 chassis->mutable_media_controls_rpt_220()->set_override_active(
46 override_active(bytes, length));
47 chassis->mutable_media_controls_rpt_220()->set_output_reported_fault(
48 output_reported_fault(bytes, length));
49 chassis->mutable_media_controls_rpt_220()->set_input_output_fault(
50 input_output_fault(bytes, length));
51 chassis->mutable_media_controls_rpt_220()->set_enabled(
52 enabled(bytes, length));
53 chassis->mutable_media_controls_rpt_220()->set_command_output_fault(
54 command_output_fault(bytes, length));
55}
56
57// config detail: {'name': 'output_value', 'enum': {0:
58// 'OUTPUT_VALUE_MEDIA_CONTROL_NONE', 1:
59// 'OUTPUT_VALUE_MEDIA_CONTROL_VOICE_COMMAND', 2:
60// 'OUTPUT_VALUE_MEDIA_CONTROL_MUTE', 3:
61// 'OUTPUT_VALUE_MEDIA_CONTROL_PREV_TRACK_ANSWER', 4:
62// 'OUTPUT_VALUE_MEDIA_CONTROL_NEXT_TRACK_HANG_UP', 5:
63// 'OUTPUT_VALUE_MEDIA_CONTROL_VOL_UP', 6:
64// 'OUTPUT_VALUE_MEDIA_CONTROL_VOL_DOWN'}, 'precision': 1.0, 'len': 8,
65// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
66// 31, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
67Media_controls_rpt_220::Output_valueType Mediacontrolsrpt220::output_value(
68 const std::uint8_t* bytes, int32_t length) const {
69 Byte t0(bytes + 3);
70 int32_t x = t0.get_byte(0, 8);
71
74 return ret;
75}
76
77// config detail: {'name': 'commanded_value', 'enum': {0:
78// 'COMMANDED_VALUE_MEDIA_CONTROL_NONE', 1:
79// 'COMMANDED_VALUE_MEDIA_CONTROL_VOICE_COMMAND', 2:
80// 'COMMANDED_VALUE_MEDIA_CONTROL_MUTE', 3:
81// 'COMMANDED_VALUE_MEDIA_CONTROL_PREV_TRACK_ANSWER', 4:
82// 'COMMANDED_VALUE_MEDIA_CONTROL_NEXT_TRACK_HANG_UP', 5:
83// 'COMMANDED_VALUE_MEDIA_CONTROL_VOL_UP', 6:
84// 'COMMANDED_VALUE_MEDIA_CONTROL_VOL_DOWN'}, 'precision': 1.0, 'len': 8,
85// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
86// 23, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
88Mediacontrolsrpt220::commanded_value(const std::uint8_t* bytes,
89 int32_t length) const {
90 Byte t0(bytes + 2);
91 int32_t x = t0.get_byte(0, 8);
92
95 return ret;
96}
97
98// config detail: {'name': 'manual_input', 'enum': {0:
99// 'MANUAL_INPUT_MEDIA_CONTROL_NONE', 1:
100// 'MANUAL_INPUT_MEDIA_CONTROL_VOICE_COMMAND', 2:
101// 'MANUAL_INPUT_MEDIA_CONTROL_MUTE', 3:
102// 'MANUAL_INPUT_MEDIA_CONTROL_PREV_TRACK_ANSWER', 4:
103// 'MANUAL_INPUT_MEDIA_CONTROL_NEXT_TRACK_HANG_UP', 5:
104// 'MANUAL_INPUT_MEDIA_CONTROL_VOL_UP', 6:
105// 'MANUAL_INPUT_MEDIA_CONTROL_VOL_DOWN'}, 'precision': 1.0, 'len': 8,
106// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|255]', 'bit':
107// 15, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
108Media_controls_rpt_220::Manual_inputType Mediacontrolsrpt220::manual_input(
109 const std::uint8_t* bytes, int32_t length) const {
110 Byte t0(bytes + 1);
111 int32_t x = t0.get_byte(0, 8);
112
115 return ret;
116}
117
118// config detail: {'name': 'vehicle_fault', 'offset': 0.0, 'precision': 1.0,
119// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 6,
120// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
121bool Mediacontrolsrpt220::vehicle_fault(const std::uint8_t* bytes,
122 int32_t length) const {
123 Byte t0(bytes + 0);
124 int32_t x = t0.get_byte(6, 1);
125
126 bool ret = x;
127 return ret;
128}
129
130// config detail: {'name': 'pacmod_fault', 'offset': 0.0, 'precision': 1.0,
131// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 5,
132// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
133bool Mediacontrolsrpt220::pacmod_fault(const std::uint8_t* bytes,
134 int32_t length) const {
135 Byte t0(bytes + 0);
136 int32_t x = t0.get_byte(5, 1);
137
138 bool ret = x;
139 return ret;
140}
141
142// config detail: {'name': 'override_active', 'offset': 0.0, 'precision': 1.0,
143// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
144// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
145bool Mediacontrolsrpt220::override_active(const std::uint8_t* bytes,
146 int32_t length) const {
147 Byte t0(bytes + 0);
148 int32_t x = t0.get_byte(1, 1);
149
150 bool ret = x;
151 return ret;
152}
153
154// config detail: {'name': 'output_reported_fault', 'offset': 0.0,
155// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
156// '[0|1]', 'bit': 4, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
157bool Mediacontrolsrpt220::output_reported_fault(const std::uint8_t* bytes,
158 int32_t length) const {
159 Byte t0(bytes + 0);
160 int32_t x = t0.get_byte(4, 1);
161
162 bool ret = x;
163 return ret;
164}
165
166// config detail: {'name': 'input_output_fault', 'offset': 0.0,
167// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
168// '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
169bool Mediacontrolsrpt220::input_output_fault(const std::uint8_t* bytes,
170 int32_t length) const {
171 Byte t0(bytes + 0);
172 int32_t x = t0.get_byte(3, 1);
173
174 bool ret = x;
175 return ret;
176}
177
178// config detail: {'name': 'enabled', 'offset': 0.0, 'precision': 1.0, 'len': 1,
179// 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type': 'bool',
180// 'order': 'motorola', 'physical_unit': ''}
181bool Mediacontrolsrpt220::enabled(const std::uint8_t* bytes,
182 int32_t length) const {
183 Byte t0(bytes + 0);
184 int32_t x = t0.get_byte(0, 1);
185
186 bool ret = x;
187 return ret;
188}
189
190// config detail: {'name': 'command_output_fault', 'offset': 0.0,
191// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
192// '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
193bool Mediacontrolsrpt220::command_output_fault(const std::uint8_t* bytes,
194 int32_t length) const {
195 Byte t0(bytes + 0);
196 int32_t x = t0.get_byte(2, 1);
197
198 bool ret = x;
199 return ret;
200}
201} // namespace lexus
202} // namespace canbus
203} // 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