Apollo 10.0
自动驾驶开放平台
vin_resp1_391.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 Vinresp1391::ID = 0x391;
32
33void Vinresp1391::Parse(const std::uint8_t* bytes, int32_t length,
34 Wey* chassis) const {
35 chassis->mutable_vin_resp1_391()->set_vin07(
36 vin07(bytes, length));
37 chassis->mutable_vin_resp1_391()->set_vin06(
38 vin06(bytes, length));
39 chassis->mutable_vin_resp1_391()->set_vin05(
40 vin05(bytes, length));
41 chassis->mutable_vin_resp1_391()->set_vin04(
42 vin04(bytes, length));
43 chassis->mutable_vin_resp1_391()->set_vin03(
44 vin03(bytes, length));
45 chassis->mutable_vin_resp1_391()->set_vin02(
46 vin02(bytes, length));
47 chassis->mutable_vin_resp1_391()->set_vin00(
48 vin00(bytes, length));
49 chassis->mutable_vin_resp1_391()->set_vin01(
50 vin01(bytes, length));
51}
52
53// config detail: {'name': 'vin07', '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 Vinresp1391::vin07(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': 'vin06', 'offset': 0.0, 'precision': 1.0, 'len': 8,
65// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 15,'type':'int',
66// 'order': 'motorola', 'physical_unit': ''}
67int Vinresp1391::vin06(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': 'vin05', 'offset': 0.0, 'precision': 1.0, 'len': 8,
76// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 23,'type':'int',
77// 'order': 'motorola', 'physical_unit': ''}
78int Vinresp1391::vin05(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': 'vin04', 'offset': 0.0, 'precision': 1.0, 'len': 8,
87// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 31,'type':'int',
88// 'order': 'motorola', 'physical_unit': ''}
89int Vinresp1391::vin04(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': 'vin03', 'offset': 0.0, 'precision': 1.0, 'len': 8,
98// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 39,'type':'int',
99// 'order': 'motorola', 'physical_unit': ''}
100int Vinresp1391::vin03(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': 'vin02', 'offset': 0.0, 'precision': 1.0, 'len': 8,
109// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 47,'type':'int',
110// 'order': 'motorola', 'physical_unit': ''}
111int Vinresp1391::vin02(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': 'vin00', 'offset': 0.0, 'precision': 1.0, 'len': 8,
120// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,'type':'int',
121// 'order': 'motorola', 'physical_unit': ''}
122int Vinresp1391::vin00(const std::uint8_t* bytes, int32_t length) const {
123 Byte t0(bytes + 7);
124 int32_t x = t0.get_byte(0, 8);
125
126 int ret = x;
127 return ret;
128}
129
130// config detail: {'name': 'vin01', 'offset': 0.0, 'precision': 1.0, 'len': 8,
131// 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 55,'type':'int',
132// 'order': 'motorola', 'physical_unit': ''}
133int Vinresp1391::vin01(const std::uint8_t* bytes, int32_t length) const {
134 Byte t0(bytes + 6);
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