pub struct SameReceiverEvent { /* private fields */ }
Expand description
Full SAME receiver status
SAME decoding occurs at two separate layers:
-
Link layer: the demodulator, synchronizer, and framer convert analog waveforms into frames of data. Each individual SAME “burst” is a frame.
-
Transport layer: each SAME frame is transmitted three times for redundancy. These retransmissions are combined together to form a single
Message
estimate.
The what()
method returns the event,
which may originate from either layer.
You can also query for the
message()
or an individual
burst()
estimate, if one is
available now. Not all events have either of these things
to report.
Implementations§
Source§impl SameReceiverEvent
impl SameReceiverEvent
Sourcepub fn message(&self) -> Option<&MessageResult>
pub fn message(&self) -> Option<&MessageResult>
Message or message decoding error, if any
If the current update includes a message or a reportable
decoding error, returns Some()
with a
message result.
Sourcepub fn message_ok(&self) -> Option<&Message>
pub fn message_ok(&self) -> Option<&Message>
Successfully-decoded message, if any
If the current update includes a successfully-decoded
message, returns it. If no message is available, returns
None
. Consider using
message()
instead to
report errors.
Sourcepub fn burst(&self) -> Option<&[u8]>
pub fn burst(&self) -> Option<&[u8]>
Raw SAME data burst, if any
Digital SAME headers are transmitted three times for redundancy. This method retrieves the raw received bytes from the link layer if any are available with this event.
If present, the link layer guarantees that:
-
No further bytes will be added to this burst. It is complete as far as the modem is aware.
-
The bytes are aligned to the start of the transmission after the preamble. If the bytes were received error-free, they begin with
ZCZC
orNNNN
, but this itself is not guaranteed.
SAME messages use only ASCII printable characters, but no such guarantees are made about this field.
Clients MUST NOT report a single burst as a
SAME message. Messages should instead be obtained from
from the transport layer’s message()
.
Sourcepub fn into_message(self) -> Option<MessageResult>
pub fn into_message(self) -> Option<MessageResult>
Consume event, returning successfully-decoded message, if any
If the current update includes a successfully-decoded
message, returns it. If no message is available, returns
None
.
Sourcepub fn into_message_ok(self) -> Option<Message>
pub fn into_message_ok(self) -> Option<Message>
Consume event, returning successfully-decoded message, if any
If the current update includes a successfully-decoded
message, returns it. If no message is available, returns
None
. Consider using SameReceiverEvent::into_message
instead.
Sourcepub fn what(&self) -> &SameEventType
pub fn what(&self) -> &SameEventType
The event which triggered the output
Either the link layer or the transport layer may trigger an event.
Sourcepub fn input_sample_counter(&self) -> u64
pub fn input_sample_counter(&self) -> u64
Event time, measured in input samples
Reports the “time” of the event using a monotonic count of input samples.
Trait Implementations§
Source§impl Clone for SameReceiverEvent
impl Clone for SameReceiverEvent
Source§fn clone(&self) -> SameReceiverEvent
fn clone(&self) -> SameReceiverEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for SameReceiverEvent
impl Debug for SameReceiverEvent
Source§impl Display for SameReceiverEvent
impl Display for SameReceiverEvent
Source§impl From<SameReceiverEvent> for Option<Message>
impl From<SameReceiverEvent> for Option<Message>
Source§fn from(rx: SameReceiverEvent) -> Self
fn from(rx: SameReceiverEvent) -> Self
Source§impl From<SameReceiverEvent> for Option<MessageResult>
impl From<SameReceiverEvent> for Option<MessageResult>
Source§fn from(rx: SameReceiverEvent) -> Self
fn from(rx: SameReceiverEvent) -> Self
Source§impl Hash for SameReceiverEvent
impl Hash for SameReceiverEvent
Source§impl PartialEq for SameReceiverEvent
impl PartialEq for SameReceiverEvent
impl Eq for SameReceiverEvent
impl StructuralPartialEq for SameReceiverEvent
Auto Trait Implementations§
impl Freeze for SameReceiverEvent
impl RefUnwindSafe for SameReceiverEvent
impl Send for SameReceiverEvent
impl Sync for SameReceiverEvent
impl Unpin for SameReceiverEvent
impl UnwindSafe for SameReceiverEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.