Timer Class¶
See the Timer Entity for generic information.
-
class TimerClass : public Acroname::BrainStem2CLI::EntityClass¶
TimerClass: The Timer Class provides access to a simple scheduler. The timer can set to fire only once, or to repeat at a certain interval. Additionally, a timer entity can execute custom Reflex routines upon firing.
Public Functions
-
TimerClass()¶
Constructors.
-
~TimerClass()¶
Destructor.
- !TimerClass ()
Finalizer.
- void init (BrainStem2CLI::ModuleClass^ module, const unsigned char index)
Initializes the class. Should only be called when manually creating classes.
- Parameters:
pModule – The module.
index – The cmdTIMER index to be addressed.
-
aErr getExpiration(unsigned int %usecDuration)¶
Get the currently set expiration time in microseconds. This is not a “live” timer. That is, it shows the expiration time originally set with setExpiration; it does not “tick down” to show the time remaining before expiration.
- Parameters:
usecDuration – The timer expiration duration in microseconds.
- Returns:
Returns common entity return values
-
aErr setExpiration(const unsigned int usecDuration)¶
Set the expiration time for the timer entity. When the timer expires, it will fire the associated timer[index]() reflex.
- Parameters:
usecDuration – The duration before timer expiration in microseconds.
- Returns:
Returns common entity return values
-
aErr getMode(unsigned char %mode)¶
Get the mode of the timer which is either single or repeat mode.
- Parameters:
mode – The mode of the time. aTIMER_MODE_REPEAT or aTIMER_MODE_SINGLE.
- Returns:
Returns common entity return values
-
aErr setMode(const unsigned char mode)¶
Set the mode of the timer which is either single or repeat mode.
- Parameters:
mode – The mode of the timer. aTIMER_MODE_REPEAT or aTIMER_MODE_SINGLE.
- Returns:
Returns common entity return values
-
TimerClass()¶