Funzione UfxDeviceNotifyReset (ufxclient.h)

Notifica a UFX di un evento di reimpostazione del bus USB.

Sintassi

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

Parametri

[in] UfxDevice

Handle a un oggetto dispositivo UFX creato dal driver chiamando UfxDeviceCreate.

[in] DeviceSpeed

Contiene un valore di tipo USB_DEVICE_SPEED che indica la velocità del dispositivo.

Valore restituito

nessuno

Osservazioni

Il driver client chiama UfxDeviceNotifyReset quando riceve un evento di reimpostazione del bus. Tutti gli endpoint non predefiniti devono essere disabilitati e l'endpoint predefinito deve essere reimpostato. Il dispositivo passa allo stato predefinito.

Il driver client chiama in genere UfxDeviceNotifyReset dalla sua funzione di callback EvtInterruptDpc . Nell'esempio seguente viene illustrato come gestire un evento di reimpostazione.


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();
}

Requisiti

Requisito Valore
Client minimo supportato Windows 10
Piattaforma di destinazione Windows
Intestazione ufxclient.h
Libreria ufxstub.lib
IRQL DISPATCH_LEVEL