A CAN network interface. This class is a wrapper around io_can_net_t*
.
More...
#include <can_net.hpp>
|
void | lock () final |
| Blocks until a lock can be obtained for the current execution agent (thread, process, task). More...
|
|
void | unlock () final |
| Releases the lock held by the execution agent. Throws no exceptions.
|
|
void | set_time () |
| Updates the CAN network time. More...
|
|
virtual void | on_read_error (::std::error_code ec, ::std::size_t errcnt) noexcept |
| The function invoked when a new CAN frame read error occurs, or when a read operation completes successfully after one or more errors. More...
|
|
virtual void | on_queue_error (::std::error_code ec, ::std::size_t errcnt) noexcept |
| The function invoked when a CAN frame is dropped because the transmit queue is full, or when a frame is successfully queued after one or more errors. More...
|
|
virtual void | on_write_error (::std::error_code ec, ::std::size_t errcnt) noexcept |
| The function invoked when a new CAN frame write error occurs, or when a write operation completes successfully after one or more errors. More...
|
|
virtual void | on_can_state (CanState new_state, CanState old_state) noexcept |
| The function invoked when a CAN bus state change is detected. More...
|
|
virtual void | on_can_error (CanError error) noexcept |
| The function invoked when an error is detected on the CAN bus. More...
|
|
virtual void | lock ()=0 |
| Blocks until a lock can be obtained for the current execution agent (thread, process, task). More...
|
|
virtual void | unlock ()=0 |
| Releases the lock held by the execution agent. Throws no exceptions.
|
|
A CAN network interface. This class is a wrapper around io_can_net_t*
.
Definition at line 38 of file can_net.hpp.
◆ CanNet() [1/2]
◆ CanNet() [2/2]
◆ ~CanNet()
virtual lely::io::CanNet::~CanNet |
( |
| ) |
|
|
inlinevirtual |
◆ start()
void lely::io::CanNet::start |
( |
| ) |
|
|
inlinenoexcept |
◆ get_ctx()
◆ get_executor()
◆ get_clock()
Clock lely::io::CanNet::get_clock |
( |
| ) |
const |
|
inlinenoexcept |
◆ lock()
void lely::io::CanNet::lock |
( |
| ) |
|
|
inlinefinalprotectedvirtual |
Blocks until a lock can be obtained for the current execution agent (thread, process, task).
If an exception is thrown, no lock is obtained.
Implements lely::util::BasicLockable.
Definition at line 104 of file can_net.hpp.
◆ set_time()
void lely::io::CanNet::set_time |
( |
| ) |
|
|
inlineprotected |
Updates the CAN network time.
The mutex protecting the CAN network interface MUST be locked for the duration of this call.
- See also
- io_can_net_set_time()
Definition at line 124 of file can_net.hpp.
◆ on_read_error()
virtual void lely::io::CanNet::on_read_error |
( |
::std::error_code |
ec, |
|
|
::std::size_t |
errcnt |
|
) |
| |
|
inlineprotectedvirtualnoexcept |
The function invoked when a new CAN frame read error occurs, or when a read operation completes successfully after one or more errors.
The mutex protecting the CAN network interface will be locked when this function is called.
- Parameters
-
ec | the error code (0 on success). |
errcnt | the number of errors since the last successful read operation. |
Definition at line 140 of file can_net.hpp.
◆ on_queue_error()
virtual void lely::io::CanNet::on_queue_error |
( |
::std::error_code |
ec, |
|
|
::std::size_t |
errcnt |
|
) |
| |
|
inlineprotectedvirtualnoexcept |
The function invoked when a CAN frame is dropped because the transmit queue is full, or when a frame is successfully queued after one or more errors.
The mutex protecting the CAN network interface will be locked when this function is called.
- Parameters
-
ec | the error code (0 on success). |
errcnt | the number of errors since the last frame was successfully queued. |
Definition at line 157 of file can_net.hpp.
◆ on_write_error()
virtual void lely::io::CanNet::on_write_error |
( |
::std::error_code |
ec, |
|
|
::std::size_t |
errcnt |
|
) |
| |
|
inlineprotectedvirtualnoexcept |
The function invoked when a new CAN frame write error occurs, or when a write operation completes successfully after one or more errors.
The mutex protecting the CAN network interface will be locked when this function is called.
- Parameters
-
ec | the error code (0 on success). |
errcnt | the number of errors since the last successful write operation. |
Definition at line 174 of file can_net.hpp.
◆ on_can_state()
virtual void lely::io::CanNet::on_can_state |
( |
CanState |
new_state, |
|
|
CanState |
old_state |
|
) |
| |
|
inlineprotectedvirtualnoexcept |
◆ on_can_error()
virtual void lely::io::CanNet::on_can_error |
( |
CanError |
error | ) |
|
|
inlineprotectedvirtualnoexcept |
The function invoked when an error is detected on the CAN bus.
The mutex protecting the CAN network interface will be locked when this function is called.
- Parameters
-
Definition at line 208 of file can_net.hpp.
The documentation for this class was generated from the following file: