Struct esp_wifi::esp_now::SendWaiter
source · pub struct SendWaiter<'s>(/* private fields */);
Expand description
This struct is returned by a sync esp now send. Invoking wait
method of
this struct will block current task until the callback function of esp now
send is called and return the status of previous sending.
This waiter borrows the sender, so when used in multiple tasks, the lock
will only be released when the waiter is dropped or consumed via wait
.
When using a lock that disables interrupts, the waiter will block forever since the callback which signals the completion of sending will never be invoked.
Implementations§
source§impl SendWaiter<'_>
impl SendWaiter<'_>
sourcepub fn wait(self) -> Result<(), EspNowError>
pub fn wait(self) -> Result<(), EspNowError>
Wait for the previous sending to complete, i.e. the send callback is invoked with status of the sending.