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