Add ability to get source aos::Node* from a Channel*
This makes it a lot easier to index by Node given a channel. And this
should be shared code anyways, not in an application.
Change-Id: Ia176e58f91a58a718b3eca8edd7ceb3bd36e441d
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/configuration.h b/aos/configuration.h
index 7ef2e6e..80c0238 100644
--- a/aos/configuration.h
+++ b/aos/configuration.h
@@ -198,6 +198,9 @@
// Returns the source node index for each channel in a config.
std::vector<size_t> SourceNodeIndex(const Configuration *config);
+// Returns the source node for a channel.
+const Node *SourceNode(const Configuration *config, const Channel *channel);
+
// Returns the all nodes that are logging timestamps on our node.
std::vector<const Node *> TimestampNodes(const Configuration *config,
const Node *my_node);