summaryrefslogtreecommitdiffstats
path: root/glucometerutils/support
diff options
context:
space:
mode:
authorArkadiusz Bulski <arek.bulski@gmail.com>2018-02-16 08:51:39 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2018-03-17 14:41:40 +0100
commit9d3e0ee1fb2dd2db8d838723316c8329d049b51d (patch)
tree7e9fc06d9b8d480188bb867dc98c4119760e4d6d /glucometerutils/support
parentconstruct-code is (almost) uptodate (diff)
downloadglucometerutils-9d3e0ee1fb2dd2db8d838723316c8329d049b51d.tar
glucometerutils-9d3e0ee1fb2dd2db8d838723316c8329d049b51d.tar.gz
glucometerutils-9d3e0ee1fb2dd2db8d838723316c8329d049b51d.tar.bz2
glucometerutils-9d3e0ee1fb2dd2db8d838723316c8329d049b51d.tar.lz
glucometerutils-9d3e0ee1fb2dd2db8d838723316c8329d049b51d.tar.xz
glucometerutils-9d3e0ee1fb2dd2db8d838723316c8329d049b51d.tar.zst
glucometerutils-9d3e0ee1fb2dd2db8d838723316c8329d049b51d.zip
Diffstat (limited to 'glucometerutils/support')
-rw-r--r--glucometerutils/support/lifescan_binary_protocol.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/glucometerutils/support/lifescan_binary_protocol.py b/glucometerutils/support/lifescan_binary_protocol.py
index 6579ab0..22e96d9 100644
--- a/glucometerutils/support/lifescan_binary_protocol.py
+++ b/glucometerutils/support/lifescan_binary_protocol.py
@@ -36,8 +36,7 @@ def LifeScanPacket(command_prefix, include_link_control):
command_prefix_construct = construct.Const(command_prefix, construct.Byte)
return construct.Struct(
- construct.RawCopy(
- construct.Embedded(
+ 'data' / construct.RawCopy(
construct.Struct(
construct.Const(b'\x02'), # stx
'length' / construct.Rebuild(
@@ -48,10 +47,9 @@ def LifeScanPacket(command_prefix, include_link_control):
length=lambda ctx: ctx.length - 7),
construct.Const(b'\x03'), # etx
),
- ),
),
'checksum' / construct.Checksum(
- construct.Int16ul, lifescan.crc_ccitt, construct.this.data),
+ construct.Int16ul, lifescan.crc_ccitt, construct.this.data.data),
)
COMMAND_SUCCESS = construct.Const(b'\x06')