Skip to content

Commit

Permalink
Merge pull request #57 from westonrobot/enhancement-protocol_v2_encoder
Browse files Browse the repository at this point in the history
v2_parser: added encoding impl for motion mode state
  • Loading branch information
rdu-weston authored Aug 13, 2024
2 parents d05a912 + 70919d4 commit a537c14
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 a537c14

Please sign in to comment.