Apollo 10.0
自动驾驶开放平台
vin_resp2_51c.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2019 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 <string>
20
21#include "glog/logging.h"
22
25
26namespace apollo {
27namespace canbus {
28namespace ch {
29
30using ::apollo::drivers::canbus::Byte;
31
33const int32_t Vinresp251c::ID = 0x51C;
34
35void Vinresp251c::Parse(const std::uint8_t* bytes, int32_t length,
36 Ch* chassis) const {
37 chassis->mutable_vin_resp2_51c()->set_vin16(
38 vin16(bytes, length));
39 chassis->mutable_vin_resp2_51c()->set_vin15(
40 vin15(bytes, length));
41 chassis->mutable_vin_resp2_51c()->set_vin14(
42 vin14(bytes, length));
43 chassis->mutable_vin_resp2_51c()->set_vin13(
44 vin13(bytes, length));
45 chassis->mutable_vin_resp2_51c()->set_vin12(
46 vin12(bytes, length));
47 chassis->mutable_vin_resp2_51c()->set_vin11(
48 vin11(bytes, length));
49 chassis->mutable_vin_resp2_51c()->set_vin10(
50 vin10(bytes, length));
51 chassis->mutable_vin_resp2_51c()->set_vin09(
52 vin09(bytes, length));
53}
54
55// config detail: {'bit': 56, 'description': 'VIN Response', 'is_signed_var':
56// False, 'len': 8, 'name': 'vin16', 'offset': 0.0, 'order': 'intel',
57// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
58// 'int'}
59std::string Vinresp251c::vin16(const std::uint8_t* bytes,
60 int32_t length) const {
61 Byte t0(bytes + 7);
62 int32_t x = t0.get_byte(0, 8);
63
64 std::string ret = "";
65 ret += x;
66 return ret;
67}
68
69// config detail: {'bit': 48, 'description': 'VIN Response', 'is_signed_var':
70// False, 'len': 8, 'name': 'vin15', 'offset': 0.0, 'order': 'intel',
71// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
72// 'int'}
73std::string Vinresp251c::vin15(const std::uint8_t* bytes,
74 int32_t length) const {
75 Byte t0(bytes + 6);
76 int32_t x = t0.get_byte(0, 8);
77
78 std::string ret = "";
79 ret += x;
80 return ret;
81}
82
83// config detail: {'bit': 40, 'description': 'VIN Response', 'is_signed_var':
84// False, 'len': 8, 'name': 'vin14', 'offset': 0.0, 'order': 'intel',
85// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
86// 'int'}
87std::string Vinresp251c::vin14(const std::uint8_t* bytes,
88 int32_t length) const {
89 Byte t0(bytes + 5);
90 int32_t x = t0.get_byte(0, 8);
91
92 std::string ret = "";
93 ret += x;
94 return ret;
95}
96
97// config detail: {'bit': 32, 'description': 'VIN Response', 'is_signed_var':
98// False, 'len': 8, 'name': 'vin13', 'offset': 0.0, 'order': 'intel',
99// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
100// 'int'}
101std::string Vinresp251c::vin13(const std::uint8_t* bytes,
102 int32_t length) const {
103 Byte t0(bytes + 4);
104 int32_t x = t0.get_byte(0, 8);
105
106 std::string ret = "";
107 ret += x;
108 return ret;
109}
110
111// config detail: {'bit': 24, 'description': 'VIN Response', 'is_signed_var':
112// False, 'len': 8, 'name': 'vin12', 'offset': 0.0, 'order': 'intel',
113// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
114// 'int'}
115std::string Vinresp251c::vin12(const std::uint8_t* bytes,
116 int32_t length) const {
117 Byte t0(bytes + 3);
118 int32_t x = t0.get_byte(0, 8);
119
120 std::string ret = "";
121 ret += x;
122 return ret;
123}
124
125// config detail: {'bit': 16, 'description': 'VIN Response', 'is_signed_var':
126// False, 'len': 8, 'name': 'vin11', 'offset': 0.0, 'order': 'intel',
127// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
128// 'int'}
129std::string Vinresp251c::vin11(const std::uint8_t* bytes,
130 int32_t length) const {
131 Byte t0(bytes + 2);
132 int32_t x = t0.get_byte(0, 8);
133
134 std::string ret = "";
135 ret += x;
136 return ret;
137}
138
139// config detail: {'bit': 8, 'description': 'VIN Response', 'is_signed_var':
140// False, 'len': 8, 'name': 'vin10', 'offset': 0.0, 'order': 'intel',
141// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
142// 'int'}
143std::string Vinresp251c::vin10(const std::uint8_t* bytes,
144 int32_t length) const {
145 Byte t0(bytes + 1);
146 int32_t x = t0.get_byte(0, 8);
147
148 std::string ret = "";
149 ret += x;
150 return ret;
151}
152
153// config detail: {'bit': 0, 'description': 'VIN Response', 'is_signed_var':
154// False, 'len': 8, 'name': 'vin09', 'offset': 0.0, 'order': 'intel',
155// 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type':
156// 'int'}
157std::string Vinresp251c::vin09(const std::uint8_t* bytes,
158 int32_t length) const {
159 Byte t0(bytes + 0);
160 int32_t x = t0.get_byte(0, 8);
161
162 std::string ret = "";
163 ret += x;
164 return ret;
165}
166} // namespace ch
167} // namespace canbus
168} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Ch *chassis) const override
class register implement
Definition arena_queue.h:37