Lely core libraries 2.3.4
|
A CAN channel read operation with a stackless coroutine as the completion task. More...
#include <co_can.hpp>
Public Member Functions | |
CoCanChannelRead (can_msg *msg, can_err *err=nullptr, ::std::chrono::nanoseconds *dp=nullptr, ev_exec_t *exec=nullptr) noexcept | |
Constructs a read operation. | |
ev::Executor | get_executor () const noexcept |
Returns the executor to which the completion task is (to be) submitted. | |
virtual void | operator() (int result, ::std::error_code ec) noexcept=0 |
The coroutine to be executed once the read operation completes (or is canceled). | |
![]() | |
void | restart () noexcept |
Resets the stackless coroutine so the next invocation starts at the beginning. | |
bool | is_ready () const noexcept |
Returns true if the stackless coroutine has finished. | |
bool | is_parent () const noexcept |
Returns true if the stackless coroutine is the parent of a fork. | |
bool | is_child () const noexcept |
Returns true if the stackless coroutine is the child of a fork. | |
Additional Inherited Members | |
![]() | |
struct can_msg * | msg |
The address at which to store the CAN frame. | |
struct can_err * | err |
The address at which to store the CAN error frame. | |
struct timespec * | tp |
The address at which to store the system time at which the CAN frame or CAN error frame was received. | |
struct ev_task | task |
The task (to be) submitted upon completion (or cancellation) of the read operation. | |
struct io_can_chan_read_result | r |
The result of the read operation. | |
A CAN channel read operation with a stackless coroutine as the completion task.
Definition at line 38 of file co_can.hpp.
|
pure virtualnoexcept |
The coroutine to be executed once the read operation completes (or is canceled).
result | 1 if a CAN frame is received, 0 if an error frame is received, or -1 on error (or if the operation is canceled). |
ec | the error code, or 0 on success. |