DrvAlive

Forms the base class for the implementation of an Alive mechanism for a physical connection. Specific actions are triggered in the selected interval (in seconds). Both a send and a receive mechanism can thus be derived. For instance, if nothing is received from a particular peripheral component for a certain time, the driver can be caused to set the connection to faulty and the data points assigned to the peripheral component to invalid. In the send direction, a certain configured data point is sent cyclically to the periphery. It is advisable to couple the Alive mechanism to internal data points, so that it remains easy to configure.

This class supplies the following virtual methods:

  • restartTimer(): brings up the timer for the relevant object again, and sets it to the given value "sec" that is held in an attribute of the class.

  • stopTimer(): sets the internal status of the relevant Alive object to "not running".

  • timeExpired(): is automatically called after the set time interval has expired; this function should be derived. All actions that should be cyclically executed, such as the sending of an Alive data point and the renewed raising of the timer, are specified here.

  • setSec(unsigned int sec): serves for setting the time interval, given in seconds, 0 deactivates the timer.

  • setUsec(unsigned int sec): serves for setting the time interval, given in micro-seconds.