summaryrefslogtreecommitdiffstats
path: root/glucometerutils/support
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2018-11-16 00:16:24 +0100
committerDiego Elio Pettenò <flameeyes@flameeyes.eu>2018-11-16 00:16:24 +0100
commit9fb8076c5f19a71f911395ae2d6a76f2ee163841 (patch)
tree05f903c14da49a8a42dc64d5642ae9217912220f /glucometerutils/support
parenttest-requirements: add some minimum version specifications. (diff)
downloadglucometerutils-9fb8076c5f19a71f911395ae2d6a76f2ee163841.tar
glucometerutils-9fb8076c5f19a71f911395ae2d6a76f2ee163841.tar.gz
glucometerutils-9fb8076c5f19a71f911395ae2d6a76f2ee163841.tar.bz2
glucometerutils-9fb8076c5f19a71f911395ae2d6a76f2ee163841.tar.lz
glucometerutils-9fb8076c5f19a71f911395ae2d6a76f2ee163841.tar.xz
glucometerutils-9fb8076c5f19a71f911395ae2d6a76f2ee163841.tar.zst
glucometerutils-9fb8076c5f19a71f911395ae2d6a76f2ee163841.zip
Diffstat (limited to 'glucometerutils/support')
-rw-r--r--glucometerutils/support/lifescan_binary_protocol.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/glucometerutils/support/lifescan_binary_protocol.py b/glucometerutils/support/lifescan_binary_protocol.py
index 4632a94..610b5ea 100644
--- a/glucometerutils/support/lifescan_binary_protocol.py
+++ b/glucometerutils/support/lifescan_binary_protocol.py
@@ -27,24 +27,21 @@ _LINK_CONTROL = construct.BitStruct(
'sequence_number' / construct.Default(construct.Flag, False),
)
-def LifeScanPacket(command_prefix, include_link_control):
+def LifeScanPacket(include_link_control):
if include_link_control:
link_control_construct = _LINK_CONTROL
else:
link_control_construct = construct.Const(b'\x00')
- command_prefix_construct = construct.Const(command_prefix, construct.Byte)
-
return construct.Struct(
'data' / construct.RawCopy(
construct.Struct(
construct.Const(b'\x02'), # stx
'length' / construct.Rebuild(
- construct.Byte, lambda this: len(this.message) + 7),
+ construct.Byte, lambda this: len(this.message) + 6),
'link_control' / link_control_construct,
- 'command_prefix' / command_prefix_construct,
'message' / construct.Bytes(
- lambda this: this.length - 7),
+ lambda this: this.length - 6),
construct.Const(b'\x03'), # etx
),
),
@@ -52,8 +49,6 @@ def LifeScanPacket(command_prefix, include_link_control):
construct.Int16ul, lifescan.crc_ccitt, construct.this.data.data),
)
-COMMAND_SUCCESS = construct.Const(b'\x06')
-
VERIO_TIMESTAMP = construct_extras.Timestamp(
construct.Int32ul, epoch=946684800) # 2000-01-01 (not 2010)