Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
5f049a8b
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
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看板
未验证
提交
5f049a8b
编写于
9月 07, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 07, 2022
浏览文件
操作
浏览文件
下载
差异文件
!9134 【轻量级 PR】:3.1Release分支:USB表格优化,需同步翻译
Merge pull request !9134 from 葛亚芳/N/A
上级
b4f265ce
d53382e1
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
13 deletion
+13
-13
zh-cn/application-dev/device/usb-guidelines.md
zh-cn/application-dev/device/usb-guidelines.md
+13
-13
未找到文件。
zh-cn/application-dev/device/usb-guidelines.md
浏览文件 @
5f049a8b
...
...
@@ -17,19 +17,19 @@ USB类开放能力如下,具体请查阅[API参考文档](../reference/apis/js
| 接口名 | 描述 |
| -------- | -------- |
| hasRight(deviceName:
string):
boolean | 如果“使用者”(如各种App或系统)有权访问设备则返回true;无权访问设备则返回false。 |
| requestRight(deviceName:
string):
Promise
<
boolean
>
| 请求给定软件包的临时权限以访问设备。 |
| connectDevice(device:
USBDevice):
Readonly
<
USBDevicePipe
>
| 根据
`getDevices()`
返回的设备信息打开USB设备。 |
| getDevices():Array
<
Readonly
<
USBDevice
>>
| 返回USB设备列表。 |
| setConfiguration(pipe:
USBDevicePipe,config:USBConfig):
number | 设置设备的配置。 |
| setInterface(pipe:
USBDevicePipe,iface:USBInterface):
number | 设置设备的接口。 |
| claimInterface(pipe:
USBDevicePipe,iface:USBInterface,force?:boolean):
number | 获取接口。 |
|bulkTransfer(pipe:
USBDevicePipe,endpoint:USBEndpoint,buffer:Uint8Array,timeout?:number):
Promise
<
number
>
| 批量传输。 |
| closePipe(pipe:
USBDevicePipe):
number | 关闭设备消息控制通道。 |
| releaseInterface(pipe:
USBDevicePipe,iface:USBInterface):
number | 释放接口。 |
| getFileDescriptor(pipe:
USBDevicePipe):
number | 获取文件描述符。 |
| getRawDescriptor(pipe:
USBDevicePipe):
Uint8Array | 获取原始的USB描述符。 |
| controlTransfer(pipe:
USBDevicePipe,contrlparam:USBControlParams,timeout?:number):
Promise
<
number
>
| 控制传输。 |
| hasRight(deviceName:
string):
boolean | 如果“使用者”(如各种App或系统)有权访问设备则返回true;无权访问设备则返回false。 |
| requestRight(deviceName:
string):
Promise
<
boolean
>
| 请求给定软件包的临时权限以访问设备。 |
| connectDevice(device:
USBDevice):
Readonly
<
USBDevicePipe
>
| 根据
`getDevices()`
返回的设备信息打开USB设备。 |
| getDevices():
Array
<
Readonly
<
USBDevice
>>
| 返回USB设备列表。 |
| setConfiguration(pipe:
USBDevicePipe, config: USBConfig):
number | 设置设备的配置。 |
| setInterface(pipe:
USBDevicePipe, iface: USBInterface):
number | 设置设备的接口。 |
| claimInterface(pipe:
USBDevicePipe, iface: USBInterface, force?: boolean):
number | 获取接口。 |
|bulkTransfer(pipe:
USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number):
Promise
<
number
>
| 批量传输。 |
| closePipe(pipe:
USBDevicePipe):
number | 关闭设备消息控制通道。 |
| releaseInterface(pipe:
USBDevicePipe, iface: USBInterface):
number | 释放接口。 |
| getFileDescriptor(pipe:
USBDevicePipe):
number | 获取文件描述符。 |
| getRawDescriptor(pipe:
USBDevicePipe):
Uint8Array | 获取原始的USB描述符。 |
| controlTransfer(pipe:
USBDevicePipe, contrlparam: USBControlParams, timeout?: number):
Promise
<
number
>
| 控制传输。 |
## 开发步骤
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录