From 45f68d03bceedbb23c64e7c4457297ceb09b61d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 17 Mar 2018 13:49:27 +0000 Subject: freestyle support: add debug logging of commands sent and received. --- glucometerutils/support/freestyle.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py index 9b7d72e..7f9c7e8 100644 --- a/glucometerutils/support/freestyle.py +++ b/glucometerutils/support/freestyle.py @@ -103,12 +103,16 @@ class FreeStyleHidDevice(hiddevice.HidDevice): usb_packet = _FREESTYLE_MESSAGE.build( {'message_type': message_type, 'command': command}) + logging.debug('Sending packet: %r', usb_packet) + self._write(usb_packet) def _read_response(self): """Read the response from the device and extracts it.""" usb_packet = self._read() + logging.debug('Read packet: %r', usb_packet) + assert usb_packet message_type = usb_packet[0] message_length = usb_packet[1] -- cgit v1.2.3