[wpilib] Remove Driverstation.waitForDsConnection (#8288)

Signed-off-by: Jade Turner <spacey-sooty@proton.me>
This commit is contained in:
Jade
2025-10-23 09:43:29 +08:00
committed by GitHub
parent 7a2a982e66
commit 8992dcdc99
3 changed files with 0 additions and 49 deletions

View File

@@ -1218,33 +1218,6 @@ public final class DriverStation {
return DriverStationJNI.getAllianceStation();
}
/**
* Wait for a DS connection.
*
* @param timeout timeout in seconds. 0 for infinite.
* @return true if connected, false if timeout
*/
public static boolean waitForDsConnection(double timeout) {
int event = WPIUtilJNI.createEvent(true, false);
DriverStationJNI.provideNewDataEventHandle(event);
boolean result;
try {
if (timeout == 0) {
WPIUtilJNI.waitForObject(event);
result = true;
} else {
result = !WPIUtilJNI.waitForObjectTimeout(event, timeout);
}
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
result = false;
} finally {
DriverStationJNI.removeNewDataEventHandle(event);
WPIUtilJNI.destroyEvent(event);
}
return result;
}
/**
* Return the approximate match time. The FMS does not send an official match time to the robots,
* but does send an approximate match time. The value will count down the time remaining in the