EVT_UFX_DEVICE_PORT_DETECT回呼函式 (ufxclient.h)
用來起始埠偵測的用戶端驅動程序實作
語法
EVT_UFX_DEVICE_PORT_DETECT EvtUfxDevicePortDetect;
void EvtUfxDevicePortDetect(
[in] UFXDEVICE unnamedParam1
)
{...}
參數
[in] unnamedParam1
用戶端驅動程式在先前呼叫UfxDeviceCreate 方法時收到的USB裝置物件的句柄。
傳回值
沒有
言論
函式主機控制器的用戶端驅動程式會呼叫 UfxDeviceCreate 方法,向 USB 函式類別延伸模組 (UFX) 註冊其 EVT_UFX_DEVICE_PORT_DETECT 實作。
用戶端驅動程序必須呼叫 UfxDevicePortDetectComplete 或 UfxDevicePortDetectCompleteEx 方法來指出埠偵測完成。
例子
EVT_UFX_DEVICE_PORT_DETECT UfxDevice_EvtDevicePortDetect;
VOID
UfxDevice_EvtDevicePortDetect (
_In_ UFXDEVICE UfxDevice
)
/*++
Routine Description:
Starts the port detection state machine
Arguments:
UfxDevice - UFXDEVICE object representing the device.
--*/
{
PUFXDEVICE_CONTEXT DeviceContext;
PCONTROLLER_CONTEXT ControllerContext;
DeviceContext = UfxDeviceGetContext(UfxDevice);
ControllerContext = DeviceGetControllerContext(DeviceContext->FdoWdfDevice);
//
// #### TODO: Insert code to determine port/charger type ####
//
// In this example we will return an unknown port type.
// This will allow UFX to connect to a host if one is present.
// UFX will timeout after 5 seconds if no host is present and transition to
// an invalid charger type, which will allow the controller to exit D0.
//
UfxDevicePortDetectComplete(ControllerContext->UfxDevice, UsbfnUnknownPort);
}
要求
要求 | 價值 |
---|---|
目標平臺 | 窗戶 |
最低 KMDF 版本 | 1.0 |
最低 UMDF 版本 | 2.0 |
標頭 | ufxclient.h |
IRQL | PASSIVE_LEVEL |