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

#include <can.hpp>

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

Public Member Functions

virtual const ICanIfacegetIface (uint8_t iface_index) const
 
virtual ICanIfacegetIface (uint8_t iface_index)=0
 
virtual uint8_t getNumIfaces () const =0
 
virtual int16_t select (CanSelectMasks &inout_masks, const CanFrame *(&pending_tx)[MaxCanIfaces], MonotonicTime blocking_deadline)=0
 
virtual ~ICanDriver ()
 

Detailed Description

Generic CAN driver.

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

Constructor & Destructor Documentation

◆ ~ICanDriver()

virtual uavcan::ICanDriver::~ICanDriver ( )
inlinevirtual

Member Function Documentation

◆ getIface() [1/2]

virtual const ICanIface* uavcan::ICanDriver::getIface ( uint8_t  iface_index) const
inlinevirtual

Default implementation of this method calls the non-const overload of getIface(). Can be overriden by the application if necessary.

Reimplemented in CanDriverMock, and PairableCanDriver.

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

◆ getIface() [2/2]

virtual ICanIface* uavcan::ICanDriver::getIface ( uint8_t  iface_index)
pure virtual

Returns an interface by index, or null pointer if the index is out of range.

Implemented in uavcan_lpc11c24::CanDriver, uavcan_kinetis::CanDriver, uavcan_stm32::CanDriver, CanDriverMock, PairableCanDriver, and uavcan_linux::SocketCanDriver.

◆ getNumIfaces()

virtual uint8_t uavcan::ICanDriver::getNumIfaces ( ) const
pure virtual

Total number of available CAN interfaces. This value shall not change after initialization.

Implemented in uavcan_linux::SocketCanDriver, VirtualCanDriver< SharedMemoryPoolSize >, uavcan_lpc11c24::CanDriver, uavcan_kinetis::CanDriver, uavcan_stm32::CanDriver, CanDriverMock, and PairableCanDriver.

◆ select()

virtual int16_t uavcan::ICanDriver::select ( CanSelectMasks inout_masks,
const CanFrame *(&)  pending_tx[MaxCanIfaces],
MonotonicTime  blocking_deadline 
)
pure virtual

Block until the deadline, or one of the specified interfaces becomes available for read or write.

Iface masks will be modified by the driver to indicate which exactly interfaces are available for IO.

Bit position in the masks defines interface index.

Note that it is allowed to return from this method even if no requested events actually happened, or if there are events that were not requested by the library.

The pending TX argument contains an array of pointers to CAN frames that the library wants to transmit next, per interface. This is intended to allow the driver to properly prioritize transmissions; many drivers will not need to use it. If a write flag for the given interface is set to one in the select mask structure, then the corresponding pointer is guaranteed to be valid (not UAVCAN_NULLPTR).

Parameters
[in,out]inout_masksMasks indicating which interfaces are needed/available for IO.
[in]pending_txArray of frames, per interface, that are likely to be transmitted next.
[in]blocking_deadlineZero means non-blocking operation.
Returns
Positive number of ready interfaces or negative error code.

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


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