Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

NetConnWatchdog Class Reference

List of all members.

Detailed Description

Watchdog for the wireless network connect.

Insures that a constant connection is maintained between both systems. If the connection is ever lost the motors will be shutdown, the connection will be fully closed and start listening for a new connection. This system is very important, since it shuts down the motors if the remote system crashes or the robot goes out of the range of the remote computer

Definition at line 17 of file NetConnWatchdog.h.

Public Types

enum  Status {
  OPEN = 1,
  CLOSED = 0,
  ERROR = -1
}
 enumeration for the status of the watchdog More...


Public Member Functions

int start ()
 start up the watchdog

int stop ()
 stop the watchdog

void countDown ()
 countDown the watchdog timer - this function should be called whenever a HBeat packet is recieved

void addTick ()
 add one to the ticker

int getInTicker ()
 get inTicker


Static Public Member Functions

NetConnWatchdogtheInstance ()
 get a pointer to the singleton instance of the NetConnWatchdog


Protected Member Functions

 NetConnWatchdog ()
 constructor for the net watchdog

 ~NetConnWatchdog ()
 destructor for the net watchdog


Private Member Functions

int error ()
 if no HBeat packets are recieved with the time required the network is shutdown and the motors are stopped


Static Private Member Functions

void tick ()
 thead function to make the watchdog tick and send out HBeat packets to the other side


Private Attributes

int inTicker
 The ticker for the watchdog.

Status status
 The status of the watchdog.

pthread_t tThread
 Thread for the watchdog to run on.


Member Enumeration Documentation

enum NetConnWatchdog::Status
 

enumeration for the status of the watchdog

Enumeration values:
OPEN  the watchdog is open
CLOSED  the watchdog is closed
ERROR  error in opening or closing the watchdog

Definition at line 22 of file NetConnWatchdog.h.


Member Function Documentation

int NetConnWatchdog::getInTicker  )  [inline]
 

get inTicker

Return values:
the current value of the ticker

Definition at line 64 of file NetConnWatchdog.h.

References inTicker.

int NetConnWatchdog::start  ) 
 

start up the watchdog

Return values:
1 on success -1 on error

int NetConnWatchdog::stop  ) 
 

stop the watchdog

Return values:
1 on success -1 on error

NetConnWatchdog* NetConnWatchdog::theInstance  )  [static]
 

get a pointer to the singleton instance of the NetConnWatchdog

Return values:
the singleton instance of the NetConnWatchdog


The documentation for this class was generated from the following file:
Generated on Fri Mar 25 23:48:46 2005 for CS498EmbeddedSystemsProgramming by doxygen 1.3.6