#include <node_status_provider.hpp>
Public Types | |
typedef StorageType< typename protocol::GetNodeInfo::Response::FieldTypes::name >::Type | NodeName |
typedef StorageType< typename protocol::NodeStatus::FieldTypes::vendor_specific_status_code >::Type | VendorSpecificStatusCode |
Private Types | |
typedef MethodBinder< NodeStatusProvider *, void(NodeStatusProvider::*)(const protocol::GetNodeInfo::Request &, protocol::GetNodeInfo::Response &)> | GetNodeInfoCallback |
Private Member Functions | |
INode & | getNode () |
void | handleGetNodeInfoRequest (const protocol::GetNodeInfo::Request &, protocol::GetNodeInfo::Response &rsp) |
virtual void | handleTimerEvent (const TimerEvent &) |
bool | isNodeInfoInitialized () const |
int | publish () |
![]() | |
MonotonicTime | getDeadline () const |
MonotonicDuration | getPeriod () const |
Scheduler & | getScheduler () const |
bool | isRunning () const |
void | startOneShotWithDeadline (MonotonicTime deadline) |
void | startOneShotWithDelay (MonotonicDuration delay) |
void | startPeriodic (MonotonicDuration period) |
void | stop () |
TimerBase (INode &node) | |
Private Attributes | |
IAdHocNodeStatusUpdater * | ad_hoc_status_updater_ |
const MonotonicTime | creation_timestamp_ |
ServiceServer< protocol::GetNodeInfo, GetNodeInfoCallback > | gni_srv_ |
protocol::GetNodeInfo::Response | node_info_ |
Publisher< protocol::NodeStatus > | node_status_pub_ |
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:
Definition at line 51 of file node_status_provider.hpp.
|
private |
Definition at line 55 of file node_status_provider.hpp.
typedef StorageType<typename protocol::GetNodeInfo::Response::FieldTypes::name>::Type uavcan::NodeStatusProvider::NodeName |
Definition at line 79 of file node_status_provider.hpp.
typedef StorageType<typename protocol::NodeStatus::FieldTypes::vendor_specific_status_code>::Type uavcan::NodeStatusProvider::VendorSpecificStatusCode |
Definition at line 77 of file node_status_provider.hpp.
|
inlineexplicit |
Definition at line 81 of file node_status_provider.hpp.
|
inline |
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.
|
inline |
Definition at line 122 of file node_status_provider.hpp.
|
inline |
Definition at line 167 of file node_status_provider.hpp.
|
inline |
Local node health code control.
Definition at line 127 of file node_status_provider.hpp.
|
inline |
Local node mode code control.
Definition at line 137 of file node_status_provider.hpp.
|
inline |
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.
|
inlineprivate |
Definition at line 66 of file node_status_provider.hpp.
|
inline |
Node version information. Can be set only once before the provider is started.
Definition at line 166 of file node_status_provider.hpp.
uavcan::MonotonicDuration uavcan::NodeStatusProvider::getStatusPublicationPeriod | ( | ) | const |
Definition at line 112 of file uc_node_status_provider.cpp.
|
inline |
Definition at line 149 of file node_status_provider.hpp.
|
private |
Definition at line 50 of file uc_node_status_provider.cpp.
|
privatevirtual |
Implement this method in your class to receive callbacks.
Implements uavcan::TimerBase.
Definition at line 29 of file uc_node_status_provider.cpp.
|
private |
Definition at line 12 of file uc_node_status_provider.cpp.
|
private |
Definition at line 18 of file uc_node_status_provider.cpp.
void uavcan::NodeStatusProvider::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 uavcan::NodeStatusProvider::setHardwareVersion | ( | const protocol::HardwareVersion & | version | ) |
Definition at line 153 of file uc_node_status_provider.cpp.
void uavcan::NodeStatusProvider::setHealth | ( | uint8_t | code | ) |
Definition at line 122 of file uc_node_status_provider.cpp.
|
inline |
Definition at line 132 of file node_status_provider.hpp.
|
inline |
Definition at line 131 of file node_status_provider.hpp.
|
inline |
Definition at line 129 of file node_status_provider.hpp.
|
inline |
Definition at line 130 of file node_status_provider.hpp.
void uavcan::NodeStatusProvider::setMode | ( | uint8_t | code | ) |
Definition at line 127 of file uc_node_status_provider.cpp.
|
inline |
Definition at line 140 of file node_status_provider.hpp.
|
inline |
Definition at line 141 of file node_status_provider.hpp.
|
inline |
Definition at line 143 of file node_status_provider.hpp.
|
inline |
Definition at line 139 of file node_status_provider.hpp.
|
inline |
Definition at line 142 of file node_status_provider.hpp.
void uavcan::NodeStatusProvider::setName | ( | const NodeName & | name | ) |
Definition at line 137 of file uc_node_status_provider.cpp.
void uavcan::NodeStatusProvider::setSoftwareVersion | ( | const protocol::SoftwareVersion & | version | ) |
Definition at line 145 of file uc_node_status_provider.cpp.
void uavcan::NodeStatusProvider::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 uavcan::NodeStatusProvider::setVendorSpecificStatusCode | ( | VendorSpecificStatusCode | code | ) |
Local node vendor-specific status code control.
Definition at line 132 of file uc_node_status_provider.cpp.
int uavcan::NodeStatusProvider::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.
|
private |
Definition at line 64 of file node_status_provider.hpp.
|
private |
Definition at line 57 of file node_status_provider.hpp.
|
private |
Definition at line 60 of file node_status_provider.hpp.
|
private |
Definition at line 62 of file node_status_provider.hpp.
|
private |
Definition at line 59 of file node_status_provider.hpp.