未验证 提交 59cfe790 编写于 作者: O openharmony_ci 提交者: Gitee

!7251 补充USB模块缺失信息

Merge pull request !7251 from liyan/master
......@@ -23,6 +23,13 @@
| [getDevInfoDevNum](_u_s_b.md#getdevinfodevnum) () const | 获取USB设备编号。 [更多...](_u_s_b.md#getdevinfodevnum) |
### Private 成员变量
| Private 成员变量 | 描述 |
| -------- | -------- |
| [USBDeviceInfo](_o_h_o_s_1_1_u_s_b_1_1_u_s_b_device_info.md) devInfo | USB设备信息。 |
## **详细描述**
USB设备信息类。
......@@ -54,4 +54,9 @@
| 静态 Public 成员函数 | 描述 |
| -------- | -------- |
| **GetInstance** () | 获取实例。 |
| [GetInstance](\_u\_s\_b.md#getinstance) () | 获取实例。 |
## 详细描述
USB驱动客户端类。
......@@ -18,3 +18,24 @@
| [DeviceEvent](_u_s_b.md#deviceevent) (const [UsbInfo](_o_h_o_s_1_1_u_s_b_1_1_usb_info.md) &info)=0 | 设备事件。 [更多...](_u_s_b.md#deviceevent) |
| [PortChangedEvent](_u_s_b.md#portchangedevent) (int32_t portId, int32_t powerRole, int32_t dataRole, int32_t mode)=0 | 端口改变事件。 [更多...](_u_s_b.md#portchangedevent) |
| [OnRemoteRequest](_u_s_b.md#onremoterequest) (uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override | 远程请求。 [更多...](_u_s_b.md#onremoterequest) |
### Private 成员函数
| Private 成员函数 | 描述 |
| -------- | -------- |
| [OHOS::USB::UsbdSubscriber::ParserUsbInfo](_u_s_b.md#parserusbinfo) (MessageParcel &data, MessageParcel &reply, MessageOption &option, UsbInfo &info) | 解析USB设备信息。 [更多...](_u_s_b.md#parserusbinfo) |
| [OHOS::USB::UsbdSubscriber::ParserPortInfo](_u_s_b.md#parserportinfo) (MessageParcel &data, MessageParcel &reply, MessageOption &option, PortInfo &info) | 解析USB设备端口信息。 [更多...](_u_s_b.md#parserportinfo) |
## **详细描述**
USB驱动订阅类。
**Since:**
3.0
**Version:**
1.0
\ No newline at end of file
......@@ -31,7 +31,16 @@
| 宏定义 | 描述 |
| -------- | -------- |
| [USB_MAX_INTERFACES](#usbmaxinterfaces)   32 | USB设备最大接口数量。 |
| [USB_MAX_INTERFACES](#usb\_max\_interfaces)   32 | USB设备最大接口数量。 |
### 静态常量
| 静态常量 | 描述 |
| -------- | -------- |
| [USB_ENDPOINT_DIR_MASK](#usb\_endpoint\_dir\_mask)   0x80 | 从地址中提取USB Endpoint方向的位掩码。 |
| [USB_ENDPOINT_DIR_IN](#usb\_endpoint\_dir\_in)   0x80 | USB Endpoint从设备到主机的数据方向。 |
| [USB_ENDPOINT_DIR_OUT](#usb\_endpoint\_dir\_out)   0 | USB Endpoint从主机到设备的数据方向。 |
### 类型定义
......@@ -59,7 +68,7 @@
| [OHOS::USB::UsbInfo::getDevInfoStatus](#getdevinfostatus) () const | 获取USB设备状态。 [更多...](#getdevinfostatus) |
| [OHOS::USB::UsbInfo::getDevInfoBusNum](#getdevinfobusnum) () const | 获取USB总线编号。 [更多...](#getdevinfobusnum) |
| [OHOS::USB::UsbInfo::getDevInfoDevNum](#getdevinfodevnum) () const | 获取USB设备编号。 [更多...](#getdevinfodevnum) |
| **OHOS::USB::UsbdClient::GetInstance** () | 获取实例。 |
| [OHOS::USB::UsbdClient::GetInstance](#getinstance) ()  | 获取实例。 [更多...](#getinstance) |
| [OHOS::USB::UsbdClient::OpenDevice](#opendevice) (const [UsbDev](_o_h_o_s_1_1_u_s_b_1_1_usb_dev.md) &dev) | 打开设备,建立连接。 [更多...](#opendevice) |
| [OHOS::USB::UsbdClient::CloseDevice](#closedevice) (const [UsbDev](_o_h_o_s_1_1_u_s_b_1_1_usb_dev.md) &dev) | 关闭设备,释放与设备相关的所有系统资源。 [更多...](#closedevice) |
| [OHOS::USB::UsbdClient::GetDeviceDescriptor](#getdevicedescriptor) (const [UsbDev](_o_h_o_s_1_1_u_s_b_1_1_usb_dev.md) &dev, std::vector< uint8_t > &descriptor) | 获取设备描述符。 [更多...](#getdevicedescriptor) |
......@@ -96,6 +105,8 @@
| [OHOS::USB::UsbdSubscriber::DeviceEvent](#deviceevent) (const [UsbInfo](_o_h_o_s_1_1_u_s_b_1_1_usb_info.md) &info)=0 | 设备事件。 [更多...](#deviceevent) |
| [OHOS::USB::UsbdSubscriber::PortChangedEvent](#portchangedevent) (int32_t portId, int32_t powerRole, int32_t dataRole, int32_t mode)=0 | 端口改变事件。 [更多...](#portchangedevent) |
| [OHOS::USB::UsbdSubscriber::OnRemoteRequest](#onremoterequest) (uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override | 远程请求。 [更多...](#onremoterequest) |
| [OHOS::USB::UsbdSubscriber::ParserUsbInfo](#parserusbinfo) (MessageParcel &data, MessageParcel &reply, MessageOption &option, UsbInfo &info) | 解析USB设备信息。 [更多...](#parserusbinfo) |
| [OHOS::USB::UsbdSubscriber::ParserPortInfo](#parserportinfo) (MessageParcel &data, MessageParcel &reply, MessageOption &option, PortInfo &info) | 解析USB设备端口信息。 [更多...](#parserportinfo) |
### 变量
......@@ -114,6 +125,7 @@
| [OHOS::USB::UsbCtrlTransfer::value](#value) | 请求值 |
| [OHOS::USB::UsbCtrlTransfer::index](#index) | 索引 |
| [OHOS::USB::UsbCtrlTransfer::timeout](#timeout) | 超时时间 |
| [OHOS::USB::UsbInfo::devInfo](#devinfo ) | USB设备信息 |
## **详细描述**
......@@ -146,6 +158,40 @@
USB设备最大接口数量
## **静态常量说明**
### USB_ENDPOINT_DIR_MASK
```
static const int32_t USB_ENDPOINT_DIR_MASK = 0x80
```
**描述:**
从地址中提取USB Endpoint方向的位掩码
### USB_ENDPOINT_DIR_IN
```
static const int32_t USB_ENDPOINT_DIR_IN = 0x80
```
**描述:**
USB Endpoint从设备到主机的数据方向
### USB_ENDPOINT_DIR_OUT
```
static const int32_t USB_ENDPOINT_DIR_OUT = 0
```
**描述:**
USB Endpoint从主机到设备的数据方向
## **类型定义说明**
......@@ -1055,6 +1101,75 @@ int32_t OHOS::USB::UsbdClient::OpenDevice (const UsbDev & dev)
1.0
### ParserUsbInfo()
```
static int32_t OHOS::USB::UsbdSubscriber::ParserUsbInfo(MessageParcel &data, MessageParcel &reply, MessageOption &option, UsbInfo &info)
```
**描述:**
解析USB设备信息。
**参数:**
| 名称 | 描述 |
| -------- | -------- |
| data | 输入参数,命令字。|
| reply | 输出参数,返回的数据。 |
| option | 输入参数,选项数据。|
| info | 输出参数,USB设备信息。|
**返回:**
0 表示操作成功。
非零值 表示操作失败。
**Since:**
3.0
**Version:**
1.0
### ParserPortInfo()
```
static int32_t OHOS::USB::UsbdSubscriber::ParserPortInfo(MessageParcel &data, MessageParcel &reply, MessageOption &option, PortInfo &info)
```
**描述:**
解析USB设备端口信息。
**参数:**
| 名称 | 描述 |
| -------- | -------- |
| data | 输入参数,命令字。|
| reply | 输出参数,返回的数据。 |
| option | 输入参数,选项数据。|
| info | 输出参数,USB设备端口信息。|
**返回:**
0 表示操作成功。
非零值 表示操作失败。
**Since:**
3.0
**Version:**
1.0
### PortChangedEvent()
......@@ -1570,6 +1685,25 @@ int32_t OHOS::USB::UsbdClient::UnRegBulkCallback (const UsbDev & dev, const UsbP
1.0
### GetInstance()
```
OHOS::USB::UsbdClient::GetInstance()
```
**描述:**
获取实例。
**Since:**
3.0
**Version:**
1.0
## **变量说明**
......@@ -1609,6 +1743,17 @@ uint8_t OHOS::USB::UsbDev::devAddr
USB设备地址
### devInfo
```
OHOS::USB::UsbInfo devInfo
```
**描述:**
USB设备信息
### devNum
......
......@@ -27,6 +27,15 @@
| -------- | -------- |
| [USB_MAX_INTERFACES](_u_s_b.md#usbmaxinterfaces)   32 | USB设备最大接口数量。 |
### 静态常量
| 静态常量 | 描述 |
| -------- | -------- |
| [USB_ENDPOINT_DIR_MASK](_u_s_b.md#usb\_endpoint\_dir\_mask)   0x80 | 从地址中提取USB Endpoint方向的位掩码。 |
| [USB_ENDPOINT_DIR_IN](_u_s_b.md#usb\_endpoint\_dir\_in)   0x80 | USB Endpoint从设备到主机的数据方向。 |
| [USB_ENDPOINT_DIR_OUT](_u_s_b.md#usb\_endpoint\_dir\_out)   0 | USB Endpoint从主机到设备的数据方向。 |
### 类型定义
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册