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.

  • Constructor Details

  • Method Details

    • initializeNotifier

      public static int initializeNotifier()
      Initializes the notifier.
    • setHALThreadPriority

      public static boolean setHALThreadPriority​(boolean realTime, int priority)
      Sets the HAL notifier thread priority.
    • 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.