Função UfxDeviceNotifyReset (ufxclient.h)

Notifica a UFX sobre um evento de redefinição de barramento USB.

Sintaxe

void UfxDeviceNotifyReset(
  [in] UFXDEVICE        UfxDevice,
  [in] USB_DEVICE_SPEED DeviceSpeed
);

Parâmetros

[in] UfxDevice

Um identificador para um objeto de dispositivo UFX que o driver criou chamando UfxDeviceCreate.

[in] DeviceSpeed

Contém um valor do tipo USB_DEVICE_SPEED que indica a velocidade do dispositivo.

Retornar valor

Nenhum

Comentários

O driver do cliente chama UfxDeviceNotifyReset quando recebe um evento de redefinição de barramento. Todos os pontos de extremidade não padrão devem ser desabilitados e o ponto de extremidade padrão deve ser redefinido. O dispositivo passa para o estado padrão.

O driver cliente normalmente chama UfxDeviceNotifyReset de sua função de retorno de chamada EvtInterruptDpc . O exemplo a seguir mostra como lidar com um evento de redefinição.


VOID
HandleUsbConnect (
    WDFDEVICE WdfDevice
    )
/*++

Routine Description:

    Handles a connect event from the controller.

Arguments:

    WDfDevice - WDFDEVICE object representing the controller.

--*/
{
    PCONTROLLER_CONTEXT ControllerContext;
    USB_DEVICE_SPEED DeviceSpeed;

    TraceEntry();

    ControllerContext = DeviceGetControllerContext(WdfDevice);

    //
    // Read the device speed.
    //

    //
    // #### TODO: Add code to read device speed from the controller ####
    //
    
    // Sample will assume SuperSpeed operation for illustration purposes
    DeviceSpeed = UsbSuperSpeed;
    
    //
    // #### TODO: Add any code needed to configure the controller after connect has occurred ####
    //


    ControllerContext->Speed = DeviceSpeed;
    TraceInformation("Connected Speed is %d!", DeviceSpeed);

    //
    // Notify UFX about reset, which will take care of updating 
    // Max Packet Size for EP0 by calling descriptor update.
    //
    UfxDeviceNotifyReset(ControllerContext->UfxDevice, DeviceSpeed);

    ControllerContext->Connect = TRUE;

    TraceExit();
}

Requisitos

Requisito Valor
Cliente mínimo com suporte Windows 10
Plataforma de Destino Windows
Cabeçalho ufxclient.h
Biblioteca ufxstub.lib
IRQL DISPATCH_LEVEL