Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 1 | #include "aos/network/message_bridge_client_lib.h" |
| 2 | |
| 3 | #include "aos/events/shm_event_loop.h" |
| 4 | #include "aos/init.h" |
| 5 | |
Austin Schuh | 4a4b687 | 2020-02-22 15:03:36 -0800 | [diff] [blame] | 6 | DEFINE_string(config, "config.json", "Path to the config."); |
Austin Schuh | e84c3ed | 2019-12-14 15:29:48 -0800 | [diff] [blame] | 7 | |
| 8 | namespace aos { |
| 9 | namespace message_bridge { |
| 10 | |
| 11 | int 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 | |
| 32 | int main(int argc, char **argv) { |
| 33 | aos::InitGoogle(&argc, &argv); |
| 34 | |
| 35 | return aos::message_bridge::Main(); |
| 36 | } |