harmony 鸿蒙IUsbPortInterface

  • 2025-06-16
  • 浏览 (4)

IUsbPortInterface

概述

相关模块:HdiUsb

汇总

Public 成员函数

名称 描述
SetPortRole([in] int portId, [in] int powerRole, [in] int dataRole) 设置USB设备端口的角色。
QueryPort([out] int portId, [out] int powerRole, [out] int dataRole, [out] int mode) 查询USB设备端口的当前设置信息。
QueryPorts([out] struct UsbPort[] portList) 查询USB设备所有端口的当前设置信息。
BindUsbdPortSubscriber([in] IUsbdSubscriber subscriber) 绑定订阅者。
UnbindUsbdPortSubscriber([in] IUsbdSubscriber subscriber) 解绑订阅者。

成员函数说明

SetPortRole()

IUsbPortInterface::SetPortRole([in] int portId, [in] int powerRole, [in] int dataRole)

描述

设置USB设备端口的角色。

起始版本: 5.1

参数:

名称 描述
portId USB设备端口ID。
powerRole 电源角色的值。
dataRole 数据角色的值。

返回:

0 表示操作成功。

非零值 表示操作失败。

QueryPort()

IUsbPortInterface::QueryPort([out] int portId, [out] int powerRole, [out] int dataRole, [out] int mode)

描述

查询USB设备端口的当前设置信息。

起始版本: 5.1

参数:

名称 描述
portId USB设备端口ID。
powerRole USB设备电源角色。
dataRole USB设备数据角色。
mode USB设备模式。

返回:

0 表示操作成功。

非零值 表示操作失败。

QueryPorts()

IUsbPortInterface::QueryPorts([out] struct UsbPort[] portList);

描述

查询USB设备所有端口的当前设置信息。

起始版本: 5.1

参数:

名称 描述
portList USB设备端口ID集合。

返回:

0 表示操作成功。

非零值 表示操作失败。

BindUsbdPortSubscriber()

IUsbPortInterface::BindUsbdPortSubscriber([in] IUsbdSubscriber subscriber)

描述

绑定订阅者。

起始版本: 5.1

参数:

名称 描述
subscriber 订阅者信息,详见IUsbdSubscriber

返回:

0 表示操作成功。

非零值 表示操作失败。

UnbindUsbdPortSubscriber()

IUsbPortInterface::UnbindUsbdPortSubscriber([in] IUsbdSubscriber subscriber);

描述

解绑订阅者。

起始版本: 5.1

参数:

名称 描述
subscriber 订阅者信息,详见IUsbdSubscriber

返回:

0 表示操作成功。

非零值 表示操作失败。

你可能感兴趣的鸿蒙文章

harmony 鸿蒙USB HDI 参考

harmony 鸿蒙HdiUsb

harmony 鸿蒙HdiUsb(V1_1)

harmony 鸿蒙HdiUsb(V1_2)

harmony 鸿蒙HdiUsb(V2_0)

harmony 鸿蒙HdiUsbfnMtp

harmony 鸿蒙IUsbDeviceInterface.idl

harmony 鸿蒙IUsbHostInterface.idl

harmony 鸿蒙IUsbInterface.idl

harmony 鸿蒙IUsbInterface.idl

0  赞