| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
Fixed syntax (missing space)
|
|
|
| |
Sometimes I gets "LO" record (lower-than 30 ) on using Precision Neo .
|
|
|
|
|
|
|
| |
This driver supports GlucoMen areo by A. Menarini Diagnostics.
It possibly works with the GlucoMen Areo 2K but it is untested with it,
and does not support reporting Ketone readings.
|
|
|
|
|
| |
While uncommon there are glucometers that don't use the default parity
mode of "none". Allow the drivers to override this.
|
|
|
|
|
|
| |
This is only affecting accucheck_reports for now, but it makes sure that
a round-trip between mmol/L→mg/dL→mmol/L don't lose (or invent)
precision.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use 5 fields with KetoneReading and TimeAdjustment too.
With this patch:
$ glucometer --driver fslibre dump --with-ketone
"2021-03-06 16:05:00","","","time","2021-03-06 15:57:59"
"2021-03-07 14:34:26","0.01","","blood sample","(Ketone)"
"2021-03-07 14:34:49","140.00","","blood sample","(Blood)"
"2021-03-07 14:48:46","131.00","","CGM","(Sensor)"
"2021-03-07 15:00:18","121.00","","CGM","(Scan)"
Without this patch, KetoneReadings and TimeAdjustments use only 4
fields:
$ glucometer --driver fslibre dump --with-ketone
"2021-03-06 16:05:00","","time","2021-03-06 15:57:59"
"2021-03-07 14:34:26","0.01","blood sample","(Ketone)"
"2021-03-07 14:34:49","140.00","","blood sample","(Blood)"
"2021-03-07 14:48:46","131.00","","CGM","(Sensor)"
"2021-03-07 15:00:18","121.00","","CGM","(Scan)"
|
|
|
|
|
| |
This allows FreeStyle Libre devices to use UTF-8 patient names, while
not risking to brick older models that might just support ASCII.
|
|
|
|
| |
This just makes debugging a bit easier.
|
|
|
|
|
|
| |
The comment string is already parsed out of the quotes (`""`) so there
is no reason to drop the first and last characters, which might make
the comment itself unreadable.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The TD-4235B meter (sold as GlucoRx Nexus Q) uses pretty much the same
protocol as the TD-4277.
This change renames the driver, and reports the model returned by the
device when receiving information.
Other than that, a couple of constants are different from the previous
meter.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Instead of maintaining the reversing tools for Abbott FreeStyle devices in
this repository, they are now part of their own project
(https://github.com/glucometers-tech/freestyle-hid), making it easier to
split the dependencies requirements.
The basic I/O of the FreeStyle session is also implemented in that library.
|
| |
|
|
|
|
| |
Remove usage of overloaded division operator in construct structures.
|
| |
|
|
|
|
|
| |
The only files that were lacking a license were the 0-sized __init__.py
files — since those are not copyrighteable, make them Unlicense relesed.
|
|
|
|
|
|
|
|
|
| |
See https://reuse.software/ for details.
For simplicity, the support files, that are vastly copy-pasta, are licensed
under MIT license, rather than LGPL-2.1-or-later.
Note that `reuse lint` currently fails due to fsfe/reuse-tool#208.
|
|
|
|
| |
This makes it friendlier to the user who's not sure how to use it.
|
|
|
|
| |
This allows wrapping around some of the interfaces, and make typing more strict.
|
|
|
|
|
| |
The "driver" is the module — the classes need to be called Device. This
allows adding further typing around this.
|
|
|
|
| |
This makes it more like the other common modules, and allows expanding the interfaces.
|
|
|
|
| |
This is following the advice provided in https://matija.suklje.name/how-and-why-to-properly-write-copyright-statements-in-your-code
|
|
|
|
|
|
|
|
| |
Now that Python 3.7 is the minimum Python version, typing can be done
inline, which makes it easier for mypy to know the files to check.
Indeed, all the files are now typechecked, which uncovered a few minor bugs
and mistakes here and there.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This replaces the definition of modes with an Enum class, which is more
appropriate, and adds typing throughout the module.
Text is also replaced with str since we don't support Python 2 anyway.
|
|
|
|
|
| |
This simplifies type annotations a bit, and makes it easier figure out why
attrs is still required (validators).
|
| |
|
|
|
|
|
|
| |
This in turn allows wrapping the FreeStyle access in its own session class,
which the freestyle_hid_console can use without dirty tricks, and without
triggering the now-abstract class.
|
|
|
|
|
| |
This should simplify maintaining the tests in the long run, and allows mypy
to more thoroughly check for types.
|
|
|
|
| |
The order of operations is a bit different with f-strings so the amount of padding is different.
|
|
|
|
|
|
|
|
|
|
|
| |
The f-strings formatted strings are generally simpler to write, read and
debug, with a few exceptions.
Keep the logging strings lazy, keep the CSV-building with %-formatting, as
it makes it more readable.
In fsoptium, keep `'$%s\r\n'` as a %-format, to avoid making it
`f'${command}\r\n'` that would make it easy to mistake for a Shell variable.
|
| |
|
|
|
|
|
|
|
| |
Message type 0x22 is a keepalive message, which has usually one 0x05 or
0x03 byte. But don't expect a certain value, just ignore the message.
This fixes issue #73.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This includes importing the right abstract classes and correcting some
call typing information.
|
|
|
|
|
|
| |
While the Libre 2 protocol is still not usable, this makes it possible to
at least send messages to it and get a translation of what the mistake was
in the first place.
|
|
|
|
|
| |
This includes both the classic "unknown message type" error, and the Libre
2 encryption error state.
|
|
|
|
|
|
| |
This is not a sequence, but rather a single initialization command. Remove
the loop and the long comment that no longer applies (serial numbers and
all.)
|
|
|
|
|
|
|
|
| |
This has been tested on fslibre and fsprecisionneo, but please report if
this does not work with other FreeStyle devices (Insulinx?)
It appears the 0x04/0x05/0x15 dance is only needed by the Abbott software
to identify which model (and software version) it is talking with.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Implemented based on the protocol documentation provide by Ascensia, with
portions from glucodump by @sm6xmm (relicensed by the author under MIT
license.)
Squashed from pull request #62.
Signed-off-by: Anders Hammarquist <iko@iko.pp.se>
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.com>
|
|
|
|
| |
Since Python 3.4 is no longer supported, there's no reason for typing not to be there.
|
|
|
|
| |
() is not a valid Iterator[List[Text]]
|
| |
|
|
|
|
|
| |
The multi-record format returns "Log Empty" if there's no entry in the
device, catch that.
|
| |
|
|
|
|
|
|
|
|
| |
Python 3.4 lacks the `typing` module, which requires try/catch when
importing, making type annotations more verbose than needed.
At the time of writing, Debian oldstable has Python 3.5 available, so it
sounds like a good default.
|
| |
|
|
|
|
|
| |
This should work just as well and makes it read a little better. Also,
replace Text references with str, since we don't support Python 2 anyway.
|
|
|
|
| |
This will allow providing other information, for other non-fslibre drivers.
|
| |
|
|
|
|
| |
Somehow mypy does not seem to recognize it as a valid construct class.
|
|
|
|
|
| |
This driver supports the GlucoRx Nexus, Menarini GlucoMen Nexus, and
Aktivmed GlucoCheck XL.
|
|
|
|
|
|
|
|
|
|
| |
This was brought up in issue #60. While the devices don't appear to care
much for patient names, and can't be expected to support UTF-8 (the Windows
software don't appear to allow that), it's worth protecting against this
and just replacing the non-ASCII characters.
To make this easier, the decoding is pushed down to the end of the
processing of the multi-packet response, rather than being done per-packet.
|
| |
|
|
|
|
|
|
| |
This includes the command line extensions to include the get/set patient
name, as well as the driver support for all FreeStyle devices with the
shared HID protocol, although not all will support this properly.
|
|
|
|
|
| |
This includes extension of the base info command to report this when asked
on the command line.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
At least the FreeStyle Precision Neo appears to be able to report an invalid
date/time (255/255/255 255:255), probably when the RTC is lost (see issue #58).
This returns a more precise output than N/A, and should suggest to confirm the
date and time setting instead.
|
| |
|
| |
|
|
|
|
|
|
| |
The FreeStyle Optimum Neo reports ketones in using the same unit as FreeStyle
Libre. Move the conversion function from fslibre.py to freestyle.py to
facilitate sharing and do the right conversion in fsprecisionneo.py.
|
|
|
|
| |
Also add a test so that we don't break this again in the future.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
As discussed in glucometer-protocols #6, the value is actually converted
the same way as blood glucose, despite it not having the same ratio.
|
|
|
|
|
|
|
|
|
|
| |
Most of the epydoc metadata (author, copyright, email) is duplicate in
the package's setup.py or README. These copies are more likely to get out
of date, and increase the amount of work to keep them in line.
The license information should rather be provided with an SPDX identifier,
which is more similar to what the Linux kernel and other projects, such as
pyserial, do.
|
|
|
|
|
|
|
|
| |
Due to EURid threatening to suspend my domain, make sure that the
references are updated to point at the right stable domain.
This includes changes to the files as well as a mailmap to update the
author references in the log.
|
|
|
|
|
|
|
| |
The value of None is not valid for current hidapi implementation, but
anything below 0 is considered no timeout.
Fixes issue #50.
|
|
|
|
| |
Fixes the nested exception reported in Issue #50.
|
|
|
|
|
| |
This caused the normal ASCII-in-UTF16 strings to be misaligned, and the
`info` output to be full of garbage.
|
|
|
|
| |
Again, this is not ready for CI yet unfortunately :(
|
| |
|
| |
|
|
|
|
| |
This avoids confusing mypy, and is also less magical.
|
| |
|
| |
|
|
|
|
| |
This also adds more type annotations for them.
|
|
|
|
|
|
| |
There's nothing really meaningful beside the timestamp sorting, remove the
flag. If for whatever analysis, a different sorting is needed, that should
be post-processed from the generated CSV.
|
|
|
|
|
| |
This cannot currently be added to CI because the lack of `construct` stubs,
which cause "unsupported left operands" for /-constructed structs.
|
| |
|
|
|
|
| |
This avoids having the separate _MeterInfoBase class, and reads much nicer.
|
|
|
|
| |
This appears to be quite variable, and this should make it more reliable.
|
|
|
|
|
| |
This would have caught the bug fixed with the previous commit, which is a
strict improvement.
|
|
|
|
|
|
|
| |
For the otultraeasy, there is no prefix provided in the acks at all, so
the previous change broke the otultraeasy.
Partial revert of b5784bb35b9968bf977d1319c3301958d671f45c.
|
|
|
|
| |
Thanks to Noel Cragg for reporting this.
|
|
|
|
|
|
|
| |
During the structure rebuild, the 'message' key is removed before its callback
is invoked, causing 'this.message' to raise a nonexistent key error. This
change reverts the line in question to its pre-84aad729 logic (but leaving the
variable name substitutions in place).
|
| |
|
|
|
| |
This is a quick fix I used to address an error for "HI" readings on my unit. This comes up when testing inhuman blood. There may be a "LO", but I have not encountered it, so I do not know how the specifics of it. This error may come up on other units, but I have just done something about the hardware I have access to.
|
| |
|
| |
|
|
|
| |
lambdafied this expression
|
|
|
| |
lambdafied this expression
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This closes Issue #30 as I actually tested this and it works perfectly fine.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The TidePool driver does not implement meal comment and it does not
validate the full message. I checked the flags with the trace and they
match the values in otverio2015.
|
| |
|
|
|
|
| |
The success status is always %x06 if there is a message at all.
|
|
|
|
|
| |
These are now coming from the software trace. The version response is funny
though.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This ensures that the command prefix is added directly into the packet
structure, simplifying the rest of the code.
Per driver changes:
- otverio2015: command prefix is changed from 0x04 to 0x03; this ensures
that all the responses share the same prefix (READ RECORD COUNT does not
repeat the selected command prefix).
- otverioiq: command prefix is changed from 0x04 to 0x03, to align with
the otverio2015 driver and the trace from OneTouch Diabetes Management
Software.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is the first commit to support OneTouch Verio IQ (Issue #30). It's
untested despite me having the device because it needs a new kernel I have
not planned to build yet.
Most of the protocol has been reverse engineered from the Tidepool driver
(https://github.com/tidepool-org/chrome-uploader/blob/master/lib/drivers/onetouch/oneTouchVerioIQ.js)
with a few assumption brought in from the UltraEasy and Verio 2015.
|
|
|
|
|
| |
The values are the same between all models sharing this protocol, even
though the full reply message isn't.
|
|
|
|
|
|
|
|
|
|
| |
Both the UltraEasy and Verio 2015 use a similar protocol, with the same
base packet serialised to the device. Factor the packet definition out (and
make it a bit more generic). Verio IQ (Issue #30) also shares the same base
protocol.
Also move the definition of VERIO_TIMESTAMP to this common module as it's
also shared with the Verio IQ.
|
| |
|
|
|
|
|
|
|
|
|
| |
There was always a 1-to-1 mapping between these two functions, so merge
them into a single function that knows both the request and response
format.
It also includes some refactoring of the actual record reading, to match
the same structure of functions in otverio2015.
|
|
|
|
| |
This makes it the same as the otverio2015.
|
| |
|
|
|
|
|
|
|
| |
This simplifies the code a bit here and there, making sure that the
structures are all define at the top of the file. It also align the
structure of the driver a bit more with otultraeasy, making it easier to
spot the similitudes.
|
|
|
|
|
|
|
| |
This adds tests to ensure this works right in the general case, so that it
can be used with different parameters.
The adapter will be reused in the otverio2015 driver.
|
|
|
|
|
|
|
|
|
| |
This removes the wholly complicated _Packet() object and replace it with
more readable construct.
Unfortunately this appears to reduce performance because of the serial
stream buffering, needed to calculate the checksum. It's unfortunate, but
it at least avoids a significant amount of custom code.
|
|
|
|
|
|
|
| |
This replaces the use of manual structures with well-defined construct
entries; it also give consistency to packet vs message.
Log input and output messages, to be clearer.
|
|
|
|
|
|
|
|
|
|
| |
With 2a825fb889735fa881566d1764cc48d2814447d2 the parameters to open the
serial device were lifted from the fsoptium driver, which was the only one
passing xonxoff=True.
The Optium device has no problem with disabling this feature, but the
codefree driver hangs if this is set to True. So instead set it to False
and get rid of it.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This simplifies the code and enforces the validation within the format
documentation too.
construct can handle the full package verification, including dealing with
padding.
|
|
|
|
| |
The shim needs to be renamed, but this makes the history simpler to read.
|
|
|
|
|
| |
This was mixing up the units in the conversion. While fixing the bug,
remove the confusing two-parameter form of convert_glucose_unit.
|
|
|
|
| |
This makes the code more idiomatic and less brittle.
|
|
|
|
| |
This makes the code more idiomatic and less brittle.
|
|
|
|
| |
This makes the code more idiomatic and less brittle.
|
|
|
|
|
|
|
| |
This was meant to be lifescan_common, and then renamed to just lifescan,
but clearly I forgot that.
Addresses part of Issue #29.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This change also remove the meal field from the _ReadingBase class and
moves it only where it belongs, i.e. in the GlucoseReading class.
|
|
|
|
| |
This renaming prepares for the ketone class introduction.
|
|
|
|
|
| |
This new measure_method stores origin of the measure (either blood
sample or from a CGM sensor).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
One of the professional options allows to choose the insulin increment
step between 1 and 0.5 unit.
This explains why the insulin dose values with no decimal part seems
doubled in memory.
This change adjusts the formating and computation when displaying these
data.
|
|
|
|
| |
The unpacked value is an integer, not a byte array anymore.
|
|
|
|
|
| |
While Verio 2015 does not appear to expose this information, Select Plus
devices do, and the mapping is very simple.
|
|
|
|
|
|
| |
The reading value is only 16-bit long, not 32-bit. The following byte is a
meal indicator (not implemented in Verio), followed by a (likely) constant
0x00.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This restores the original behaviour, that seems to be necessary for the
FreeStyle devices.
|
|
|
|
|
| |
This is important for a meter I'm working on right now, as there is no
obvious way to tell whether to wait for new packets or not.
|
|
|
|
| |
This is a semantics difference between hidraw and HIDAPI, cover for it.
|
|
|
|
|
| |
I'm currently implementing a separate HID-based driver that does not use
the Abbott protocol, so this makes my life easier.
|
|
|
|
|
|
|
|
|
| |
This allows these drivers to be used on operating systems other than Linux,
as hidapi abstracts away the access. The interface is similar enough to
using hidraw that the actual code only needed minimal changes.
Maintain the ability to access the devices with the hidraw path too,
without forcing the dependency.
|
|\
| |
| | |
Fix encoding info and add missing __init__.py file
|
| | |
|
|/
|
|
| |
even if rapid-acting-flag is set double-rapid-acting-insulin record does not always exist, so make it optional and provide a default value
|
|
|
|
|
|
|
|
| |
This allows the drivers to keep up to date with what they support and
need. Should make Issue #9 easier to solve.
Also merge the dependency list with the list of supported devices, so that
you don't have to join the two tables in your head.
|
|
|
|
|
|
|
|
| |
This allows the drivers to provide information on what they support
directly, rather than relying on the README file. It also allows to provide
further information for the quirkier devices.
This is again trying to resolve Issue #9.
|
|
|
|
|
|
| |
This allows the serial support class to open the serial port without each
driver having to pass the same long list of parameters, given that
effectively all the meters use the same parameters, except few.
|
| |
|
|
|
|
|
|
|
|
| |
pyserial makes it very easy to look for a serial port based on VID/PID
pairs, so use those when possible. Unfortunately serial drivers are also
the least reliable as all of the cables but Abbott's use generic IDs.
This keeps in the direction of solving Issue 9.
|
| |
|
|
|
|
|
|
|
|
| |
This requires the drivers to validate their device, but also means they can
provide a more explicit error message for the user as to what should be
passed.
This is a first step to help solving Issue 9.
|
|
|
|
|
| |
This adds some very free-form comments to note where the reading comes from
and to convert the flags into something that the user can use.
|
|
|
|
|
|
|
|
| |
This is the first (draft) version of the driver, that only downloads the
automatic sensor readings, marking them as (Sensor) in the comments.
I'll follow up with downloading of the scans and blood tests, but wanted to
have this pushed first.
|
| |
|
|
|
|
|
|
|
|
|
| |
Opening the device with read+write permissions is necessary to send write10 SCSI
commands. The error message I was receiving was "SG_IO ioctl error; Operation
not permitted" when running as non-root.
http://sg.danny.cz/sg/sg_io.html describes SCSI permissions in greater depth and
helped illuminate the nature of the permissions problem.
|
|
|
|
| |
This avoids creating a binary file when running the tool as root (bad Flameeyes).
|
|
|
|
|
|
|
|
|
|
| |
This is based off the fsprecisionneo driver, as the two share an almost
identical protocol. The readings format is different between them, but
otherwise the commands are compatible.
There are a number of higher-level commands that differ between them,
though, so it might be necessary to specialize the drivers further in the
future.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
There are shared commands that allow settings the date and time of the
device, implement those in the freestyle support module, so that they can
be re-used in implementation of the same base protocol.
|
| |
|
|
|
|
|
| |
This driver uses the HID-based protocol which is shared among different
devices.
|
|
|
|
|
| |
The number of freestyle devices drivers will soon skyrocket, use the same
shortening as the OneTouch ones.
|
|
|
|
|
| |
This makes it easier to figure out which files represent drivers, and which
ones are per-vendor support modules.
|
| |
|
|
|
|
|
|
| |
This matches the gdef MeterInfo message, and produces a similar (though not
identical) string as before. Importantly, it allows providing semantic
information.
|
| |
|
|
|
|
|
| |
Since there is no way to expose non-glucose readings right now (I might
work on that in the future), filter β-ketones results out from the dump.
|
|
|
|
| |
Not sure how this ever worked.
|
| |
|
|
|
|
|
| |
This driver supports SD Codefree readers, that are sold in the UK by
HomeHealth UK.
|
| |
|
|
|
|
|
| |
I managed to get my hands on an US-edition of the device, and I can confirm
this behaves in a similar way to the otultraeasy.
|
| |
|
|
|
|
|
| |
Most glucometers have *some* sort of checksum, so there is no reason to
implement this on a per-driver basis.
|
|
|
|
|
|
|
|
|
| |
The default USB connection provides a USB storage device with a CSV
datafile. This driver works by looking for that file and importing it.
This does not support setting the time, nor reading the actual device
time, but it is at least a good way to import data from different meters
under the same format.
|
|
|
|
| |
This will lead the way to providing meal information with future drivers.
|
|
|
|
|
|
|
|
| |
This should be working for OneTouch Select Plus devices, too. It currently
does not support reporting in the native unit of the device.
As of today, you'll also need my forked repository of python-scsi, as the
current upstream one does not have working SGIO for Linux.
|
| |
|
|
|
|
|
| |
Also make the exception more general, so that it can be used in the
verio2015 driver.
|
|
|
|
|
| |
The same CRC-CCITT function is used in Verio 2015 devices, so prepare to
reuse it by moving it to the common module.
|
|
|
|
| |
Also update copyright year.
|
|
|
|
|
| |
This should ensure more integrity of the results, and matches the behaviour
on the lifescan devices.
|
|
|
|
|
| |
This driver supports dumping of (glucose) readings and reading/setting the
clock.
|
|
|
|
| |
It seems like the device is very sensible to the reset command.
|
|
|
|
|
| |
The function is not shared with the Ultra Easy and likely not with
other devices either.
|
|
|
|
|
| |
The driver is fully functional but requires proper documentation and
testing.
|
|
|
|
| |
The otultraeasy does not provide comments or meal indications.
|
|
|
|
|
| |
The otultraeasy requires explicit connect/disconnect so implementing
this before is helpful.
|
| |
|
|
|
|
|
| |
This changes the dump output for otultra2 devices as they would dump data in
record format, last reading first.
|
|
|
|
|
|
| |
While mmol/L is the international standard unit, at least LifeScan uses mg/dL in
all their devices, and since they are the ones for which we have protocols for,
we might as well use the same.
|
|
|
|
|
| |
While not all readers implement before/after meal notes, it's possible
to implement an heuristics for that.
|
|
|
|
|
| |
Idea by Jim Sifferle, implemented in a slightly different way as I
noticed I forgot to quote it properly.
|
|
|
|
|
| |
If any exception is thrown by the library, print an error statement and return a
non-zero exit value.
|
|
|
|
| |
This allows to get the serial number, as well as other details about the glucometer once it's installed.
|
| |
|
|
|
|
| |
This also dumps the comment with the dump command.
|
|
|
|
|
| |
The Reading object will be extended to cater for flags, comments and
other device-specific information.
|
|
|
|
|
| |
There is no reason for me to use GPLv3 now that I'm not using the
CRC32-Sick code, so I'll go with the most liberal license out there.
|
|
|
|
|
|
|
| |
Unlike what I though, OneTouch2 does not use CRC32 Sick algorithm, but
a very stupid full 16-bit modulo sum of the bytes in the reply.
This is very simple and does not require GPLv3 code at all.
|
|
|
|
|
|
|
| |
This introduced some changes in the Exception class to simplify the
code, and at the same time it adds a module for multiple lifescan
drivers to share code (multiple OneTouch protocols share the same
checksum for instance).
|
| |
|
| |
|
| |
|
|
|