From f956feec452cd7c2a3287740173fd20414fe9ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 24 Jul 2018 22:16:28 +0100 Subject: Fix sdcodefree driver, the same as the lifescan changes. Thanks to Noel Cragg for reporting this. --- glucometerutils/drivers/sdcodefree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glucometerutils/drivers/sdcodefree.py b/glucometerutils/drivers/sdcodefree.py index ac3e228..4636d2a 100644 --- a/glucometerutils/drivers/sdcodefree.py +++ b/glucometerutils/drivers/sdcodefree.py @@ -46,7 +46,7 @@ _PACKET = construct.Struct( {e: e.value for e in Direction}), 'length' / construct.Rebuild( construct.Byte, lambda this: len(this.message) + 2), - 'message' / construct.Bytes(lambda this: len(this.message)), + 'message' / construct.Bytes(lambda this: this.length - 2), 'checksum' / construct.Checksum( construct.Byte, xor_checksum, construct.this.message), 'etx' / construct.Const(0xAA, construct.Byte) -- cgit v1.2.3