Skip to content

Commit

Permalink
Fix handling consecutive messages in recvBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jrgriffin94 committed Jul 17, 2024
1 parent b163faf commit 3d510fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zcm/transport/cobs_serial/generic_serial_cobs_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ static size_t cobs_decode_zcm(uint8_t* dest, circBuffer_t* src, size_t length)
}

block = code = byte;
if (code == 0x00) break;
}

byte = cb_front(src, bytesRead++);
Expand Down Expand Up @@ -233,7 +234,7 @@ int serial_cobs_recvmsg(zcm_trans_cobs_serial_t* zt, zcm_msg_t* msg,

// Calculate Fletcher-16 checksum for entire payload (including checkbytes)
uint16_t checksum = 0;
checksum = fletcher16(zt->recvMsgData, bytesDecoded - 1);
checksum = fletcher16(zt->recvMsgData, bytesDecoded);
if (checksum != 0x0000) return ZCM_EINVALID;

// Copy channel name
Expand Down

0 comments on commit 3d510fa

Please sign in to comment.