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
Refactor Bayer Contour ASTM driver. Add support for Contour NEXT LINK 2.4 #221
Refactor Bayer Contour ASTM driver. Add support for Contour NEXT LINK 2.4 #221
Conversation
…luding a fix for uploading in mmol/L)
Update unit tests to work with new device. Modifications to verifyChecksum to avoid the trim()
…eLink has no data for the downloaded time period.
this.valid = false; | ||
this.frame_len = 0; | ||
this.payload = null; | ||
return this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to return here, as we don't seem to be using the returned value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using it, further down.
var astmFrameBuffer = {
...
}.reset();
It's like a constructor of sorts to avoid code duplication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ther than when parsing records. Rename variables to be more correct. Add some of the Gerrit's change requests.
Make parseHeader consistent with parseDataRecord.
|
||
if(packetHead['HEADER'] !== MAGIC_HEADER){ | ||
debug('Invalid packet from Contour device'); | ||
callback(new Error('Invalid USB packet received.'), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just testing the error handling by unplugging the device during an upload. You need to return the callback, otherwise it will still try to process and upload the invalid data. Also, remember to clear the timeout timer and interval timers.
Hi there! I'm sorry I didn't get a chance to merge this before going on holiday - this PR will now need a little bit of updating to be compatible with the redux work that got merged into master recently. The main change is that there is now a single device definition in |
Thanks! I've successfully uploaded (and verified BG readings) of:
One that still need to be fixed after the merge: |
LGTM! Will try to merge as soon. |
I agree to the terms of Tidepool Project’s Volunteer/Contributor License Agreement v1.0
as it exists at http://tidepool-org.github.io/TidepoolVCLA.pdf on 7th January 2016.