OpenJAUS SAE SDK  6.0.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
openjaus::system::SimpleWatchdog Class Reference

#include <SimpleWatchdog.h>

Inherits openjaus::system::AbstractWatchdog.

Public Member Functions

 SimpleWatchdog (uint16 timeout_ms)
 
virtual ~SimpleWatchdog ()
 
void start ()
 Start the watchdog. More...
 
void cancel ()
 Cancel the watchdog. More...
 
void reset ()
 Reset the watchdog. More...
 
bool timedOut () const
 Specifies if the watchdog has timed out. More...
 
- Public Member Functions inherited from openjaus::system::AbstractWatchdog
 AbstractWatchdog ()
 
virtual ~AbstractWatchdog ()
 
void addTimeOutCallback (void(*function)(void *object, WatchdogInterface *watchdog), void *object)
 
- Public Member Functions inherited from openjaus::system::WatchdogInterface
 WatchdogInterface ()
 
virtual ~WatchdogInterface ()
 

Private Types

enum  WatchdogStateEnum { WATCHDOG_NOT_STARTED, WATCHDOG_NORMAL, WATCHDOG_TIMEOUT }
 

Private Member Functions

void resetInternal ()
 
void startTimeoutTimer ()
 
void handleTimeoutInterval (system::Timer *timer)
 

Private Attributes

uint16 timeout_ms
 
WatchdogStateEnum state
 
system::Timer timeoutTimer
 
system::Mutex mutex
 
unsigned int resetCount
 

Additional Inherited Members

- Protected Member Functions inherited from openjaus::system::AbstractWatchdog
void executeCallbacks ()
 

Member Enumeration Documentation

◆ WatchdogStateEnum

Enumerator
WATCHDOG_NOT_STARTED 
WATCHDOG_NORMAL 
WATCHDOG_TIMEOUT 

Constructor & Destructor Documentation

◆ SimpleWatchdog()

openjaus::system::SimpleWatchdog::SimpleWatchdog ( uint16  timeout_ms)

◆ ~SimpleWatchdog()

openjaus::system::SimpleWatchdog::~SimpleWatchdog ( )
virtual

Member Function Documentation

◆ cancel()

void openjaus::system::SimpleWatchdog::cancel ( )
virtual

Cancels the watchdog. A watchdog cannot be restarted once it's been cancelled and a new watchdog must be created.

Implements openjaus::system::WatchdogInterface.

◆ handleTimeoutInterval()

void openjaus::system::SimpleWatchdog::handleTimeoutInterval ( system::Timer timer)
private

◆ reset()

void openjaus::system::SimpleWatchdog::reset ( )
virtual

Resets the watchdog such that it does not timeout. If the watchdog is not reset within the drive timeout interval, the watched dog will move to the timeout state and the timeout function will be executed.

Implements openjaus::system::WatchdogInterface.

◆ resetInternal()

void openjaus::system::SimpleWatchdog::resetInternal ( )
private

◆ start()

void openjaus::system::SimpleWatchdog::start ( )
virtual

Starts the watchdog. A watchdog can only be started once. It can be cancelled after it is started but it cannot be restarted if it is cancelled. This method gives more flexibility over when a watchdog is started.

Implements openjaus::system::WatchdogInterface.

◆ startTimeoutTimer()

void openjaus::system::SimpleWatchdog::startTimeoutTimer ( )
private

◆ timedOut()

bool openjaus::system::SimpleWatchdog::timedOut ( ) const
virtual

Specifies if the watchdog has timed out. This is set to true when the reset interval has not been called within the drive timeout interval. If timedOut is true, reset must be called at (or faster than) the drive timeout interval for the length of time specified by the recovery time interval before the timeout will be cleared.

Implements openjaus::system::WatchdogInterface.

Member Data Documentation

◆ mutex

system::Mutex openjaus::system::SimpleWatchdog::mutex
private

◆ resetCount

unsigned int openjaus::system::SimpleWatchdog::resetCount
private

◆ state

WatchdogStateEnum openjaus::system::SimpleWatchdog::state
private

◆ timeout_ms

uint16 openjaus::system::SimpleWatchdog::timeout_ms
private

◆ timeoutTimer

system::Timer openjaus::system::SimpleWatchdog::timeoutTimer
private

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