pub struct FrameParser { /* private fields */ }Expand description
Frame parser. One per channel.
Implementations§
Source§impl FrameParser
impl FrameParser
Sourcepub fn new(channel_idx: u8, channel_freq_hz: f64) -> Self
pub fn new(channel_idx: u8, channel_freq_hz: f64) -> Self
Create a parser stamping the given channel index + freq onto every emitted message.
Sourcepub fn take_polarity_flip(&mut self) -> bool
pub fn take_polarity_flip(&mut self) -> bool
Polarity-flip handshake. ChannelBank reads + clears this
after each MskDemod::process round; if true, it calls
MskDemod::toggle_polarity() to recover from 180° phase
slip detected via the inverted-SYN preamble.
Sourcepub fn drain<F: FnMut(AcarsMessage)>(&mut self, on_message: F)
pub fn drain<F: FnMut(AcarsMessage)>(&mut self, on_message: F)
Drain decoded messages buffered by synchronous
BitSink::put_bit → consume_byte runs. Production
callers (ChannelBank::process) invoke this after each
demod block. Tests use feed_bytes() instead.
Sourcepub fn feed_bytes<F: FnMut(AcarsMessage)>(
&mut self,
bytes: &[u8],
on_message: F,
)
pub fn feed_bytes<F: FnMut(AcarsMessage)>( &mut self, bytes: &[u8], on_message: F, )
Convenience: drive the parser with a sequence of fully-
formed bytes — used by unit tests that bypass MSK demod
and feed hand-crafted byte sequences directly. Also
drains the resulting messages into on_message for test
ergonomics.
Trait Implementations§
Source§impl BitSink for FrameParser
impl BitSink for FrameParser
Source§fn take_polarity_flip(&mut self) -> bool
fn take_polarity_flip(&mut self) -> bool
Polled by
MskDemod::process after each put_bit.
Returning true tells the demodulator to toggle its
internal polarity (acarsdec MskS ^= 2) immediately.
ACARS uses this to recover from 180° phase slip detected
via inverted-SYN preamble — the C does the toggle
directly inside decodeAcars (called from putbit),
which means the very next bit emerges from the demod
with inverted polarity. Sinks that don’t track polarity
(synthetic-test capturers, etc.) keep the default
false. Default is non-breaking for existing test
stubs.Auto Trait Implementations§
impl Freeze for FrameParser
impl RefUnwindSafe for FrameParser
impl Send for FrameParser
impl Sync for FrameParser
impl Unpin for FrameParser
impl UnsafeUnpin for FrameParser
impl UnwindSafe for FrameParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more