From 4a4f45c3f6a90990f6da792b8f181442b2eacc39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sat, 27 Mar 2021 18:02:04 +0000 Subject: serial meters support: allow selection of parity mode. While uncommon there are glucometers that don't use the default parity mode of "none". Allow the drivers to override this. --- glucometerutils/support/serial.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glucometerutils/support/serial.py b/glucometerutils/support/serial.py index a9b4b85..68132e1 100644 --- a/glucometerutils/support/serial.py +++ b/glucometerutils/support/serial.py @@ -40,6 +40,7 @@ class SerialDevice: """ BAUDRATE: Optional[int] = None + PARITY: str = serial.PARITY_NONE DEFAULT_CABLE_ID: Optional[str] = None TIMEOUT: float = 1 @@ -62,7 +63,7 @@ class SerialDevice: timeout=self.TIMEOUT, writeTimeout=None, bytesize=serial.EIGHTBITS, - parity=serial.PARITY_NONE, + parity=self.PARITY, stopbits=serial.STOPBITS_ONE, xonxoff=False, rtscts=False, -- cgit v1.2.3