25using ::apollo::drivers::canbus::Byte;
34 static const uint32_t PERIOD = 20 * 1000;
39 Demo* chassis)
const {
40 chassis->mutable_vehicle_mode_command_105()->set_heartbeat_105(
41 heartbeat_105(bytes, length));
42 chassis->mutable_vehicle_mode_command_105()->set_checksum_105(
43 checksum_105(bytes, length));
44 chassis->mutable_vehicle_mode_command_105()->set_turn_light_ctrl(
45 turn_light_ctrl(bytes, length));
46 chassis->mutable_vehicle_mode_command_105()->set_vin_req(
47 vin_req(bytes, length));
48 chassis->mutable_vehicle_mode_command_105()->set_drive_mode_ctrl(
49 drive_mode_ctrl(bytes, length));
50 chassis->mutable_vehicle_mode_command_105()->set_steer_mode_ctrl(
51 steer_mode_ctrl(bytes, length));
57 heartbeat_105_ = (heartbeat_105_) % 16;
58 set_p_heartbeat_105(data, heartbeat_105_);
60 data[0] ^ data[1] ^ data[2] ^ data[3] ^ data[4] ^ data[5] ^ data[6];
61 set_p_checksum_105(data, checksum_105_);
65 set_p_turn_light_ctrl(data, turn_light_ctrl_);
66 set_p_vin_req(data, vin_req_);
67 set_p_drive_mode_ctrl(data, drive_mode_ctrl_);
68 set_p_steer_mode_ctrl(data, steer_mode_ctrl_);
84 heartbeat_105_ = heartbeat_105;
91void Vehiclemodecommand105::set_p_heartbeat_105(uint8_t* data,
93 heartbeat_105 = ProtocolData::BoundedValue(0, 15, heartbeat_105);
94 int x = heartbeat_105;
96 Byte to_set(data + 0);
97 to_set.set_value(x, 4, 4);
102 checksum_105_ = checksum_105;
109void Vehiclemodecommand105::set_p_checksum_105(uint8_t* data,
111 checksum_105 = ProtocolData::BoundedValue(0, 255, checksum_105);
112 int x = checksum_105;
114 Byte to_set(data + 7);
115 to_set.set_value(x, 0, 8);
120 turn_light_ctrl_ = turn_light_ctrl;
130void Vehiclemodecommand105::set_p_turn_light_ctrl(
133 int x = turn_light_ctrl;
135 Byte to_set(data + 2);
136 to_set.set_value(x, 0, 2);
149void Vehiclemodecommand105::set_p_vin_req(
153 Byte to_set(data + 3);
154 to_set.set_value(x, 0, 1);
159 drive_mode_ctrl_ = drive_mode_ctrl;
168void Vehiclemodecommand105::set_p_drive_mode_ctrl(
171 int x = drive_mode_ctrl;
173 Byte to_set(data + 1);
174 to_set.set_value(x, 0, 3);
179 steer_mode_ctrl_ = steer_mode_ctrl;
189void Vehiclemodecommand105::set_p_steer_mode_ctrl(
192 int x = steer_mode_ctrl;
194 Byte to_set(data + 0);
195 to_set.set_value(x, 0, 3);
198int Vehiclemodecommand105::heartbeat_105(
const std::uint8_t* bytes,
199 int32_t length)
const {
201 int32_t x = t0.get_byte(4, 4);
207int Vehiclemodecommand105::checksum_105(
const std::uint8_t* bytes,
208 int32_t length)
const {
210 int32_t x = t0.get_byte(0, 8);
217Vehiclemodecommand105::turn_light_ctrl(
const std::uint8_t* bytes,
218 int32_t length)
const {
220 int32_t x = t0.get_byte(0, 2);
228 const std::uint8_t* bytes, int32_t length)
const {
230 int32_t x = t0.get_byte(0, 1);
238Vehiclemodecommand105::drive_mode_ctrl(
const std::uint8_t* bytes,
239 int32_t length)
const {
241 int32_t x = t0.get_byte(0, 3);
249Vehiclemodecommand105::steer_mode_ctrl(
const std::uint8_t* bytes,
250 int32_t length)
const {
252 int32_t x = t0.get_byte(0, 3);
Vehiclemodecommand105 * set_heartbeat_105(int heartbeat_105)
Vehiclemodecommand105 * set_vin_req(Vehicle_mode_command_105::Vin_reqType vin_req)
void UpdateData(uint8_t *data) override
Vehiclemodecommand105 * set_steer_mode_ctrl(Vehicle_mode_command_105::Steer_mode_ctrlType steer_mode_ctrl)
Vehiclemodecommand105 * set_turn_light_ctrl(Vehicle_mode_command_105::Turn_light_ctrlType turn_light_ctrl)
Vehiclemodecommand105 * set_checksum_105(int checksum_105)
void Parse(const std::uint8_t *bytes, int32_t length, Demo *chassis) const override
void UpdateData_Heartbeat(uint8_t *data) override
Vehiclemodecommand105 * set_drive_mode_ctrl(Vehicle_mode_command_105::Drive_mode_ctrlType drive_mode_ctrl)
uint32_t GetPeriod() const override
@ DRIVE_MODE_CTRL_THROTTLE_PADDLE_DRIVE
@ STEER_MODE_CTRL_STANDARD_STEER
@ TURN_LIGHT_CTRL_TURNLAMP_OFF
@ VIN_REQ_VIN_REQ_DISABLE