Skip to content

Latest commit

 

History

History
112 lines (78 loc) · 4.24 KB

nf-ucmmanager-ucmconnectortypecattach.md

File metadata and controls

112 lines (78 loc) · 4.24 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NF:ucmmanager.UcmConnectorTypeCAttach
UcmConnectorTypeCAttach function (ucmmanager.h)
Notifies the USB connector manager framework extension (UcmCx) when a partner connector is attached.
buses\ucmconnectortypecattach.htm
usbref
05/07/2018
UcmConnectorTypeCAttach function
UcmConnectorTypeCAttach, UcmConnectorTypeCAttach method [Buses], buses.ucmconnectortypecattach, ucmmanager/UcmConnectorTypeCAttach
ucmmanager.h
Ucmcx.h
Windows
Windows 10
Windows Server 2016
1.15
2.15
UcmCxstub.lib
PASSIVE_LEVEL
Windows
UcmConnectorTypeCAttach
ucmmanager/UcmConnectorTypeCAttach
APIRef
kbSyntax
COM
UcmCxstub.lib
UcmCxstub.dll
UcmConnectorTypeCAttach

UcmConnectorTypeCAttach function

-description

Notifies the USB connector manager framework extension (UcmCx) when a partner connector is attached.

-parameters

-param Connector [in]

Handle to the connector object that the client driver received in the previous call to UcmConnectorCreate.

-param Params [in]

A pointer to a driver-allocated UCM_CONNECTOR_TYPEC_ATTACH_PARAMS that has been initialized by calling UCM_CONNECTOR_TYPEC_ATTACH_PARAMS_INIT.

-returns

UcmConnectorTypeCAttach returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method can return an appropriate NTSTATUS value.

-remarks

When a connection to a partner connector is detected, the client driver calls this method to notify UcmCx with information about the partner connector. That information includes the connector role, down stream or upstream facing port, the amount of current connector can draw or deliver, and charging state. UcmCx uses that information to perform certain operations. For example, it may determine the role of the partner connector attached, and configure the USB controller in host or peripheral mode.

Typically, every UcmConnectorTypeCAttach call has a subsequent UcmConnectorTypeCDetach call to notify UcmCx when the partner connector is detached. However, when a powered cable without an upstream port is attached (indicated by Params->PortPartnerType set to UcmTypeCPortStatePoweredCableNoUfp). The client driver can call UcmConnectorTypeCAttach again when a connection is detected to the upstream port to the powered cable.

Examples

        UCM_CONNECTOR_TYPEC_ATTACH_PARAMS attachParams;

        UCM_CONNECTOR_TYPEC_ATTACH_PARAMS_INIT(
            &attachParams,
            UcmTypeCPortStateDfp);
        attachParams.CurrentAdvertisement = UcmTypeCCurrent1500mA;

        status = UcmConnectorTypeCAttach(
                    Connector,
                    &attachParams);
        if (!NT_SUCCESS(status))
        {
            TRACE_ERROR(
                "UcmConnectorTypeCAttach() failed with %!STATUS!.",
                status);
            goto Exit;
        }

        TRACE_INFO("UcmConnectorTypeCAttach() succeeded.");

-see-also

UCM_CONNECTOR_TYPEC_ATTACH_PARAMS

UCM_CONNECTOR_TYPEC_ATTACH_PARAMS_INIT

UcmConnectorCreate