Ignore null opcode bytes within a cgm page #11
Merged
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.
This PR changes the cgm page decoding to ignore null opcode bytes throughout a cgm page.
Background: While decoding cgm pages and examining the output, I noticed a recurring pattern of two 0-value GlucoseSensor records followed by a DataEnd in some of the pages (See json output example below). It looks like some subset of pumps append two null bytes after a DataEnd (0x01) record. These two bytes are being identified as sgv records with a value of 0.
I made the change in this PR to ignore nulls within a page and ran a before/after diff of every glucose page in the repo I could find. In each diff, the two sgv records are no longer present and the corresponding DataEnd record has a timestamp 10 minutes earlier (since the two glucose records are no longer offsetting the DataEnd relative timestamp).