Apollo 10.0
自动驾驶开放平台
rear_lights_rpt_418.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 Rearlightsrpt418::ID = 0x418;
32
33void Rearlightsrpt418::Parse(const std::uint8_t* bytes, int32_t length,
34 Lexus* chassis) const {
35 chassis->mutable_rear_lights_rpt_418()->set_reverse_lights_on_is_valid(
36 reverse_lights_on_is_valid(bytes, length));
37 chassis->mutable_rear_lights_rpt_418()->set_brake_lights_on_is_valid(
38 brake_lights_on_is_valid(bytes, length));
39 chassis->mutable_rear_lights_rpt_418()->set_reverse_lights_on(
40 reverse_lights_on(bytes, length));
41 chassis->mutable_rear_lights_rpt_418()->set_brake_lights_on(
42 brake_lights_on(bytes, length));
43}
44
45// config detail: {'name': 'reverse_lights_on_is_valid', 'offset': 0.0,
46// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
47// '[0|1]', 'bit': 9, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
48bool Rearlightsrpt418::reverse_lights_on_is_valid(const std::uint8_t* bytes,
49 int32_t length) const {
50 Byte t0(bytes + 1);
51 int32_t x = t0.get_byte(1, 1);
52
53 bool ret = x;
54 return ret;
55}
56
57// config detail: {'name': 'brake_lights_on_is_valid', 'offset': 0.0,
58// 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
59// '[0|1]', 'bit': 8, 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
60bool Rearlightsrpt418::brake_lights_on_is_valid(const std::uint8_t* bytes,
61 int32_t length) const {
62 Byte t0(bytes + 1);
63 int32_t x = t0.get_byte(0, 1);
64
65 bool ret = x;
66 return ret;
67}
68
69// config detail: {'name': 'reverse_lights_on', 'offset': 0.0, 'precision': 1.0,
70// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 1,
71// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
72bool Rearlightsrpt418::reverse_lights_on(const std::uint8_t* bytes,
73 int32_t length) const {
74 Byte t0(bytes + 0);
75 int32_t x = t0.get_byte(1, 1);
76
77 bool ret = x;
78 return ret;
79}
80
81// config detail: {'name': 'brake_lights_on', 'offset': 0.0, 'precision': 1.0,
82// 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0,
83// 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
84bool Rearlightsrpt418::brake_lights_on(const std::uint8_t* bytes,
85 int32_t length) const {
86 Byte t0(bytes + 0);
87 int32_t x = t0.get_byte(0, 1);
88
89 bool ret = x;
90 return ret;
91}
92} // namespace lexus
93} // namespace canbus
94} // 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