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

A CAN channel. More...

#include <can.hpp>

Inheritance diagram for lely::io::CanChannel:
Collaboration diagram for lely::io::CanChannel:

Public Member Functions

 CanChannel (io_poll_t *poll, ev_exec_t *exec, ::std::size_t rxlen=0)
 ~CanChannel ()
int get_handle () const noexcept
void open (const io_can_ctrl_t *ctrl, CanBusFlag flags, ::std::error_code &ec) noexcept
void open (const io_can_ctrl_t *ctrl, CanBusFlag flags=CanBusFlag::NONE)
void assign (int fd, ::std::error_code &ec) noexcept
void assign (int fd)
int release () noexcept
bool is_open () const noexcept
void close (::std::error_code &ec) noexcept
void close ()
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 CAN channel.

Definition at line 89 of file can.hpp.

Constructor & Destructor Documentation

◆ CanChannel()

lely::io::CanChannel::CanChannel ( io_poll_t * poll,
ev_exec_t * exec,
::std::size_t rxlen = 0 )
inline
See also
io_can_chan_create()

Definition at line 92 of file can.hpp.

◆ ~CanChannel()

lely::io::CanChannel::~CanChannel ( )
inline
See also
io_can_chan_destroy()

Definition at line 115 of file can.hpp.

Member Function Documentation

◆ get_handle()

int lely::io::CanChannel::get_handle ( ) const
inlinenoexcept
See also
io_can_chan_get_handle()

Definition at line 119 of file can.hpp.

◆ open() [1/2]

void lely::io::CanChannel::open ( const io_can_ctrl_t * ctrl,
CanBusFlag flags,
::std::error_code & ec )
inlinenoexcept
See also
io_can_chan_open()

Definition at line 125 of file can.hpp.

◆ open() [2/2]

void lely::io::CanChannel::open ( const io_can_ctrl_t * ctrl,
CanBusFlag flags = CanBusFlag::NONE )
inline
See also
io_can_chan_open()

Definition at line 138 of file can.hpp.

◆ assign() [1/2]

void lely::io::CanChannel::assign ( int fd,
::std::error_code & ec )
inlinenoexcept
See also
io_can_chan_assign()

Definition at line 146 of file can.hpp.

◆ assign() [2/2]

void lely::io::CanChannel::assign ( int fd)
inline
See also
io_can_chan_assign()

Definition at line 158 of file can.hpp.

◆ release()

int lely::io::CanChannel::release ( )
inlinenoexcept
See also
io_can_chan_release()

Definition at line 166 of file can.hpp.

◆ is_open()

bool lely::io::CanChannel::is_open ( ) const
inlinenoexcept
See also
io_can_chan_is_open()

Definition at line 172 of file can.hpp.

◆ close() [1/2]

void lely::io::CanChannel::close ( ::std::error_code & ec)
inlinenoexcept
See also
io_can_chan_close()

Definition at line 178 of file can.hpp.

◆ close() [2/2]

void lely::io::CanChannel::close ( )
inline
See also
io_can_chan_close()

Definition at line 190 of file can.hpp.


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