Repository navigation
Conversation
A failed sensor answers the glucose request with status 0x80, its last reading and algorithm state 27 (transmitterFailed). The parser rejected any nonzero status, so the manager logged "Unable to handle glucose control response" every five minutes, never learned the state, and showed the sensor as connecting instead of raising the sensor-failed alert. The message now keeps the status and decodes the timestamp, sequence, age and algorithm state for any status. Glucose, prediction and trend are nil when the status is nonzero, so a reading the sensor did not mark current is never stored.
Contributor
Author
|
This is not an important thing to fix for non-direct integration. |
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
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.
Backport of the parsing fix from #85 to
main, cherry-picked from d3f2a7b.A failed sensor answers the glucose request with status 0x80, its last reading and algorithm state 27 (transmitterFailed). The parser rejected any nonzero status. So the manager logged "Unable to handle glucose control response" every five minutes, never learned the state, and showed the sensor as connecting instead of raising the sensor-failed alert.
The message now keeps the status and decodes the timestamp, sequence, age and algorithm state for any status. Glucose, prediction and trend are nil when the status is nonzero, so a reading the sensor didn't mark current is never stored. On
main,G7CGMManager.sensor(_:didRead:)checksalgorithmState.sensorFailedbefore it looks at glucose, so the alert fires as on next-dev.Not included
#85's other three commits (asking for the transmitter version until the serial number arrives, and sending the serial with the sensor start) depend on next-dev-only code: the transmitter version query,
G7SensorRecord, and the previous-sensor page. They aren't part of this backport.Testing
Adds
testFailedSensorStatusStillReportsAlgorithmStatetoG7GlucoseMessageTests. The same change and test pass on next-dev. I couldn't build the legacy workspace here: Xcode 27 rejects its watchOS 7.1/6.1 and TrueTime iOS 12 deployment targets before anything compiles.