1# JS API Changes of the USB Subsystem 2 3The table below lists the APIs changes of the USB subsystem in OpenHarmony 3.2 Beta2 over OpenHarmony 3.2 Beta1. 4 5## API Changes 6 7| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| 8|---|---|---|---| 9| ohos.usb | FunctionType | NCM = 256 | Added| 10| ohos.usb | FunctionType | AUDIO_SOURCE = 128 | Added| 11| ohos.usb | FunctionType | MIDI = 64 | Added| 12| ohos.usb | FunctionType | RNDIS = 32 | Added| 13| ohos.usb | FunctionType | PTP = 16 | Added| 14| ohos.usb | FunctionType | MTP = 8 | Added| 15| ohos.usb | FunctionType | HDC = 4 | Added| 16| ohos.usb | FunctionType | ECM = 2 | Added| 17| ohos.usb | FunctionType | ACM = 1 | Added| 18| ohos.usb | FunctionType | NONE = 0 | Added| 19| ohos.usb | USBPort | status: USBPortStatus; | Added| 20| ohos.usb | USBPort | supportedModes: PortModeType; | Added| 21| ohos.usb | USBPort | id: number; | Added| 22| ohos.usb | USBPortStatus | currentDataRole: number; | Added| 23| ohos.usb | USBPortStatus | currentPowerRole: number; | Added| 24| ohos.usb | USBPortStatus | currentMode: number; | Added| 25| ohos.usb | PortModeType | NUM_MODES = 4 | Added| 26| ohos.usb | PortModeType | DRP = 3 | Added| 27| ohos.usb | PortModeType | DFP = 2 | Added| 28| ohos.usb | PortModeType | UFP = 1 | Added| 29| ohos.usb | PortModeType | NONE = 0 | Added| 30| ohos.usb | DataRoleType | DEVICE = 2 | Added| 31| ohos.usb | DataRoleType | HOST = 1 | Added| 32| ohos.usb | DataRoleType | NONE = 0 | Added| 33| ohos.usb | PowerRoleType | SINK = 2 | Added| 34| ohos.usb | PowerRoleType | SOURCE = 1 | Added| 35| ohos.usb | PowerRoleType | NONE = 0 | Added| 36| ohos.usb | usb | setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise\<boolean>; | Added| 37| ohos.usb | usb | getSupportedModes(portId: number): PortModeType; | Added| 38| ohos.usb | usb | getPorts(): Array\<USBPort>; | Added| 39| ohos.usb | usb | getCurrentFunctions(): FunctionType; | Added| 40| ohos.usb | usb | setCurrentFunctions(funcs: FunctionType): Promise\<boolean>; | Added| 41| ohos.usb | usb | usbFunctionsToString(funcs: FunctionType): string; | Added| 42| ohos.usb | usb | usbFunctionsFromString(funcs: string): number; | Added| 43