Apollo 10.0
自动驾驶开放平台
vin_resp2_392.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 "glog/logging.h"
20
23
24namespace apollo {
25namespace canbus {
26namespace wey {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Vinresp2392::ID = 0x392;
32
33void Vinresp2392::Parse(const std::uint8_t* bytes, int32_t length,
34 Wey* chassis) const {
35 chassis->mutable_vin_resp2_392()->set_vin15(
36 vin15(bytes, length));
37 chassis->mutable_vin_resp2_392()->set_vin14(
38 vin14(bytes, length));
39 chassis->mutable_vin_resp2_392()->set_vin13(
40 vin13(bytes, length));
41 chassis->mutable_vin_resp2_392()->set_vin12(
42 vin12(bytes, length));
43 chassis->mutable_vin_resp2_392()->set_vin11(
44 vin11(bytes, length));
45 chassis->mutable_vin_resp2_392()->set_vin10(
46 vin10(bytes, length));
47 chassis->mutable_vin_resp2_392()->set_vin09(
48 vin09(bytes, length));
49 chassis->mutable_vin_resp2_392()->set_vin08(
50 vin08(bytes, length));
51}
52
53// config detail: {'name': 'vin15', 'offset': 0.0, 'precision': 1.0, 'len': 8,
54// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 7, 'type':'int',
55// 'order': 'motorola', 'physical_unit': ''}
56int Vinresp2392::vin15(const std::uint8_t* bytes, int32_t length) const {
57 Byte t0(bytes + 0);
58 int32_t x = t0.get_byte(0, 8);
59
60 int ret = x;
61 return ret;
62}
63
64// config detail: {'name': 'vin14', 'offset': 0.0, 'precision': 1.0, 'len': 8,
65// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 15,
66// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
67int Vinresp2392::vin14(const std::uint8_t* bytes, int32_t length) const {
68 Byte t0(bytes + 1);
69 int32_t x = t0.get_byte(0, 8);
70
71 int ret = x;
72 return ret;
73}
74
75// config detail: {'name': 'vin13', 'offset': 0.0, 'precision': 1.0, 'len': 8,
76// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 23,
77// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
78int Vinresp2392::vin13(const std::uint8_t* bytes, int32_t length) const {
79 Byte t0(bytes + 2);
80 int32_t x = t0.get_byte(0, 8);
81
82 int ret = x;
83 return ret;
84}
85
86// config detail: {'name': 'vin12', 'offset': 0.0, 'precision': 1.0, 'len': 8,
87// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 31,
88// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
89int Vinresp2392::vin12(const std::uint8_t* bytes, int32_t length) const {
90 Byte t0(bytes + 3);
91 int32_t x = t0.get_byte(0, 8);
92
93 int ret = x;
94 return ret;
95}
96
97// config detail: {'name': 'vin11', 'offset': 0.0, 'precision': 1.0, 'len': 8,
98// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 39,
99// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
100int Vinresp2392::vin11(const std::uint8_t* bytes, int32_t length) const {
101 Byte t0(bytes + 4);
102 int32_t x = t0.get_byte(0, 8);
103
104 int ret = x;
105 return ret;
106}
107
108// config detail: {'name': 'vin10', 'offset': 0.0, 'precision': 1.0, 'len': 8,
109// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 47,
110// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
111int Vinresp2392::vin10(const std::uint8_t* bytes, int32_t length) const {
112 Byte t0(bytes + 5);
113 int32_t x = t0.get_byte(0, 8);
114
115 int ret = x;
116 return ret;
117}
118
119// config detail: {'name': 'vin09', 'offset': 0.0, 'precision': 1.0, 'len': 8,
120// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 55,
121// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
122int Vinresp2392::vin09(const std::uint8_t* bytes, int32_t length) const {
123 Byte t0(bytes + 6);
124 int32_t x = t0.get_byte(0, 8);
125
126 int ret = x;
127 return ret;
128}
129
130// config detail: {'name': 'vin08', 'offset': 0.0, 'precision': 1.0, 'len': 8,
131// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
132// 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
133int Vinresp2392::vin08(const std::uint8_t* bytes, int32_t length) const {
134 Byte t0(bytes + 7);
135 int32_t x = t0.get_byte(0, 8);
136
137 int ret = x;
138 return ret;
139}
140} // namespace wey
141} // namespace canbus
142} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Wey *chassis) const override
class register implement
Definition arena_queue.h:37