pub enum Modulation {
LoRa(LoRaConfig),
FskGfsk(FskConfig),
LrFhss(LrFhssConfig),
Flrc(FlrcConfig),
}Expand description
Any of the four modulation configs, tagged by ModulationId.
This is the type carried inside Command::SetConfig. Encoding writes
the modulation_id byte first, then delegates to the per-modulation
encode. Decoding dispatches on the leading byte and calls the
matching decode.
Variants§
Implementations§
Source§impl Modulation
impl Modulation
pub const fn id(&self) -> ModulationId
Sourcepub fn encode(&self, buf: &mut [u8]) -> Result<usize, ModulationEncodeError>
pub fn encode(&self, buf: &mut [u8]) -> Result<usize, ModulationEncodeError>
Encode as [modulation_id][params] into buf. Returns the total
number of bytes written.
Sourcepub fn decode(buf: &[u8]) -> Result<Self, ModulationParseError>
pub fn decode(buf: &[u8]) -> Result<Self, ModulationParseError>
Decode from [modulation_id][params]. The full slice is the
SET_CONFIG payload; length errors are propagated as
ModulationParseError::WrongLength.
Trait Implementations§
Source§impl Clone for Modulation
impl Clone for Modulation
Source§fn clone(&self) -> Modulation
fn clone(&self) -> Modulation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Modulation
impl Debug for Modulation
Source§impl Format for Modulation
impl Format for Modulation
Source§impl PartialEq for Modulation
impl PartialEq for Modulation
impl Copy for Modulation
impl Eq for Modulation
impl StructuralPartialEq for Modulation
Auto Trait Implementations§
impl Freeze for Modulation
impl RefUnwindSafe for Modulation
impl Send for Modulation
impl Sync for Modulation
impl Unpin for Modulation
impl UnsafeUnpin for Modulation
impl UnwindSafe for Modulation
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