PX4 Firmware
PX4 Autopilot Software http://px4.io
VirtualCanDriver Class Reference

Objects of this class are owned by the sub-node thread. More...

#include <uavcan_virtual_can_driver.hpp>

Inheritance diagram for VirtualCanDriver:
Collaboration diagram for VirtualCanDriver:

Classes

class  Event
 

Public Member Functions

 VirtualCanDriver (unsigned arg_num_ifaces, uavcan::ISystemClock &system_clock, uavcan::IPoolAllocator &allocator, unsigned virtual_iface_block_allocation_quota)
 
 ~VirtualCanDriver ()
 
- Public Member Functions inherited from ITxQueueInjector
virtual ~ITxQueueInjector ()
 

Private Member Functions

uavcan::ICanIface * getIface (uint8_t iface_index) override
 
uint8_t getNumIfaces () const override
 
int16_t select (uavcan::CanSelectMasks &inout_masks, const uavcan::CanFrame *(&)[uavcan::MaxCanIfaces], uavcan::MonotonicTime blocking_deadline) override
 This and other methods of ICanDriver will be invoked by the sub-node thread. More...
 
void handleRxFrame (const uavcan::CanRxFrame &frame, uavcan::CanIOFlags flags) override
 This handler will be invoked by the main node thread. More...
 
void injectTxFramesInto (uavcan::INode &main_node) override
 This method will be invoked by the main node thread. More...
 

Private Attributes

Event event_
 Used to unblock the select() call when IO happens. More...
 
pthread_mutex_t driver_mutex_
 Shared across all ifaces. More...
 
uavcan::LazyConstructor< VirtualCanIfaceifaces_ [uavcan::MaxCanIfaces]
 
const unsigned num_ifaces_
 
uavcan::ISystemClock & clock_
 

Detailed Description

Objects of this class are owned by the sub-node thread.

This class does not use heap memory.

Definition at line 339 of file uavcan_virtual_can_driver.hpp.

Constructor & Destructor Documentation

◆ VirtualCanDriver()

VirtualCanDriver::VirtualCanDriver ( unsigned  arg_num_ifaces,
uavcan::ISystemClock &  system_clock,
uavcan::IPoolAllocator &  allocator,
unsigned  virtual_iface_block_allocation_quota 
)
inline

Definition at line 486 of file uavcan_virtual_can_driver.hpp.

References Lock::init(), and VirtualCanDriver::Event::init().

Here is the call graph for this function:

◆ ~VirtualCanDriver()

VirtualCanDriver::~VirtualCanDriver ( )
inline

Definition at line 506 of file uavcan_virtual_can_driver.hpp.

References Lock::deinit(), and VirtualCanDriver::Event::deinit().

Here is the call graph for this function:

Member Function Documentation

◆ getIface()

uavcan::ICanIface* VirtualCanDriver::getIface ( uint8_t  iface_index)
inlineoverrideprivate

Definition at line 417 of file uavcan_virtual_can_driver.hpp.

◆ getNumIfaces()

uint8_t VirtualCanDriver::getNumIfaces ( ) const
inlineoverrideprivate

Definition at line 422 of file uavcan_virtual_can_driver.hpp.

◆ handleRxFrame()

void VirtualCanDriver::handleRxFrame ( const uavcan::CanRxFrame &  frame,
uavcan::CanIOFlags  flags 
)
inlineoverrideprivate

This handler will be invoked by the main node thread.

Definition at line 462 of file uavcan_virtual_can_driver.hpp.

References VirtualCanDriver::Event::signal().

Here is the call graph for this function:

◆ injectTxFramesInto()

void VirtualCanDriver::injectTxFramesInto ( uavcan::INode &  main_node)
inlineoverrideprivatevirtual

This method will be invoked by the main node thread.

Implements ITxQueueInjector.

Definition at line 476 of file uavcan_virtual_can_driver.hpp.

References VirtualCanDriver::Event::signal().

Here is the call graph for this function:

◆ select()

int16_t VirtualCanDriver::select ( uavcan::CanSelectMasks &  inout_masks,
const uavcan::CanFrame *  (&)[uavcan::MaxCanIfaces],
uavcan::MonotonicTime  blocking_deadline 
)
inlineoverrideprivate

This and other methods of ICanDriver will be invoked by the sub-node thread.

Definition at line 427 of file uavcan_virtual_can_driver.hpp.

References VirtualCanDriver::Event::waitFor().

Here is the call graph for this function:

Member Data Documentation

◆ clock_

uavcan::ISystemClock& VirtualCanDriver::clock_
private

Definition at line 415 of file uavcan_virtual_can_driver.hpp.

◆ driver_mutex_

pthread_mutex_t VirtualCanDriver::driver_mutex_
private

Shared across all ifaces.

Definition at line 412 of file uavcan_virtual_can_driver.hpp.

◆ event_

Event VirtualCanDriver::event_
private

Used to unblock the select() call when IO happens.

Definition at line 411 of file uavcan_virtual_can_driver.hpp.

◆ ifaces_

uavcan::LazyConstructor<VirtualCanIface> VirtualCanDriver::ifaces_[uavcan::MaxCanIfaces]
private

Definition at line 413 of file uavcan_virtual_can_driver.hpp.

◆ num_ifaces_

const unsigned VirtualCanDriver::num_ifaces_
private

Definition at line 414 of file uavcan_virtual_can_driver.hpp.


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