mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[hal] Add handle constructor and name getters for sim devices (#4925)
This commit is contained in:
@@ -24,7 +24,7 @@ public class SimDeviceSim {
|
||||
* @param name name of the SimDevice
|
||||
*/
|
||||
public SimDeviceSim(String name) {
|
||||
m_handle = SimDeviceDataJNI.getSimDeviceHandle(name);
|
||||
this(SimDeviceDataJNI.getSimDeviceHandle(name));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,6 +48,24 @@ public class SimDeviceSim {
|
||||
this(name + "[" + index + "," + channel + "]");
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a SimDeviceSim.
|
||||
*
|
||||
* @param handle the low level handle for the corresponding SimDevice
|
||||
*/
|
||||
public SimDeviceSim(int handle) {
|
||||
m_handle = handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of this object.
|
||||
*
|
||||
* @return name
|
||||
*/
|
||||
public String getName() {
|
||||
return SimDeviceDataJNI.getSimDeviceName(m_handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the property object with the given name.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user