js-apidiff-usb.md 4.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# JS API Changes of the USB Subsystem

The table below lists the APIs changes of the USB subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.

## API Changes

| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.usb | USBRequestDirection | USB_REQUEST_DIR_FROM_DEVICE = 0x80 | Added|
| ohos.usb | USBRequestDirection | USB_REQUEST_DIR_TO_DEVICE = 0 | Added|
| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_VENDOR | Added|
| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_CLASS | Added|
| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_STANDARD = 0 | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_OTHER | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_ENDPOINT | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_INTERFACE | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_DEVICE = 0 | Added|
| ohos.usb | USBControlParams | data: Uint8Array; | Added|
| ohos.usb | USBControlParams | index: number; | Added|
| ohos.usb | USBControlParams | value: number; | Added|
| ohos.usb | USBControlParams | reqType: USBControlRequestType; | Added|
| ohos.usb | USBControlParams | target: USBRequestTargetType; | Added|
| ohos.usb | USBControlParams | request: number; | Added|
| ohos.usb | USBDevicePipe | devAddress: number; | Added|
| ohos.usb | USBDevicePipe | busNum: number; | Added|
W
wusongqing 已提交
26
| ohos.usb | USBDevice | configs: Array\<USBConfig>; | Added|
27 28 29 30 31 32 33 34 35 36 37 38
| ohos.usb | USBDevice | protocol: number; | Added|
| ohos.usb | USBDevice | subClass: number; | Added|
| ohos.usb | USBDevice | clazz: number; | Added|
| ohos.usb | USBDevice | productId: number; | Added|
| ohos.usb | USBDevice | vendorId: number; | Added|
| ohos.usb | USBDevice | version: string; | Added|
| ohos.usb | USBDevice | productName: string; | Added|
| ohos.usb | USBDevice | manufacturerName: string; | Added|
| ohos.usb | USBDevice | name: string; | Added|
| ohos.usb | USBDevice | serial: string; | Added|
| ohos.usb | USBDevice | devAddress: number; | Added|
| ohos.usb | USBDevice | busNum: number; | Added|
W
wusongqing 已提交
39
| ohos.usb | USBConfig | interfaces: Array\<USBInterface>; | Added|
40 41 42 43 44 45
| ohos.usb | USBConfig | isSelfPowered: boolean; | Added|
| ohos.usb | USBConfig | isRemoteWakeup: boolean; | Added|
| ohos.usb | USBConfig | name: string; | Added|
| ohos.usb | USBConfig | maxPower: number; | Added|
| ohos.usb | USBConfig | attributes: number; | Added|
| ohos.usb | USBConfig | id: number; | Added|
W
wusongqing 已提交
46
| ohos.usb | USBInterface | endpoints: Array\<USBEndpoint>; | Added|
47 48 49 50 51 52 53 54 55 56 57 58 59 60
| ohos.usb | USBInterface | name: string; | Added|
| ohos.usb | USBInterface | alternateSetting: number; | Added|
| ohos.usb | USBInterface | subClass: number; | Added|
| ohos.usb | USBInterface | clazz: number; | Added|
| ohos.usb | USBInterface | protocol: number; | Added|
| ohos.usb | USBInterface | id: number; | Added|
| ohos.usb | USBEndpoint | interfaceId: number; | Added|
| ohos.usb | USBEndpoint | type: number; | Added|
| ohos.usb | USBEndpoint | number: number; | Added|
| ohos.usb | USBEndpoint | direction: USBRequestDirection; | Added|
| ohos.usb | USBEndpoint | maxPacketSize: number; | Added|
| ohos.usb | USBEndpoint | interval: number; | Added|
| ohos.usb | USBEndpoint | attributes: number; | Added|
| ohos.usb | USBEndpoint | address: number; | Added|
W
wusongqing 已提交
61 62 63 64 65 66 67 68 69 70 71 72 73
| ohos.usb | usb | closePipe(pipe: USBDevicePipe): number; | Added|
| ohos.usb | usb | bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array,timeout?: number): Promise\<number>; | Added|
| ohos.usb | usb | controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise\<number>; | Added|
| ohos.usb | usb | getFileDescriptor(pipe: USBDevicePipe): number; | Added|
| ohos.usb | usb | getRawDescriptor(pipe: USBDevicePipe): Uint8Array; | Added|
| ohos.usb | usb | setInterface(pipe: USBDevicePipe, iface: USBInterface): number; | Added|
| ohos.usb | usb | setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | Added|
| ohos.usb | usb | releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; | Added|
| ohos.usb | usb | claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; | Added|
| ohos.usb | usb | requestRight(deviceName: string): Promise\<boolean>; | Added|
| ohos.usb | usb | hasRight(deviceName: string): boolean; | Added|
| ohos.usb | usb | connectDevice(device: USBDevice): Readonly\<USBDevicePipe>; | Added|
| ohos.usb | usb | getDevices(): Array\<Readonly\<USBDevice>>; | Added|