Apollo 10.0
自动驾驶开放平台
interior_lights_rpt_416.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 Interiorlightsrpt416::ID = 0x416;
32
33void Interiorlightsrpt416::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_interior_lights_rpt_416()->set_dim_level_is_valid(
36 dim_level_is_valid(bytes, length));
37 chassis->mutable_interior_lights_rpt_416()->set_mood_lights_on_is_valid(
38 mood_lights_on_is_valid(bytes, length));
39 chassis->mutable_interior_lights_rpt_416()->set_rear_dome_lights_on_is_valid(
40 rear_dome_lights_on_is_valid(bytes, length));
41 chassis->mutable_interior_lights_rpt_416()->set_front_dome_lights_on_is_valid(
42 front_dome_lights_on_is_valid(bytes, length));
43 chassis->mutable_interior_lights_rpt_416()->set_dim_level(
44 dim_level(bytes, length));
45 chassis->mutable_interior_lights_rpt_416()->set_mood_lights_on(
46 mood_lights_on(bytes, length));
47 chassis->mutable_interior_lights_rpt_416()->set_rear_dome_lights_on(
48 rear_dome_lights_on(bytes, length));
49 chassis->mutable_interior_lights_rpt_416()->set_front_dome_lights_on(
50 front_dome_lights_on(bytes, length));
51}
52
53// config detail: {'name': 'dim_level_is_valid', 'offset': 0.0,
54// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
55// '[0|1]', 'bit': 19, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
56bool Interiorlightsrpt416::dim_level_is_valid(const std::uint8_t* bytes,
57 int32_t length) const {
58 Byte t0(bytes + 2);
59 int32_t x = t0.get_byte(3, 1);
60
61 bool ret = x;
62 return ret;
63}
64
65// config detail: {'name': 'mood_lights_on_is_valid', 'offset': 0.0,
66// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
67// '[0|1]', 'bit': 18, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
68bool Interiorlightsrpt416::mood_lights_on_is_valid(const std::uint8_t* bytes,
69 int32_t length) const {
70 Byte t0(bytes + 2);
71 int32_t x = t0.get_byte(2, 1);
72
73 bool ret = x;
74 return ret;
75}
76
77// config detail: {'name': 'rear_dome_lights_on_is_valid', 'offset': 0.0,
78// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
79// '[0|1]', 'bit': 17, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
80bool Interiorlightsrpt416::rear_dome_lights_on_is_valid(
81 const std::uint8_t* bytes, int32_t length) const {
82 Byte t0(bytes + 2);
83 int32_t x = t0.get_byte(1, 1);
84
85 bool ret = x;
86 return ret;
87}
88
89// config detail: {'name': 'front_dome_lights_on_is_valid', 'offset': 0.0,
90// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
91// '[0|1]', 'bit': 16, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
92bool Interiorlightsrpt416::front_dome_lights_on_is_valid(
93 const std::uint8_t* bytes, int32_t length) const {
94 Byte t0(bytes + 2);
95 int32_t x = t0.get_byte(0, 1);
96
97 bool ret = x;
98 return ret;
99}
100
101// config detail: {'name': 'dim_level', 'enum': {0: 'DIM_LEVEL_DIM_LEVEL_MIN',
102// 1: 'DIM_LEVEL_DIM_LEVEL_1', 2: 'DIM_LEVEL_DIM_LEVEL_2', 3:
103// 'DIM_LEVEL_DIM_LEVEL_3', 4: 'DIM_LEVEL_DIM_LEVEL_4', 5:
104// 'DIM_LEVEL_DIM_LEVEL_5', 6: 'DIM_LEVEL_DIM_LEVEL_6', 7:
105// 'DIM_LEVEL_DIM_LEVEL_7', 8: 'DIM_LEVEL_DIM_LEVEL_8', 9:
106// 'DIM_LEVEL_DIM_LEVEL_9', 10: 'DIM_LEVEL_DIM_LEVEL_10', 11:
107// 'DIM_LEVEL_DIM_LEVEL_11', 12: 'DIM_LEVEL_DIM_LEVEL_MAX'}, 'precision': 1.0,
108// 'len': 8, 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|12]',
109// 'bit': 15, 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
110Interior_lights_rpt_416::Dim_levelType Interiorlightsrpt416::dim_level(
111 const std::uint8_t* bytes, int32_t length) const {
112 Byte t0(bytes + 1);
113 int32_t x = t0.get_byte(0, 8);
114
117 return ret;
118}
119
120// config detail: {'name': 'mood_lights_on', 'offset': 0.0, 'precision': 1.0,
121// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 2,
122// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
123bool Interiorlightsrpt416::mood_lights_on(const std::uint8_t* bytes,
124 int32_t length) const {
125 Byte t0(bytes + 0);
126 int32_t x = t0.get_byte(2, 1);
127
128 bool ret = x;
129 return ret;
130}
131
132// config detail: {'name': 'rear_dome_lights_on', 'offset': 0.0,
133// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
134// '[0|1]', 'bit': 1, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
135bool Interiorlightsrpt416::rear_dome_lights_on(const std::uint8_t* bytes,
136 int32_t length) const {
137 Byte t0(bytes + 0);
138 int32_t x = t0.get_byte(1, 1);
139
140 bool ret = x;
141 return ret;
142}
143
144// config detail: {'name': 'front_dome_lights_on', 'offset': 0.0,
145// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
146// '[0|1]', 'bit': 0, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
147bool Interiorlightsrpt416::front_dome_lights_on(const std::uint8_t* bytes,
148 int32_t length) const {
149 Byte t0(bytes + 0);
150 int32_t x = t0.get_byte(0, 1);
151
152 bool ret = x;
153 return ret;
154}
155} // namespace lexus
156} // namespace canbus
157} // 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