Apollo 10.0
自动驾驶开放平台
scu_epb_310.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 Scuepb310::ID = 0x310;
30
31void Scuepb310::Parse(const std::uint8_t* bytes, int32_t length,
32 Ge3* chassis) const {
33 chassis->mutable_scu_epb_310()->set_epb_intidx(
34 epb_intidx(bytes, length));
35 chassis->mutable_scu_epb_310()->set_epb_drvmode(
36 epb_drvmode(bytes, length));
37 chassis->mutable_scu_epb_310()->set_epb_sysst(
38 epb_sysst(bytes, length));
39 chassis->mutable_scu_epb_310()->set_epb_faultst(
40 epb_faultst(bytes, length));
41}
42
43// config detail: {'description': 'EPS interrupt index', 'enum': {0:
44// 'EPB_INTIDX_NOINT', 1: 'EPB_INTIDX_OVERFLOW', 2: 'EPB_INTIDX_TIMEOUT'},
45// 'precision': 1.0, 'len': 3, 'name': 'epb_intidx', 'is_signed_var': False,
46// 'offset': 0.0, 'physical_range': '[0|7]', 'bit': 10, 'type': 'enum', 'order':
47// 'motorola', 'physical_unit': ''}
48Scu_epb_310::Epb_intidxType Scuepb310::epb_intidx(const std::uint8_t* bytes,
49 int32_t length) const {
50 Byte t0(bytes + 1);
51 int32_t x = t0.get_byte(0, 3);
52
54 return ret;
55}
56
57// config detail: {'description': 'EPB drive mode', 'enum': {0:
58// 'EPB_DRVMODE_INVALID', 1: 'EPB_DRVMODE_MANUAL', 2: 'EPB_DRVMODE_INTERRUPT',
59// 3: 'EPB_DRVMODE_AUTO'}, 'precision': 1.0, 'len': 2, 'name': 'epb_drvmode',
60// 'is_signed_var': False, 'offset': 0.0, 'physical_range': '[0|3]', 'bit': 6,
61// 'type': 'enum', 'order': 'motorola', 'physical_unit': ''}
62Scu_epb_310::Epb_drvmodeType Scuepb310::epb_drvmode(const std::uint8_t* bytes,
63 int32_t length) const {
64 Byte t0(bytes + 0);
65 int32_t x = t0.get_byte(5, 2);
66
68 static_cast<Scu_epb_310::Epb_drvmodeType>(x);
69 return ret;
70}
71
72// config detail: {'description': 'EPB system status', 'enum': {0:
73// 'EPB_SYSST_RELEASED', 1: 'EPB_SYSST_APPLIED', 2: 'EPB_SYSST_RELEASING', 3:
74// 'EPB_SYSST_FAULT', 4: 'EPB_SYSST_APPLYING', 5: 'EPB_SYSST_DISENGAGED'},
75// 'precision': 1.0, 'len': 3, 'name': 'epb_sysst', 'is_signed_var': False,
76// 'offset': 0.0, 'physical_range': '[0|7]', 'bit': 2, 'type': 'enum', 'order':
77// 'motorola', 'physical_unit': ''}
78Scu_epb_310::Epb_sysstType Scuepb310::epb_sysst(const std::uint8_t* bytes,
79 int32_t length) const {
80 Byte t0(bytes + 0);
81 int32_t x = t0.get_byte(0, 3);
82
84 return ret;
85}
86
87// config detail: {'description': 'EPB fault status', 'enum': {0:
88// 'EPB_FAULTST_NORMAL', 1: 'EPB_FAULTST_FAULT'}, 'precision': 1.0, 'len': 1,
89// 'name': 'epb_faultst', 'is_signed_var': False, 'offset': 0.0,
90// 'physical_range': '[0|1]', 'bit': 7, 'type': 'enum', 'order': 'motorola',
91// 'physical_unit': ''}
92Scu_epb_310::Epb_faultstType Scuepb310::epb_faultst(const std::uint8_t* bytes,
93 int32_t length) const {
94 Byte t0(bytes + 0);
95 int32_t x = t0.get_byte(7, 1);
96
98 static_cast<Scu_epb_310::Epb_faultstType>(x);
99 return ret;
100}
101} // namespace ge3
102} // namespace canbus
103} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Ge3 *chassis) const override
static const int32_t ID
Definition scu_epb_310.h:29
class register implement
Definition arena_queue.h:37