Share via


Función UfxDeviceNotifyReset (ufxclient.h)

Notifica a UFX sobre un evento de restablecimiento de bus USB.

Sintaxis

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

Parámetros

[in] UfxDevice

Identificador de un objeto de dispositivo UFX que creó el controlador mediante una llamada a UfxDeviceCreate.

[in] DeviceSpeed

Contiene un valor de tipo USB_DEVICE_SPEED que indica la velocidad del dispositivo.

Valor devuelto

None

Observaciones

El controlador cliente llama a UfxDeviceNotifyReset cuando recibe un evento de restablecimiento de bus. Todos los puntos de conexión no predeterminados deben deshabilitarse y se debe restablecer el punto de conexión predeterminado. El dispositivo se mueve al estado predeterminado.

El controlador de cliente normalmente llama a UfxDeviceNotifyReset desde su función de devolución de llamada EvtInterruptDpc . En el ejemplo siguiente se muestra cómo controlar un evento de restablecimiento.


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 Value
Cliente mínimo compatible Windows 10
Plataforma de destino Windows
Encabezado ufxclient.h
Library ufxstub.lib
IRQL DISPATCH_LEVEL