From d7518b79f5e9dd1fd504be0a6a6cba42c5f73700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Mon, 8 Feb 2016 22:24:37 +0000 Subject: Implement a basic driver for the FreeStyle Optium devices. This driver supports dumping of (glucose) readings and reading/setting the clock. --- glucometerutils/drivers/freestyle_optium.py | 249 ++++++++++++++++++++++++++++ glucometerutils/exceptions.py | 7 + 2 files changed, 256 insertions(+) create mode 100644 glucometerutils/drivers/freestyle_optium.py diff --git a/glucometerutils/drivers/freestyle_optium.py b/glucometerutils/drivers/freestyle_optium.py new file mode 100644 index 0000000..0be4995 --- /dev/null +++ b/glucometerutils/drivers/freestyle_optium.py @@ -0,0 +1,249 @@ +# -*- coding: utf-8 -*- +"""Driver for FreeStyle Optium devices""" + +__author__ = 'Diego Elio Pettenò' +__email__ = 'flameeyes@flameeyes.eu' +__copyright__ = 'Copyright © 2016, Diego Elio Pettenò' +__license__ = 'MIT' + +import datetime +import re +import sys + +import serial + +from glucometerutils import common +from glucometerutils import exceptions + +_CLOCK_RE = re.compile( + r'^Clock:\t(?P[A-Z][a-z]{2}) (?P[0-9]{2}) (?P[0-9]{4})\t' + r'(?P