Fungsi UfxDeviceNotifyReset (ufxclient.h)

Memberi tahu UFX tentang peristiwa reset bus USB.

Sintaks

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

Parameter

[in] UfxDevice

Handel ke objek perangkat UFX yang dibuat driver dengan memanggil UfxDeviceCreate.

[in] DeviceSpeed

Berisi nilai jenis USB_DEVICE_SPEED yang menunjukkan kecepatan perangkat.

Nilai kembali

Tidak ada

Keterangan

Driver klien memanggil UfxDeviceNotifyReset saat menerima peristiwa reset bus. Semua titik akhir non-default harus dinonaktifkan dan titik akhir default harus diatur ulang. Perangkat berpindah ke status default.

Driver klien biasanya memanggil UfxDeviceNotifyReset dari fungsi panggilan balik EvtInterruptDpc - nya. Contoh berikut menunjukkan cara menangani peristiwa reset.


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

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung Windows 10
Target Platform Windows
Header ufxclient.h
Pustaka ufxstub.lib
IRQL DISPATCH_LEVEL