EVT_UFX_DEVICE_PORT_DETECT funzione di callback (ufxclient.h)

Implementazione del driver client per avviare il rilevamento delle porte

Sintassi

EVT_UFX_DEVICE_PORT_DETECT EvtUfxDevicePortDetect;

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

Parametri

[in] unnamedParam1

Handle a un oggetto dispositivo USB ricevuto dal driver client in una chiamata precedente al metodo UfxDeviceCreate .

Valore restituito

nessuno

Osservazioni

Il driver client per il controller host della funzione registra la relativa implementazione EVT_UFX_DEVICE_PORT_DETECT con l'estensione della classe di funzione USB (UFX) chiamando il metodo UfxDeviceCreate .

Il driver client deve indicare il completamento del rilevamento delle porte chiamando i metodi UfxDevicePortDetectComplete o UfxDevicePortDetectCompleteEx .

Esempio

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

Requisiti

Requisito Valore
Piattaforma di destinazione Windows
Versione KMDF minima 1.0
Versione UMDF minima 2,0
Intestazione ufxclient.h
IRQL PASSIVE_LEVEL

Vedi anche