pub enum CommandStatus {
DataAvailable,
Timeout,
ProcessingError,
ExecutionFailed,
TransmitDone,
}Expand description
How the last command went, from the low bits of a status byte.
Variants§
DataAvailable
There is something for the host to read.
Timeout
The command ran out of time.
ProcessingError
The radio could not process the command.
ExecutionFailed
The radio understood the command and could not carry it out.
TransmitDone
A transmission finished.
Implementations§
Source§impl CommandStatus
impl CommandStatus
Sourcepub const fn of(status: u8) -> Option<CommandStatus>
pub const fn of(status: u8) -> Option<CommandStatus>
Reads the command status out of a status byte.
§Arguments
status- the byte the radio answered with.
§Returns
The status, or None for a value the datasheet reserves.
§Examples
use pamoja_radios::sx1302::sx1261::CommandStatus;
assert_eq!(CommandStatus::of(0x24), Some(CommandStatus::DataAvailable));
assert_eq!(CommandStatus::of(0x2c), Some(CommandStatus::TransmitDone));Trait Implementations§
Source§impl Clone for CommandStatus
impl Clone for CommandStatus
Source§fn clone(&self) -> CommandStatus
fn clone(&self) -> CommandStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CommandStatus
Source§impl Debug for CommandStatus
impl Debug for CommandStatus
impl Eq for CommandStatus
Source§impl PartialEq for CommandStatus
impl PartialEq for CommandStatus
impl StructuralPartialEq for CommandStatus
Auto Trait Implementations§
impl Freeze for CommandStatus
impl RefUnwindSafe for CommandStatus
impl Send for CommandStatus
impl Sync for CommandStatus
impl Unpin for CommandStatus
impl UnsafeUnpin for CommandStatus
impl UnwindSafe for CommandStatus
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