Apollo 10.0
自动驾驶开放平台
scu_3_303.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 Scu3303::ID = 0x303;
30
31void Scu3303::Parse(const std::uint8_t* bytes, int32_t length,
32 Ge3* chassis) const {
33 chassis->mutable_scu_3_303()->set_vin15(vin15(bytes, length));
34 chassis->mutable_scu_3_303()->set_vin14(vin14(bytes, length));
35 chassis->mutable_scu_3_303()->set_vin13(vin13(bytes, length));
36 chassis->mutable_scu_3_303()->set_vin12(vin12(bytes, length));
37 chassis->mutable_scu_3_303()->set_vin11(vin11(bytes, length));
38 chassis->mutable_scu_3_303()->set_vin10(vin10(bytes, length));
39 chassis->mutable_scu_3_303()->set_vin09(vin09(bytes, length));
40 chassis->mutable_scu_3_303()->set_vin08(vin08(bytes, length));
41}
42
43// config detail: {'description': 'VIN string character 15', 'offset': 0.0,
44// 'precision': 1.0, 'len': 8, 'name': 'vin15', 'is_signed_var': False,
45// 'physical_range': '[0|255]', 'bit': 63, 'type': 'int', 'order': 'motorola',
46// 'physical_unit': '-'}
47int Scu3303::vin15(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 14', 'offset': 0.0,
56// 'precision': 1.0, 'len': 8, 'name': 'vin14', 'is_signed_var': False,
57// 'physical_range': '[0|255]', 'bit': 55, 'type': 'int', 'order': 'motorola',
58// 'physical_unit': '-'}
59int Scu3303::vin14(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 13', 'offset': 0.0,
68// 'precision': 1.0, 'len': 8, 'name': 'vin13', 'is_signed_var': False,
69// 'physical_range': '[0|255]', 'bit': 47, 'type': 'int', 'order': 'motorola',
70// 'physical_unit': '-'}
71int Scu3303::vin13(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 12', 'offset': 0.0,
80// 'precision': 1.0, 'len': 8, 'name': 'vin12', 'is_signed_var': False,
81// 'physical_range': '[0|255]', 'bit': 39, 'type': 'int', 'order': 'motorola',
82// 'physical_unit': '-'}
83int Scu3303::vin12(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 11', 'offset': 0.0,
92// 'precision': 1.0, 'len': 8, 'name': 'vin11', 'is_signed_var': False,
93// 'physical_range': '[0|255]', 'bit': 31, 'type': 'int', 'order': 'motorola',
94// 'physical_unit': '-'}
95int Scu3303::vin11(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 10', 'offset': 0.0,
104// 'precision': 1.0, 'len': 8, 'name': 'vin10', 'is_signed_var': False,
105// 'physical_range': '[0|255]', 'bit': 23, 'type': 'int', 'order': 'motorola',
106// 'physical_unit': '-'}
107int Scu3303::vin10(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 09', 'offset': 0.0,
116// 'precision': 1.0, 'len': 8, 'name': 'vin09', 'is_signed_var': False,
117// 'physical_range': '[0|255]', 'bit': 15, 'type': 'int', 'order': 'motorola',
118// 'physical_unit': '-'}
119int Scu3303::vin09(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 08', 'offset': 0.0,
128// 'precision': 1.0, 'len': 8, 'name': 'vin08', 'is_signed_var': False,
129// 'physical_range': '[0|255]', 'bit': 7, 'type': 'int', 'order': 'motorola',
130// 'physical_unit': '-'}
131int Scu3303::vin08(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.
static const int32_t ID
Definition scu_3_303.h:29
void Parse(const std::uint8_t *bytes, int32_t length, Ge3 *chassis) const override
Definition scu_3_303.cc:31
class register implement
Definition arena_queue.h:37