Class NotifierJNI
This class is not meant for direct use by teams. Instead, the org.wpilib.system.Notifier class, which corresponds to the C++ Notifier class, should be used.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JNIWrapper
JNIWrapper.Helper -
Method Summary
Modifier and TypeMethodDescriptionstatic voidacknowledgeNotifierAlarm(int notifierHandle) Indicates the notifier alarm has been serviced.static voidcancelNotifierAlarm(int notifierHandle, boolean ack) Cancels all future notifier alarms for a notifier.static intCreates a notifier.static voiddestroyNotifier(int notifierHandle) Destroys a notifier.static intgetNotifierOverrun(int notifierHandle) Gets the overrun count for a notifier.static voidsetNotifierAlarm(int notifierHandle, long alarmTime, long intervalTime, boolean absolute, boolean ack) Updates the initial and interval alarm times for a notifier.static voidsetNotifierName(int notifierHandle, String name) Sets the name of the notifier.Methods inherited from class JNIWrapper
forceLoad, suppressUnused
-
Method Details
-
createNotifier
Creates a notifier.A notifier is an timer that alarms at an initial and (optionally) repeated intervals. This can be used to make precise control loops.
- Returns:
- the created notifier
- See Also:
-
setNotifierName
Sets the name of the notifier.- Parameters:
notifierHandle- Notifier handle.name- Notifier name.- See Also:
-
destroyNotifier
Destroys a notifier.Destruction wakes up any waiters.
- Parameters:
notifierHandle- the notifier handle- See Also:
-
setNotifierAlarm
public static void setNotifierAlarm(int notifierHandle, long alarmTime, long intervalTime, boolean absolute, boolean ack) Updates the initial and interval alarm times for a notifier.The alarmTime is an absolute time (using the WPI now() time base) if absolute is true, or relative to the current time if absolute is false.
If intervalTime is non-zero, the notifier will alarm periodically following alarmTime at the given interval.
If an absolute alarmTime is in the past, the notifier will alarm immediately.
- Parameters:
notifierHandle- the notifier handlealarmTime- the first alarm time (in microseconds)intervalTime- the periodic interval time (in microseconds)absolute- true if the alarm time is absoluteack- true to acknowledge any prior alarm- See Also:
-
cancelNotifierAlarm
Cancels all future notifier alarms for a notifier.- Parameters:
notifierHandle- the notifier handleack- true to acknowledge any prior alarm- See Also:
-
acknowledgeNotifierAlarm
Indicates the notifier alarm has been serviced. Makes no change to future alarms.One of setNotifierAlarm (with ack=true), cancelNotifierAlarm (with ack=true), or this function must be called before waiting for the next alarm.
- Parameters:
notifierHandle- the notifier handle- See Also:
-
getNotifierOverrun
Gets the overrun count for a notifier.An overrun occurs when a notifier's alarm is not serviced before the next scheduled alarm time.
- Parameters:
notifierHandle- the notifier handle- Returns:
- overrun count
-