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

Improve Radio Interface Connection State Handling #14

Open
1 task
TylerFlar opened this issue Jan 5, 2025 · 0 comments
Open
1 task

Improve Radio Interface Connection State Handling #14

TylerFlar opened this issue Jan 5, 2025 · 0 comments

Comments

@TylerFlar
Copy link
Contributor

Objective

The TCP server doesn't correctly detect when clients disconnect, and the serial interface doesn't track the connection state. Connection losses can lead to unhandled expectations in the send/receive loops, and resources aren't always properly cleaned up after disconnection.

Requirements

  • The interfaces MUST clean up resources if there is an unexpected disconnection for both Serial and TCP ("Simulated") interfaces.
  • The DroneComms module MUST provide a callback parameter for connection broken errors.
  • The DroneCOmms module MAY attempt to re-establish the connection.

Tasks

  1. Add the is_connected flag to both interfaces and update on connect and disconnect.
  2. Escapsolate functions with try-catch, and if there's an error, change the flag to false clean up connect resources and call an error function specified by the user.
  3. Change the receiver to check the flag before sending a packet.

Deliverables

  • Pull request to dev branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant