Make the RT priority of message bridge configurable
Helps make the roboRIO forward messages more reliably.
Change-Id: Ibbd7575f7219cb22dc6d6b9fb78c5041e7ac3a89
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/network/message_bridge_server.cc b/aos/network/message_bridge_server.cc
index ee276d6..9f336c0 100644
--- a/aos/network/message_bridge_server.cc
+++ b/aos/network/message_bridge_server.cc
@@ -5,6 +5,7 @@
#include "glog/logging.h"
DEFINE_string(config, "config.json", "Path to the config.");
+DEFINE_int32(rt_priority, -1, "If > 0, run as this RT priority");
namespace aos {
namespace message_bridge {
@@ -14,6 +15,9 @@
aos::configuration::ReadConfig(FLAGS_config);
aos::ShmEventLoop event_loop(&config.message());
+ if (FLAGS_rt_priority > 0) {
+ event_loop.SetRuntimeRealtimePriority(FLAGS_rt_priority);
+ }
MessageBridgeServer app(&event_loop);