diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-03-17 14:38:14 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.eu> | 2018-03-17 14:41:48 +0100 |
commit | 8cc54e346a649effe117f8b684a6b9a5693eed1e (patch) | |
tree | 4587265e4d80951a9d1b1f0af71410fe933362a7 | |
parent | Update lifescan_binary_protocol.py (diff) | |
download | glucometerutils-8cc54e346a649effe117f8b684a6b9a5693eed1e.tar glucometerutils-8cc54e346a649effe117f8b684a6b9a5693eed1e.tar.gz glucometerutils-8cc54e346a649effe117f8b684a6b9a5693eed1e.tar.bz2 glucometerutils-8cc54e346a649effe117f8b684a6b9a5693eed1e.tar.lz glucometerutils-8cc54e346a649effe117f8b684a6b9a5693eed1e.tar.xz glucometerutils-8cc54e346a649effe117f8b684a6b9a5693eed1e.tar.zst glucometerutils-8cc54e346a649effe117f8b684a6b9a5693eed1e.zip |
Diffstat (limited to '')
-rw-r--r-- | glucometerutils/drivers/fsoptium.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/glucometerutils/drivers/fsoptium.py b/glucometerutils/drivers/fsoptium.py index 5c57ae3..1e1a319 100644 --- a/glucometerutils/drivers/fsoptium.py +++ b/glucometerutils/drivers/fsoptium.py @@ -90,11 +90,15 @@ class Device(serial.SerialDevice): def _send_command(self, command): cmd_bytes = bytes('$%s\r\n' % command, 'ascii') + logging.debug('Sending command: %r', cmd_bytes) + self.serial_.write(cmd_bytes) self.serial_.flush() response = self.serial_.readlines() + logging.debug('Received response: %r', response) + # We always want to decode the output, and remove stray \r\n. Any failure in # decoding means the output is invalid anyway. decoded_response = [line.decode('ascii').rstrip('\r\n') |