mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-21 01:01:41 +00:00
Check offline updates for incompatibility (#2361)
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
package org.photonvision.common.hardware;
|
||||
|
||||
import edu.wpi.first.util.CombinedRuntimeLoader;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -139,6 +140,27 @@ public enum Platform {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function serves to map between formats used in the CombinedRuntimeLoader and the platform
|
||||
* names used in the wpilib-tools-plugin. This is typically used for native libraries.
|
||||
*
|
||||
* @return String representing the platform in the format used by wpilib-tools-plugin, or an empty
|
||||
* string if the platform is not recognized.
|
||||
*/
|
||||
public static String getNativePlatform() {
|
||||
String platPath = CombinedRuntimeLoader.getPlatformPath();
|
||||
|
||||
if (platPath == "/linux/x86-64/") {
|
||||
return "linuxx64";
|
||||
} else if (platPath == "/windows/x86-64/") {
|
||||
return "winx64";
|
||||
} else if (platPath == "/linux/arm64/") {
|
||||
return "linuxarm64";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static String getHardwareModel() {
|
||||
return currentPlatform.hardwareModel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user