From 49fb93ebb03a536627fc5966aba2380cc781eaff Mon Sep 17 00:00:00 2001 From: ge-yafang Date: Thu, 19 Jan 2023 17:03:11 +0800 Subject: [PATCH] update docs Signed-off-by: ge-yafang --- en/application-dev/device/usb-guidelines.md | 92 ++++++++++----------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/en/application-dev/device/usb-guidelines.md b/en/application-dev/device/usb-guidelines.md index 5d2eefbc96..4cc830271f 100644 --- a/en/application-dev/device/usb-guidelines.md +++ b/en/application-dev/device/usb-guidelines.md @@ -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. ```js - // Import the USB API package. - import usb from '@ohos.usbV9'; - // Obtain the USB device list. - let deviceList = usb.getDevices(); - /* - 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: [ + // Import the USB API package. + import usb from '@ohos.usbV9'; + // Obtain the USB device list. + let deviceList = usb.getDevices(); + /* + Example deviceList structure + [ { - id: 1, - attributes: 224, - isRemoteWakeup: true, - isSelfPowered: true, - maxPower: 0, 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, - protocol: 0, - clazz: 9, - subclass: 0, - alternateSetting: 0, + id: 1, + attributes: 224, + isRemoteWakeup: true, + isSelfPowered: true, + maxPower: 0, name: "1-1", - endpoints: [ + interfaces: [ { - address: 129, - attributes: 3, - interval: 12, - maxPacketSize: 4, - direction: 128, - number: 1, - type: 3, - interfaceId: 0, + id: 0, + protocol: 0, + clazz: 9, + subclass: 0, + alternateSetting: 0, + name: "1-1", + endpoints: [ + { + address: 129, + attributes: 3, + interval: 12, + maxPacketSize: 4, + direction: 128, + number: 1, + type: 3, + interfaceId: 0, + } + ] } ] } ] } ] - } - ] - */ - - ``` + */ + ``` + 2. Obtain the device operation permissions. -- GitLab