blob: 891a8a1258567cea7d2f4466acfb621bc13f70e4 [file] [log] [blame]
Austin Schuhe84c3ed2019-12-14 15:29:48 -08001#include "aos/network/message_bridge_client_lib.h"
2
3#include "aos/events/shm_event_loop.h"
4#include "aos/init.h"
5
Austin Schuh4a4b6872020-02-22 15:03:36 -08006DEFINE_string(config, "config.json", "Path to the config.");
Austin Schuhe84c3ed2019-12-14 15:29:48 -08007
8namespace aos {
9namespace message_bridge {
10
11int Main() {
12 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
13 aos::configuration::ReadConfig(FLAGS_config);
14
15 aos::ShmEventLoop event_loop(&config.message());
16
17 MessageBridgeClient app(&event_loop);
18
19 // TODO(austin): Save messages into a vector to be logged. One file per
20 // channel? Need to sort out ordering.
21 //
22 // TODO(austin): Low priority, "reliable" logging channel.
23
24 event_loop.Run();
25
26 return EXIT_SUCCESS;
27}
28
29} // namespace message_bridge
30} // namespace aos
31
32int main(int argc, char **argv) {
33 aos::InitGoogle(&argc, &argv);
34
35 return aos::message_bridge::Main();
36}