Public Member Functions | List of all members
uavcan::ICanIface Class Referenceabstract

#include <can.hpp>

Inheritance diagram for uavcan::ICanIface:
Inheritance graph
[legend]

Public Member Functions

virtual int16_t configureFilters (const CanFilterConfig *filter_configs, uint16_t num_configs)=0
 
virtual uint64_t getErrorCount () const =0
 
virtual uint16_t getNumFilters () const =0
 
virtual int16_t receive (CanFrame &out_frame, MonotonicTime &out_ts_monotonic, UtcTime &out_ts_utc, CanIOFlags &out_flags)=0
 
virtual int16_t send (const CanFrame &frame, MonotonicTime tx_deadline, CanIOFlags flags)=0
 
virtual ~ICanIface ()
 

Detailed Description

Single non-blocking CAN interface.

Definition at line 147 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.

Constructor & Destructor Documentation

◆ ~ICanIface()

virtual uavcan::ICanIface::~ICanIface ( )
inlinevirtual

Member Function Documentation

◆ configureFilters()

virtual int16_t uavcan::ICanIface::configureFilters ( const CanFilterConfig filter_configs,
uint16_t  num_configs 
)
pure virtual

Configure the hardware CAN filters. CanFilterConfig.

Returns
0 = success, negative for error.

Implemented in uavcan_lpc11c24::CanDriver, uavcan_kinetis::CanIface, uavcan_stm32::CanIface, uavcan_linux::SocketCanIface, CanIfaceMock, PairableCanDriver, and VirtualCanIface.

◆ getErrorCount()

virtual uint64_t uavcan::ICanIface::getErrorCount ( ) const
pure virtual

Continuously incrementing counter of hardware errors. Arbitration lost should not be treated as a hardware error.

Implemented in uavcan_linux::SocketCanIface, VirtualCanIface, uavcan_lpc11c24::CanDriver, uavcan_kinetis::CanIface, uavcan_stm32::CanIface, CanIfaceMock, and PairableCanDriver.

◆ getNumFilters()

virtual uint16_t uavcan::ICanIface::getNumFilters ( ) const
pure virtual

◆ receive()

virtual int16_t uavcan::ICanIface::receive ( CanFrame out_frame,
MonotonicTime out_ts_monotonic,
UtcTime out_ts_utc,
CanIOFlags out_flags 
)
pure virtual

Non-blocking reception.

Timestamps should be provided by the CAN driver, ideally by the hardware CAN controller.

Monotonic timestamp is required and can be not precise since it is needed only for protocol timing validation (transfer timeouts and inter-transfer intervals).

UTC timestamp is optional, if available it will be used for precise time synchronization; must be set to zero if not available.

Refer to ISystemClock to learn more about timestamps.

Parameters
[out]out_ts_monotonicMonotonic timestamp, mandatory.
[out]out_ts_utcUTC timestamp, optional, zero if unknown.
Returns
1 = one frame received, 0 = RX buffer empty, negative for error.

◆ send()

virtual int16_t uavcan::ICanIface::send ( const CanFrame frame,
MonotonicTime  tx_deadline,
CanIOFlags  flags 
)
pure virtual

Non-blocking transmission.

If the frame wasn't transmitted upon TX deadline, the driver should discard it.

Note that it is LIKELY that the library will want to send the frames that were passed into the select() method as the next ones to transmit, but it is NOT guaranteed. The library can replace those with new frames between the calls.

Returns
1 = one frame transmitted, 0 = TX buffer full, negative for error.

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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04