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

#include <abstract_node.hpp>

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

Public Member Functions

virtual IPoolAllocatorgetAllocator ()=0
 
DispatchergetDispatcher ()
 
const DispatchergetDispatcher () const
 
MonotonicTime getMonotonicTime () const
 
NodeID getNodeID () const
 
virtual const SchedulergetScheduler () const =0
 
virtual SchedulergetScheduler ()=0
 
ISystemClockgetSystemClock ()
 
UtcTime getUtcTime () const
 
int injectTxFrame (const CanFrame &frame, MonotonicTime tx_deadline, uint8_t iface_mask, CanIOFlags flags=0)
 
void installRxFrameListener (IRxFrameListener *lst)
 
bool isPassiveMode () const
 
virtual void registerInternalFailure (const char *msg)=0
 
void removeRxFrameListener ()
 
bool setNodeID (NodeID nid)
 
int spin (MonotonicDuration duration)
 
int spin (MonotonicTime deadline)
 
int spinOnce ()
 
virtual ~INode ()
 

Detailed Description

Abstract node class. If you're going to implement your own node class for your application, please inherit this class so it can be used with default publisher, subscriber, server, etc. classes. Normally you don't need to use it directly though - please refer to the class Node<> instead.

Definition at line 19 of file abstract_node.hpp.

Constructor & Destructor Documentation

◆ ~INode()

virtual uavcan::INode::~INode ( )
inlinevirtual

Definition at line 22 of file abstract_node.hpp.

Member Function Documentation

◆ getAllocator()

virtual IPoolAllocator& uavcan::INode::getAllocator ( )
pure virtual

◆ getDispatcher() [1/2]

Dispatcher& uavcan::INode::getDispatcher ( )
inline

Definition at line 28 of file abstract_node.hpp.

◆ getDispatcher() [2/2]

const Dispatcher& uavcan::INode::getDispatcher ( ) const
inline

Definition at line 29 of file abstract_node.hpp.

◆ getMonotonicTime()

MonotonicTime uavcan::INode::getMonotonicTime ( ) const
inline

Definition at line 32 of file abstract_node.hpp.

◆ getNodeID()

NodeID uavcan::INode::getNodeID ( ) const
inline

Returns the Node ID of this node. If Node ID was not set yet, an invalid value will be returned.

Definition at line 39 of file abstract_node.hpp.

◆ getScheduler() [1/2]

virtual const Scheduler& uavcan::INode::getScheduler ( ) const
pure virtual

◆ getScheduler() [2/2]

virtual Scheduler& uavcan::INode::getScheduler ( )
pure virtual

◆ getSystemClock()

ISystemClock& uavcan::INode::getSystemClock ( )
inline

Definition at line 31 of file abstract_node.hpp.

◆ getUtcTime()

UtcTime uavcan::INode::getUtcTime ( ) const
inline

Definition at line 33 of file abstract_node.hpp.

◆ injectTxFrame()

int uavcan::INode::injectTxFrame ( const CanFrame frame,
MonotonicTime  tx_deadline,
uint8_t  iface_mask,
CanIOFlags  flags = 0 
)
inline

This method allows to directly transmit a raw CAN frame circumventing the whole UAVCAN stack. Mandatory parameters:

Parameters
frameCAN frame to be transmitted.
tx_deadlineThe frame will be discarded if it could not be transmitted by this time.
iface_maskThis bitmask allows to select what CAN interfaces this frame should go into. Example:
  • 1 - the frame will be sent only to iface 0.
  • 4 - the frame will be sent only to iface 2.
  • 3 - the frame will be sent to ifaces 0 and 1.

Optional parameters:

Parameters
flagsCAN IO flags. Please refer to the CAN driver API for details.

Definition at line 109 of file abstract_node.hpp.

◆ installRxFrameListener()

void uavcan::INode::installRxFrameListener ( IRxFrameListener lst)
inline

Definition at line 121 of file abstract_node.hpp.

◆ isPassiveMode()

bool uavcan::INode::isPassiveMode ( ) const
inline

Whether the node is in passive mode, i.e. can't transmit anything to the bus. Please read the specs to learn more.

Definition at line 57 of file abstract_node.hpp.

◆ registerInternalFailure()

virtual void uavcan::INode::registerInternalFailure ( const char *  msg)
pure virtual

◆ removeRxFrameListener()

void uavcan::INode::removeRxFrameListener ( )
inline

The IRxFrameListener interface allows one to monitor all incoming CAN frames. This feature can be used to implement multithreaded nodes, or to add secondary protocol support.

Definition at line 120 of file abstract_node.hpp.

◆ setNodeID()

bool uavcan::INode::setNodeID ( NodeID  nid)
inline

Sets the Node ID of this node. Node ID can be assigned only once. This method returns true if the Node ID was successfully assigned, otherwise it returns false. As long as a valid Node ID is not set, the node will remain in passive mode. Using a non-unicast Node ID puts the node into passive mode (as default).

Definition at line 48 of file abstract_node.hpp.

◆ spin() [1/2]

int uavcan::INode::spin ( MonotonicDuration  duration)
inline

Runs the node. Normally your application should not block anywhere else. Block inside this method forever or call it periodically. This method returns 0 if no errors occurred, or a negative error code if something failed (see error.hpp).

Definition at line 74 of file abstract_node.hpp.

◆ spin() [2/2]

int uavcan::INode::spin ( MonotonicTime  deadline)
inline

Same as spin(MonotonicDuration), but the deadline is specified as an absolute time value rather than duration.

Definition at line 63 of file abstract_node.hpp.

◆ spinOnce()

int uavcan::INode::spinOnce ( )
inline

This method is designed for non-blocking applications. Instead of blocking, it returns immediately once all available CAN frames and timer events are processed. Note that this is unlike plain spin(), which will strictly return when the deadline is reached, even if there still are unprocessed events. This method returns 0 if no errors occurred, or a negative error code if something failed (see error.hpp).

Definition at line 86 of file abstract_node.hpp.


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


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