UsbDbgPdd_SetPower (Compact 2013)
10/16/2014
Implement this function to enable and disable the USB debug connection between the device and the development computer.
Syntax
extern "C" void UsbDbgPdd_SetPower(
BOOL fPowerOff
)
Parameters
- fPowerOff
[in] Set to TRUE to disable the USB debug connection; set to FALSE to enable it.
Return Value
None.
Remarks
The model device driver (MDD) calls this function when the OEM adaption layer (OAL) calls IOCTL_KITL_POWER_CALL to suspend or resume the Windows Embedded Compact powered device. When OAL calls suspend, fPowerOff is set to TRUE. When the OAL calls resume, fPowerOff is set to FALSE. The platform-dependent device driver (PDD) takes appropriate action here to reenable the USB debug connection or to disable the USB debug connection, for example by logically detaching the USB cable.
Example
The following example shows a typical implementation of the UsbDbgPdd_SetPower function.
Important
For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.
extern "C" void UsbDbgPdd_SetPower(
BOOL fPowerOff
)
{
USBDBGMSG(USBDBG_ZONE_FUNC, (L"usbdbgpdd: +UsbDbgPdd_SetPower\r\n"));
if (fPowerOff)
PowerOff();
else
PowerOn();
USBDBGMSG(USBDBG_ZONE_FUNC, (L"usbdbgpdd: -UsbDbgPdd_SetPower\r\n"));
}
Requirements
Header |
UsbDbgDdsi.h |