EVT_UFX_DEVICE_PORT_DETECT função de retorno de chamada (ufxclient.h)

A implementação do driver cliente para iniciar a detecção de porta

Sintaxe

EVT_UFX_DEVICE_PORT_DETECT EvtUfxDevicePortDetect;

void EvtUfxDevicePortDetect(
  [in] UFXDEVICE unnamedParam1
)
{...}

Parâmetros

[in] unnamedParam1

O identificador para um objeto de dispositivo USB que o driver cliente recebeu em uma chamada anterior para o método UfxDeviceCreate .

Retornar valor

Nenhum

Comentários

O driver do cliente para o controlador de host de função registra sua implementação de EVT_UFX_DEVICE_PORT_DETECT com a extensão de classe de função USB (UFX) chamando o método UfxDeviceCreate .

O driver do cliente deve indicar a conclusão da detecção de porta chamando os métodos UfxDevicePortDetectComplete ou UfxDevicePortDetectCompleteEx .

Exemplos

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
Plataforma de Destino Windows
Versão mínima do KMDF 1.0
Versão mínima do UMDF 2,0
Cabeçalho ufxclient.h
IRQL PASSIVE_LEVEL

Confira também