Lely core libraries 2.3.5
lely::io::UserCanChannel Class Reference

A user-defined CAN channel. More...

#include <can.hpp>

Inheritance diagram for lely::io::UserCanChannel:
Collaboration diagram for lely::io::UserCanChannel:

Public Member Functions

 UserCanChannel (io_ctx_t *ctx, ev_exec_t *exec, CanBusFlag flags=CanBusFlag::NONE, size_t rxlen=0, int txtime=0, io_user_can_chan_write_t *func=nullptr, void *arg=nullptr)
 
 ~UserCanChannel ()
 
void on_read (const can_msg *msg, const ::std::chrono::nanoseconds &d, int timeout, ::std::error_code &ec) noexcept
 
void on_read (const can_msg *msg, const ::std::chrono::nanoseconds &d, int timeout=-1)
 
void on_read (const can_msg *msg, int timeout, ::std::error_code &ec) noexcept
 
void on_read (const can_msg *msg, int timeout=-1)
 
void on_read (const can_err *err, const ::std::chrono::nanoseconds &d, int timeout, ::std::error_code &ec) noexcept
 
void on_read (const can_err *err, const ::std::chrono::nanoseconds &d, int timeout=-1)
 
void on_read (const can_err *err, int timeout, ::std::error_code &ec) noexcept
 
void on_read (const can_err *err, int timeout=-1)
 
- Public Member Functions inherited from lely::io::CanChannelBase
CanBusFlag get_flags () const
 
int read (can_msg *msg, can_err *err, ::std::chrono::nanoseconds *dp, int timeout, ::std::error_code &ec) noexcept
 
bool read (can_msg *msg, can_err *err=nullptr, ::std::chrono::nanoseconds *dp=nullptr, int timeout=-1)
 
void submit_read (struct io_can_chan_read &read) noexcept
 
template<class F>
void submit_read (can_msg *msg, can_err *err, ::std::chrono::nanoseconds *dp, ev_exec_t *exec, F &&f)
 
template<class F>
void submit_read (can_msg *msg, can_err *err, ::std::chrono::nanoseconds *dp, F &&f)
 
bool cancel_read (struct io_can_chan_read &read) noexcept
 
bool abort_read (struct io_can_chan_read &read) noexcept
 
ev::Future< int, int > async_read (ev_exec_t *exec, can_msg *msg, can_err *err=nullptr, timespec *tp=nullptr, struct io_can_chan_read **pread=nullptr)
 
ev::Future< int, int > async_read (can_msg *msg, can_err *err=nullptr, timespec *tp=nullptr, struct io_can_chan_read **pread=nullptr)
 
void write (const can_msg &msg, int timeout, ::std::error_code &ec) noexcept
 
void write (const can_msg &msg, int timeout=-1)
 
void submit_write (struct io_can_chan_write &write) noexcept
 
template<class F>
void submit_write (const can_msg &msg, ev_exec_t *exec, F &&f)
 
template<class F>
void submit_write (const can_msg &msg, F &&f)
 
bool cancel_write (struct io_can_chan_write &write) noexcept
 
bool abort_write (struct io_can_chan_write &write) noexcept
 
ev::Future< void, int > async_write (ev_exec_t *exec, const can_msg &msg, struct io_can_chan_write **pwrite=nullptr)
 
ev::Future< void, int > async_write (const can_msg &msg, struct io_can_chan_write **pwrite=nullptr)
 
- Public Member Functions inherited from lely::io::Device
ContextBase get_ctx () const noexcept
 
ev::Executor get_executor () const noexcept
 
bool cancel (ev_task &task) noexcept
 
::std::size_t cancel_all () noexcept
 
bool abort (ev_task &task) noexcept
 
::std::size_t abort_all () noexcept
 

Detailed Description

A user-defined CAN channel.

Definition at line 37 of file can.hpp.

Constructor & Destructor Documentation

◆ UserCanChannel()

lely::io::UserCanChannel::UserCanChannel ( io_ctx_t * ctx,
ev_exec_t * exec,
CanBusFlag flags = CanBusFlag::NONE,
size_t rxlen = 0,
int txtime = 0,
io_user_can_chan_write_t * func = nullptr,
void * arg = nullptr )
inline
See also
io_user_can_chan_create()

Definition at line 40 of file can.hpp.

◆ ~UserCanChannel()

lely::io::UserCanChannel::~UserCanChannel ( )
inline
See also
io_user_can_chan_destroy()

Definition at line 67 of file can.hpp.

Member Function Documentation

◆ on_read() [1/8]

void lely::io::UserCanChannel::on_read ( const can_msg * msg,
const ::std::chrono::nanoseconds & d,
int timeout,
::std::error_code & ec )
inlinenoexcept
See also
io_user_can_chan_on_msg()

Definition at line 71 of file can.hpp.

◆ on_read() [2/8]

void lely::io::UserCanChannel::on_read ( const can_msg * msg,
const ::std::chrono::nanoseconds & d,
int timeout = -1 )
inline
See also
io_user_can_chan_on_msg()

Definition at line 85 of file can.hpp.

◆ on_read() [3/8]

void lely::io::UserCanChannel::on_read ( const can_msg * msg,
int timeout,
::std::error_code & ec )
inlinenoexcept
See also
io_user_can_chan_on_msg()

Definition at line 94 of file can.hpp.

◆ on_read() [4/8]

void lely::io::UserCanChannel::on_read ( const can_msg * msg,
int timeout = -1 )
inline
See also
io_user_can_chan_on_msg()

Definition at line 106 of file can.hpp.

◆ on_read() [5/8]

void lely::io::UserCanChannel::on_read ( const can_err * err,
const ::std::chrono::nanoseconds & d,
int timeout,
::std::error_code & ec )
inlinenoexcept
See also
io_user_can_chan_on_err()

Definition at line 114 of file can.hpp.

◆ on_read() [6/8]

void lely::io::UserCanChannel::on_read ( const can_err * err,
const ::std::chrono::nanoseconds & d,
int timeout = -1 )
inline
See also
io_user_can_chan_on_err()

Definition at line 128 of file can.hpp.

◆ on_read() [7/8]

void lely::io::UserCanChannel::on_read ( const can_err * err,
int timeout,
::std::error_code & ec )
inlinenoexcept
See also
io_user_can_chan_on_err()

Definition at line 137 of file can.hpp.

◆ on_read() [8/8]

void lely::io::UserCanChannel::on_read ( const can_err * err,
int timeout = -1 )
inline
See also
io_user_can_chan_on_err()

Definition at line 149 of file can.hpp.


The documentation for this class was generated from the following file: