Skip to content

AX.25: initiator pre-connect XID probe (NegotiateSrejBeforeConnect) — closes the XID pick - #65

Merged
M0LTE merged 2 commits into
mainfrom
feat/xid-initiator-probe
Jul 12, 2026
Merged

AX.25: initiator pre-connect XID probe (NegotiateSrejBeforeConnect) — closes the XID pick#65
M0LTE merged 2 commits into
mainfrom
feat/xid-initiator-probe

Conversation

@M0LTE

@M0LTE M0LTE commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

The last piece of the XID pick (Table A #4). Mirrors C# Ax25Listener.NegotiateSrejBeforeConnectAsync, decomposing its async bounded-wait onto pico's clock-free event core as an explicit pre-connect state:

  • begin probe — emit our XID command (SREJ offer), defer the SABM.
  • response merge — inbound XID response merges via apply_negotiated, records to the peer-capability cache, converts the deferred drive into DL-CONNECT (the negotiated srej_enabled survives establishment).
  • timeout fallback — revert to go-back-N + dial plain SABM; cache learns the no-response.
  • cache hit — skip the probe, dial straight with cached caps.

Tested end-to-end (probe→response→SREJ activates on the link; timeout→fallback; both cache-hit variants; mdl offer/revert). +7 tests (724 total); clippy/no_std/fw-build/drift-guard all green.

Correct layering note: only the wall-clock duration of the bounded wait lives in the fw timer task (the core is clock-free, like capability.rs's now_ms); the timeout handler + all transitions are implemented and host-tested.

🤖 Generated with Claude Code

Tom Fanning and others added 2 commits July 12, 2026 20:24
Add the two synchronous mutation points of the C# initiator probe
(Ax25Listener.NegotiateSrejBeforeConnectAsync):

- begin_pre_connect_xid: seed the context SREJ-capable and return the
  mod-8 offer (SREJ + OPSREJMult) to advertise in the XID *command*.
- revert_pre_connect_xid: the `if (!confirmed)` fallback — undo the
  seeded SREJ so a silent peer degrades to go-back-N.

The confirmed-response merge reuses the existing apply_negotiated. Four
mdl tests cover offer / confirmed-SREJ / REJ-revert / silent-revert.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Wire the initiator half of the LinBPQ SREJ accommodation into the
synchronous session manager, mirroring C#
Ax25Listener.NegotiateSrejBeforeConnectAsync decomposed onto the
event-driven core (the async bounded-wait becomes an explicit
pre-connect state resolved by discrete post/timeout calls):

- connect_planned: a plan with pre_connect_xid (mod-8) now begins a
  probe instead of dialling straight; the extended / no-probe / fresh
  cache-hit paths still dial straight via connect_extended.
- begin_xid_probe: seed SREJ-capable, emit our XID *command*, and arm a
  new Slot.xid_probe (XidProbe) pending state — deferring the SABM.
- post_with_local: an inbound XID *response* while a probe is pending is
  merged via mdl::apply_negotiated against our stored offer, then the
  drive is converted into the deferred DL-CONNECT-request (the SABM).
- xid_probe_timeout: the bounded-wait expiry — revert to go-back-N
  (mdl::revert_pre_connect_xid) and dial the plain SABM.
- xid_probe_pending: lets the fw arm/clear the timeout.

The negotiated srej_enabled stages on the context and survives
establishment; three scenario tests cover response→SREJ→connect (+ the
SREJ actually activating out-of-sequence), timeout→go-back-N fallback +
cache-learns-non-answerer, and fresh-cache-hit→dial-straight. The prior
connect_planned test is updated for the new probe-vs-dial-straight split.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@M0LTE
M0LTE merged commit 3c4156b into main Jul 12, 2026
M0LTE added a commit that referenced this pull request Jul 12, 2026
docs(roadmap): initiator XID probe landed (#65) — closes the XID pick
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