From 4bb2b588699d99c0c4ec2abb28f5a421a4629ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 8 Feb 2014 21:56:25 +0000 Subject: otultra2: avoid using connect/disconnect to wake up the device. It seems like the device is very sensible to the reset command. --- glucometerutils/drivers/otultra2.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/glucometerutils/drivers/otultra2.py b/glucometerutils/drivers/otultra2.py index 8f21ac2..f44450a 100644 --- a/glucometerutils/drivers/otultra2.py +++ b/glucometerutils/drivers/otultra2.py @@ -130,8 +130,7 @@ class Device(object): timeout=1, xonxoff=False, rtscts=False, dsrdtr=False, writeTimeout=None) def connect(self): - self.serial_.write(b'\x11\r') - self.serial_.flush() + return def disconnect(self): return @@ -142,7 +141,7 @@ class Device(object): Args: cmd: command and parameters to send (without newline) """ - cmdstring = bytes(cmd + '\r', 'ascii') + cmdstring = bytes('\x11\r' + cmd + '\r', 'ascii') self.serial_.write(cmdstring) self.serial_.flush() -- cgit v1.2.3