LibDS
Qt-based library for controlling FRC robots
|
Implements a simple watchdog used to reset comms. when needed. More...
#include <Watchdog.h>
Public Slots | |
void | reset () |
void | setExpirationTime (int msecs) |
Signals | |
void | expired () |
Public Member Functions | |
int | expirationTime () const |
Private Attributes | |
QTimer | m_timer |
Implements a simple watchdog used to reset comms. when needed.
The Watchdog
class implements a simple software watchdog with the help of the QTimer
object.
During normal operation, the program periodically resets the watchdog timer to prevent it from expiring. If, due to an error, the program fails to reset or feed the watchdog, it shall expire and emit the appropriate signals.
The expiration signal is then received by the current protocol, which in turn will reset itself and try to re-establish communications with the robot controller and the FMS.
int Watchdog::expirationTime | ( | ) | const |
Returns the expiration time of the watchdog in milliseconds
Referenced by reset().
|
slot |
Resets the watchdog and prevents it from expiring
References expirationTime().
Referenced by DriverStation::readFMSPacket(), DriverStation::readRadioPacket(), DriverStation::readRobotPacket(), and setExpirationTime().
|
slot |
Changes the expiration time and resets the watchdog
References reset().
Referenced by DriverStation::setProtocol().