From ca3219e417c216da1a25ce49f78ec3448baa8fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=9B=E4=BA=9A=E8=8A=B3?= Date: Thu, 25 Aug 2022 09:02:19 +0000 Subject: [PATCH] fixed 44bff45 from https://gitee.com/ge-yafang/docs/pulls/8660 update zh-cn/application-dev/device/usb-guidelines.md. Signed-off-by: @ge-yafang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 葛亚芳 --- .../application-dev/device/usb-guidelines.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/zh-cn/application-dev/device/usb-guidelines.md b/zh-cn/application-dev/device/usb-guidelines.md index 4743a90dd8..8c836de650 100644 --- a/zh-cn/application-dev/device/usb-guidelines.md +++ b/zh-cn/application-dev/device/usb-guidelines.md @@ -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> | 控制传输。 | ## 开发步骤 @@ -115,7 +115,7 @@ USB设备可作为Host设备连接Device设备进行数据传输。开发示例 打开对应接口,在设备信息(deviceList)中选取对应的interface。 interface1为设备配置中的一个接口。 */ - usb.claimInterface(pipe , interface1, true); + usb.claimInterface(pipe, interface1, true); ``` 4. 数据传输。 -- GitLab