Chapter 4: Software
Omnii HDK API Functions
38
Psion Teklogix Omnii HDK User Manual
4.7.4.4 Hdk7545_SetPower
Syntax
DWORD Hdk7545_SetPower( HANDLE hdk, BOOL enable );
Parameters
•
hdk – [in] an open HDK handle.
•
enable – [in] the new power state of the connector being controlled (see
).
Description
Powers on/off the connector being controlled.
The power state is reference-counted. If this function is called multiple times with the 'enable'
parameter set to TRUE, it has to be called the same number of times with the 'enable' parameter
set to FALSE in order to power the connector off.
The default power state for connectors is off.
Returns
•
ERROR_SUCCESS – if successful.
•
ERROR_INVALID_HANDLE – the specified handle is invalid.
•
ERROR_INVALID_DATA - an exception was generated.
•
Other errors are possible.
Sample Code
4.7.4.5 Hdk7545_GetPower
Syntax
DWORD Hdk7545_GetPower( HANDLE hdk, BOOL *enabled );
Parameters
•
hdk – [in] an open HDK handle.
•
enabled – [out] pointer to a BOOL containing the current connector power state.
Description
This function is used to determine the current power state of a connector.
The default power state for connectors is off.
DWORD SetPower()
{
Hdk7545_Connector expansionSlot = Hdk7545_Connector_Expansion1;
HANDLE hdkHandle = INVALID_HANDLE_VALUE;
DWORD result = Hdk7545_Open(&hdkHandle, expansionSlot);
if( result != ERROR_SUCCESS ) {
return ERROR_NOT_SUPPORTED;
}
result = Hdk7545_SetPower(hdkHandle, TRUE);
if( result != ERROR_SUCCESS ) {
Hdk7545_Close(&hdkHandle);
return result;
}
Hdk7545_Close(&hdkHandle);
return ERROR_SUCCESS;
}
Содержание OMNii HDK XT10
Страница 4: ......
Страница 10: ......
Страница 12: ......
Страница 18: ......
Страница 20: ......
Страница 24: ......
Страница 26: ......
Страница 32: ......
Страница 72: ......
Страница 90: ......
Страница 92: ......
Страница 116: ......
Страница 124: ......
Страница 126: ......
Страница 130: ......
Страница 132: ......
Страница 154: ......
Страница 168: ......
Страница 170: ......
Страница 182: ......
Страница 184: ......
Страница 188: ......