Repository navigation
Stop the previous sensor monitor when a new one is adopted - #28
Merged
Merged
Conversation
Re-pairing without relaunching left the old monitor running: adopt replaced it without stopping it, and delete dropped it without stopping it. Its silence watchdog kept re-arming CCCDs and reading patch status, and when its stream ended it reported a disconnect that tore down the live monitor and scheduled another reconnect, so log lines and connect requests multiplied with each re-pair until Loop was relaunched. stop() now drops the monitor's handlers, adopt stops the monitor it replaces, delete stops its monitor, and a disconnect from a monitor that is no longer current is ignored.
Contributor
Author
|
Tested in the iOS Simulator against libre3sim, with next-dev Loop. Scenario: Delete CGM, then Add CGM and pair the same sensor; do that twice, then have the sensor drop the link.
The spurious "Replace sensor" in the original report is a separate issue (#29): an event-log entry with errorData 8 repeated in patch status while patchState is still 4. libre3sim reproduces it with |
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.
Re-pairing a sensor without relaunching Loop left the previous
LibreLoopSensorMonitorrunning:adopt(monitor:)replacedself.monitorwithout stopping the old one.delete()setmonitor = nilwithout callingstop().Each re-pair added another live watchdog (CCCD re-arms, patch status reads) and another source of spurious disconnects. Log lines and connect requests multiplied, and readings had long gaps until Loop was relaunched.
Changes:
stop()drops the monitor's handlers.adoptstops the monitor it replaces.deletestops its monitor.onDisconnectignores a monitor that is no longer current.Builds in a next-dev workspace, and the LibreLoop tests pass. Not yet reproduced on hardware.