| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This avoids SPDX tagging files that have no useful content.
|
|
|
|
|
| |
This replaces the usage of generics from `typing` with built-in or from
`collections.abc` since Python 3.9 is the minimum supported version.
|
|
|
|
|
| |
The suspected `$uom?` command was finally confirmed to be the correct
command to identify the unit of measure used.
|
|
|
|
|
|
|
|
|
| |
After three years, the encrypted protocol is understood and implemented,
huge thanks to @MPM1107.
The actual implementation of the driver is exactly the same as the one
for Libre readers, besides the encryption. The two share effectively
all of the driver.
|
|
|
|
|
| |
This makes sure that the import of BinaryIO is actually used in the code
itself.
|
|
|
|
|
| |
While uncommon there are glucometers that don't use the default parity
mode of "none". Allow the drivers to override this.
|
|
|
|
|
| |
This allows FreeStyle Libre devices to use UTF-8 patient names, while
not risking to brick older models that might just support ASCII.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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 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 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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Again, this is not ready for CI yet unfortunately :(
|
| |
|
|
|
|
| |
This avoids confusing mypy, and is also less magical.
|
| |
|
|
|
|
|
| |
This cannot currently be added to CI because the lack of `construct` stubs,
which cause "unsupported left operands" for /-constructed structs.
|
|
|
|
|
|
|
| |
For the otultraeasy, there is no prefix provided in the acks at all, so
the previous change broke the otultraeasy.
Partial revert of b5784bb35b9968bf977d1319c3301958d671f45c.
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
lambdafied this expression
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
The success status is always %x06 if there is a message at all.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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 avoids creating a binary file when running the tool as root (bad Flameeyes).
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
This makes it easier to figure out which files represent drivers, and which
ones are per-vendor support modules.
|