提交 7b1f9b0f 编写于 作者: G ge-yafang

update docs

Signed-off-by: Nge-yafang <geyafang@huawei.com>
上级 49fb93eb
...@@ -35,60 +35,60 @@ You can set a USB device as the USB host to connect to other USB devices for dat ...@@ -35,60 +35,60 @@ You can set a USB device as the USB host to connect to other USB devices for dat
1. Obtain the USB device list. 1. Obtain the USB device list.
```js ```js
// Import the USB API package. // Import the USB API package.
import usb from '@ohos.usbV9'; import usb from '@ohos.usbV9';
// Obtain the USB device list. // Obtain the USB device list.
let deviceList = usb.getDevices(); let deviceList = usb.getDevices();
/* /*
Example deviceList structure Example deviceList structure
[ [
{
name: "1-1",
serial: "",
manufacturerName: "",
productName: "",
version: "",
vendorId: 7531,
productId: 2,
clazz: 9,
subclass: 0,
protocol: 1,
devAddress: 1,
busNum: 1,
configs: [
{ {
id: 1,
attributes: 224,
isRemoteWakeup: true,
isSelfPowered: true,
maxPower: 0,
name: "1-1", name: "1-1",
serial: "", interfaces: [
manufacturerName: "",
productName: "",
version: "",
vendorId: 7531,
productId: 2,
clazz: 9,
subclass: 0,
protocol: 1,
devAddress: 1,
busNum: 1,
configs: [
{ {
id: 1, id: 0,
attributes: 224, protocol: 0,
isRemoteWakeup: true, clazz: 9,
isSelfPowered: true, subclass: 0,
maxPower: 0, alternateSetting: 0,
name: "1-1", name: "1-1",
interfaces: [ endpoints: [
{ {
id: 0, address: 129,
protocol: 0, attributes: 3,
clazz: 9, interval: 12,
subclass: 0, maxPacketSize: 4,
alternateSetting: 0, direction: 128,
name: "1-1", number: 1,
endpoints: [ type: 3,
{ interfaceId: 0,
address: 129, }
attributes: 3, ]
interval: 12, }
maxPacketSize: 4, ]
direction: 128, }
number: 1, ]
type: 3, }
interfaceId: 0, ]
}
]
}
]
}
]
}
]
*/ */
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册