[hal] Add handle constructor and name getters for sim devices (#4925)

This commit is contained in:
Ryan Blue
2023-01-11 14:45:15 -05:00
committed by GitHub
parent 53d8d33bca
commit dc4355c031
11 changed files with 98 additions and 1 deletions

View File

@@ -106,6 +106,15 @@ public class SimDevice implements AutoCloseable {
return m_handle;
}
/**
* Get the name of the simulated device.
*
* @return the name
*/
public String getName() {
return SimDeviceJNI.getSimDeviceName(m_handle);
}
/**
* Creates a value on the simulated device.
*

View File

@@ -33,6 +33,14 @@ public class SimDeviceJNI extends JNIWrapper {
*/
public static native void freeSimDevice(int handle);
/**
* Get the name of a simulated device.
*
* @param handle simulated device handle
* @return name of the simulated device
*/
public static native String getSimDeviceName(int handle);
private static native int createSimValueNative(
int device, String name, int direction, int type, long value1, double value2);