blob: ee276d63d9152bbe0025d45b592b94f77bfacc19 [file] [log] [blame]
Austin Schuhe84c3ed2019-12-14 15:29:48 -08001#include "aos/events/shm_event_loop.h"
2#include "aos/init.h"
3#include "aos/network/message_bridge_server_lib.h"
4#include "gflags/gflags.h"
5#include "glog/logging.h"
6
Austin Schuh4a4b6872020-02-22 15:03:36 -08007DEFINE_string(config, "config.json", "Path to the config.");
Austin Schuhe84c3ed2019-12-14 15:29:48 -08008
9namespace aos {
10namespace message_bridge {
11
12int Main() {
13 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
14 aos::configuration::ReadConfig(FLAGS_config);
15
16 aos::ShmEventLoop event_loop(&config.message());
17
18 MessageBridgeServer app(&event_loop);
19
20 // TODO(austin): Track which messages didn't make it in time and need to be
21 // logged locally and forwarded.
22
23 event_loop.Run();
24
25 return EXIT_SUCCESS;
26}
27
28} // namespace message_bridge
29} // namespace aos
30
31int main(int argc, char **argv) {
32 aos::InitGoogle(&argc, &argv);
33
34 return aos::message_bridge::Main();
35}