From 296775d23156ce553d9e95c19ff6421cc60c06d8 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Tue, 12 Mar 2024 17:48:58 -0400 Subject: [PATCH] M17 - Do not include Data Type Byte in PKT CRC; --- src/m17.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m17.c b/src/m17.c index 741df58..2e4754c 100644 --- a/src/m17.c +++ b/src/m17.c @@ -2527,7 +2527,7 @@ void encodeM17PKT(dsd_opts * opts, dsd_state * state) if (m17_p1_packed[x] == 0) break; //stop at the termination byte x++; } - crc_cmp = crc16m17(m17_p1_packed, x); + crc_cmp = crc16m17(m17_p1_packed+1, x-1); //debug dump CRC (when pad is literally zero) fprintf (stderr, " X: %d; LAST: %02X; TERM: %02X; CRC: %04X", x, m17_p1_packed[x-1], m17_p1_packed[x], crc_cmp); @@ -2823,7 +2823,7 @@ void processM17PKT(dsd_opts * opts, dsd_state * state) if (eot) { //do a CRC check - uint16_t crc_cmp = crc16m17(state->m17_pkt, total); + uint16_t crc_cmp = crc16m17(state->m17_pkt+1, total-1); uint16_t crc_ext = (state->m17_pkt[end-2] << 8) + state->m17_pkt[end-1]; if (crc_cmp == crc_ext)