Chapter 4: Software
Omnii HDK API Functions
Returns
•
ERROR_SUCCESS – if successful.
•
ERROR_INVALID_HANDLE – the specified handle is invalid.
•
ERROR_INVALID_PARAMETER – one of the parameters is incorrect or invalid.
•
ERROR_INVALID_DATA - an exception was generated.
•
Other errors are possible.
Sample Code
DWORD SetPowerMode()
{
Hdk7545_Connector expansionSlot = Hdk7545_Connector_Expansion1;
HANDLE hdkHandle = INVALID_HANDLE_VALUE;
DWORD result = Hdk7545_Open(&hdkHandle, expansionSlot);
if( result != ERROR_SUCCESS ) {
}
result = Hdk7545_SetPowerMode(hdkHandle, Hdk7545_PowerMode_Manual);
if( result != ERROR_SUCCESS ) {
}
Hdk7545_Close(&hdkHandle);
return ERROR_SUCCESS;
}
4.7.4.7 Hdk7545_GetPowerMode
Syntax
DWORD Hdk7545_GetPowerMode( HANDLE hdk, Hdk7545_PowerMode *mode );
Parameters
•
hdk – [in] an open HDK handle.
•
mode – [out] pointer to a Hdk7545_PowerMode value that will contain the current power
mode of the connector.
Description
This function is used to retrieve the current power mode of the device attached to the connector.
There are currently two modes available: Auto and Manual.
The default power mode is Manual.
This function can only be called by a driver, not by an application. The driver that calls this
function must be loaded by the Peripherals driver at startup.
Returns
•
ERROR_SUCCESS – if successful.
•
ERROR_INVALID_HANDLE – the specified handle is invalid.
•
ERROR_INVALID_PARAMETER – one of the parameters is incorrect or invalid.
•
ERROR_INVALID_DATA - an exception was generated.
•
Other errors are possible.
40
Psion Teklogix Omnii HDK User Manual
return ERROR_NOT_SUPPORTED;
Hdk7545_Close(&hdkHandle);
return ERROR_GEN_FAILURE;