From 058ddbfe4f860ba0bd5294f996dce0d53290995a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sun, 7 Jan 2018 14:25:56 +0000 Subject: otverioiq: fix definition of the reading response, fix get_reading_count method. --- glucometerutils/drivers/otverioiq.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/glucometerutils/drivers/otverioiq.py b/glucometerutils/drivers/otverioiq.py index 0eb94b4..d239cff 100644 --- a/glucometerutils/drivers/otverioiq.py +++ b/glucometerutils/drivers/otverioiq.py @@ -88,10 +88,9 @@ _MEAL_FLAG = { _READING_RESPONSE = construct.Struct( lifescan_binary_protocol.COMMAND_SUCCESS, - 'timestamp' / construct_extras.Timestamp(construct.Int32ul), - 'value' / construct.Int32ul, + 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, + 'value' / construct.Int16ul, 'control_test' / construct.Flag, - construct.Padding(1), # unknown 'meal' / construct.SymmetricMapping( construct.Byte, _MEAL_FLAG), construct.Padding(2), # unknown @@ -190,8 +189,7 @@ class Device(serial.SerialDevice): def _get_reading_count(self): response = self._send_request( - _READ_RECORD_REQUEST, {'record_id': _INVALID_RECORD}, - _READING_COUNT_RESPONSE) + _READ_RECORD_COUNT_REQUEST, None, _READ_RECORD_COUNT_RESPONSE) return response.count def _get_reading(self, record_id): -- cgit v1.2.3