[hal] Rename SimValueCallback2 to SimValueCallback (#3212)

This commit is contained in:
Peter Johnson
2021-03-21 23:22:04 -07:00
committed by GitHub
parent a6f6539691
commit 6137f98eb5
5 changed files with 14 additions and 94 deletions

View File

@@ -13,7 +13,6 @@ import edu.wpi.first.hal.SimValue;
import edu.wpi.first.hal.simulation.SimDeviceCallback;
import edu.wpi.first.hal.simulation.SimDeviceDataJNI;
import edu.wpi.first.hal.simulation.SimValueCallback;
import edu.wpi.first.hal.simulation.SimValueCallback2;
/** Class to control the simulation side of a SimDevice. */
public class SimDeviceSim {
@@ -191,22 +190,6 @@ public class SimDeviceSim {
return new CallbackStore(uid, SimDeviceDataJNI::cancelSimValueChangedCallback);
}
/**
* Register a callback to be run every time a value is changed on this device.
*
* @param callback the callback
* @param initialNotify should the callback be run with the initial state
* @return the {@link CallbackStore} object associated with this callback. Save a reference to
* this object so GC doesn't cancel the callback.
*/
public CallbackStore registerValueChangedCallback2(
SimValue value, SimValueCallback2 callback, boolean initialNotify) {
int uid =
SimDeviceDataJNI.registerSimValueChangedCallback2(
value.getNativeHandle(), callback, initialNotify);
return new CallbackStore(uid, SimDeviceDataJNI::cancelSimValueChangedCallback);
}
/**
* Register a callback for SimDouble.reset() and similar functions. The callback is called with
* the old value.
@@ -216,7 +199,7 @@ public class SimDeviceSim {
* @param initialNotify ignored (present for consistency)
*/
public CallbackStore registerValueResetCallback(
SimValue value, SimValueCallback2 callback, boolean initialNotify) {
SimValue value, SimValueCallback callback, boolean initialNotify) {
int uid =
SimDeviceDataJNI.registerSimValueResetCallback(
value.getNativeHandle(), callback, initialNotify);