#include <Watchdog.h>
Public Member Functions | |
Watchdog (void) | |
~Watchdog (void) | |
bool | Feed (void) |
void | Kill (void) |
unsigned int | GetTimer (void) |
unsigned int | GetExpiration (void) |
void | SetExpiration (unsigned int expiration_ms) |
bool | GetEnabled (void) |
void | SetEnabled (bool enabled) |
bool | IsAlive (void) |
bool | IsSystemActive (void) |
This is serious business. Don't just disable the watchdog. You can't afford it!
http://thedailywtf.com/Articles/_0x2f__0x2f_TODO_0x3a__Uncomment_Later.aspx
Watchdog::Watchdog | ( | void | ) |
The Watchdog is born.
Watchdog::~Watchdog | ( | void | ) |
Time to bury him in the back yard.
bool Watchdog::Feed | ( | void | ) |
Throw the dog a bone.
When everything is going well, you feed your dog when you get home. Let's hope you don't drive your car off a bridge on the way home... Your dog won't get fed and he will starve to death.
By the way, it's not cool to ask the neighbor (some random task) to feed your dog for you. He's your responsibility!
void Watchdog::Kill | ( | void | ) |
Put the watchdog out of its misery.
Don't wait for your dying robot to starve when there is a problem. Kill it quickly, cleanly, and humanely.
unsigned int Watchdog::GetTimer | ( | void | ) |
Read how long it has been since the watchdog was last fed.
unsigned int Watchdog::GetExpiration | ( | void | ) |
Read what the current expiration is.
void Watchdog::SetExpiration | ( | unsigned int | expiration_ms | ) |
Configure how many milliseconds your watchdog can be neglected before he starves to death.
expiration_ms | The number of milliseconds before starvation. |
bool Watchdog::GetEnabled | ( | void | ) |
Find out if the watchdog is currently enabled or disabled (mortal or immortal).
void Watchdog::SetEnabled | ( | bool | enabled | ) |
Enable or disable the watchdog timer.
When enabled, you must keep feeding the watchdog timer to keep the watchdog active, and hence the dangerous parts (motor outputs, etc.) can keep functioning. When disabled, the watchdog is immortal and will remain active even without being fed. It will also ignore any kill commands while disabled.
enabled | Enable or disable the watchdog. |
bool Watchdog::IsAlive | ( | void | ) |
Check in on the watchdog and make sure he's still kicking.
This indicates that your watchdog is allowing the system to operate. It is still possible that the network communications is not allowing the system to run, but you can check this to make sure it's not your fault. Check IsSystemActive() for overall system status.
If the watchdog is disabled, then your watchdog is immortal.
bool Watchdog::IsSystemActive | ( | void | ) |
Check on the overall status of the system.