提交 49fb93eb 编写于 作者: G ge-yafang

update docs

Signed-off-by: Nge-yafang <geyafang@huawei.com>
上级 cd2b3edf
...@@ -35,63 +35,63 @@ You can set a USB device as the USB host to connect to other USB devices for dat ...@@ -35,63 +35,63 @@ 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",
interfaces: [ serial: "",
manufacturerName: "",
productName: "",
version: "",
vendorId: 7531,
productId: 2,
clazz: 9,
subclass: 0,
protocol: 1,
devAddress: 1,
busNum: 1,
configs: [
{ {
id: 0, id: 1,
protocol: 0, attributes: 224,
clazz: 9, isRemoteWakeup: true,
subclass: 0, isSelfPowered: true,
alternateSetting: 0, maxPower: 0,
name: "1-1", name: "1-1",
endpoints: [ interfaces: [
{ {
address: 129, id: 0,
attributes: 3, protocol: 0,
interval: 12, clazz: 9,
maxPacketSize: 4, subclass: 0,
direction: 128, alternateSetting: 0,
number: 1, name: "1-1",
type: 3, endpoints: [
interfaceId: 0, {
address: 129,
attributes: 3,
interval: 12,
maxPacketSize: 4,
direction: 128,
number: 1,
type: 3,
interfaceId: 0,
}
]
} }
] ]
} }
] ]
} }
] ]
} */
] ```
*/
```
2. Obtain the device operation permissions. 2. Obtain the device operation permissions.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册