Mbed OS Reference
|
Base class for asynchronous operations in the USB stack. More...
#include <AsyncOp.h>
Public Member Functions | |
AsyncOp () | |
Construct a new AsyncOp object. More... | |
AsyncOp (mbed::Callback< void()> &callback) | |
Construct a new AsyncOp object. More... | |
virtual | ~AsyncOp () |
Cleanup resources used by this AsyncOp. More... | |
void | wait (rtos::Mutex *host_mutex, rtos::Kernel::Clock::duration_u32 rel_time=rtos::Kernel::wait_for_u32_forever) |
Wait for this asynchronous operation to complete. More... | |
void | abort () |
Abort this asynchronous operation. More... | |
bool | timeout () |
Check if this operation timed out. More... | |
bool | aborted () |
Check if this operation was aborted. More... | |
Protected Member Functions | |
virtual bool | process ()=0 |
Callback indicating that something changed. More... | |
virtual void | complete () |
Callback indicating that this event finished. More... | |
Base class for asynchronous operations in the USB stack.
Classes such as USBCDC use this to submit operations to be processed by an ISR.
AsyncOp | ( | mbed::Callback< void()> & | callback | ) |
Construct a new AsyncOp object.
callback | Completion callback |
void wait | ( | rtos::Mutex * | host_mutex, |
rtos::Kernel::Clock::duration_u32 | rel_time = rtos::Kernel::wait_for_u32_forever |
||
) |
Wait for this asynchronous operation to complete.
If the timeout expires then this asynchronous operation is aborted and the timeout flag is set.
void abort | ( | ) |
Abort this asynchronous operation.
This function has no effect if the operation is complete. Otherwise the aborted flag is set.
bool timeout | ( | ) |
Check if this operation timed out.
bool aborted | ( | ) |
Check if this operation was aborted.
|
protectedpure virtual |
Callback indicating that something changed.
|
protectedvirtual |
Callback indicating that this event finished.