Apollo 10.0
自动驾驶开放平台
shift_rpt_66.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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 gem {
27
28using ::apollo::drivers::canbus::Byte;
29
31const int32_t Shiftrpt66::ID = 0x66;
32
33void Shiftrpt66::Parse(const std::uint8_t* bytes, int32_t length,
34 Gem* chassis) const {
35 chassis->mutable_shift_rpt_66()->set_manual_input(
36 manual_input(bytes, length));
37 chassis->mutable_shift_rpt_66()->set_commanded_value(
38 commanded_value(bytes, length));
39 chassis->mutable_shift_rpt_66()->set_output_value(
40 output_value(bytes, length));
41}
42
43// config detail: {'name': 'manual_input', 'enum': {0: 'MANUAL_INPUT_PARK', 1:
44// 'MANUAL_INPUT_REVERSE', 2: 'MANUAL_INPUT_NEUTRAL', 3: 'MANUAL_INPUT_FORWARD',
45// 4: 'MANUAL_INPUT_HIGH'}, 'precision': 1.0, 'len': 8, 'is_signed_var': False,
46// 'offset': 0.0, 'physical_range': '[0|4]', 'bit': 7, 'type': 'enum', 'order':
47// 'motorola', 'physical_unit': ''}
48Shift_rpt_66::Manual_inputType Shiftrpt66::manual_input(
49 const std::uint8_t* bytes, int32_t length) const {
50 Byte t0(bytes + 0);
51 int32_t x = t0.get_byte(0, 8);
52
54 static_cast<Shift_rpt_66::Manual_inputType>(x);
55 return ret;
56}
57
58// config detail: {'name': 'commanded_value', 'enum': {0:
59// 'COMMANDED_VALUE_PARK', 1: 'COMMANDED_VALUE_REVERSE', 2:
60// 'COMMANDED_VALUE_NEUTRAL', 3: 'COMMANDED_VALUE_FORWARD', 4:
61// 'COMMANDED_VALUE_HIGH'}, 'precision': 1.0, 'len': 8, 'is_signed_var': False,
62// 'offset': 0.0, 'physical_range': '[0|4]', 'bit': 15, 'type': 'enum', 'order':
63// 'motorola', 'physical_unit': ''}
64Shift_rpt_66::Commanded_valueType Shiftrpt66::commanded_value(
65 const std::uint8_t* bytes, int32_t length) const {
66 Byte t0(bytes + 1);
67 int32_t x = t0.get_byte(0, 8);
68
71 return ret;
72}
73
74// config detail: {'name': 'output_value', 'enum': {0: 'OUTPUT_VALUE_PARK', 1:
75// 'OUTPUT_VALUE_REVERSE', 2: 'OUTPUT_VALUE_NEUTRAL', 3: 'OUTPUT_VALUE_FORWARD',
76// 4: 'OUTPUT_VALUE_HIGH'}, 'precision': 1.0, 'len': 8, 'is_signed_var': False,
77// 'offset': 0.0, 'physical_range': '[0|4]', 'bit': 23, 'type': 'enum', 'order':
78// 'motorola', 'physical_unit': ''}
79Shift_rpt_66::Output_valueType Shiftrpt66::output_value(
80 const std::uint8_t* bytes, int32_t length) const {
81 Byte t0(bytes + 2);
82 int32_t x = t0.get_byte(0, 8);
83
85 static_cast<Shift_rpt_66::Output_valueType>(x);
86 return ret;
87}
88} // namespace gem
89} // namespace canbus
90} // namespace apollo
Defines the Byte class.
void Parse(const std::uint8_t *bytes, int32_t length, Gem *chassis) const override
class register implement
Definition arena_queue.h:37