Skip to main content

Ieee802154

Struct Ieee802154 

Source
pub struct Ieee802154<'a> { /* private fields */ }
Available on crate features ieee802154 and unstable only.
Expand description

IEEE 802.15.4 driver

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Implementations§

Source§

impl<'a> Ieee802154<'a>

Source

pub fn new(radio: IEEE802154<'a>) -> Self

Construct a new driver, enabling the IEEE 802.15.4 radio in the process

NOTE: Coexistence with Wi-Fi or Bluetooth is currently not possible. If you do it anyway, things will break.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_config(&mut self, cfg: Config)

Set the configuration for the driver

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn start_receive(&mut self)

Start receiving frames

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn raw_received(&mut self) -> Option<RawReceived>

Return the raw data of a received frame

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn get_ack_frame(&self) -> Option<RawReceived>

Get the ACK frame received in response to the last transmission.

When a transmitted frame requires acknowledgment, the peer sends back an ACK frame. This method returns that ACK frame data, which includes the Frame Pending bit and other information needed by upper layers like OpenThread.

Returns None if no ACK was received (frame didn’t require ACK, ACK timed out, or no transmission has occurred).

The ACK frame is cleared at the start of each new transmission.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn received(&mut self) -> Option<Result<ReceivedFrame, Error>>

Get a received frame, if available

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn transmit(&mut self, frame: &Frame, cca: bool) -> Result<(), Error>

Transmit a frame

If cca is true, a Clear Channel Assessment is performed before transmitting. The transmission is aborted if the channel is busy.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn transmit_raw(&mut self, frame: &[u8], cca: bool) -> Result<(), Error>

Transmit a raw frame

If cca is true, a Clear Channel Assessment is performed before transmitting. The transmission is aborted if the channel is busy.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_tx_done_callback(&mut self, callback: &'a mut (dyn FnMut() + Send))

Set the transmit done callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn clear_tx_done_callback(&mut self)

Clear the transmit done callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_rx_available_callback( &mut self, callback: &'a mut (dyn FnMut() + Send), )

Set the receive available callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn clear_rx_available_callback(&mut self)

Clear the receive available callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_tx_done_callback_fn(&mut self, callback: fn())

Set the transmit done callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn clear_tx_done_callback_fn(&mut self)

Clear the transmit done callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_rx_available_callback_fn(&mut self, callback: fn())

Set the receive available callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn clear_rx_available_callback_fn(&mut self)

Clear the receive available callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_tx_failed_callback(&mut self, callback: &'a mut (dyn FnMut() + Send))

Set the transmit failed callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn clear_tx_failed_callback(&mut self)

Clear the transmit failed callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn set_tx_failed_callback_fn(&mut self, callback: fn())

Set the transmit failed callback function pointer.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn clear_tx_failed_callback_fn(&mut self)

Clear the transmit failed callback function.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Trait Implementations§

Source§

impl<'a> Debug for Ieee802154<'a>

Source§

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

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

impl Drop for Ieee802154<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a> Format for Ieee802154<'a>
where [u8; 129]: Format, PhyClockGuard<'a>: Format, PhyInitGuard<'a>: Format,

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.

Auto Trait Implementations§

§

impl<'a> Freeze for Ieee802154<'a>

§

impl<'a> RefUnwindSafe for Ieee802154<'a>

§

impl<'a> Send for Ieee802154<'a>

§

impl<'a> Sync for Ieee802154<'a>

§

impl<'a> Unpin for Ieee802154<'a>

§

impl<'a> UnsafeUnpin for Ieee802154<'a>

§

impl<'a> UnwindSafe for Ieee802154<'a>

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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> Same for T

Source§

type Output = T

Should always be Self
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.