Lely core libraries  2.2.5
can.hpp File Reference

This header file is part of the I/O library; it contains the C++ interface for the abstract CAN bus. More...

#include <lely/ev/future.hpp>
#include <lely/io2/can/err.hpp>
#include <lely/io2/can/msg.hpp>
#include <lely/io2/can.h>
#include <lely/io2/dev.hpp>
#include <lely/util/chrono.hpp>
#include <utility>
Include dependency graph for can.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  lely::io::detail::CanChannelReadWrapper< F >
 
class  lely::io::CanChannelRead
 A read operation suitable for use with a CAN channel. More...
 
class  lely::io::detail::CanChannelWriteWrapper< F >
 
class  lely::io::CanChannelWrite
 A write operation suitable for use with a CAN channel. More...
 
class  lely::io::CanControllerBase
 A reference to an abstract CAN controller. More...
 
class  lely::io::CanChannelBase
 A reference to an abstract CAN channel. More...
 

Enumerations

enum class  lely::io::CanBusFlag : int { ERR = IO_CAN_BUS_FLAG_ERR , FDF = IO_CAN_BUS_FLAG_FDF , BRS = IO_CAN_BUS_FLAG_BRS , NONE = IO_CAN_BUS_FLAG_NONE , MASK = IO_CAN_BUS_FLAG_MASK }
 The CAN bus flags. More...
 

Functions

template<class F >
typename ::std::enable_if< compat::is_invocable< F, int, ::std::error_code >::value, detail::CanChannelReadWrapper< F > * >::type lely::io::make_can_channel_read_wrapper (can_msg *msg, can_err *err, ::std::chrono::nanoseconds *dp, ev_exec_t *exec, F &&f)
 Creates a CAN channel read operation with a completion task. More...
 
template<class F >
typename ::std::enable_if< compat::is_invocable< F, ::std::error_code >::value, detail::CanChannelWriteWrapper< F > * >::type lely::io::make_can_channel_write_wrapper (const can_msg &msg, ev_exec_t *exec, F &&f)
 Creates a CAN channel write operation with a completion task. More...
 

Detailed Description

This header file is part of the I/O library; it contains the C++ interface for the abstract CAN bus.

See also
lely/io2/can.h
Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file can.hpp.

Enumeration Type Documentation

◆ CanBusFlag

enum lely::io::CanBusFlag : int
strong

The CAN bus flags.

Enumerator
ERR 

Reception of error frames is enabled.

FDF 

FD Format (formerly Extended Data Length) support is enabled.

BRS 

Bit Rate Switch support is enabled.

Definition at line 40 of file can.hpp.

Function Documentation

◆ make_can_channel_read_wrapper()

template<class F >
typename ::std::enable_if< compat::is_invocable<F, int, ::std::error_code>::value, detail::CanChannelReadWrapper<F>*>::type lely::io::make_can_channel_read_wrapper ( can_msg msg,
can_err err,
::std::chrono::nanoseconds *  dp,
ev_exec_t exec,
F &&  f 
)
inline

Creates a CAN channel read operation with a completion task.

The operation deletes itself after it is completed, so it MUST NOT be deleted once it is submitted to a CAN channel.

Definition at line 132 of file can.hpp.

◆ make_can_channel_write_wrapper()

template<class F >
typename ::std::enable_if< compat::is_invocable<F, ::std::error_code>::value, detail::CanChannelWriteWrapper<F>*>::type lely::io::make_can_channel_write_wrapper ( const can_msg msg,
ev_exec_t exec,
F &&  f 
)
inline

Creates a CAN channel write operation with a completion task.

The operation deletes itself after it is completed, so it MUST NOT be deleted once it is submitted to a CAN channel.

Definition at line 231 of file can.hpp.