Руслан Урядинский / libuavcan

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

NodeStatusProvider Class Reference

NodeStatusProvider Class Reference

Provides the status and basic information about this node to other network participants. More...

#include <node_status_provider.hpp>

Inherits uavcan::TimerBase.

Public Member Functions

int startAndPublish (const TransferPriority priority=TransferPriority::Default)
 Starts the provider and immediately broadcasts uavcan.protocol.NodeStatus.
int forcePublish ()
 Publish the message uavcan.protocol.NodeStatus right now, out of schedule.
void setStatusPublicationPeriod (uavcan::MonotonicDuration period)
 Allows to override default publishing rate for uavcan.protocol.NodeStatus.
void setAdHocNodeStatusUpdater (IAdHocNodeStatusUpdater *updater)
 Configure the optional handler that is invoked before every node status message is emitted.
uint8_t getHealth () const
 Local node health code control.
uint8_t getMode () const
 Local node mode code control.
void setVendorSpecificStatusCode (VendorSpecificStatusCode code)
 Local node vendor-specific status code control.
const NodeName & getName () const
 Local node name control.
const protocol::SoftwareVersion & getSoftwareVersion () const
 Node version information.

Private Member Functions

void startOneShotWithDeadline (MonotonicTime deadline)
 Various ways to start the timer - periodically or once.
MonotonicDuration getPeriod () const
 Returns period if the timer is in periodic mode.

Detailed Description

Provides the status and basic information about this node to other network participants.

Usually the application does not need to deal with this class directly - it's instantiated by the node class.

Default values:

  • health - OK
  • mode - INITIALIZATION

Definition at line 51 of file node_status_provider.hpp.


Member Function Documentation

int forcePublish (  )

Publish the message uavcan.protocol.NodeStatus right now, out of schedule.

Returns negative error code.

Definition at line 105 of file node_status_provider.hpp.

uint8_t getHealth (  ) const

Local node health code control.

Definition at line 127 of file node_status_provider.hpp.

uint8_t getMode (  ) const

Local node mode code control.

Definition at line 137 of file node_status_provider.hpp.

const NodeName& getName (  ) const

Local node name control.

Can be set only once before the provider is started. The provider will refuse to start if the node name is not set.

Definition at line 159 of file node_status_provider.hpp.

const protocol::SoftwareVersion& getSoftwareVersion (  ) const

Node version information.

Can be set only once before the provider is started.

Definition at line 166 of file node_status_provider.hpp.

void setAdHocNodeStatusUpdater ( IAdHocNodeStatusUpdater updater )

Configure the optional handler that is invoked before every node status message is emitted.

By default no handler is installed. It is allowed to pass a null pointer, that will disable the ad-hoc update feature. IAdHocNodeStatusUpdater

Definition at line 117 of file uc_node_status_provider.cpp.

void setStatusPublicationPeriod ( uavcan::MonotonicDuration  period )

Allows to override default publishing rate for uavcan.protocol.NodeStatus.

Refer to the DSDL definition of uavcan.protocol.NodeStatus to see what is the default rate. Doesn't fail; if the value is outside of acceptable range, a closest valid value will be used instead.

Definition at line 96 of file uc_node_status_provider.cpp.

void setVendorSpecificStatusCode ( VendorSpecificStatusCode  code )

Local node vendor-specific status code control.

Definition at line 132 of file uc_node_status_provider.cpp.

int startAndPublish ( const TransferPriority  priority = TransferPriority::Default )

Starts the provider and immediately broadcasts uavcan.protocol.NodeStatus.

Returns negative error code.

Definition at line 58 of file uc_node_status_provider.cpp.