Package edu.wpi.first.hal
Class NotifierJNI
- java.lang.Object
-
- edu.wpi.first.hal.JNIWrapper
-
- edu.wpi.first.hal.NotifierJNI
-
public class NotifierJNI extends JNIWrapper
The NotifierJNI class directly wraps the C++ HAL Notifier.This class is not meant for direct use by teams. Instead, the edu.wpi.first.wpilibj.Notifier class, which corresponds to the C++ Notifier class, should be used.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.wpi.first.hal.JNIWrapper
JNIWrapper.Helper
-
-
Constructor Summary
Constructors Constructor Description NotifierJNI()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcancelNotifierAlarm(int notifierHandle)Cancels any pending wakeups set by updateNotifierAlarm().static voidcleanNotifier(int notifierHandle)Deletes the notifier object when we are done with it.static intinitializeNotifier()Initializes the notifier.static voidsetNotifierName(int notifierHandle, String name)Sets the name of the notifier.static voidstopNotifier(int notifierHandle)Wakes up the waiter with time=0.static voidupdateNotifierAlarm(int notifierHandle, long triggerTime)Sets the notifier to wakeup the waiter in another triggerTime microseconds.static longwaitForNotifierAlarm(int notifierHandle)Block until woken up by an alarm (or stop).-
Methods inherited from class edu.wpi.first.hal.JNIWrapper
forceLoad
-
-
-
-
Method Detail
-
initializeNotifier
public static int initializeNotifier()
Initializes the notifier.
-
setNotifierName
public static void setNotifierName(int notifierHandle, String name)Sets the name of the notifier.
-
stopNotifier
public static void stopNotifier(int notifierHandle)
Wakes up the waiter with time=0. Note: after this function is called, all calls to waitForNotifierAlarm() will immediately start returning 0.
-
cleanNotifier
public static void cleanNotifier(int notifierHandle)
Deletes the notifier object when we are done with it.
-
updateNotifierAlarm
public static void updateNotifierAlarm(int notifierHandle, long triggerTime)Sets the notifier to wakeup the waiter in another triggerTime microseconds.
-
cancelNotifierAlarm
public static void cancelNotifierAlarm(int notifierHandle)
Cancels any pending wakeups set by updateNotifierAlarm(). Does NOT wake up any waiters.
-
waitForNotifierAlarm
public static long waitForNotifierAlarm(int notifierHandle)
Block until woken up by an alarm (or stop).- Returns:
- Time when woken up.
-
-