Apollo 11.0
自动驾驶开放平台
shift_aux_rpt_328.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 Shiftauxrpt328::ID = 0x328;
32
33void Shiftauxrpt328::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_shift_aux_rpt_328()->set_speed_interlock_active_is_valid(
36 speed_interlock_active_is_valid(bytes, length));
37 chassis->mutable_shift_aux_rpt_328()->set_speed_interlock_active(
38 speed_interlock_active(bytes, length));
39 chassis->mutable_shift_aux_rpt_328()->set_brake_interlock_active_is_valid(
40 brake_interlock_active_is_valid(bytes, length));
41 chassis->mutable_shift_aux_rpt_328()->set_brake_interlock_active(
42 brake_interlock_active(bytes, length));
43 chassis->mutable_shift_aux_rpt_328()->set_stay_in_neutral_mode_is_valid(
44 stay_in_neutral_mode_is_valid(bytes, length));
45 chassis->mutable_shift_aux_rpt_328()->set_stay_in_neutral_mode(
46 stay_in_neutral_mode(bytes, length));
47 chassis->mutable_shift_aux_rpt_328()->set_between_gears_is_valid(
48 between_gears_is_valid(bytes, length));
49 chassis->mutable_shift_aux_rpt_328()->set_between_gears(
50 between_gears(bytes, length));
51}
52
53// config detail: {'name': 'speed_interlock_active_is_valid', 'offset': 0.0,
54// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
55// '[0|1]', 'bit': 11, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
56bool Shiftauxrpt328::speed_interlock_active_is_valid(const std::uint8_t* bytes,
57 int32_t length) const {
58 Byte t0(bytes + 1);
59 int32_t x = t0.get_byte(3, 1);
60
61 bool ret = x;
62 return ret;
63}
64
65// config detail: {'name': 'speed_interlock_active', 'offset': 0.0,
66// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
67// '[0|1]', 'bit': 3, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
68bool Shiftauxrpt328::speed_interlock_active(const std::uint8_t* bytes,
69 int32_t length) const {
70 Byte t0(bytes + 0);
71 int32_t x = t0.get_byte(3, 1);
72
73 bool ret = x;
74 return ret;
75}
76
77// config detail: {'name': 'brake_interlock_active_is_valid', 'offset': 0.0,
78// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
79// '[0|1]', 'bit': 10, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
80bool Shiftauxrpt328::brake_interlock_active_is_valid(const std::uint8_t* bytes,
81 int32_t length) const {
82 Byte t0(bytes + 1);
83 int32_t x = t0.get_byte(2, 1);
84
85 bool ret = x;
86 return ret;
87}
88
89// config detail: {'name': 'brake_interlock_active', 'offset': 0.0,
90// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
91// '[0|1]', 'bit': 2, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
92bool Shiftauxrpt328::brake_interlock_active(const std::uint8_t* bytes,
93 int32_t length) const {
94 Byte t0(bytes + 0);
95 int32_t x = t0.get_byte(2, 1);
96
97 bool ret = x;
98 return ret;
99}
100
101// config detail: {'name': 'stay_in_neutral_mode_is_valid', 'offset': 0.0,
102// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
103// '[0|1]', 'bit': 9, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
104bool Shiftauxrpt328::stay_in_neutral_mode_is_valid(const std::uint8_t* bytes,
105 int32_t length) const {
106 Byte t0(bytes + 1);
107 int32_t x = t0.get_byte(1, 1);
108
109 bool ret = x;
110 return ret;
111}
112
113// config detail: {'name': 'stay_in_neutral_mode', 'offset': 0.0,
114// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
115// '[0|1]', 'bit': 1, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
116bool Shiftauxrpt328::stay_in_neutral_mode(const std::uint8_t* bytes,
117 int32_t length) const {
118 Byte t0(bytes + 0);
119 int32_t x = t0.get_byte(1, 1);
120
121 bool ret = x;
122 return ret;
123}
124
125// config detail: {'name': 'between_gears_is_valid', 'offset': 0.0,
126// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
127// '[0|1]', 'bit': 8, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
128bool Shiftauxrpt328::between_gears_is_valid(const std::uint8_t* bytes,
129 int32_t length) const {
130 Byte t0(bytes + 1);
131 int32_t x = t0.get_byte(0, 1);
132
133 bool ret = x;
134 return ret;
135}
136
137// config detail: {'name': 'between_gears', 'offset': 0.0, 'precision': 1.0,
138// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0,
139// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
140bool Shiftauxrpt328::between_gears(const std::uint8_t* bytes,
141 int32_t length) const {
142 Byte t0(bytes + 0);
143 int32_t x = t0.get_byte(0, 1);
144
145 bool ret = x;
146 return ret;
147}
148} // namespace lexus
149} // namespace canbus
150} // 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