Add multinode maps and type specific maps.
This lets us do things like remap timing reports per node and handle
them correctly. And also only map the timing reports and not everything
on /aos. This also becomes more interesting when AOS_LOG logs, and we
have a starter which publishes statistics.
Change-Id: I2147e3b722b472d4480c86e7c8acda938aa3d1d2
diff --git a/aos/events/event_loop.cc b/aos/events/event_loop.cc
index 2c3a215..af5a3e5 100644
--- a/aos/events/event_loop.cc
+++ b/aos/events/event_loop.cc
@@ -355,7 +355,19 @@
// Make a raw sender for the report.
const Channel *channel = configuration::GetChannel(
configuration(), "/aos", timing::Report::GetFullyQualifiedName(),
- name());
+ name(), node());
+
+ // Since we are using a RawSender, validity isn't checked. So check it
+ // ourselves.
+ if (node() != nullptr) {
+ if (!configuration::ChannelIsSendableOnNode(channel, node())) {
+ LOG(FATAL) << "Channel { \"name\": \"/aos"
+ << channel->name()->string_view() << "\", \"type\": \""
+ << channel->type()->string_view()
+ << "\" } is not able to be sent on this node. Check your "
+ "configuration.";
+ }
+ }
CHECK(channel != nullptr) << ": Channel { \"name\": \"/aos\", \"type\": \""
<< timing::Report::GetFullyQualifiedName()
<< "\" } not found in config.";