[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

@@ -47,17 +47,11 @@ public class SimDeviceDataJNI extends JNIWrapper {
public static native int registerSimValueCreatedCallback(
int device, SimValueCallback callback, boolean initialNotify);
public static native int registerSimValueCreatedCallback2(
int device, SimValueCallback2 callback, boolean initialNotify);
public static native void cancelSimValueCreatedCallback(int uid);
public static native int registerSimValueChangedCallback(
int handle, SimValueCallback callback, boolean initialNotify);
public static native int registerSimValueChangedCallback2(
int handle, SimValueCallback2 callback, boolean initialNotify);
public static native void cancelSimValueChangedCallback(int uid);
/**
@@ -69,7 +63,7 @@ public class SimDeviceDataJNI extends JNIWrapper {
* @param initialNotify ignored (present for consistency)
*/
public static native int registerSimValueResetCallback(
int handle, SimValueCallback2 callback, boolean initialNotify);
int handle, SimValueCallback callback, boolean initialNotify);
public static native void cancelSimValueResetCallback(int uid);

View File

@@ -8,10 +8,10 @@ import edu.wpi.first.hal.HALValue;
@FunctionalInterface
public interface SimValueCallback {
void callback(String name, int handle, boolean readonly, HALValue value);
void callback(String name, int handle, int direction, HALValue value);
default void callbackNative(
String name, int handle, boolean readonly, int type, long value1, double value2) {
callback(name, handle, readonly, HALValue.fromNative(type, value1, value2));
String name, int handle, int direction, int type, long value1, double value2) {
callback(name, handle, direction, HALValue.fromNative(type, value1, value2));
}
}

View File

@@ -1,17 +0,0 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.hal.simulation;
import edu.wpi.first.hal.HALValue;
@FunctionalInterface
public interface SimValueCallback2 {
void callback(String name, int handle, int direction, HALValue value);
default void callbackNative(
String name, int handle, int direction, int type, long value1, double value2) {
callback(name, handle, direction, HALValue.fromNative(type, value1, value2));
}
}