History

history Module

This module provides some basic helper/formatting utilities, specifically targeted at decoding ReadHistoryData data.

class decocare.history.BasalProfileStart(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 3
decode()[source]
opcode = 123
class decocare.history.Battery(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 26
class decocare.history.BigBolusWizardChange(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 143
opcode = 90
class decocare.history.ChangeBasalProfile_new_profile(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 145
decode()[source]
opcode = 9
class decocare.history.ChangeBasalProfile_old_profile(head, larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 145
decode()[source]
opcode = 8
class decocare.history.ChangeRemoteID(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 39
class decocare.history.ChangeTime(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 23
class decocare.history.ChangeTimeDisplay(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 100
class decocare.history.ChangeUtility(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 99
class decocare.history.ClearAlarm(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 12
class decocare.history.EnableDisableRemote(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 14
opcode = 38
class decocare.history.HistoryPage(raw)[source]

Bases: decocare.history.PagedData

clean(data)[source]
decode(larger=False)[source]
class decocare.history.Ian0B(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

head_length = 3
opcode = 11
class decocare.history.Ian3F(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 3
opcode = 63
class decocare.history.Ian50(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 34
opcode = 80
class decocare.history.Ian54(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 57
opcode = 84
class decocare.history.Ian69(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 2
opcode = 105
class decocare.history.IanA8(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

head_length = 10
opcode = 168
class decocare.history.LowBattery(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 25
class decocare.history.LowReservoir(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

>>> rec = LowReservoir( LowReservoir._test_1[:2] )
>>> decoded = rec.parse(LowReservoir._test_1)
>>> print str(rec)
LowReservoir 2012-12-07T11:02:43 head[2], body[0] op[0x34]
>>> print pformat(decoded)
{'amount': 20.0}
decode()[source]
opcode = 52
class decocare.history.MResultTotals(head, larger=False)[source]

Bases: decocare.records.base.InvalidRecord

On 722 this seems like two records.

date_length = 2
date_str()[source]
head_length = 5
opcode = 7
parse_time()[source]
class decocare.history.Model522ResultTotals(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 40
date_length = 2
date_str()[source]
head_length = 1
opcode = 109
parse_time()[source]
class decocare.history.NewTimeSet(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 24
class decocare.history.NoDelivery(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

head_length = 4
opcode = 6
class decocare.history.OldBolusWizardChange(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 117
opcode = 90
class decocare.history.PagedData(raw)[source]

Bases: object

PagedData - context for parsing a page of cgm data.

clean(data)[source]
eat_nulls(data)[source]
class decocare.history.PumpResume(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 31
class decocare.history.PumpSuspend(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 30
class decocare.history.Rewind(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 33
class decocare.history.Sara6E(head, larger=False)[source]

Bases: decocare.history.Model522ResultTotals

Seems specific to 722?

body_length = 48
opcode = 110
class decocare.history.SelectBasalProfile(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

opcode = 20
class decocare.history.TempBasal(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

body_length = 1
decode()[source]
opcode = 51
class decocare.history.TempBasalDuration(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.KnownRecord

decode()[source]
opcode = 22
decocare.history.decode_remote_id(msg)[source]

practice decoding some remote ids:

0x27
0x01 0xe2 0x40
0x03 0x42 0x2a
0x28 0x0c 0x89
0x92 0x00 0x00 0x00
>>> decode_remote_id(_remote_ids[0])
'123456'
>>> decode_remote_id(_remote_ids[1])
'213546'
>>> decode_remote_id(_remote_ids[2])
'821650'
decocare.history.describe()[source]
decocare.history.describe_rate(offset, rate, q)[source]
class decocare.history.old6c(head=bytearray(b''), larger=False)[source]

Bases: decocare.records.base.InvalidRecord

body_length = 38
opcode = 108
decocare.history.parse_record(fd, head=bytearray(b''), larger=False)[source]

Given a file-like object, and the head of a record, parse the rest of the record. Look up the type of record, read in just enough data to parse it, return the result.

decocare.history.suggest(head, larger=False)[source]

Look in the known table of commands to find a suitable record type for this opcode.

decocare.history.unmask_m_midnight(data)[source]

Extract date values from a series of bytes. Always returns tuple given a bytearray of at least 3 bytes.

Returns 6-tuple of scalar values year, month, day, hours, minutes, seconds.

Table Of Contents

Previous topic

Download

Next topic

lib

This Page