Skip to content
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

Merged
merged 20 commits into from Mar 24, 2016
Merged

Refactor Bayer Contour ASTM driver. Add support for Contour NEXT LINK 2.4 #221

merged 20 commits into from Mar 24, 2016

Conversation

pazaan
Copy link
Contributor

@pazaan pazaan commented Jan 7, 2016

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.

this.valid = false;
this.frame_len = 0;
this.payload = null;
return this;
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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);
Copy link
Member

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.

@gniezen
Copy link
Member

gniezen commented Feb 26, 2016

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 redux/reducers/devices.js where previously the definitions were all over the place.

@gniezen
Copy link
Member

gniezen commented Mar 21, 2016

Thanks! I've successfully uploaded (and verified BG readings) of:

  • Bayer Contour Next USB
  • Bayer Contour Next
  • Bayer Contour USB
  • Bayer Contour Next Link

One that still need to be fixed after the merge: lib/core/deviceInfo.js and lib/state/appState.js has both been deprecated and were removed from master. Don't put them back! ;)

@gniezen
Copy link
Member

gniezen commented Mar 24, 2016

LGTM! Will try to merge as soon.

@gniezen gniezen merged commit e08b943 into tidepool-org:master Mar 24, 2016
@pazaan pazaan deleted the pazaan/bayer-contour-next-astm branch March 2, 2017 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants