summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glucometerutils/drivers/sdcodefree.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/glucometerutils/drivers/sdcodefree.py b/glucometerutils/drivers/sdcodefree.py
index 5bc76fb..ac3e228 100644
--- a/glucometerutils/drivers/sdcodefree.py
+++ b/glucometerutils/drivers/sdcodefree.py
@@ -45,8 +45,8 @@ _PACKET = construct.Struct(
construct.Byte,
{e: e.value for e in Direction}),
'length' / construct.Rebuild(
- construct.Byte, lambda ctx: len(ctx.message) + 2),
- 'message' / construct.Bytes(length=lambda ctx: ctx.length - 2),
+ construct.Byte, lambda this: len(this.message) + 2),
+ 'message' / construct.Bytes(lambda this: len(this.message)),
'checksum' / construct.Checksum(
construct.Byte, xor_checksum, construct.this.message),
'etx' / construct.Const(0xAA, construct.Byte)