From ec501f9e4044989ca75e2cd5d77d52e6829ff4b1 Mon Sep 17 00:00:00 2001 From: Jason Mobarak Date: Tue, 12 Oct 2021 12:51:53 -0700 Subject: [PATCH] fix crc calculation bug [DEVINFRA-568] --- python/sbp/msg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sbp/msg.py b/python/sbp/msg.py index fcf3215cd8..32557ad801 100755 --- a/python/sbp/msg.py +++ b/python/sbp/msg.py @@ -131,7 +131,7 @@ def _get_framed(self, buf, offset, insert_payload): crc_offset = header_offset + self.length preamble_bytes = 1 crc_over_len = _HEADER_LEN + self.length - preamble_bytes - self.crc = crc16(buf[1:1+crc_over_len]) + self.crc = crc16(buf[1+offset:1+offset+crc_over_len]) _CRC_PARSER.pack_into(buf, crc_offset, self.crc) length = preamble_bytes + crc_over_len + _CRC_LEN return length