Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
59cfe790
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
59cfe790
编写于
7月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!7251 补充USB模块缺失信息
Merge pull request !7251 from liyan/master
上级
55de8991
fc5fda2d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
190 addition
and
3 deletion
+190
-3
zh-cn/device-dev/reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usb_info.md
...dev/reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usb_info.md
+7
-0
zh-cn/device-dev/reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usbd_client.md
.../reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usbd_client.md
+6
-1
zh-cn/device-dev/reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usbd_subscriber.md
...erence/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usbd_subscriber.md
+21
-0
zh-cn/device-dev/reference/hdi-apis/_u_s_b.md
zh-cn/device-dev/reference/hdi-apis/_u_s_b.md
+147
-2
zh-cn/device-dev/reference/hdi-apis/usbd__type_8h.md
zh-cn/device-dev/reference/hdi-apis/usbd__type_8h.md
+9
-0
未找到文件。
zh-cn/device-dev/reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usb_info.md
浏览文件 @
59cfe790
...
...
@@ -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设备信息类。
zh-cn/device-dev/reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usbd_client.md
浏览文件 @
59cfe790
...
...
@@ -54,4 +54,9 @@
| 静态
Public
成员函数 | 描述 |
| -------- | -------- |
|
**GetInstance**
() | 获取实例。 |
|
[
GetInstance
](
\_u\_s\_b.md#getinstance
)
() | 获取实例。 |
## 详细描述
USB驱动客户端类。
zh-cn/device-dev/reference/hdi-apis/_o_h_o_s_1_1_u_s_b_1_1_usbd_subscriber.md
浏览文件 @
59cfe790
...
...
@@ -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
zh-cn/device-dev/reference/hdi-apis/_u_s_b.md
浏览文件 @
59cfe790
...
...
@@ -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
...
...
zh-cn/device-dev/reference/hdi-apis/usbd__type_8h.md
浏览文件 @
59cfe790
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录