diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-01-07 00:53:28 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-01-07 00:53:28 +0100 |
commit | 34b8153d2612b6450650230b596ee51cac82c4de (patch) | |
tree | e0bbc99e451406f163e896363cec66dd7d6050f3 /glucometerutils/drivers/otverioiq.py | |
parent | otverioiq: update version and serial number requests. (diff) | |
download | glucometerutils-34b8153d2612b6450650230b596ee51cac82c4de.tar glucometerutils-34b8153d2612b6450650230b596ee51cac82c4de.tar.gz glucometerutils-34b8153d2612b6450650230b596ee51cac82c4de.tar.bz2 glucometerutils-34b8153d2612b6450650230b596ee51cac82c4de.tar.lz glucometerutils-34b8153d2612b6450650230b596ee51cac82c4de.tar.xz glucometerutils-34b8153d2612b6450650230b596ee51cac82c4de.tar.zst glucometerutils-34b8153d2612b6450650230b596ee51cac82c4de.zip |
Diffstat (limited to 'glucometerutils/drivers/otverioiq.py')
-rw-r--r-- | glucometerutils/drivers/otverioiq.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/glucometerutils/drivers/otverioiq.py b/glucometerutils/drivers/otverioiq.py index 96b9c93..462832d 100644 --- a/glucometerutils/drivers/otverioiq.py +++ b/glucometerutils/drivers/otverioiq.py @@ -27,12 +27,10 @@ from glucometerutils.support import serial _PACKET = lifescan_binary_protocol.LifeScanPacket( 0x03, True) -_COMMAND_SUCCESS = construct.Const(b'\x06') - _VERSION_REQUEST = construct.Const(b'\x0d\x01') _VERSION_RESPONSE = construct.Struct( - _COMMAND_SUCCESS, + lifescan_binary_protocol.COMMAND_SUCCESS, 'version' / construct.PascalString(construct.Byte, encoding='ascii'), # NULL-termination is not included in string length. construct.Constant('\x00'), @@ -42,14 +40,14 @@ _SERIAL_NUMBER_REQUEST = construct.Const( b'\x0b\x01\x02') _SERIAL_NUMBER_RESPONSE = construct.Struct( - _COMMAND_SUCCESS, + lifescan_binary_protocol.COMMAND_SUCCESS, 'serial_number' / construct.CString(encoding='ascii'), ) _READ_RTC_REQUEST = construct.Const(b'\x20\x02') _READ_RTC_RESPONSE = construct.Struct( - _COMMAND_SUCCESS, + lifescan_binary_protocol.COMMAND_SUCCESS, 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, ) @@ -63,7 +61,7 @@ _GLUCOSE_UNIT_REQUEST = construct.Const( _GLUCOSE_UNIT_RESPONSE = construct.Struct( - _COMMAND_SUCCESS, + lifescan_binary_protocol.COMMAND_SUCCESS, 'unit' / lifescan_binary_protocol.GLUCOSE_UNIT, construct.Padding(3), ) @@ -73,7 +71,7 @@ _MEMORY_ERASE_REQUEST = construct.Const(b'\x1a') # Untested _READ_RECORD_COUNT_REQUEST = construct.Const(b'\x27\x00') _READ_RECORD_COUNT_RESPONSE = construct.Struct( - _COMMAND_SUCCESS, + lifescan_binary_protocol.COMMAND_SUCCESS, 'count' / construct.Int16ul, ) @@ -83,7 +81,7 @@ _READ_RECORD_REQUEST = construct.Struct( ) _READING_RESPONSE = construct.Struct( - _COMMAND_SUCCESS, + lifescan_binary_protocol.COMMAND_SUCCESS, 'timestamp' / construct_extras.Timestamp(construct.Int32ul), 'value' / construct.Int32ul, 'control' / construct.Byte, # Unknown value @@ -172,7 +170,9 @@ class Device(serial.SerialDevice): return response.timestamp def zero_log(self): - self._send_request(_MEMORY_ERASE_REQUEST, None, _COMMAND_SUCCESS) + self._send_request( + _MEMORY_ERASE_REQUEST, None, + lifescan_binary_protocol.COMMAND_SUCCESS) def get_glucose_unit(self): response = self._send_request( |