pub trait LoraRadio {
type Error: Debug;
// Required methods
fn link(&self) -> Option<LinkSettings>;
fn start_transmit(&mut self, frame: &[u8]) -> Result<u64, Self::Error>;
fn finish_transmit(&mut self) -> Result<bool, Self::Error>;
fn listen(&mut self) -> Result<(), Self::Error>;
fn take_frame(
&mut self,
buffer: &mut [u8],
) -> Result<Option<usize>, Self::Error>;
}Expand description
Required Associated Types§
Required Methods§
Sourcefn link(&self) -> Option<LinkSettings>
fn link(&self) -> Option<LinkSettings>
Returns the link settings frames go out with, which the duty cycle’s arithmetic needs.
§Returns
The settings, or None while the radio is unconfigured.
Sourcefn finish_transmit(&mut self) -> Result<bool, Self::Error>
fn finish_transmit(&mut self) -> Result<bool, Self::Error>
Reports whether the frame start_transmit began has
left.
§Returns
true once it has been sent.
§Errors
Whatever the radio reports, including a transmission that timed out.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".