Apollo 10.0
自动驾驶开放平台
park_command_104.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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/demo/proto/demo.pb.h"
20
22
23namespace apollo {
24namespace canbus {
25namespace demo {
26
28 : public ::apollo::drivers::canbus::ProtocolData<::apollo::canbus::Demo> {
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 Demo* chassis) const override;
38
39 void UpdateData_Heartbeat(uint8_t* data) override;
40
41 void UpdateData(uint8_t* data) override;
42
43 void Reset() override;
44
45 // config detail: {'bit': 7, 'is_signed_var': False, 'len': 4, 'name':
46 // 'Heartbeat_104', 'offset': 0.0, 'order': 'motorola', 'physical_range':
47 // '[0|15]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
48 Parkcommand104* set_heartbeat_104(int heartbeat_104);
49
50 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
51 // 'CheckSum_104', 'offset': 0.0, 'order': 'motorola', 'physical_range':
52 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
53 Parkcommand104* set_checksum_104(int checksum_104);
54
55 // config detail: {'bit': 8, 'description': 'command', 'enum': {0:
56 // 'PARK_TARGET_RELEASE', 1: 'PARK_TARGET_PARKING_TRIGGER'}, 'is_signed_var':
57 // False, 'len': 1, 'name': 'Park_Target', 'offset': 0.0, 'order': 'motorola',
58 // 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0,
59 // 'signal_type': 'command', 'type': 'enum'}
62
63 // config detail: {'bit': 0, 'description': 'enable', 'enum': {0:
64 // 'PARK_EN_CTRL_DISABLE', 1: 'PARK_EN_CTRL_ENABLE'}, 'is_signed_var': False,
65 // 'len': 1, 'name': 'Park_EN_CTRL', 'offset': 0.0, 'order': 'motorola',
66 // 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0,
67 // 'signal_type': 'enable', 'type': 'enum'}
70
71 private:
72 // config detail: {'bit': 7, 'is_signed_var': False, 'len': 4, 'name':
73 // 'Heartbeat_104', 'offset': 0.0, 'order': 'motorola', 'physical_range':
74 // '[0|15]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
75 void set_p_heartbeat_104(uint8_t* data, int heartbeat_104);
76
77 // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name':
78 // 'CheckSum_104', 'offset': 0.0, 'order': 'motorola', 'physical_range':
79 // '[0|255]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
80 void set_p_checksum_104(uint8_t* data, int checksum_104);
81
82 // config detail: {'bit': 8, 'description': 'command', 'enum': {0:
83 // 'PARK_TARGET_RELEASE', 1: 'PARK_TARGET_PARKING_TRIGGER'}, 'is_signed_var':
84 // False, 'len': 1, 'name': 'Park_Target', 'offset': 0.0, 'order': 'motorola',
85 // 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0,
86 // 'signal_type': 'command', 'type': 'enum'}
87 void set_p_park_target(uint8_t* data,
89
90 // config detail: {'bit': 0, 'description': 'enable', 'enum': {0:
91 // 'PARK_EN_CTRL_DISABLE', 1: 'PARK_EN_CTRL_ENABLE'}, 'is_signed_var': False,
92 // 'len': 1, 'name': 'Park_EN_CTRL', 'offset': 0.0, 'order': 'motorola',
93 // 'physical_range': '[0|1]', 'physical_unit': '', 'precision': 1.0,
94 // 'signal_type': 'enable', 'type': 'enum'}
95 void set_p_park_en_ctrl(uint8_t* data,
97
98 int heartbeat_104(const std::uint8_t* bytes, const int32_t length) const;
99
100 int checksum_104(const std::uint8_t* bytes, const int32_t length) const;
101
102 Park_command_104::Park_targetType park_target(const std::uint8_t* bytes,
103 const int32_t length) const;
104
105 Park_command_104::Park_en_ctrlType park_en_ctrl(const std::uint8_t* bytes,
106 const int32_t length) const;
107
108 private:
109 int heartbeat_104_;
110 int checksum_104_;
113};
114
115} // namespace demo
116} // namespace canbus
117} // namespace apollo
void UpdateData_Heartbeat(uint8_t *data) override
void UpdateData(uint8_t *data) override
Parkcommand104 * set_heartbeat_104(int heartbeat_104)
Parkcommand104 * set_park_en_ctrl(Park_command_104::Park_en_ctrlType park_en_ctrl)
uint32_t GetPeriod() const override
Parkcommand104 * set_park_target(Park_command_104::Park_targetType park_target)
Parkcommand104 * set_checksum_104(int checksum_104)
void Parse(const std::uint8_t *bytes, int32_t length, Demo *chassis) const override
This is the base class of protocol data.
class register implement
Definition arena_queue.h:37
The class of ProtocolData