summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArkadiusz Bulski <arek.bulski@gmail.com>2018-03-07 02:09:20 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2018-03-17 14:41:40 +0100
commit8fe51bcb2d208654aefba38004aaa105a6e8339a (patch)
tree448df11405742913eff58efa335a50a933222026
parentCString supports UTF-16/32-LE/BE (diff)
downloadglucometerutils-8fe51bcb2d208654aefba38004aaa105a6e8339a.tar
glucometerutils-8fe51bcb2d208654aefba38004aaa105a6e8339a.tar.gz
glucometerutils-8fe51bcb2d208654aefba38004aaa105a6e8339a.tar.bz2
glucometerutils-8fe51bcb2d208654aefba38004aaa105a6e8339a.tar.lz
glucometerutils-8fe51bcb2d208654aefba38004aaa105a6e8339a.tar.xz
glucometerutils-8fe51bcb2d208654aefba38004aaa105a6e8339a.tar.zst
glucometerutils-8fe51bcb2d208654aefba38004aaa105a6e8339a.zip
-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)