Merge branch 'dynamic_node_id_raft' of https://github.com/UAVCAN/uavcan into dynamic_node_id_raft

This commit is contained in:
David Sidrane
2015-05-12 14:48:05 -10:00
2 changed files with 7 additions and 2 deletions
@@ -92,6 +92,8 @@ class NodeDiscoverer : TimerBase
*/
enum { MaxAttemptsToGetNodeInfo = 5 };
enum { NumNodeStatusStaticReceivers = 64 };
/*
* States
*/
@@ -102,7 +104,7 @@ class NodeDiscoverer : TimerBase
NodeMap node_map_; ///< Will not work in UAVCAN_TINY
ServiceClient<protocol::GetNodeInfo, GetNodeInfoResponseCallback> get_node_info_client_;
Subscriber<protocol::NodeStatus, NodeStatusCallback> node_status_sub_;
Subscriber<protocol::NodeStatus, NodeStatusCallback, NumNodeStatusStaticReceivers> node_status_sub_;
/*
* Methods
@@ -110,6 +110,10 @@ private:
handleNodeStatusMessage(msg);
}
protected:
/**
* This event will be invoked at 2 Hz rate. It can be used by derived classes as well.
*/
virtual void handleTimerEvent(const TimerEvent&)
{
const int OfflineTimeoutMs100 = protocol::NodeStatus::OFFLINE_TIMEOUT_MS / 100;
@@ -134,7 +138,6 @@ private:
}
}
protected:
/**
* Called when a node becomes online, changes status or goes offline.
* Refer to uavcan.protocol.NodeStatus for the offline timeout value.