Apollo 10.0
自动驾驶开放平台
scu_2_302.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#include "glog/logging.h"
21
22namespace apollo {
23namespace canbus {
24namespace ge3 {
25
26using ::apollo::drivers::canbus::Byte;
27
29const int32_t Scu2302::ID = 0x302;
30
31void Scu2302::Parse(const std::uint8_t* bytes, int32_t length,
32 Ge3* chassis) const {
33 chassis->mutable_scu_2_302()->set_vin07(vin07(bytes, length));
34 chassis->mutable_scu_2_302()->set_vin06(vin06(bytes, length));
35 chassis->mutable_scu_2_302()->set_vin05(vin05(bytes, length));
36 chassis->mutable_scu_2_302()->set_vin04(vin04(bytes, length));
37 chassis->mutable_scu_2_302()->set_vin03(vin03(bytes, length));
38 chassis->mutable_scu_2_302()->set_vin02(vin02(bytes, length));
39 chassis->mutable_scu_2_302()->set_vin01(vin01(bytes, length));
40 chassis->mutable_scu_2_302()->set_vin00(vin00(bytes, length));
41}
42
43// config detail: {'description': 'VIN string character 07', 'offset': 0.0,
44// 'precision': 1.0, 'len': 8, 'name': 'vin07', 'is_signed_var': False,
45// 'physical_range': '[0|255]', 'bit': 63, 'type': 'int', 'order': 'motorola',
46// 'physical_unit': '-'}
47int Scu2302::vin07(const std::uint8_t* bytes, int32_t length) const {
48 Byte t0(bytes + 7);
49 int32_t x = t0.get_byte(0, 8);
50
51 int ret = x;
52 return ret;
53}
54
55// config detail: {'description': 'VIN string character 06', 'offset': 0.0,
56// 'precision': 1.0, 'len': 8, 'name': 'vin06', 'is_signed_var': False,
57// 'physical_range': '[0|255]', 'bit': 55, 'type': 'int', 'order': 'motorola',
58// 'physical_unit': '-'}
59int Scu2302::vin06(const std::uint8_t* bytes, int32_t length) const {
60 Byte t0(bytes + 6);
61 int32_t x = t0.get_byte(0, 8);
62
63 int ret = x;
64 return ret;
65}
66
67// config detail: {'description': 'VIN string character 05', 'offset': 0.0,
68// 'precision': 1.0, 'len': 8, 'name': 'vin05', 'is_signed_var': False,
69// 'physical_range': '[0|255]', 'bit': 47, 'type': 'int', 'order': 'motorola',
70// 'physical_unit': '-'}
71int Scu2302::vin05(const std::uint8_t* bytes, int32_t length) const {
72 Byte t0(bytes + 5);
73 int32_t x = t0.get_byte(0, 8);
74
75 int ret = x;
76 return ret;
77}
78
79// config detail: {'description': 'VIN string character 04', 'offset': 0.0,
80// 'precision': 1.0, 'len': 8, 'name': 'vin04', 'is_signed_var': False,
81// 'physical_range': '[0|255]', 'bit': 39, 'type': 'int', 'order': 'motorola',
82// 'physical_unit': '-'}
83int Scu2302::vin04(const std::uint8_t* bytes, int32_t length) const {
84 Byte t0(bytes + 4);
85 int32_t x = t0.get_byte(0, 8);
86
87 int ret = x;
88 return ret;
89}
90
91// config detail: {'description': 'VIN string character 03', 'offset': 0.0,
92// 'precision': 1.0, 'len': 8, 'name': 'vin03', 'is_signed_var': False,
93// 'physical_range': '[0|255]', 'bit': 31, 'type': 'int', 'order': 'motorola',
94// 'physical_unit': '-'}
95int Scu2302::vin03(const std::uint8_t* bytes, int32_t length) const {
96 Byte t0(bytes + 3);
97 int32_t x = t0.get_byte(0, 8);
98
99 int ret = x;
100 return ret;
101}
102
103// config detail: {'description': 'VIN string character 02', 'offset': 0.0,
104// 'precision': 1.0, 'len': 8, 'name': 'vin02', 'is_signed_var': False,
105// 'physical_range': '[0|255]', 'bit': 23, 'type': 'int', 'order': 'motorola',
106// 'physical_unit': '-'}
107int Scu2302::vin02(const std::uint8_t* bytes, int32_t length) const {
108 Byte t0(bytes + 2);
109 int32_t x = t0.get_byte(0, 8);
110
111 int ret = x;
112 return ret;
113}
114
115// config detail: {'description': 'VIN string character 01', 'offset': 0.0,
116// 'precision': 1.0, 'len': 8, 'name': 'vin01', 'is_signed_var': False,
117// 'physical_range': '[0|255]', 'bit': 15, 'type': 'int', 'order': 'motorola',
118// 'physical_unit': '-'}
119int Scu2302::vin01(const std::uint8_t* bytes, int32_t length) const {
120 Byte t0(bytes + 1);
121 int32_t x = t0.get_byte(0, 8);
122
123 int ret = x;
124 return ret;
125}
126
127// config detail: {'description': 'VIN string character 00', 'offset': 0.0,
128// 'precision': 1.0, 'len': 8, 'name': 'vin00', 'is_signed_var': False,
129// 'physical_range': '[0|255]', 'bit': 7, 'type': 'int', 'order': 'motorola',
130// 'physical_unit': '-'}
131int Scu2302::vin00(const std::uint8_t* bytes, int32_t length) const {
132 Byte t0(bytes + 0);
133 int32_t x = t0.get_byte(0, 8);
134
135 int ret = x;
136 return ret;
137}
138} // namespace ge3
139} // namespace canbus
140} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Ge3 *chassis) const override
Definition scu_2_302.cc:31
static const int32_t ID
Definition scu_2_302.h:29
class register implement
Definition arena_queue.h:37