HWService

This class contains the interface between the general driver and the hardware-specific part. Derivations are always made from this class. The interface consists of the following virtual functions:

  • PVSSboolean initialize(int argc, char *argv[]) - the hardware-specific part should be initialized in this function. If the initialization is successful, PVSS_TRUE must be returned, since if the return value is PVSS_FALSE the general driver aborts the start-up.

  • PVSSboolean start() - is called after the connection to the EventManager is successfully set up. If externally aborted (e.g.: by pressing Ctrl-C (if DRVMODE_EXITING is set), the start-up is interrupted and the program is terminated.

  • void stop() - is called on termination and should restore the defined (startable) status of the hardware.

  • void workProc() - handles e.g. data arriving spontaneously from the periphery (alert direction), is periodically called from DrvManager::mainLoop().

  • PVSSboolean writeData(HWObject *ptr) - is called from toHW(...) and used for writing the data from the HW object buffer to the periphery (including conversion into the expected protocol format).

  • void generalQuery(DpIdentifier& dpId, VariablePtr varPtr) - a spontaneous message was received for the general query data point - the function is to execute the general query.

  • void singleQuery(HWObject *objPtr) - a spontaneous message was received for the single query data point, or the value should be polled - the function is to execute the query.

  • void hotLink2Internal(DpIdentifier& dpId, VariablePtr varPtr) - a spontaneous message was received for an internal data point. This function can be used to respond to the message.