pub struct Ieee802154<'a> { /* private fields */ }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>
impl<'a> Ieee802154<'a>
Sourcepub fn new(radio: IEEE802154<'a>) -> Self
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.
Sourcepub fn set_config(&mut self, cfg: Config)
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.
Sourcepub fn start_receive(&mut self)
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.
Sourcepub fn raw_received(&mut self) -> Option<RawReceived>
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.
Sourcepub fn get_ack_frame(&self) -> Option<RawReceived>
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.
Sourcepub fn received(&mut self) -> Option<Result<ReceivedFrame, Error>>
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.
Sourcepub fn transmit(&mut self, frame: &Frame, cca: bool) -> Result<(), Error>
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.
Sourcepub fn transmit_raw(&mut self, frame: &[u8], cca: bool) -> Result<(), Error>
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.
Sourcepub fn set_tx_done_callback(&mut self, callback: &'a mut (dyn FnMut() + Send))
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.
Sourcepub fn clear_tx_done_callback(&mut self)
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.
Sourcepub fn set_rx_available_callback(
&mut self,
callback: &'a mut (dyn FnMut() + Send),
)
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.
Sourcepub fn clear_rx_available_callback(&mut self)
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.
Sourcepub fn set_tx_done_callback_fn(&mut self, callback: fn())
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.
Sourcepub fn clear_tx_done_callback_fn(&mut self)
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.
Sourcepub fn set_rx_available_callback_fn(&mut self, callback: fn())
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.
Sourcepub fn clear_rx_available_callback_fn(&mut self)
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.
Sourcepub fn set_tx_failed_callback(&mut self, callback: &'a mut (dyn FnMut() + Send))
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.
Sourcepub fn clear_tx_failed_callback(&mut self)
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.
Sourcepub fn set_tx_failed_callback_fn(&mut self, callback: fn())
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.
Sourcepub fn clear_tx_failed_callback_fn(&mut self)
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.