pub struct Status(/* private fields */);
Expand description

Radio status.

This is returned by status.

Implementations§

source§

impl Status

source

pub const fn from_raw(value: u8) -> Status

Create a new Status from a raw u8 value.

This is the same as Status::from(u8), but in a const function.

Example
use stm32wlxx_hal::subghz::{CmdStatus, Status, StatusMode};

const STATUS: Status = Status::from_raw(0x54_u8);
assert_eq!(STATUS.mode(), Ok(StatusMode::Rx));
assert_eq!(STATUS.cmd(), Ok(CmdStatus::Available));
source

pub const fn mode(&self) -> Result<StatusMode, u8>

sub-GHz radio operating mode.

Example
use stm32wlxx_hal::subghz::{Status, StatusMode};

let status: Status = 0xACu8.into();
assert_eq!(status.mode(), Ok(StatusMode::StandbyRc));
source

pub const fn cmd(&self) -> Result<CmdStatus, u8>

Command status.

This method frequently returns reserved values such as Err(1). ST support has confirmed that this is normal and should be ignored.

Example
use stm32wlxx_hal::subghz::{CmdStatus, Status};

let status: Status = 0xACu8.into();
assert_eq!(status.cmd(), Ok(CmdStatus::Complete));

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Status> for u8

source§

fn from(x: Status) -> Self

Converts to this type from the input type.
source§

impl From<u8> for Status

source§

fn from(x: u8) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Status

source§

fn eq(&self, other: &Status) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Status

source§

impl Eq for Status

source§

impl StructuralEq for Status

source§

impl StructuralPartialEq for Status

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.