blob: f829b41107b886f2f159e7678dd568f4e260fe14 [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001#include "aos/configuration.h"
Austin Schuh6b9c4152019-11-29 12:45:24 -08002#include "aos/events/ping_lib.h"
Alex Perrycb7da4b2019-08-28 19:35:56 -07003#include "aos/events/shm_event_loop.h"
4#include "aos/init.h"
5#include "aos/json_to_flatbuffer.h"
6#include "gflags/gflags.h"
7#include "glog/logging.h"
8
Austin Schuh5d89cf52019-12-28 16:27:42 -08009DEFINE_string(config, "aos/events/pingpong_config.json", "Path to the config.");
10
Alex Perrycb7da4b2019-08-28 19:35:56 -070011int main(int argc, char **argv) {
Austin Schuh32fd5a72019-12-01 22:20:26 -080012 aos::InitGoogle(&argc, &argv);
Alex Perrycb7da4b2019-08-28 19:35:56 -070013
14 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
Austin Schuh5d89cf52019-12-28 16:27:42 -080015 aos::configuration::ReadConfig(FLAGS_config);
Alex Perrycb7da4b2019-08-28 19:35:56 -070016
Austin Schuh32fd5a72019-12-01 22:20:26 -080017 aos::ShmEventLoop event_loop(&config.message());
Alex Perrycb7da4b2019-08-28 19:35:56 -070018
19 aos::Ping ping(&event_loop);
20
21 event_loop.Run();
22
Austin Schuh32fd5a72019-12-01 22:20:26 -080023 aos::Cleanup();
Alex Perrycb7da4b2019-08-28 19:35:56 -070024 return 0;
25}