sdr_acars/lib.rs
1//! ACARS (Aircraft Communications Addressing and Reporting
2//! System) decoder. Faithful Rust port of
3//! [acarsdec](https://github.com/TLeconte/acarsdec) — pure
4//! DSP + parsing, no GTK, no SDR-driver dependency.
5//!
6//! # Example: multi-channel decode from a 2.5 `MSps` complex IQ stream
7//!
8//! ```no_run
9//! use num_complex::Complex32;
10//! use sdr_acars::ChannelBank;
11//!
12//! const US_ACARS: &[f64] = &[
13//! 129_125_000.0, 130_025_000.0, 130_425_000.0,
14//! 130_450_000.0, 131_525_000.0, 131_550_000.0,
15//! ];
16//!
17//! # fn read_iq_block() -> Vec<Complex32> { Vec::new() }
18//! // Center on the midpoint of the channel extremes (130.3375 MHz)
19//! // so the 2.425 MHz cluster fits inside the 2.5 MHz Nyquist window.
20//! let mut bank =
21//! ChannelBank::new(2_500_000.0, 130_337_500.0, US_ACARS)?;
22//! loop {
23//! let iq: Vec<Complex32> = read_iq_block();
24//! if iq.is_empty() { break; }
25//! bank.process(&iq, |msg| {
26//! let label = String::from_utf8_lossy(&msg.label);
27//! println!("{} {label} {}", msg.aircraft, msg.text);
28//! });
29//! }
30//! # Ok::<(), sdr_acars::AcarsError>(())
31//! ```
32//!
33//! For pre-decimated 12.5 kHz IF input (e.g. WAV files written
34//! by acarsdec's `--save` mode, one channel per WAV channel),
35//! drive [`msk::MskDemod`] + [`frame::FrameParser`] directly
36//! instead — see `bin/sdr-acars-cli.rs` for the WAV path.
37
38pub mod channel;
39pub mod crc;
40pub mod error;
41pub mod frame;
42pub mod json;
43pub mod label;
44pub mod label_parsers;
45pub mod msk;
46pub mod reassembly;
47pub mod syndrom;
48
49pub use channel::{ChannelBank, ChannelLockState, ChannelStats};
50pub use error::AcarsError;
51pub use frame::{AcarsMessage, FrameParser};
52pub use json::serialize_message as serialize_acars_json;
53pub use label::lookup as lookup_label;
54pub use label_parsers::{Oooi, decode_label};
55pub use msk::{IF_RATE_HZ, MskDemod};
56pub use reassembly::{MessageAssembler, REASSEMBLY_TIMEOUT};