F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
WatchdogTimer.hpp
Go to the documentation of this file.
1 #ifndef _WatchdogTimer_hpp_
2 #define _WatchdogTimer_hpp_
3 
4 #include <FpConfig.hpp>
5 
6 namespace Os {
7  class WatchdogTimer {
8  public:
9 
10  typedef enum {
16 
17  typedef void (*WatchdogCb)(void *);
18 
19  WatchdogTimer();
20  virtual ~WatchdogTimer();
21  WatchdogStatus startTicks( I32 delayInTicks,
22  WatchdogCb p_callback,
23  void* parameter
24  );
25  WatchdogStatus startMs( I32 delayInMs,
26  WatchdogCb p_callback,
27  void* parameter
28  );
30 
31 
33 
34  void expire();
35 
36  private:
37 
38  I32 m_handle;
39  WatchdogCb m_cb;
40  void* m_parameter;
41  I32 m_timerTicks;
42  I32 m_timerMs;
44 
45  };
46 }
47 
48 #endif
C++-compatible configuration header for fprime configuration.
WatchdogStatus startMs(I32 delayInMs, WatchdogCb p_callback, void *parameter)
WatchdogStatus startTicks(I32 delayInTicks, WatchdogCb p_callback, void *parameter)
void(* WatchdogCb)(void *)
@ WATCHDOG_INIT_ERROR
Timer initialization failed.
@ WATCHDOG_OK
Call was successful.
@ WATCHDOG_CANCEL_ERROR
Timer cancellation failed.
@ WATCHDOG_START_ERROR
Timer startup failed.
WatchdogStatus restart()
restart timer with previous value
WatchdogStatus cancel()
cancel timer
virtual ~WatchdogTimer()
void expire()
Invoke the callback function with m_parameter.