[hal,wpilib] Switch to new game data (#8584)

Game data is now limited to 8 bytes, and comes through the UDP packets.
This commit is contained in:
Thad House
2026-02-06 21:38:15 -08:00
committed by GitHub
parent ac45c694f3
commit 85adbf990e
45 changed files with 820 additions and 695 deletions

View File

@@ -240,14 +240,26 @@ TEST(DriverStationTest, MatchTime) {
EXPECT_EQ(kTestTime, callback.GetLastValue());
}
TEST(DriverStationTest, SetGameSpecificMessage) {
TEST(DriverStationTest, SetGameData) {
HAL_Initialize(500, 0);
DriverStationSim::ResetData();
constexpr auto message = "Hello World!";
DriverStationSim::SetGameSpecificMessage(message);
constexpr auto message = "Hello";
DriverStationSim::SetGameData(message);
DriverStationSim::NotifyNewData();
EXPECT_EQ(message, DriverStation::GetGameSpecificMessage());
auto gameData = DriverStation::GetGameData();
ASSERT_TRUE(gameData.has_value());
EXPECT_EQ(message, gameData.value());
}
TEST(DriverStationTest, SetGameDataEmpty) {
HAL_Initialize(500, 0);
DriverStationSim::ResetData();
DriverStationSim::SetGameData("");
DriverStationSim::NotifyNewData();
auto gameData = DriverStation::GetGameData();
EXPECT_FALSE(gameData.has_value());
}
TEST(DriverStationTest, SetEventName) {