Lely core libraries
2.2.5
|
Go to the documentation of this file.
25 #ifndef LELY_IO2_CO_CAN_HPP_
26 #define LELY_IO2_CO_CAN_HPP_
42 ::std::chrono::nanoseconds* dp =
nullptr,
45 msg,
err, dp ? &ts_ :
nullptr, exec,
48 auto result = read->r.result;
52 if (self->dp_) *
self->dp_ = util::from_timespec(self->ts_);
75 virtual void operator()(
int result, ::std::error_code ec) noexcept = 0;
79 ::std::chrono::nanoseconds* dp_{
nullptr};
114 virtual void operator()(::std::error_code ec) noexcept = 0;
120 #endif // !LELY_IO2_CO_CAN_HPP_
const struct ev_exec_vtbl *const ev_exec_t
An abstract task executor.
struct io_can_chan_read * io_can_chan_read_from_task(struct ev_task *task)
Obtains a pointer to a CAN channel read operation from a pointer to its completion task.
A CAN channel write operation with a stackless coroutine as the completion task.
virtual void operator()(::std::error_code ec) noexcept=0
The coroutine to be executed once the write operation completes (or is canceled).
A CAN or CAN FD format frame.
struct ev_task task
The task (to be) submitted upon completion (or cancellation) of the write 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).
A CAN channel read operation.
#define IO_CAN_CHAN_READ_INIT(msg, err, tp, exec, func)
The static initializer for io_can_chan_read.
struct can_msg * msg
The address at which to store the CAN frame.
A CAN channel write operation.
const struct can_msg * msg
A pointer to the CAN frame to be written.
An abstract task executor. This class is a wrapper around #ev_exec_t*.
The parent class for function objects used as stackless coroutines.
#define IO_CAN_CHAN_WRITE_INIT(msg, exec, func)
The static initializer for io_can_chan_write.
CoCanChannelWrite(const can_msg *msg, ev_exec_t *exec=nullptr) noexcept
Constructs a write operation.
CoCanChannelRead(can_msg *msg, can_err *err=nullptr, ::std::chrono::nanoseconds *dp=nullptr, ev_exec_t *exec=nullptr) noexcept
Constructs a read operation.
struct can_err * err
The address at which to store the CAN error frame.
struct io_can_chan_write * io_can_chan_write_from_task(struct ev_task *task)
Obtains a pointer to a CAN channel write operation from a pointer to its completion task.
ev::Executor get_executor() const noexcept
Returns the executor to which the completion task is (to be) submitted.
struct ev_task task
The task (to be) submitted upon completion (or cancellation) of the read operation.
::std::error_code make_error_code(SdoErrc e) noexcept
Creates an error code corresponding to an SDO abort code.
ev_exec_t * exec
A pointer to the executor to which the task is (to be) submitted.
A CAN channel read operation with a stackless coroutine as the completion task.