summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glucometerutils/support/lifescan_binary_protocol.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/glucometerutils/support/lifescan_binary_protocol.py b/glucometerutils/support/lifescan_binary_protocol.py
index 9bdb220..1771dcf 100644
--- a/glucometerutils/support/lifescan_binary_protocol.py
+++ b/glucometerutils/support/lifescan_binary_protocol.py
@@ -40,11 +40,11 @@ def LifeScanPacket(command_prefix, include_link_control):
construct.Struct(
construct.Const(b'\x02'), # stx
'length' / construct.Rebuild(
- construct.Byte, lambda ctx: len(ctx.message) + 7),
+ construct.Byte, lambda this: len(this.message) + 7),
'link_control' / link_control_construct,
'command_prefix' / command_prefix_construct,
'message' / construct.Bytes(
- length=lambda ctx: ctx.length - 7),
+ lambda this: len(this.message)),
construct.Const(b'\x03'), # etx
),
),