EVT_UFX_DEVICE_PORT_DETECT función de devolución de llamada (ufxclient.h)
Implementación del controlador cliente para iniciar la detección de puertos
Sintaxis
EVT_UFX_DEVICE_PORT_DETECT EvtUfxDevicePortDetect;
void EvtUfxDevicePortDetect(
[in] UFXDEVICE unnamedParam1
)
{...}
Parámetros
[in] unnamedParam1
Identificador de un objeto de dispositivo USB que el controlador cliente recibió en una llamada anterior al método UfxDeviceCreate.
Valor devuelto
Ninguno
Observaciones
El controlador cliente del controlador host de función registra su implementación de EVT_UFX_DEVICE_PORT_DETECT con la extensión de clase de función USB (UFX) llamando al método UfxDeviceCreate.
El controlador cliente debe indicar la finalización de la detección de puertos llamando a los métodos ufxDevicePortDetectComplete o UfxDevicePortDetectCompleteEx.
Ejemplos
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);
}
Requisitos
Requisito | Valor |
---|---|
de la plataforma de destino de | Windows |
versión mínima de KMDF | 1.0 |
versión mínima de UMDF | 2.0 |
encabezado de | ufxclient.h |
irQL | PASSIVE_LEVEL |
Consulte también
- UfxDeviceCrear
- UfxDeviceEventComplete
- UfxDevicePortDetectComplete
- UfxDevicePortDetectCompleteEx