• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# JS API Changes of the USB Subsystem
2
3The table below lists the APIs changes of the USB subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
4
5## API Changes
6
7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
8|---|---|---|---|
9| ohos.usb | USBRequestDirection | USB_REQUEST_DIR_FROM_DEVICE = 0x80 | Added|
10| ohos.usb | USBRequestDirection | USB_REQUEST_DIR_TO_DEVICE = 0 | Added|
11| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_VENDOR | Added|
12| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_CLASS | Added|
13| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_STANDARD = 0 | Added|
14| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_OTHER | Added|
15| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_ENDPOINT | Added|
16| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_INTERFACE | Added|
17| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_DEVICE = 0 | Added|
18| ohos.usb | USBControlParams | data: Uint8Array; | Added|
19| ohos.usb | USBControlParams | index: number; | Added|
20| ohos.usb | USBControlParams | value: number; | Added|
21| ohos.usb | USBControlParams | reqType: USBControlRequestType; | Added|
22| ohos.usb | USBControlParams | target: USBRequestTargetType; | Added|
23| ohos.usb | USBControlParams | request: number; | Added|
24| ohos.usb | USBDevicePipe | devAddress: number; | Added|
25| ohos.usb | USBDevicePipe | busNum: number; | Added|
26| ohos.usb | USBDevice | configs: Array\<USBConfig>; | Added|
27| ohos.usb | USBDevice | protocol: number; | Added|
28| ohos.usb | USBDevice | subClass: number; | Added|
29| ohos.usb | USBDevice | clazz: number; | Added|
30| ohos.usb | USBDevice | productId: number; | Added|
31| ohos.usb | USBDevice | vendorId: number; | Added|
32| ohos.usb | USBDevice | version: string; | Added|
33| ohos.usb | USBDevice | productName: string; | Added|
34| ohos.usb | USBDevice | manufacturerName: string; | Added|
35| ohos.usb | USBDevice | name: string; | Added|
36| ohos.usb | USBDevice | serial: string; | Added|
37| ohos.usb | USBDevice | devAddress: number; | Added|
38| ohos.usb | USBDevice | busNum: number; | Added|
39| ohos.usb | USBConfig | interfaces: Array\<USBInterface>; | Added|
40| ohos.usb | USBConfig | isSelfPowered: boolean; | Added|
41| ohos.usb | USBConfig | isRemoteWakeup: boolean; | Added|
42| ohos.usb | USBConfig | name: string; | Added|
43| ohos.usb | USBConfig | maxPower: number; | Added|
44| ohos.usb | USBConfig | attributes: number; | Added|
45| ohos.usb | USBConfig | id: number; | Added|
46| ohos.usb | USBInterface | endpoints: Array\<USBEndpoint>; | Added|
47| ohos.usb | USBInterface | name: string; | Added|
48| ohos.usb | USBInterface | alternateSetting: number; | Added|
49| ohos.usb | USBInterface | subClass: number; | Added|
50| ohos.usb | USBInterface | clazz: number; | Added|
51| ohos.usb | USBInterface | protocol: number; | Added|
52| ohos.usb | USBInterface | id: number; | Added|
53| ohos.usb | USBEndpoint | interfaceId: number; | Added|
54| ohos.usb | USBEndpoint | type: number; | Added|
55| ohos.usb | USBEndpoint | number: number; | Added|
56| ohos.usb | USBEndpoint | direction: USBRequestDirection; | Added|
57| ohos.usb | USBEndpoint | maxPacketSize: number; | Added|
58| ohos.usb | USBEndpoint | interval: number; | Added|
59| ohos.usb | USBEndpoint | attributes: number; | Added|
60| ohos.usb | USBEndpoint | address: number; | Added|
61| ohos.usb | usb | closePipe(pipe: USBDevicePipe): number; | Added|
62| ohos.usb | usb | bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array,timeout?: number): Promise\<number>; | Added|
63| ohos.usb | usb | controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise\<number>; | Added|
64| ohos.usb | usb | getFileDescriptor(pipe: USBDevicePipe): number; | Added|
65| ohos.usb | usb | getRawDescriptor(pipe: USBDevicePipe): Uint8Array; | Added|
66| ohos.usb | usb | setInterface(pipe: USBDevicePipe, iface: USBInterface): number; | Added|
67| ohos.usb | usb | setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | Added|
68| ohos.usb | usb | releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; | Added|
69| ohos.usb | usb | claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; | Added|
70| ohos.usb | usb | requestRight(deviceName: string): Promise\<boolean>; | Added|
71| ohos.usb | usb | hasRight(deviceName: string): boolean; | Added|
72| ohos.usb | usb | connectDevice(device: USBDevice): Readonly\<USBDevicePipe>; | Added|
73| ohos.usb | usb | getDevices(): Array\<Readonly\<USBDevice>>; | Added|
74