X2 Standard  Version 1.24
Public Types | Public Member Functions | List of all members
X2PowerControl Class Reference

The X2PowerControl example. More...

#include <x2powercontrol.h>

Inheritance diagram for X2PowerControl:
PowerControlDriverInterface DriverRootInterface LinkInterface HardwareInfoInterface DriverInfoInterface

Public Types

enum  { X2_POWER_CONTROL_CIRCUITS = 8 }
 
- Public Types inherited from DriverRootInterface
enum  DeviceType {
  DT_UNKNOWN = 0, DT_MOUNT = 1, DT_FOCUSER = 2, DT_CAMERA = 3,
  DT_FILTERWHEEL = 4, DT_DOME = 5, DT_ROTATOR = 6, DT_WEATHER = 7,
  DT_GPSTFP = 8, DT_VIDEO = 9, DT_OTA =10, DT_AO =11,
  DT_POWERCONTROL =12, DT_PRIVATE_A =13
}
 

Public Member Functions

 X2PowerControl (const char *pszDisplayName, const int &nInstanceIndex, SerXInterface *pSerXIn, TheSkyXFacadeForDriversInterface *pTheSkyXIn, SleeperInterface *pSleeperIn, BasicIniUtilInterface *pIniUtilIn, LoggerInterface *pLoggerIn, MutexInterface *pIOMutexIn, TickCountInterface *pTickCountIn)
 
DriverRootInterface Implementation
virtual int queryAbstraction (const char *pszName, void **ppVal)
 
DriverInfoInterface Implementation
virtual void driverInfoDetailedInfo (BasicStringInterface &str) const
 
virtual double driverInfoVersion (void) const
 
HardwareInfoInterface Implementation
virtual void deviceInfoNameShort (BasicStringInterface &str) const
 
virtual void deviceInfoNameLong (BasicStringInterface &str) const
 
virtual void deviceInfoDetailedDescription (BasicStringInterface &str) const
 
virtual void deviceInfoFirmwareVersion (BasicStringInterface &str)
 
virtual void deviceInfoModel (BasicStringInterface &str)
 
- Public Member Functions inherited from PowerControlDriverInterface
virtual DeviceType deviceType (void)
 
virtual bool isEstablishLinkAbortable (void) const
 

LinkInterface Implementation

See LinkInterface.

virtual int establishLink (void)
 
virtual int terminateLink (void)
 
virtual bool isLinked (void) const
 
virtual int numberOfCircuits (int &nNumber)
 
virtual int circuitState (const int &nIndex, bool &bZeroForOffOneForOn)
 
virtual int setCircuitState (const int &nIndex, const bool &bZeroForOffOneForOn)
 

Detailed Description

The X2PowerControl example.

Use this example as a template to write an X2PowerControl driver.

Member Function Documentation

◆ circuitState()

int X2PowerControl::circuitState ( const int &  nZeroBasedIndex,
bool &  bZeroForOffOneForOn 
)
virtual

Called by TheSky to determine (read) the current state of a circuit.

Parameters
nZeroBasedIndex(in) the index of the circuit, starting at zero to 1-number of circuits.
bZeroForOffOneForOn(out) the current state of a circuit. Set bZeroForOffOneForOn to zero (0) to indcate the circuit is off and one (1) to indcate the circuit is on.

Reimplemented from PowerControlDriverInterface.

◆ deviceInfoDetailedDescription()

void X2PowerControl::deviceInfoDetailedDescription ( BasicStringInterface str) const
virtual

Return a detailed device description.

Implements PowerControlDriverInterface.

◆ deviceInfoFirmwareVersion()

void X2PowerControl::deviceInfoFirmwareVersion ( BasicStringInterface str)
virtual

Return the firmware version, if available.

Implements PowerControlDriverInterface.

◆ deviceInfoModel()

void X2PowerControl::deviceInfoModel ( BasicStringInterface str)
virtual

Return the device model name.

Implements PowerControlDriverInterface.

◆ deviceInfoNameLong()

void X2PowerControl::deviceInfoNameLong ( BasicStringInterface str) const
virtual

Return a detailed device name.

Implements PowerControlDriverInterface.

◆ deviceInfoNameShort()

void X2PowerControl::deviceInfoNameShort ( BasicStringInterface str) const
virtual

Return a short device name.

Implements PowerControlDriverInterface.

◆ driverInfoDetailedInfo()

void X2PowerControl::driverInfoDetailedInfo ( BasicStringInterface str) const
virtual

Return detailed information about the driver.

Implements PowerControlDriverInterface.

◆ driverInfoVersion()

double X2PowerControl::driverInfoVersion ( void  ) const
virtual

Return a version number.

Implements PowerControlDriverInterface.

◆ establishLink()

int X2PowerControl::establishLink ( void  )
virtual

Connect (link) to the device.

Implements PowerControlDriverInterface.

◆ isLinked()

bool X2PowerControl::isLinked ( void  ) const
virtual

Return true if there is a connection, otherwise return false.

Implements PowerControlDriverInterface.

◆ numberOfCircuits()

int X2PowerControl::numberOfCircuits ( int &  nNumber)
virtual

Return the number of circuits (outlets) that can be controlled by this power control device.

Parameters
nNumber(out) the number of circuits controlled by this power control device. This method will be called once after a successfull establishLink().

Reimplemented from PowerControlDriverInterface.

◆ queryAbstraction()

int X2PowerControl::queryAbstraction ( const char *  pszName,
void **  ppVal 
)
virtual

Return a pointer to well defined interface.

Implements PowerControlDriverInterface.

◆ setCircuitState()

int X2PowerControl::setCircuitState ( const int &  nZeroBasedIndex,
const bool &  bZeroForOffOneForOn 
)
virtual

Called by TheSky to set the state of a circuit.

Parameters
nZeroBasedIndex(in) the index of the circuit, starting at zero to 1-number of circuits.
bZeroForOffOneForOn(in) the desired state of a circuit. bZeroForOffOneForOn will be zero (0) to set the circuit off and one (1) to set the circuit on.

Reimplemented from PowerControlDriverInterface.

◆ terminateLink()

int X2PowerControl::terminateLink ( void  )
virtual

Disconnect from the device.

Implements PowerControlDriverInterface.


The documentation for this class was generated from the following files:
X2 Examples
(C) Software Bisque, Inc. All rights reserved.