ax25sdl 0.9.0

Generated AX.25 v2.2 SDL state-machine tables (figc4.x) as no_std-capable Rust data.
Documentation
  • Coverage
  • 81.25%
    247 out of 304 items documented0 out of 14 items with examples
  • Size
  • Source code size: 701.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.6 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • packet-net/ax25sdl
    0 0 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • M0LTE

ax25sdl

Generated AX.25 v2.2 SDL state-machine tables (the figc4.x figures from the AX.25 v2.2 specification) as no_std-capable Rust data.

This is the Rust backend of packet-net/ax25sdl: the spec's figc4.1–figc4.7 state machines and subroutines, transcribed once with discipline and emitted as &'static data tables. A downstream AX.25 runtime walks these tables — it has no opinion of its own about what AX.25 says. The .g.rs files are generated by the repo's C# codegen pipeline from the YAML transcriptions under spec-sdl/; do not edit them by hand.

Install

[dependencies]
ax25sdl = "0.7"

Embedded / bare-metal (no_std) consumers opt out of std:

[dependencies]
ax25sdl = { version = "0.7", default-features = false }

no_std

The crate is #![no_std] unless the default-on std feature is enabled. The entire data/type core is no_std-clean: every type is Copy, holds only &'static borrows + scalars + the closed-set enums, and touches no allocator. The std feature gates no API surface — it exists only so the host test harness links std. A default-features = false build targets, for example, a Raspberry Pi Pico W (thumbv6m-none-eabi) AX.25 node.

Typed closed sets

Action verbs, guard atoms, and events are typed closed enums — Ax25ActionVerb, Ax25Guard, Ax25Event — so a consumer can match exhaustively. A renamed, removed, or typo'd verb / atom / event upstream becomes a compile error in your match, not a runtime "unknown SDL action" panic. A transition's guard is an &'static [GuardTerm] conjunction, where each GuardTerm carries a typed Ax25Guard atom plus a negate flag. (This mirrors the C# and TypeScript backends; see ADR-0002 in the repo.)

use ax25sdl::{Ax25ActionVerb, Ax25Guard, GuardTerm, DATA_LINK_CONNECTED};

// Walk a state page's transitions and evaluate a guard.
fn guard_holds(guard: &[GuardTerm], eval: impl Fn(Ax25Guard) -> bool) -> bool {
    guard.iter().all(|t| eval(t.atom) ^ t.negate)
}

let t = &DATA_LINK_CONNECTED.transitions[0];
match t.actions[0].verb {
    Ax25ActionVerb::DiscardIFrameQueue => { /* … */ }
    _ => {}
}

Layout

Each state page is a pub static (e.g. DATA_LINK_CONNECTED: StatePage); the figc4.7 subroutines are a SubroutinesPage. The runtime types (StatePage, TransitionSpec, ActionStep, GuardTerm, …) live in the types module and are re-exported at the crate root.

License

AGPL-3.0-or-later. Spec text and figures derive from the AX.25 v2.2 specification.