Apollo 10.0
自动驾驶开放平台
vin_resp2_515.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 Vinresp2515::ID = 0x515;
34
35void Vinresp2515::Parse(const std::uint8_t* bytes, int32_t length,
36 Devkit* chassis) const {
37 chassis->mutable_vin_resp2_515()->set_vin15(
38 vin15(bytes, length));
39 chassis->mutable_vin_resp2_515()->set_vin14(
40 vin14(bytes, length));
41 chassis->mutable_vin_resp2_515()->set_vin13(
42 vin13(bytes, length));
43 chassis->mutable_vin_resp2_515()->set_vin12(
44 vin12(bytes, length));
45 chassis->mutable_vin_resp2_515()->set_vin11(
46 vin11(bytes, length));
47 chassis->mutable_vin_resp2_515()->set_vin10(
48 vin10(bytes, length));
49 chassis->mutable_vin_resp2_515()->set_vin09(
50 vin09(bytes, length));
51 chassis->mutable_vin_resp2_515()->set_vin08(
52 vin08(bytes, length));
53}
54
55// config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name': 'vin15',
56// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
57// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
58std::string Vinresp2515::vin15(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': 'vin14',
69// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
70// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
71std::string Vinresp2515::vin14(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': 'vin13',
82// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
83// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
84std::string Vinresp2515::vin13(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': 'vin12',
95// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
96// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
97std::string Vinresp2515::vin12(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': 'vin11',
108// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
109// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
110std::string Vinresp2515::vin11(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': 'vin10',
121// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
122// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
123std::string Vinresp2515::vin10(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': 'vin09',
134// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
135// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
136std::string Vinresp2515::vin09(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': 'vin08',
147// 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|255]',
148// 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
149std::string Vinresp2515::vin08(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