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;
}
Summary of Contents for OMNii HDK XT10
Page 4: ......
Page 10: ......
Page 12: ......
Page 18: ......
Page 20: ......
Page 24: ......
Page 26: ......
Page 32: ......
Page 72: ......
Page 90: ......
Page 92: ......
Page 116: ......
Page 124: ......
Page 126: ......
Page 130: ......
Page 132: ......
Page 154: ......
Page 168: ......
Page 170: ......
Page 182: ......
Page 184: ......
Page 188: ......