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_client.cc b/aos/network/message_bridge_client.cc
index 891a8a1..61a7271 100644
--- a/aos/network/message_bridge_client.cc
+++ b/aos/network/message_bridge_client.cc
@@ -4,6 +4,7 @@
#include "aos/init.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 {
@@ -13,6 +14,9 @@
aos::configuration::ReadConfig(FLAGS_config);
aos::ShmEventLoop event_loop(&config.message());
+ if (FLAGS_rt_priority > 0) {
+ event_loop.SetRuntimeRealtimePriority(FLAGS_rt_priority);
+ }
MessageBridgeClient app(&event_loop);