-
Notifications
You must be signed in to change notification settings - Fork 0
freestyle lite driver #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
garberw
wants to merge
58
commits into
experimental-construct-freestyle
Choose a base branch
from
master
base: experimental-construct-freestyle
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The shim needs to be renamed, but this makes the history simpler to read.
This should make it easier to add dependencies and so on.
This should address Issue 5 (theoretically some of the dependencies are OS-specific but that's a longer problem). Also partially addresses Issue 9 because now we have an easy to understand "install and try out" option.
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 would have found an extra bug that was pushed unfixed after enum conversion, and two bugs that I did find during the conversion.
With 2a825fb 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 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.
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 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 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 makes it the same as the otverio2015.
…2015. 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 test was actually only testing the CRC CCITT implementation now that otultraeasy uses construct.
…vers. 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.
The values are the same between all models sharing this protocol, even though the full reply message isn't.
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.
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.
These are now coming from the software trace. The version response is funny though.
The success status is always %x06 if there is a message at all.
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.
As noted in Issue #30, this is currently untested, but I'm confident it won't take much to get it to working state.
This closes Issue #30 as I actually tested this and it works perfectly fine.
The API changed in slightly incompatible ways so I'll have some work to make sure this works on both versions (and that there is some test around it, possibly).
… only. This still is required to fix Issue #38, but luckily it's just a test failure for now.
lambdafied this expression
lambdafied this expression
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.
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).
Thanks to Noel Cragg for reporting this.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.