Apollo  6.0
Open source self driving car software
wiper_cmd_134.h
Go to the documentation of this file.
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 
17 #pragma once
18 
19 #include "modules/canbus/proto/chassis_detail.pb.h"
21 
22 namespace apollo {
23 namespace canbus {
24 namespace lexus {
25 
27  ::apollo::canbus::ChassisDetail> {
28  public:
29  static const int32_t ID;
30 
31  Wipercmd134();
32 
33  uint32_t GetPeriod() const override;
34 
35  void UpdateData(uint8_t* data) override;
36 
37  void Reset() override;
38 
39  // config detail: {'name': 'IGNORE_OVERRIDES', 'offset': 0.0,
40  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
41  // '[0|1]', 'bit': 1, 'type': 'bool', 'order': 'motorola', 'physical_unit':
42  // ''}
43  Wipercmd134* set_ignore_overrides(bool ignore_overrides);
44 
45  // config detail: {'name': 'ENABLE', 'offset': 0.0, 'precision': 1.0, 'len':
46  // 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type':
47  // 'bool', 'order': 'motorola', 'physical_unit': ''}
48  Wipercmd134* set_enable(bool enable);
49 
50  // config detail: {'name': 'CLEAR_OVERRIDE', 'offset': 0.0, 'precision': 1.0,
51  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 2,
52  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
53  Wipercmd134* set_clear_override(bool clear_override);
54 
55  // config detail: {'name': 'WIPER_CMD', 'enum': {0: 'WIPER_CMD_WIPERS_OFF', 1:
56  // 'WIPER_CMD_INTERMITTENT_1', 2: 'WIPER_CMD_INTERMITTENT_2', 3:
57  // 'WIPER_CMD_INTERMITTENT_3', 4: 'WIPER_CMD_INTERMITTENT_4', 5:
58  // 'WIPER_CMD_INTERMITTENT_5', 6: 'WIPER_CMD_LOW', 7: 'WIPER_CMD_HIGH'},
59  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
60  // 'physical_range': '[0|7]', 'bit': 15, 'type': 'enum', 'order': 'motorola',
61  // 'physical_unit': ''}
62  Wipercmd134* set_wiper_cmd(Wiper_cmd_134::Wiper_cmdType wiper_cmd);
63 
64  // config detail: {'name': 'CLEAR_FAULTS', 'offset': 0.0, 'precision': 1.0,
65  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 3,
66  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
67  Wipercmd134* set_clear_faults(bool clear_faults);
68 
69  private:
70  // config detail: {'name': 'IGNORE_OVERRIDES', 'offset': 0.0,
71  // 'precision': 1.0, 'len': 1, 'is_signed_var': False, 'physical_range':
72  // '[0|1]', 'bit': 1, 'type': 'bool', 'order': 'motorola', 'physical_unit':
73  // ''}
74  void set_p_ignore_overrides(uint8_t* data, bool ignore_overrides);
75 
76  // config detail: {'name': 'ENABLE', 'offset': 0.0, 'precision': 1.0, 'len':
77  // 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 0, 'type':
78  // 'bool', 'order': 'motorola', 'physical_unit': ''}
79  void set_p_enable(uint8_t* data, bool enable);
80 
81  // config detail: {'name': 'CLEAR_OVERRIDE', 'offset': 0.0, 'precision': 1.0,
82  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 2,
83  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
84  void set_p_clear_override(uint8_t* data, bool clear_override);
85 
86  // config detail: {'name': 'WIPER_CMD', 'enum': {0: 'WIPER_CMD_WIPERS_OFF', 1:
87  // 'WIPER_CMD_INTERMITTENT_1', 2: 'WIPER_CMD_INTERMITTENT_2', 3:
88  // 'WIPER_CMD_INTERMITTENT_3', 4: 'WIPER_CMD_INTERMITTENT_4', 5:
89  // 'WIPER_CMD_INTERMITTENT_5', 6: 'WIPER_CMD_LOW', 7: 'WIPER_CMD_HIGH'},
90  // 'precision': 1.0, 'len': 8, 'is_signed_var': False, 'offset': 0.0,
91  // 'physical_range': '[0|7]', 'bit': 15, 'type': 'enum', 'order': 'motorola',
92  // 'physical_unit': ''}
93  void set_p_wiper_cmd(uint8_t* data, Wiper_cmd_134::Wiper_cmdType wiper_cmd);
94 
95  // config detail: {'name': 'CLEAR_FAULTS', 'offset': 0.0, 'precision': 1.0,
96  // 'len': 1, 'is_signed_var': False, 'physical_range': '[0|1]', 'bit': 3,
97  // 'type': 'bool', 'order': 'motorola', 'physical_unit': ''}
98  void set_p_clear_faults(uint8_t* data, bool clear_faults);
99 
100  private:
101  bool ignore_overrides_;
102  bool enable_;
103  bool clear_override_;
104  Wiper_cmd_134::Wiper_cmdType wiper_cmd_;
105  bool clear_faults_;
106 };
107 
108 } // namespace lexus
109 } // namespace canbus
110 } // namespace apollo
Wipercmd134 * set_enable(bool enable)
Wipercmd134 * set_clear_override(bool clear_override)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Wipercmd134 * set_clear_faults(bool clear_faults)
This is the base class of protocol data.
Definition: protocol_data.h:44
uint32_t GetPeriod() const override
Wipercmd134 * set_ignore_overrides(bool ignore_overrides)
Definition: wiper_cmd_134.h:26
static const int32_t ID
Definition: wiper_cmd_134.h:29
Wipercmd134 * set_wiper_cmd(Wiper_cmd_134::Wiper_cmdType wiper_cmd)
The class of ProtocolData.
void UpdateData(uint8_t *data) override