Skip to content

Commit

Permalink
v2_parser: added encoding impl for motion mode state
Browse files Browse the repository at this point in the history
  • Loading branch information
rdu-weston committed Aug 13, 2024
1 parent d05a912 commit 70919d4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/protocol_v2/agilex_msg_parser_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,15 @@ bool EncodeCanFrameV2(const AgxMessage *msg, struct can_frame *tx_frame) {
memcpy(tx_frame->data, (uint8_t *)(&frame), tx_frame->can_dlc);
break;
}
case AgxMsgMotionModeState: {
tx_frame->can_id = CAN_MSG_CURRENT_CTRL_MODE;
tx_frame->can_dlc = 2;
MotionModeStateFrame frame;
frame.motion_mode = msg->body.motion_mode_state_msg.motion_mode;
frame.mode_changing = msg->body.motion_mode_state_msg.mode_changing;
memcpy(tx_frame->data, (uint8_t *)(&frame), tx_frame->can_dlc);
break;
}
case AgxMsgLightState: {
tx_frame->can_id = CAN_MSG_LIGHT_STATE_ID;
tx_frame->can_dlc = 8;
Expand Down

0 comments on commit 70919d4

Please sign in to comment.