pub enum Command {
Ping,
GetInfo,
SetConfig(Modulation),
Tx {
flags: TxFlags,
data: Vec<u8, MAX_OTA_PAYLOAD>,
},
RxStart,
RxStop,
}Expand description
Host-to-device command.
Tx.data is owned so a parsed Command outlives the frame buffer it
came from. This is a single memcpy over the radio packet — trivial
relative to LoRa airtime, and it simplifies the firmware’s statechart
(which needs to carry the pending TX across state transitions).
Variants§
Implementations§
Source§impl Command
impl Command
Sourcepub fn encode_payload(
&self,
buf: &mut [u8],
) -> Result<usize, CommandEncodeError>
pub fn encode_payload( &self, buf: &mut [u8], ) -> Result<usize, CommandEncodeError>
Encode the command’s payload (the bytes between the frame header
and the CRC) into buf. Returns the number of bytes written.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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