Apollo 10.0
自动驾驶开放平台
vin_resp1_514.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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 demo {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Vinresp1514::ID = 0x514;
32
33void Vinresp1514::Parse(const std::uint8_t* bytes, int32_t length,
34 Demo* chassis) const {
35 chassis->mutable_vin_resp1_514()->set_vin07(vin07(bytes, length));
36 chassis->mutable_vin_resp1_514()->set_vin06(vin06(bytes, length));
37 chassis->mutable_vin_resp1_514()->set_vin05(vin05(bytes, length));
38 chassis->mutable_vin_resp1_514()->set_vin04(vin04(bytes, length));
39 chassis->mutable_vin_resp1_514()->set_vin03(vin03(bytes, length));
40 chassis->mutable_vin_resp1_514()->set_vin02(vin02(bytes, length));
41 chassis->mutable_vin_resp1_514()->set_vin01(vin01(bytes, length));
42 chassis->mutable_vin_resp1_514()->set_vin00(vin00(bytes, length));
43}
44
45// config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name': 'vin07',
46// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
47// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
48int Vinresp1514::vin07(const std::uint8_t* bytes, int32_t length) const {
49 Byte t0(bytes + 7);
50 int32_t x = t0.get_byte(0, 8);
51
52 int ret = x;
53 return ret;
54}
55
56// config detail: {'bit': 55, 'is_signed_var': False, 'len': 8, 'name': 'vin06',
57// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
58// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
59int Vinresp1514::vin06(const std::uint8_t* bytes, int32_t length) const {
60 Byte t0(bytes + 6);
61 int32_t x = t0.get_byte(0, 8);
62
63 int ret = x;
64 return ret;
65}
66
67// config detail: {'bit': 47, 'is_signed_var': False, 'len': 8, 'name': 'vin05',
68// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
69// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
70int Vinresp1514::vin05(const std::uint8_t* bytes, int32_t length) const {
71 Byte t0(bytes + 5);
72 int32_t x = t0.get_byte(0, 8);
73
74 int ret = x;
75 return ret;
76}
77
78// config detail: {'bit': 39, 'is_signed_var': False, 'len': 8, 'name': 'vin04',
79// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
80// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
81int Vinresp1514::vin04(const std::uint8_t* bytes, int32_t length) const {
82 Byte t0(bytes + 4);
83 int32_t x = t0.get_byte(0, 8);
84
85 int ret = x;
86 return ret;
87}
88
89// config detail: {'bit': 31, 'is_signed_var': False, 'len': 8, 'name': 'vin03',
90// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
91// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
92int Vinresp1514::vin03(const std::uint8_t* bytes, int32_t length) const {
93 Byte t0(bytes + 3);
94 int32_t x = t0.get_byte(0, 8);
95
96 int ret = x;
97 return ret;
98}
99
100// config detail: {'bit': 23, 'is_signed_var': False, 'len': 8, 'name': 'vin02',
101// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
102// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
103int Vinresp1514::vin02(const std::uint8_t* bytes, int32_t length) const {
104 Byte t0(bytes + 2);
105 int32_t x = t0.get_byte(0, 8);
106
107 int ret = x;
108 return ret;
109}
110
111// config detail: {'bit': 15, 'is_signed_var': False, 'len': 8, 'name': 'vin01',
112// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
113// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
114int Vinresp1514::vin01(const std::uint8_t* bytes, int32_t length) const {
115 Byte t0(bytes + 1);
116 int32_t x = t0.get_byte(0, 8);
117
118 int ret = x;
119 return ret;
120}
121
122// config detail: {'bit': 7, 'is_signed_var': False, 'len': 8, 'name': 'vin00',
123// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
124// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
125int Vinresp1514::vin00(const std::uint8_t* bytes, int32_t length) const {
126 Byte t0(bytes + 0);
127 int32_t x = t0.get_byte(0, 8);
128
129 int ret = x;
130 return ret;
131}
132} // namespace demo
133} // namespace canbus
134} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Demo *chassis) const override
class register implement
Definition arena_queue.h:37