blob: 2beb9ec559b77d45a062992d8047b482758e2812 [file] [log] [blame]
Austin Schuh99f7c6a2024-06-25 22:07:44 -07001#include "absl/flags/flag.h"
2#include "absl/log/check.h"
3#include "absl/log/log.h"
Philipp Schrader790cb542023-07-05 21:06:52 -07004
Henry Speisere5f05aa2022-05-02 21:24:26 -07005#include "aos/configuration.h"
6#include "aos/events/shm_event_loop.h"
7#include "aos/init.h"
8#include "aos/json_to_flatbuffer.h"
Philipp Schrader790cb542023-07-05 21:06:52 -07009#include "frc971/constants/constants_sender_lib.h"
Henry Speisere5f05aa2022-05-02 21:24:26 -070010#include "frc971/constants/testdata/constants_data_generated.h"
11#include "frc971/constants/testdata/constants_list_generated.h"
Henry Speisere5f05aa2022-05-02 21:24:26 -070012
Austin Schuh99f7c6a2024-06-25 22:07:44 -070013ABSL_FLAG(std::string, config, "frc971/constants/testdata/aos_config.json",
14 "Path to the config.");
15ABSL_FLAG(std::string, constants_path,
16 "frc971/constants/testdata/test_constants.json",
17 "Path to the constant file");
Henry Speisere5f05aa2022-05-02 21:24:26 -070018// This is just a sample binary
19int main(int argc, char **argv) {
20 aos::InitGoogle(&argc, &argv);
21 aos::FlatbufferDetachedBuffer<aos::Configuration> config =
Austin Schuh99f7c6a2024-06-25 22:07:44 -070022 aos::configuration::ReadConfig(absl::GetFlag(FLAGS_config));
Henry Speisere5f05aa2022-05-02 21:24:26 -070023 aos::ShmEventLoop event_loop(&config.message());
24 frc971::constants::ConstantSender<frc971::constants::testdata::ConstantsData,
25 frc971::constants::testdata::ConstantsList>
Austin Schuh99f7c6a2024-06-25 22:07:44 -070026 constants_sender(&event_loop, absl::GetFlag(FLAGS_constants_path));
Henry Speisere5f05aa2022-05-02 21:24:26 -070027 event_loop.Run();
28
29 return 0;
30}