summaryrefslogtreecommitdiffstats
path: root/freestyle_hid (follow)
Commit message (Collapse)AuthorAgeFilesLines
* console: allow sending a single command to the device.HEADfreestyle-hid-1.1.1mainDiego Elio Pettenò2023-08-031-0/+14
| | | | | | This avoids having to open the session and makes scripting a lot easier particularly when changing the settings of the device and needing a restart to continue.
* Use empty `__init__.py` files.Diego Elio Pettenò2023-08-032-6/+0
| | | | This avoids adding SPDX tagging on empty files.
* Update typing to PEP 585 style.Diego Elio Pettenò2023-08-032-5/+7
| | | | | This replaces the usage of generics from `typing` with built-in or from `collections.abc` since Python 3.9 is the minimum supported version.
* Be more verbose on error messages and parsing with construct.Diego Elio Pettenò2023-08-033-44/+119
| | | | | Instead of manually combining and parsing integers (particularly IV that is a 56-bit integer), use construct formats to handle the parsing.
* Don't depend on product ID to enable encrypted protocol.Diego Elio Pettenò2023-08-032-6/+21
| | | | | | | | This is a little less automatic in the way it works, but it allows the caller to decide whether to enable the encrypted protocol for the session or not. It also raises earlier in case the encryption keys are not found.
* If present, load the actual keys from freestyle-keys package.Diego Elio Pettenò2023-08-032-10/+26
|
* Reformat to pass pre-commit checks.Diego Elio Pettenò2023-08-032-40/+75
|
* Update authors and headers information.Diego Elio Pettenò2023-08-031-1/+5
|
* initial encrypted protocol supportMPM11072023-08-032-22/+198
|
* Reformat with the new black.Diego Elio Pettenò2023-04-161-1/+0
|
* Use the new usbmon-tools 3 DeviceAddress command line flags.freestyle-hid-1.0.3Diego Elio Pettenò2021-05-162-5/+15
|
* Fix tests: DeviceAddress objects cannot be joined.Diego Elio Pettenò2021-05-161-1/+4
|
* Use the new APIs from usbmon-tools to simplify chatter extraction.Diego Elio Pettenò2021-05-161-48/+20
| | | | | The HID support module, together with the search by IDs make it easier to write a reliable extractor.
* Allow selecting which encoding to use for decoding text commands.Diego Elio Pettenò2021-03-032-12/+18
| | | | | | | | The FreeStyle Libre at least allows patient names and other strings to be set in UTF-8 so there is no reason to force ascii everywhere. Instead, allow the session to define an encoding for ease of integration with downstream tools.
* Calculate multirecords checksum based on the raw bytes.Diego Elio Pettenò2021-03-031-7/+14
| | | | | | | | | | | | | | | | | The original FreeStyle Libre software is known for incorrectly truncating strings with UTF-8, which causes the multi-record strings not to decode correctly. But since the Libre actually sends these as they are provided, we can calculate the checksum correctly if we do that _before_ replacing the invalid codepoints. This splits the `send_text_command` method into a public and a private interface, with the public returning the expected string, while the private returns the raw bytes. It should probably be changed to always return bytes instead. This change fixes https://github.com/glucometers-tech/glucometerutils/issues/103.
* Backport the one test that was present in glucometerutils.Diego Elio Pettenò2020-10-042-0/+25
| | | | This also sets up the whole pytest configuration and Travis CI integration.
* Initial import of freestyle-hid.freestyle-hid-1.0.0Diego Elio Pettenò2020-10-0410-0/+835
This library is a factor-out of https://github.com/glucometers-tech/glucometerutils to only include the FreeStyle implementation, to make it easier to use outside of glucometerutils, and in particular to make it easier to build better reverse engineering tooling around it. Note that since the code was a mix of MIT and Apache-2.0 license, the overall license of the library is written down as Apache-2.0, as that would be a super-set of the requirements from MIT.