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 AprsIsConnection.State and State Change Events #116

Merged
merged 8 commits into from
Apr 8, 2022

Conversation

CBielstein
Copy link
Owner

Description

This switches from a simple "logged in" Boolean flag to tracking state across the full life of the AprsIsConnection object. It also adds an event which can be subscribed to for notifications of when that status changes.

This is especially useful for clients who may wish to know when a connection has been achieved, a login complete, or some error has lead to a disconnect and a new connection is required.

Changes

  • Remove AprsIsConnection.LoggedIn in favor of AprsIsConnection.State
  • Introduce ConnectionState enum for various states an APRS-IS connection can hold
  • Updates and adds tests for validation

Validation

  • Updated tests away from AprsIsConnection.LoggedIn to AprsIsConnection.State
  • Added new tests for disconnected events
  • All tests passing

@CBielstein CBielstein added the enhancement New feature or request label Mar 31, 2022
@CBielstein CBielstein self-assigned this Mar 31, 2022
@CBielstein
Copy link
Owner Author

Note to @eddywine for review: Since I add a layer of indentation for the try-finally in AprsIsConnection AND change a few lines, the diff is all weird there. It may be easier to disable whitespace in the diff. That setting is under the gear in the files tab:
image

@CBielstein CBielstein merged commit 4f825de into main Apr 8, 2022
@CBielstein CBielstein deleted the connection-state branch April 8, 2022 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant