Apollo 10.0
自动驾驶开放平台
gear_command_103.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2020 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
17#pragma once
18
19#include "modules/canbus_vehicle/devkit/proto/devkit.pb.h"
20
22
23namespace apollo {
24namespace canbus {
25namespace devkit {
26
28 ::apollo::canbus::Devkit> {
29 public:
30 static const int32_t ID;
31
33
34 uint32_t GetPeriod() const override;
35
36 void Parse(const std::uint8_t* bytes, int32_t length,
37 Devkit* chassis) const override;
38
39 void UpdateData(uint8_t* data) override;
40
41 void Reset() override;
42
43 // config detail: {'name': 'Gear_Target', 'enum': {0: 'GEAR_TARGET_INVALID',
44 // 1: 'GEAR_TARGET_PARK', 2: 'GEAR_TARGET_REVERSE', 3: 'GEAR_TARGET_NEUTRAL',
45 // 4: 'GEAR_TARGET_DRIVE'}, 'precision': 1.0, 'len': 3, 'is_signed_var':
46 // False, 'offset': 0.0, 'physical_range': '[0|4]', 'bit': 10, 'type': 'enum',
47 // 'order': 'motorola', 'physical_unit': ''}
50
51 // config detail: {'name': 'Gear_EN_CTRL', 'enum': {0: 'GEAR_EN_CTRL_DISABLE',
52 // 1: 'GEAR_EN_CTRL_ENABLE'}, 'precision': 1.0, 'len': 1, 'is_signed_var':
53 // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum',
54 // 'order': 'motorola', 'physical_unit': ''}
57
58 // config detail: {'name': 'CheckSum_103', 'offset': 0.0, 'precision': 1.0,
59 // 'len': 8, 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
60 // 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
61 Gearcommand103* set_checksum_103(int checksum_103);
62
63 private:
64 // config detail: {'name': 'Gear_Target', 'enum': {0: 'GEAR_TARGET_INVALID',
65 // 1: 'GEAR_TARGET_PARK', 2: 'GEAR_TARGET_REVERSE', 3: 'GEAR_TARGET_NEUTRAL',
66 // 4: 'GEAR_TARGET_DRIVE'}, 'precision': 1.0, 'len': 3, 'is_signed_var':
67 // False, 'offset': 0.0, 'physical_range': '[0|4]', 'bit': 10, 'type': 'enum',
68 // 'order': 'motorola', 'physical_unit': ''}
69 void set_p_gear_target(uint8_t* data,
71
72 // config detail: {'name': 'Gear_EN_CTRL', 'enum': {0: 'GEAR_EN_CTRL_DISABLE',
73 // 1: 'GEAR_EN_CTRL_ENABLE'}, 'precision': 1.0, 'len': 1, 'is_signed_var':
74 // False, 'offset': 0.0, 'physical_range': '[0|1]', 'bit': 0, 'type': 'enum',
75 // 'order': 'motorola', 'physical_unit': ''}
76 void set_p_gear_en_ctrl(uint8_t* data,
78
79 // config detail: {'name': 'CheckSum_103', 'offset': 0.0, 'precision': 1.0,
80 // 'len': 8, 'is_signed_var': False, 'physical_range': '[0|255]', 'bit': 63,
81 // 'type': 'int', 'order': 'motorola', 'physical_unit': ''}
82 void set_p_checksum_103(uint8_t* data, int checksum_103);
83
84 // report the command
85 Gear_command_103::Gear_targetType gear_target(const std::uint8_t* bytes,
86 const int32_t length) const;
87
88 Gear_command_103::Gear_en_ctrlType gear_en_ctrl(const std::uint8_t* bytes,
89 const int32_t length) const;
90
91 int checksum_103(const std::uint8_t* bytes, const int32_t length) const;
92
93 private:
96 int checksum_103_;
97};
98
99} // namespace devkit
100} // namespace canbus
101} // namespace apollo
Gearcommand103 * set_gear_en_ctrl(Gear_command_103::Gear_en_ctrlType gear_en_ctrl)
Gearcommand103 * set_gear_target(Gear_command_103::Gear_targetType gear_target)
void UpdateData(uint8_t *data) override
Gearcommand103 * set_checksum_103(int checksum_103)
void Parse(const std::uint8_t *bytes, int32_t length, Devkit *chassis) const override
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData