[sim] Add support for disabling SimDevices (#2568)

This allows disabling/enabling SimDevices via prefix matching.  This can be
used to force devices that normally use SimDevice in simulation mode to
instead talk directly to the hardware as in normal operation.
This commit is contained in:
Peter Johnson
2020-07-04 01:09:49 -07:00
committed by GitHub
parent 1851ba1434
commit 80a1fa9ece
6 changed files with 101 additions and 2 deletions

View File

@@ -11,6 +11,9 @@ import edu.wpi.first.hal.HALValue;
import edu.wpi.first.hal.JNIWrapper;
public class SimDeviceDataJNI extends JNIWrapper {
public static native void setSimDeviceEnabled(String prefix, boolean enabled);
public static native boolean isSimDeviceEnabled(String name);
public static native int registerSimDeviceCreatedCallback(String prefix, SimDeviceCallback callback, boolean initialNotify);
public static native void cancelSimDeviceCreatedCallback(int uid);