LibDS
Qt-based library for controlling FRC robots
Public Slots | Signals | Public Member Functions | Private Attributes | List of all members
Watchdog Class Reference

Implements a simple watchdog used to reset comms. when needed. More...

#include <Watchdog.h>

Inheritance diagram for Watchdog:

Public Slots

void reset ()
 
void setExpirationTime (int msecs)
 

Signals

void expired ()
 

Public Member Functions

int expirationTime () const
 

Private Attributes

QTimer m_timer
 

Detailed Description

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.

Member Function Documentation

int Watchdog::expirationTime ( ) const

Returns the expiration time of the watchdog in milliseconds

Referenced by reset().

void Watchdog::reset ( )
slot

Resets the watchdog and prevents it from expiring

References expirationTime().

Referenced by DriverStation::readFMSPacket(), DriverStation::readRadioPacket(), DriverStation::readRobotPacket(), and setExpirationTime().

void Watchdog::setExpirationTime ( int  msecs)
slot

Changes the expiration time and resets the watchdog

References reset().

Referenced by DriverStation::setProtocol().


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