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

Add NAK logic to request retransmission from pump based on @ecc1's code #42

Open
wkcwells opened this issue Aug 17, 2016 · 3 comments
Open

Comments

@wkcwells
Copy link

Code is here: https://github.com/ecc1/medtronic

@wkcwells
Copy link
Author

I have a basic prototype working. Still refining it...

@oskarpearson
Copy link
Owner

Heya Keving. I'm just discovering the wonders of the golang code that Eric worked on. I wasn't entirely sure what this issue relates to, though? Would you mind adding some detail/explanation? Thanks!

@ecc1
Copy link

ecc1 commented Sep 16, 2016

When requesting a history page from a MM pump, the protocol returns 16 records to make up the whole page of data. The client sends the request, gets the first record, then has to send an ACK for each subsequent record.

The records have sequence numbers 1..16. Previously, if you were expecting #7 but instead got #8, you would realize that you'd lost #7, throw up your hands, and return failure for the whole operation.

I discovered that the protocol also accepts a NAK instead of an ACK, which will cause retransmission of the current record. Unfortunately, the ACKs and NAKs don't have sequence numbers so the logic is a little tricky -- you can't wait until you see an unexpected sequence number because then it's too late. You have to send the NAK when you timeout expecting a response.

Anyway, the net result is that history page fetches in noisy or marginal comms environments are much more likely to suceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants