pub struct EspNowSender<'d> { /* private fields */ }
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.
Implementations§
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.
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.