# -*- coding: utf-8 -*- """Driver for FreeStyle Optium devices. Supported features: - get readings (ignores ketone results); - use the glucose unit preset on the device by default; - get and set date and time; - get serial number and software version. Expected device path: /dev/ttyUSB0 or similar serial port device. Further information on the device protocol can be found at https://flameeyes.github.io/glucometer-protocols/abbott/freestyle-optium """ __author__ = 'Diego Elio Pettenò' __email__ = 'flameeyes@flameeyes.eu' __copyright__ = 'Copyright © 2016-2017, Diego Elio Pettenò' __license__ = 'MIT' import datetime import logging import re from glucometerutils import common from glucometerutils import exceptions from glucomterutils.support import serial _CLOCK_RE = re.compile( r'^Clock:\t(?P[A-Z][a-z]{2}) (?P[0-9]{2}) (?P[0-9]{4})\t' r'(?P