diff --git a/decocare/history.py b/decocare/history.py index 0f01626..895065d 100644 --- a/decocare/history.py +++ b/decocare/history.py @@ -270,6 +270,12 @@ class Ian69(KnownRecord): class Ian50(KnownRecord): opcode = 0x50 body_length = 34 + + # XXX: tghoward testing on 723 at length 30 + body_length = 30 + def __init__ (self, head, model, **kwds): + super(Ian50, self).__init__(head, model, **kwds) + self.body_length = model.Ian50Body _confirmed.append(Ian50) class Ian54(KnownRecord): @@ -699,7 +705,10 @@ def __init__(self, head, larger=False): def decode (self): self.parse_time( ) mid = unmask_m_midnight(self.date)[0:3] - return (dict(valid_date=date(*mid).isoformat())) + try: + return (dict(valid_date=date(*mid).isoformat())) + except ValueError, e: + return (dict(error_date=mid, error=str(e))) _confirmed.append(Sara6E) diff --git a/decocare/models/__init__.py b/decocare/models/__init__.py index b400e30..4d4518f 100644 --- a/decocare/models/__init__.py +++ b/decocare/models/__init__.py @@ -79,6 +79,7 @@ class PumpModel (object): basal_strokes = 40 MMOL_DEFAULT = False larger = False + Ian50Body = 30 def __init__(self, model, session): self.model = model self.session = session @@ -254,9 +255,11 @@ class Model723 (Model523): pass class Model530 (Model523): + Ian50Body = 34 pass class Model730 (Model530): + Ian50Body = 34 pass class Model540 (Model530): diff --git a/decocare/stick.py b/decocare/stick.py index 9edbdc1..d12731a 100755 --- a/decocare/stick.py +++ b/decocare/stick.py @@ -13,6 +13,11 @@ Consumes a :ref:`link`, which allows us to debug everything on the wire. +This module contains a class for each logical operation available in +the stick's firmware. Each operation is sent has a string of bytes +over the serial/usb interface, and then a response with a particular +format can be read. + """ log = logging.getLogger( ).getChild(__name__) @@ -36,7 +41,7 @@ class StickCommand(object): allows you to send recieve commands to the pump, by formatting your message into payloads with opcodes, and then letting the stick work on what you've given it. It's kind of like a modem with this funky - binary interface. + binary interface and 64 byte payloads. """ code = [ 0x00 ] label = 'example stick command' diff --git a/logs/2016-01-09/ReadHistoryData-page-0.data b/logs/2016-01-09/ReadHistoryData-page-0.data new file mode 100644 index 0000000..c4dd3da Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-0.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-10.data b/logs/2016-01-09/ReadHistoryData-page-10.data new file mode 100644 index 0000000..0349ec1 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-10.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-11.data b/logs/2016-01-09/ReadHistoryData-page-11.data new file mode 100644 index 0000000..efe9b1a Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-11.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-12.data b/logs/2016-01-09/ReadHistoryData-page-12.data new file mode 100644 index 0000000..a968463 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-12.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-13.data b/logs/2016-01-09/ReadHistoryData-page-13.data new file mode 100644 index 0000000..8ba5ea1 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-13.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-14.data b/logs/2016-01-09/ReadHistoryData-page-14.data new file mode 100644 index 0000000..eb97ff5 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-14.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-15.data b/logs/2016-01-09/ReadHistoryData-page-15.data new file mode 100644 index 0000000..a995d94 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-15.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-16.data b/logs/2016-01-09/ReadHistoryData-page-16.data new file mode 100644 index 0000000..ea4e7f6 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-16.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-17.data b/logs/2016-01-09/ReadHistoryData-page-17.data new file mode 100644 index 0000000..830b9ae Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-17.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-18.data b/logs/2016-01-09/ReadHistoryData-page-18.data new file mode 100644 index 0000000..059b8e2 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-18.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-19.data b/logs/2016-01-09/ReadHistoryData-page-19.data new file mode 100644 index 0000000..92e835b Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-19.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-20.data b/logs/2016-01-09/ReadHistoryData-page-20.data new file mode 100644 index 0000000..043c43c Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-20.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-21.data b/logs/2016-01-09/ReadHistoryData-page-21.data new file mode 100644 index 0000000..d2f88ef Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-21.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-22.data b/logs/2016-01-09/ReadHistoryData-page-22.data new file mode 100644 index 0000000..6fb963b Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-22.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-23.data b/logs/2016-01-09/ReadHistoryData-page-23.data new file mode 100644 index 0000000..985d355 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-23.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-24.data b/logs/2016-01-09/ReadHistoryData-page-24.data new file mode 100644 index 0000000..332dac0 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-24.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-25.data b/logs/2016-01-09/ReadHistoryData-page-25.data new file mode 100644 index 0000000..33a445f Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-25.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-26.data b/logs/2016-01-09/ReadHistoryData-page-26.data new file mode 100644 index 0000000..c4170df Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-26.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-27.data b/logs/2016-01-09/ReadHistoryData-page-27.data new file mode 100644 index 0000000..acee5de Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-27.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-28.data b/logs/2016-01-09/ReadHistoryData-page-28.data new file mode 100644 index 0000000..ebfd566 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-28.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-29.data b/logs/2016-01-09/ReadHistoryData-page-29.data new file mode 100644 index 0000000..a7abb80 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-29.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-30.data b/logs/2016-01-09/ReadHistoryData-page-30.data new file mode 100644 index 0000000..ec416f6 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-30.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-31.data b/logs/2016-01-09/ReadHistoryData-page-31.data new file mode 100644 index 0000000..a39b25a Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-31.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-32.data b/logs/2016-01-09/ReadHistoryData-page-32.data new file mode 100644 index 0000000..be9f6c0 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-32.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-33.data b/logs/2016-01-09/ReadHistoryData-page-33.data new file mode 100644 index 0000000..78a81e6 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-33.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-34.data b/logs/2016-01-09/ReadHistoryData-page-34.data new file mode 100644 index 0000000..6bd3f13 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-34.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-35.data b/logs/2016-01-09/ReadHistoryData-page-35.data new file mode 100644 index 0000000..fa40d65 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-35.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-36.data b/logs/2016-01-09/ReadHistoryData-page-36.data new file mode 100644 index 0000000..9bf3397 --- /dev/null +++ b/logs/2016-01-09/ReadHistoryData-page-36.data @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logs/2016-01-09/ReadHistoryData-page-37.data b/logs/2016-01-09/ReadHistoryData-page-37.data new file mode 100644 index 0000000..9bf3397 --- /dev/null +++ b/logs/2016-01-09/ReadHistoryData-page-37.data @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/logs/2016-01-09/ReadHistoryData-page-7.data b/logs/2016-01-09/ReadHistoryData-page-7.data new file mode 100644 index 0000000..806f3e9 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-7.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-8.data b/logs/2016-01-09/ReadHistoryData-page-8.data new file mode 100644 index 0000000..0dd4d31 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-8.data differ diff --git a/logs/2016-01-09/ReadHistoryData-page-9.data b/logs/2016-01-09/ReadHistoryData-page-9.data new file mode 100644 index 0000000..ada0d08 Binary files /dev/null and b/logs/2016-01-09/ReadHistoryData-page-9.data differ