[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

@@ -121,14 +121,9 @@ TEST(DriverStationTest, Joystick) {
TEST(DriverStationTest, EventInfo) {
constexpr std::string_view eventName = "UnitTest";
constexpr std::string_view gameData = "Insert game specific info here :D";
HAL_MatchInfo info;
wpi::util::format_to_n_c_str(info.eventName, sizeof(info.eventName),
eventName);
wpi::util::format_to_n_c_str(
reinterpret_cast<char*>(info.gameSpecificMessage),
sizeof(info.gameSpecificMessage), gameData);
info.gameSpecificMessageSize = gameData.size();
info.matchNumber = 5;
info.matchType = HAL_MatchType::HAL_kMatchType_qualification;
info.replayNumber = 42;
@@ -139,11 +134,7 @@ TEST(DriverStationTest, EventInfo) {
HAL_MatchInfo dataBack;
HAL_GetMatchInfo(&dataBack);
std::string gsm{reinterpret_cast<char*>(dataBack.gameSpecificMessage),
dataBack.gameSpecificMessageSize};
EXPECT_EQ(eventName, dataBack.eventName);
EXPECT_EQ(gameData, gsm);
EXPECT_EQ(5, dataBack.matchNumber);
EXPECT_EQ(HAL_MatchType::HAL_kMatchType_qualification, dataBack.matchType);
EXPECT_EQ(42, dataBack.replayNumber);