James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 1 | #include "aos/events/simulated_event_loop.h" |
| 2 | #include "aos/testing/path.h" |
James Kuszmaul | 04a343c | 2023-02-20 16:38:22 -0800 | [diff] [blame] | 3 | #include "frc971/constants/constants_sender_lib.h" |
Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 4 | #include "y2023/constants/constants_generated.h" |
| 5 | #include "y2023/constants/constants_list_generated.h" |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 6 | |
| 7 | namespace y2023 { |
James Kuszmaul | cf451fb | 2023-03-10 20:42:36 -0800 | [diff] [blame] | 8 | bool SendSimulationConstants(aos::SimulatedEventLoopFactory *factory, int team, |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 9 | std::string constants_path) { |
| 10 | for (const aos::Node *node : factory->nodes()) { |
| 11 | std::unique_ptr<aos::EventLoop> event_loop = |
| 12 | factory->MakeEventLoop("constants_sender", node); |
| 13 | frc971::constants::ConstantSender<Constants, ConstantsList> sender( |
| 14 | event_loop.get(), constants_path, team, "/constants"); |
| 15 | } |
James Kuszmaul | cf451fb | 2023-03-10 20:42:36 -0800 | [diff] [blame] | 16 | return true; |
James Kuszmaul | d67f6d2 | 2023-02-05 17:37:25 -0800 | [diff] [blame] | 17 | } |
| 18 | } // namespace y2023 |