pub struct EspNowSender<'d> { /* private fields */ }unstable only.Expand description
This is the sender part of ESP-NOW. You can get this sender by splitting
a EspNow instance.
You need a lock when using this sender in multiple tasks. DO NOT USE a lock implementation that disables interrupts since the completion of a sending requires waiting for a callback invoked in an interrupt.
§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 EspNowSender<'_>
impl EspNowSender<'_>
Sourcepub fn send<'s>(
&'s mut self,
dst_addr: &[u8; 6],
data: &[u8],
) -> Result<SendWaiter<'s>, EspNowError>
pub fn send<'s>( &'s mut self, dst_addr: &[u8; 6], data: &[u8], ) -> Result<SendWaiter<'s>, EspNowError>
Send data to peer
The peer needs to be added to the peer list first.
§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§impl EspNowSender<'_>
impl EspNowSender<'_>
Sourcepub fn send_async<'s, 'r>(
&'s mut self,
addr: &'r [u8; 6],
data: &'r [u8],
) -> SendFuture<'s, 'r> ⓘ
pub fn send_async<'s, 'r>( &'s mut self, addr: &'r [u8; 6], data: &'r [u8], ) -> SendFuture<'s, 'r> ⓘ
Sends data asynchronously to a peer (using its MAC) using ESP-NOW.
§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.