UfxDevicePortDetectCompleteEx function (ufxclient.h)

Notifies UFX about the port type that was detected, and optionally requests an action.

Syntax

void UfxDevicePortDetectCompleteEx(
  [in] UFXDEVICE       UfxDevice,
  [in] USBFN_PORT_TYPE PortType,
  [in] USBFN_ACTION    Action
);

Parameters

[in] UfxDevice

A handle to a UFX device object that the driver created by calling UfxDeviceCreate.

[in] PortType

Contains an enumeration value of type USBFN_PORT_TYPE.

[in] Action

Contains an enumeration value of type USBFN_ACTION.

Return value

None

Remarks

The client driver calls UfxDevicePortDetectCompleteEx after port detection is complete, typically from its EVT_UFX_DEVICE_PORT_DETECT callback function. On some platforms, UFX may use the reported port type to notify the battery manager of the maximum current it can draw from the USB port.

If the Action parameter is set to UsbfnActionNoCad, UFX does not notify the battery manager at all.

If the Action parameter is set to UsbfnActionDetectProprietaryCharger, UFX requests that the client driver initiate proprietary charger detection by calling the client driver’s EVT_UFX_DEVICE_DETECT_PROPRIETARY_CHARGER callback function.

The following snippet shows how a client driver calls UfxDevicePortDetectCompleteEx.

    switch (OnAttach.AttachAction) {
    case UsbfnPortDetected:
        TraceInformation("Port Detected");
        UfxDevicePortDetectComplete(
            ControllerData->UfxDevice,
            OnAttach.PortType);

        break;

    case UsbfnPortDetectedNoCad:
        TraceInformation("Port Detected No CAD");
        UfxDevicePortDetectCompleteEx(
            ControllerData->UfxDevice,
            OnAttach.PortType,
            UsbfnActionNoCad);

        break;


Requirements

Requirement Value
Minimum supported client Windows 10
Target Platform Windows
Header ufxclient.h
Library ufxstub.lib
IRQL DISPATCH_LEVEL