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

Feature: Implement connected-mode operation #21

Merged
merged 207 commits into from
May 8, 2024

Conversation

sjlongland
Copy link
Owner

Previously, aioax25 only supported UI frames, which was enough to participate on an APRS network, but not enough to be a full fledged AX.25 node.

This implements preliminary support for making and accepting AX.25 connections from a remote node.

sjlongland added 30 commits May 5, 2024 09:28
AX.25 2.2 adds support for modulo-128 frames using a 16-bit control
field.  The only way to know you're dealing with modulo-128 traffic is
by remembering that you negotiated it earlier.

Thus we need 8-bit and 16-bit versions of the frame structure to handle
the enlarged control field in the modulo-128 case.
This adds untested code for encoding and decoding various frame types
related to connected-mode operation.
Add tests whilst we're at it.
Put the majority of the frame logic in the top-level `AX25Frame.decode`
method for convenience.

We can rely on the fact that the least-significant two bits of a control
field are all we need to identify I, S and U frames.  Further more, the
least significant byte is sent first, so there's sufficient detail at
this point to identify the U frames up-front, and with some help,
I and S frames too.
We're unlikely to see these, I think most people will have "ugraded" to
2.x by now, and if not, they should be encouraged to do so, but at the
very least we can at least ensure we digipeat such frames properly.
The concept here is that `AX25Station` represents the local AX.25 node
implemented by the Python application, while `AX25Peer` represents a
remote AX.25 TNC.

`AX25Station` basically routes according to the source AX.25 address to
an appropriate `AX25Peer`.  Some garbage collection is implemented to
ensure memory isn't exhausted.
sjlongland added 27 commits May 7, 2024 16:58
Don't check if it's been cancelled, `asyncio` doesn't seem to care.
This calls a remote AX.25 station, very crude at the moment, but it
seems to be able to interact with BPQ32.
These are not practically unit testable.
The only time we do an XID is just prior to a connection attempt, we
should enforce this to simplify logic.
BPQ32 responds with FRMR, so fallback to AX.25 2.0 seems to work.
Now its purpose makes sense!  Not part of the AX.25 2.0 spec, but it
seems to make more sense than the other variables for tracking this
point.
This runs a program and redirects stdin/stdout/stderr to the packet
link.  CR is translated to LF and back again.
@sjlongland sjlongland closed this May 8, 2024
@sjlongland sjlongland merged commit 3152c52 into master May 8, 2024
8 checks passed
@sjlongland sjlongland deleted the feature/connected-mode branch May 8, 2024 05:20
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

Successfully merging this pull request may close these issues.

1 participant