Apollo 10.0
自动驾驶开放平台
horn_rpt_79.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 Hornrpt79::ID = 0x79;
32
33void Hornrpt79::Parse(const std::uint8_t* bytes, int32_t length,
34 Gem* chassis) const {
35 chassis->mutable_horn_rpt_79()->set_output_value(
36 output_value(bytes, length));
37 chassis->mutable_horn_rpt_79()->set_commanded_value(
38 commanded_value(bytes, length));
39 chassis->mutable_horn_rpt_79()->set_manual_input(
40 manual_input(bytes, length));
41}
42
43// config detail: {'name': 'output_value', 'enum': {0: 'OUTPUT_VALUE_OFF', 1:
44// 'OUTPUT_VALUE_ON'}, 'precision': 1.0, 'len': 8, 'is_signed_var': False,
45// 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 23, 'type': 'enum', 'order':
46// 'motorola', 'physical_unit': ''}
47Horn_rpt_79::Output_valueType Hornrpt79::output_value(const std::uint8_t* bytes,
48 int32_t length) const {
49 Byte t0(bytes + 2);
50 int32_t x = t0.get_byte(0, 8);
51
53 static_cast<Horn_rpt_79::Output_valueType>(x);
54 return ret;
55}
56
57// config detail: {'name': 'commanded_value', 'enum': {0: 'COMMANDED_VALUE_OFF',
58// 1: 'COMMANDED_VALUE_ON'}, 'precision': 1.0, 'len': 8, 'is_signed_var': False,
59// 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 15, 'type': 'enum', 'order':
60// 'motorola', 'physical_unit': ''}
61Horn_rpt_79::Commanded_valueType Hornrpt79::commanded_value(
62 const std::uint8_t* bytes, int32_t length) const {
63 Byte t0(bytes + 1);
64 int32_t x = t0.get_byte(0, 8);
65
68 return ret;
69}
70
71// config detail: {'name': 'manual_input', 'enum': {0: 'MANUAL_INPUT_OFF', 1:
72// 'MANUAL_INPUT_ON'}, 'precision': 1.0, 'len': 8, 'is_signed_var': False,
73// 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 7, 'type': 'enum', 'order':
74// 'motorola', 'physical_unit': ''}
75Horn_rpt_79::Manual_inputType Hornrpt79::manual_input(const std::uint8_t* bytes,
76 int32_t length) const {
77 Byte t0(bytes + 0);
78 int32_t x = t0.get_byte(0, 8);
79
81 static_cast<Horn_rpt_79::Manual_inputType>(x);
82 return ret;
83}
84} // namespace gem
85} // namespace canbus
86} // namespace apollo
Defines the Byte class.
static const int32_t ID
Definition horn_rpt_79.h:29
void Parse(const std::uint8_t *bytes, int32_t length, Gem *chassis) const override
class register implement
Definition arena_queue.h:37