From b42507f91d6dc298460af59ad436bd874decc513 Mon Sep 17 00:00:00 2001 From: Ben Zhou Date: Sat, 2 Nov 2024 00:59:15 +0000 Subject: [PATCH] Add unpacking case for datagram --- projects/bootloader/src/can_datagram.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/bootloader/src/can_datagram.c b/projects/bootloader/src/can_datagram.c index 1db27d5e..6a08ac44 100644 --- a/projects/bootloader/src/can_datagram.c +++ b/projects/bootloader/src/can_datagram.c @@ -70,10 +70,11 @@ BootloaderDatagram_t unpack_datagram(Boot_CanMessage *msg, uint16_t *target_node *target_nodes = msg->data_u16[0]; break; case CAN_ARBITRATION_PING: - - ret_datagram.payload.jump_app.node_ids = msg->data_u16[0]; - ret_datagram.payload. - break; + ret_datagram.payload.ping.node_ids = msg->data_u16[0]; + *target_nodes = msg->data_u16[0]; + ret_datagram.payload.ping.req = msg->data_u8[1]; + ret_datagram.payload.ping.data_len = ((uint32_t)msg->data_u16[2] << 16) | (uint32_t)msg->data_u16[1]; // Combine the two 16 bit values into a 32 bit value + break; default: break;