[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

@@ -312,6 +312,29 @@ Java_org_wpilib_hardware_hal_DriverStationJNI_getMatchInfo
return status;
}
/*
* Class: org_wpilib_hardware_hal_DriverStationJNI
* Method: getGameData
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL
Java_org_wpilib_hardware_hal_DriverStationJNI_getGameData
(JNIEnv* env, jclass, jstring existing)
{
HAL_GameData gameData;
HAL_GetGameData(&gameData);
std::string_view newView{gameData.gameData};
if (existing != nullptr) {
// Load existing, see if it matches return old
JStringRef existingStr{env, existing};
std::string_view existingView{existingStr};
if (existingView == newView) {
return existing;
}
}
return MakeJString(env, newView);
}
/*
* Class: org_wpilib_hardware_hal_DriverStationJNI
* Method: sendError