CCAux  2.20.0.0
CCAux API reference
Functions
Power functions

Functions

EXTERN_C CCAUXDLL_API POWERHANDLE CCAUXDLL_CALLING_CONV GetPower (void)
 
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Power_release (POWERHANDLE)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getBLPowerStatus (POWERHANDLE, CCStatus *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getCanPowerStatus (POWERHANDLE, CCStatus *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getVideoPowerStatus (POWERHANDLE, uint8_t *videoStatus)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getExtFanPowerStatus (POWERHANDLE, CCStatus *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getButtonPowerTransitionStatus (POWERHANDLE, ButtonPowerTransitionStatus *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getVideoOCDStatus (POWERHANDLE, OCDStatus *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getCanOCDStatus (POWERHANDLE, OCDStatus *status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_setBLPowerStatus (POWERHANDLE, CCStatus status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_setCanPowerStatus (POWERHANDLE, CCStatus status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_setVideoPowerStatus (POWERHANDLE, uint8_t status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_setExtFanPowerStatus (POWERHANDLE, CCStatus status)
 
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_ackPowerRequest (POWERHANDLE)
 

Detailed Description

Functions in the Power class

Function Documentation

◆ GetPower()

EXTERN_C CCAUXDLL_API POWERHANDLE CCAUXDLL_CALLING_CONV CrossControl::GetPower ( void  )

Factory function that creates instances of the Power object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
POWERHANDLE to an allocated Power object. The returned handle needs to be deallocated using the Power_release(POWERHANDLE) method when it's no longer needed. Returns NULL if it fails to allocate memory.

Example Usage:

POWERHANDLE pPower = ::GetPower();
assert(pPower);
power_example(pPower);
Power_release(pPower);
EXTERN_C CCAUXDLL_API POWERHANDLE CCAUXDLL_CALLING_CONV GetPower(void)
EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV Power_release(POWERHANDLE)
void * POWERHANDLE
Definition: Power.h:33

◆ Power_ackPowerRequest()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_ackPowerRequest ( POWERHANDLE  )

Acknowledge a power request from the system supervisor. This is handled by the service/daemon and should normally not be used by applications unless the CrossControl service/daemon is not being run on the system. If that is the case, the following requests (read by getButtonPowerTransitionStatus) should be acknowledged: BPTS_ShutDown, BPTS_Suspend and BPTS_Restart

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Power_getBLPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_getBLPowerStatus ( POWERHANDLE  ,
CCStatus status 
)

Get backlight power status.

Supported Platform(s): XL, XL5, XM, XM9

Parameters
statusBacklight power status.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Power_getBLPowerStatus(pPower, &status);
if (err == ERR_SUCCESS)
{
cout << "Backlight power is " << ((status == Enabled) ? "ON" : "OFF") << endl;
}
else
{
cout << "Error(" << err << ") in function Power_getBLPowerStatus: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getBLPowerStatus(POWERHANDLE, CCStatus *status)
EXTERN_C CCAUXDLL_API char_t const *CCAUXDLL_CALLING_CONV GetErrorStringA(eErr errCode)
@ Enabled
Definition: CCAuxTypes.h:155
@ ERR_SUCCESS
Definition: CCAuxTypes.h:163

◆ Power_getButtonPowerTransitionStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_getButtonPowerTransitionStatus ( POWERHANDLE  ,
ButtonPowerTransitionStatus status 
)

Get the current status for front panel button and on/off signal.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200, X1200

Parameters
statusThe current status. See the definition of ButtonPowerTransitionStatus for details.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Power_getCanOCDStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_getCanOCDStatus ( POWERHANDLE  ,
OCDStatus status 
)

Get Can power overcurrent detection status. Find out if the Can power supervision has detected overcurrent, likely caused by short circuit problems. The overcurrent detection system will immediately turn of the power if such a condition occurs. If the overcurrent remains, Can power is turned off permanently until the unit is restarted. Up to 5 consecutive over-current conditions needed until power is turned off completely. If application software turns off and on the power, the failure counter will be reset.

Supported Platform(s): XL, XL5, XM, XS, XA

Parameters
statusThe current overcurrent detection status
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

cout << "Checking overcurrent status... " << endl;
OCDStatus ocdstatus;
err = Power_getCanOCDStatus(pPower, &ocdstatus);
if (err == ERR_NOT_SUPPORTED)
{
cout << "Not supported." << endl;
}
else if (err != ERR_SUCCESS)
{
cout << "Error(" << err << ") in function Power_getCanOCDStatus: " << GetErrorStringA(err) << endl;
}
else
{
cout << "Power_getCanOCDStatus: Can OCD status is: ";
switch (ocdstatus)
{
case OCD_OK:
cout << "OCD_OK" << std::endl;
break;
case OCD_OC:
cout << "OCD_OC" << std::endl;
break;
cout << "OCD_POWER_OFF" << std::endl;
break;
default:
cout << "ERROR" << std::endl;
break;
}
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getCanOCDStatus(POWERHANDLE, OCDStatus *status)
OCDStatus
Definition: CCAuxTypes.h:474
@ OCD_OK
Definition: CCAuxTypes.h:475
@ OCD_POWER_OFF
Definition: CCAuxTypes.h:478
@ OCD_OC
Definition: CCAuxTypes.h:476
@ ERR_NOT_SUPPORTED
Definition: CCAuxTypes.h:165

◆ Power_getCanPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_getCanPowerStatus ( POWERHANDLE  ,
CCStatus status 
)

Get can power status.

Supported Platform(s): XL, XL5, XM, XS, XA

Parameters
statusCan power status.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Power_getExtFanPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_getExtFanPowerStatus ( POWERHANDLE  ,
CCStatus status 
)

Get external fan power status.

Supported Platform(s): XL, XL5, XM

Parameters
statusFan power status.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Power_getVideoOCDStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_getVideoOCDStatus ( POWERHANDLE  ,
OCDStatus status 
)

Get Video power overcurrent detection status. Find out if the video power supervision has detected overcurrent, likely caused by short circuit problems. The overcurrent detection system will immediately turn of the power if such a condition occurs. If the overcurrent remains, video power is turned off permanently until the unit is restarted. Up to 5 consecutive over-current conditions needed until power is turned off completely. If application software turns off and on the power, the failure counter will be reset.

Supported Platform(s): XL, XM, XS, XA

Parameters
statusThe current overcurrent detection status
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Power_getVideoOCDStatus(pPower, &ocdstatus);
if (err == ERR_NOT_SUPPORTED)
{
/* Don't print anything */
}
else if (err != ERR_SUCCESS)
{
cout << "Error(" << err << ") in function Power_getVideoOCDStatus: " << GetErrorStringA(err) << endl;
}
else
{
cout << "Power_getVideoOCDStatus: Video OCD status is: ";
switch (ocdstatus)
{
case OCD_OK:
cout << "OCD_OK" << std::endl;
break;
case OCD_OC:
cout << "OCD_OC" << std::endl;
break;
cout << "OCD_POWER_OFF" << std::endl;
break;
default:
cout << "ERROR" << std::endl;
break;
}
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getVideoOCDStatus(POWERHANDLE, OCDStatus *status)

◆ Power_getVideoPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_getVideoPowerStatus ( POWERHANDLE  ,
uint8_t videoStatus 
)

Get Video power status.

Supported Platform(s): XL, XL5, XM, XS, XA

Parameters
videoStatusVideo power status. Bit0: Video 1. Bit1: Video 2. Bit2: Video 3. Bit3: Video 4. (1=on, 0=off)
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

err = Power_getVideoPowerStatus(pPower, &value);
if (err == ERR_SUCCESS)
{
cout << "Video power status: " << endl;
cout << "Video1: " << ((value & 0x01) ? "ON" : "OFF") << endl;
cout << "Video2: " << ((value & 0x02) ? "ON" : "OFF") << endl;
cout << "Video3: " << ((value & 0x04) ? "ON" : "OFF") << endl;
cout << "Video4: " << ((value & 0x08) ? "ON" : "OFF") << endl;
}
else
{
cout << "Error(" << err << ") in function Power_getVideoPowerStatus: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_getVideoPowerStatus(POWERHANDLE, uint8_t *videoStatus)

◆ Power_release()

EXTERN_C CCAUXDLL_API void CCAUXDLL_CALLING_CONV CrossControl::Power_release ( POWERHANDLE  )

Delete the Power object.

Supported Platform(s): XL, XL5, XM, XM9, XS, XA, VC, VA, VS, VI2, V700, Yukon, V510, V710, V1000, V1200

Returns
-

Example Usage:

POWERHANDLE pPower = ::GetPower();
assert(pPower);
power_example(pPower);
Power_release(pPower);

◆ Power_setBLPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_setBLPowerStatus ( POWERHANDLE  ,
CCStatus  status 
)

Set backlight power status.

Supported Platform(s): XL, XL5, XM, XM9

Parameters
statusBacklight power status.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

Example Usage:

cout << "Blinking backlight... " << endl;
cin.sync();
cout << endl << "Press Enter to to turn off the Backlight and then Enter to turn it on again..." << endl;
cin.get();
cin.sync();
cin.get();
if (err != ERR_SUCCESS)
{
cout << "Error(" << err << ") in function Power_setBLPowerStatus: " << GetErrorStringA(err) << endl;
}
EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV Power_setBLPowerStatus(POWERHANDLE, CCStatus status)
@ Disabled
Definition: CCAuxTypes.h:154

◆ Power_setCanPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_setCanPowerStatus ( POWERHANDLE  ,
CCStatus  status 
)

Set can power status.

Supported Platform(s): XL, XL5, XM, XS, XA

Parameters
statusCan power status.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Power_setExtFanPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_setExtFanPowerStatus ( POWERHANDLE  ,
CCStatus  status 
)

Set external fan power status.

Supported Platform(s): XL, XL5, XM

Parameters
statusFan power status.
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.

◆ Power_setVideoPowerStatus()

EXTERN_C CCAUXDLL_API eErr CCAUXDLL_CALLING_CONV CrossControl::Power_setVideoPowerStatus ( POWERHANDLE  ,
uint8_t  status 
)

Set Video power status.

Supported Platform(s): XL, XM, XS, XA

Parameters
statusVideo power status. Bit0: Video 1. Bit1: Video 2. Bit2: Video 3. Bit3: Video 4. (1=on, 0=off)
Returns
error status. 0 = ERR_SUCCESS, otherwise error code. See the enum eErr for details.