RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.system.Watchdog Class Reference
Inheritance diagram for org.wpilib.system.Watchdog:

Public Member Functions

 Watchdog (double timeout, Runnable callback)
 Watchdog (Time timeout, Runnable callback)
void close ()
boolean equals (Object obj)
int hashCode ()
int compareTo (Watchdog rhs)
double getTime ()
void setTimeout (double timeout)
double getTimeout ()
boolean isExpired ()
void addEpoch (String epochName)
void printEpochs ()
void reset ()
void enable ()
void disable ()
void suppressTimeoutMessage (boolean suppress)

Detailed Description

A class that's a wrapper around a watchdog timer.

When the timer expires, a message is printed to the console and an optional user-provided callback is invoked.

The watchdog is initialized disabled, so the user needs to call enable() before use.

Definition at line 26 of file Watchdog.java.

Constructor & Destructor Documentation

◆ Watchdog() [1/2]

org.wpilib.system.Watchdog.Watchdog ( double timeout,
Runnable callback )

Watchdog constructor.

Parameters
timeoutThe watchdog's timeout in seconds with nanosecond resolution.
callbackThis function is called when the timeout expires.

Definition at line 60 of file Watchdog.java.

◆ Watchdog() [2/2]

org.wpilib.system.Watchdog.Watchdog ( Time timeout,
Runnable callback )

Watchdog constructor.

Parameters
timeoutThe watchdog's timeout with nanosecond resolution.
callbackThis function is called when the timeout expires.

Definition at line 72 of file Watchdog.java.

Member Function Documentation

◆ addEpoch()

void org.wpilib.system.Watchdog.addEpoch ( String epochName)

Adds time since last epoch to the list printed by printEpochs().

See also
Tracer.addEpoch(String)
Parameters
epochNameThe name to associate with the epoch.

Definition at line 164 of file Watchdog.java.

◆ close()

void org.wpilib.system.Watchdog.close ( )

Definition at line 77 of file Watchdog.java.

◆ compareTo()

int org.wpilib.system.Watchdog.compareTo ( Watchdog rhs)

Definition at line 92 of file Watchdog.java.

◆ disable()

void org.wpilib.system.Watchdog.disable ( )

Disables the watchdog timer.

Definition at line 205 of file Watchdog.java.

◆ enable()

void org.wpilib.system.Watchdog.enable ( )

Enables the watchdog timer.

Definition at line 187 of file Watchdog.java.

◆ equals()

boolean org.wpilib.system.Watchdog.equals ( Object obj)

Definition at line 82 of file Watchdog.java.

◆ getTime()

double org.wpilib.system.Watchdog.getTime ( )

Returns the time in seconds since the watchdog was last fed.

Returns
The time in seconds since the watchdog was last fed.

Definition at line 103 of file Watchdog.java.

◆ getTimeout()

double org.wpilib.system.Watchdog.getTimeout ( )

Returns the watchdog's timeout in seconds.

Returns
The watchdog's timeout in seconds.

Definition at line 135 of file Watchdog.java.

◆ hashCode()

int org.wpilib.system.Watchdog.hashCode ( )

Definition at line 87 of file Watchdog.java.

◆ isExpired()

boolean org.wpilib.system.Watchdog.isExpired ( )

Returns true if the watchdog timer has expired.

Returns
True if the watchdog timer has expired.

Definition at line 149 of file Watchdog.java.

◆ printEpochs()

void org.wpilib.system.Watchdog.printEpochs ( )

Prints list of epochs added so far and their times.

See also
Tracer.printEpochs()

Definition at line 173 of file Watchdog.java.

◆ reset()

void org.wpilib.system.Watchdog.reset ( )

Resets the watchdog timer.

This also enables the timer if it was previously disabled.

Definition at line 182 of file Watchdog.java.

◆ setTimeout()

void org.wpilib.system.Watchdog.setTimeout ( double timeout)

Sets the watchdog's timeout.

Parameters
timeoutThe watchdog's timeout in seconds with nanosecond resolution.

Definition at line 112 of file Watchdog.java.

◆ suppressTimeoutMessage()

void org.wpilib.system.Watchdog.suppressTimeoutMessage ( boolean suppress)

Enable or disable suppression of the generic timeout message.

This may be desirable if the user-provided callback already prints a more specific message.

Parameters
suppressWhether to suppress generic timeout message.

Definition at line 222 of file Watchdog.java.


The documentation for this class was generated from the following file: