NodeID pickNextNodeToQueryAndCleanupMap() { NodeID node_id; do { node_id = pickNextNodeToQuery(); if (node_id.isUnicast()) { if (needToQuery(node_id)) { return node_id; } else { removeNode(node_id); } } } while (node_id.isUnicast()); return NodeID(); }
virtual void handleTimerEvent(const TimerEvent&) { bool at_least_one_request_needed = false; const NodeID next = pickNextNodeToQuery(at_least_one_request_needed); if (next.isUnicast()) { UAVCAN_ASSERT(at_least_one_request_needed); getEntry(next).updated_since_last_attempt = false; const int res = get_node_info_client_.call(next, protocol::GetNodeInfo::Request()); if (res < 0) { get_node_info_client_.getNode().registerInternalFailure("NodeInfoRetriever GetNodeInfo call"); } } else { if (!at_least_one_request_needed) { TimerBase::stop(); UAVCAN_TRACE("NodeInfoRetriever", "Timer stopped"); } } }