From 227a588854174d29bfb8ddcf07173ab659bb47d2 Mon Sep 17 00:00:00 2001 From: NickWang007 Date: Wed, 6 Aug 2025 10:07:08 +0800 Subject: [PATCH] =?UTF-8?q?usbmanager=20sdk=20=E5=90=88=E5=85=A5=20master?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: NickWang007 Change-Id: I1a46139a83e57008a4eaa523cf037fca2a3e5981 Signed-off-by: NickWang007 --- api/@ohos.usbManager.d.ts | 754 +++++++++++++++++++------------ api/@ohos.usbManager.serial.d.ts | 279 +++++++----- 2 files changed, 640 insertions(+), 393 deletions(-) diff --git a/api/@ohos.usbManager.d.ts b/api/@ohos.usbManager.d.ts index b2139a3bf1..e330737225 100644 --- a/api/@ohos.usbManager.d.ts +++ b/api/@ohos.usbManager.d.ts @@ -25,7 +25,8 @@ import { AsyncCallback } from './@ohos.base'; * * @namespace usbManager * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace usbManager { /** @@ -41,7 +42,8 @@ declare namespace usbManager { * @returns { Array> } USB device list. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getDevices(): Array>; @@ -68,7 +70,8 @@ declare namespace usbManager { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 14400001 - Access right denied. Call requestRight to get the USBDevicePipe access right first. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function connectDevice(device: USBDevice): Readonly; @@ -93,7 +96,8 @@ declare namespace usbManager { *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function hasRight(deviceName: string): boolean; @@ -120,7 +124,8 @@ declare namespace usbManager { *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function requestRight(deviceName: string): Promise; @@ -147,7 +152,8 @@ declare namespace usbManager { *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function removeRight(deviceName: string): boolean; @@ -308,7 +314,8 @@ declare namespace usbManager { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function addDeviceAccessRight(tokenId: string, deviceName: string): boolean; @@ -331,7 +338,7 @@ declare namespace usbManager { * * @permission ohos.permission.MANAGE_USB_CONFIG * @param { string } funcs - descriptor of the supported function list. It cannot be empty. - * @returns { number } the numeric mask combination of the function list. + * @returns { int } the numeric mask combination of the function list. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 202 - Permission denied. Normal application do not have permission to use system api. * @throws { BusinessError } 401 - Parameter error. Possible causes: @@ -340,9 +347,10 @@ declare namespace usbManager { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function getFunctionsFromString(funcs: string): number; + function getFunctionsFromString(funcs: string): int; /** * Converts the numeric mask combination of a given USB function list to a string descriptor. @@ -372,7 +380,8 @@ declare namespace usbManager { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getStringFromFunctions(funcs: FunctionType): string; @@ -408,7 +417,8 @@ declare namespace usbManager { * @throws { BusinessError } 14400006 - Unsupported operation. The function is not supported. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function setDeviceFunctions(funcs: FunctionType): Promise; @@ -432,7 +442,8 @@ declare namespace usbManager { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getDeviceFunctions(): FunctionType; /* usb port functions begin */ @@ -457,7 +468,8 @@ declare namespace usbManager { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getPortList(): Array; @@ -479,7 +491,7 @@ declare namespace usbManager { * Gets the mask combination for the supported mode list of the specified USBPort. * * @permission ohos.permission.MANAGE_USB_CONFIG - * @param { number } portId - unique ID of the port. It cannot be empty. + * @param { int } portId - unique ID of the port. It cannot be empty. * @returns { PortModeType } the mask combination for the supported mode list in PortModeType. * @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 202 - Permission denied. Normal application do not have permission to use system api. @@ -489,9 +501,10 @@ declare namespace usbManager { * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function getPortSupportModes(portId: number): PortModeType; + function getPortSupportModes(portId: int): PortModeType; /** * Sets the role types supported by the specified USBPort, which can be powerRole (for charging) and dataRole (for data transfer). @@ -514,7 +527,7 @@ declare namespace usbManager { * Sets the role types supported by the specified USBPort, which can be powerRole (for charging) and dataRole (for data transfer). * * @permission ohos.permission.MANAGE_USB_CONFIG - * @param { number } portId - unique ID of the port. It cannot be empty. + * @param { int } portId - unique ID of the port. It cannot be empty. * @param { PowerRoleType } powerRole - charging role. It cannot be empty. * @param { DataRoleType } dataRole - data role. It cannot be empty. * @returns { Promise } the promise returned by the function. @@ -527,9 +540,10 @@ declare namespace usbManager { * @throws { BusinessError } 14400003 - Unsupported operation. The current device does not support port role switching. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function setPortRoleTypes(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; + function setPortRoleTypes(portId: int, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; /** * Adds USB accessory access right. @@ -553,7 +567,7 @@ declare namespace usbManager { * Adds USB accessory access right. * * @permission ohos.permission.MANAGE_USB_CONFIG - * @param { number } tokenId - refers to application that require access permissions. It cannot be empty. + * @param { int } tokenId - refers to application that require access permissions. It cannot be empty. * @param { USBAccessory } accessory - USB accessory. It cannot be empty. * @throws { BusinessError } 201 - The permission check failed. * @throws { BusinessError } 202 - Permission denied. Normal application do not have permission to use system api. @@ -566,9 +580,10 @@ declare namespace usbManager { * @throws { BusinessError } 14400005 - Database operation exception. * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function addAccessoryRight(tokenId: number, accessory: USBAccessory): void; + function addAccessoryRight(tokenId: int, accessory: USBAccessory): void; /* usb pipe functions begin */ /** * Claims a USB interface. @@ -589,15 +604,16 @@ declare namespace usbManager { * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. It cannot be empty. * @param { USBInterface } iface - USB interface, which is used to determine the interface to claim. It cannot be empty. * @param { boolean } [force] - optional parameter that determines whether to forcibly claim the USB interface. - * @returns { number } returns **0** if the USB interface is successfully claimed; returns an error code otherwise. + * @returns { int } returns **0** if the USB interface is successfully claimed; returns an error code otherwise. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; + function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): int; /** * Releases a USB interface. @@ -616,15 +632,16 @@ declare namespace usbManager { * * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. It cannot be empty. * @param { USBInterface } iface - USB interface, which is used to determine the interface to release. It cannot be empty. - * @returns { number } returns **0** if the USB interface is successfully released; returns an error code otherwise. + * @returns { int } returns **0** if the USB interface is successfully released; returns an error code otherwise. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; + function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): int; /** * Sets the device configuration. @@ -643,15 +660,16 @@ declare namespace usbManager { * * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. It cannot be empty. * @param { USBConfiguration } config - device configuration. It cannot be empty. - * @returns { number } returns **0** if the device configuration is successfully set; returns an error code otherwise. + * @returns { int } returns **0** if the device configuration is successfully set; returns an error code otherwise. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number; + function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): int; /** * Sets a USB interface. @@ -670,15 +688,16 @@ declare namespace usbManager { * * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. It cannot be empty. * @param { USBInterface } iface - USB interface, which is used to determine the interface to set. It cannot be empty. - * @returns { number } returns **0** if the USB interface is successfully set; return an error code otherwise. + * @returns { int } returns **0** if the USB interface is successfully set; return an error code otherwise. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; + function setInterface(pipe: USBDevicePipe, iface: USBInterface): int; /** * Obtains the raw USB descriptor. @@ -701,7 +720,8 @@ declare namespace usbManager { *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; @@ -720,15 +740,16 @@ declare namespace usbManager { * Obtains the file descriptor. * * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. It cannot be empty. - * @returns { number } returns the file descriptor of the USB device. + * @returns { int } returns the file descriptor of the USB device. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function getFileDescriptor(pipe: USBDevicePipe): number; + function getFileDescriptor(pipe: USBDevicePipe): int; /** * Performs control transfer. @@ -767,17 +788,18 @@ declare namespace usbManager { * * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. It cannot be empty. * @param { USBDeviceRequestParams } requestparam - control transfer parameters. It cannot be empty. - * @param { number } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @returns { Promise } returns the size of the transmitted or received data block if the control transfer is successful; + * @param { int } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @returns { Promise } returns the size of the transmitted or received data block if the control transfer is successful; * return -1 if an exception occurs. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function usbControlTransfer(pipe: USBDevicePipe, requestparam: USBDeviceRequestParams, timeout?: number): Promise; + function usbControlTransfer(pipe: USBDevicePipe, requestparam: USBDeviceRequestParams, timeout?: int): Promise; /** * Performs bulk transfer. @@ -800,22 +822,23 @@ declare namespace usbManager { * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. It cannot be empty. * @param { USBEndpoint } endpoint - USB endpoint, which is used to determine the USB port for data transfer. It cannot be empty. * @param { Uint8Array } buffer - buffer for writing or reading data. It cannot be empty. - * @param { number } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @returns { Promise } the size of the transmitted or received data block if the control transfer is successful; + * @param { int } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @returns { Promise } the size of the transmitted or received data block if the control transfer is successful; * return -1 if an exception occurs. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function bulkTransfer( pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, - timeout?: number - ): Promise; + timeout?: int + ): Promise; /** * Closes a USB device pipe. @@ -832,15 +855,16 @@ declare namespace usbManager { * Closes a USB device pipe. * * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. It cannot be empty. - * @returns { number } returns **0** if the USB device pipe is closed successfully; return an error code otherwise. + * @returns { int } returns **0** if the USB device pipe is closed successfully; return an error code otherwise. * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1.Mandatory parameters are left unspecified. *
2.Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - function closePipe(pipe: USBDevicePipe): number; + function closePipe(pipe: USBDevicePipe): int; /** * Checks whether the application has the right to access the USB accessory. @@ -871,7 +895,8 @@ declare namespace usbManager { * @throws { BusinessError } 14400005 - Database operation exception. * @throws { BusinessError } 14401001 - The target USBAccessory not matched. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function hasAccessoryRight(accessory: USBAccessory): boolean; @@ -904,7 +929,8 @@ declare namespace usbManager { * @throws { BusinessError } 14400005 - Database operation exception. * @throws { BusinessError } 14401001 - The target USBAccessory not matched. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function requestAccessoryRight(accessory: USBAccessory): Promise; @@ -935,7 +961,8 @@ declare namespace usbManager { * @throws { BusinessError } 14400005 - Database operation exception. * @throws { BusinessError } 14401001 - The target USBAccessory not matched. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function cancelAccessoryRight(accessory: USBAccessory): void; @@ -956,7 +983,8 @@ declare namespace usbManager { * @throws { BusinessError } 14400004 - Service exception. Possible causes: *
1. No accessory is plugged in. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function getAccessoryList(): Array>; @@ -993,7 +1021,8 @@ declare namespace usbManager { * @throws { BusinessError } 14401002 - Failed to open the native accessory node. * @throws { BusinessError } 14401003 - Cannot reopen the accessory. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function openAccessory(accessory: USBAccessory): USBAccessoryHandle; @@ -1020,7 +1049,8 @@ declare namespace usbManager { * @throws { BusinessError } 14400004 - Service exception. Possible causes: *
1. No accessory is plugged in. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function closeAccessory(accessoryHandle: USBAccessoryHandle): void; @@ -1029,51 +1059,57 @@ declare namespace usbManager { * * @typedef USBEndpoint * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBEndpoint { /** * Endpoint address * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - address: number; + address: int; /** * Endpoint attributes * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - attributes: number; + attributes: int; /** * Endpoint interval * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - interval: number; + interval: int; /** * Maximum size of data packets on the endpoint * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - maxPacketSize: number; + maxPacketSize: int; /** * Endpoint direction * * @type { USBRequestDirection } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ direction: USBRequestDirection; @@ -1086,23 +1122,35 @@ declare namespace usbManager { */ number: number; + /** + * Endpoint address + * + * @type { int } + * @syscap SystemCapability.USB.USBManager + * @since 20 + * @arkts 1.2 + */ + endpointAddr: int; + /** * Endpoint type * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - type: number; + type: int; /** * Unique ID defined by USBInterface.id, which indicates the interface to which the endpoint belongs * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - interfaceId: number; + interfaceId: int; @@ -1113,60 +1161,67 @@ declare namespace usbManager { * * @typedef USBInterface * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBInterface { /** * Unique ID of the USB interface * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - id: number; + id: int; /** * Interface protocol * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - protocol: number; + protocol: int; /** * Device type * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - clazz: number; + clazz: int; /** * Device subclass * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - subClass: number; + subClass: int; /** * Alternation between descriptors of the same USB interface * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - alternateSetting: number; + alternateSetting: int; /** * Interface name * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ name: string; @@ -1175,7 +1230,8 @@ declare namespace usbManager { * * @type { Array } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ endpoints: Array; } @@ -1185,42 +1241,47 @@ declare namespace usbManager { * * @typedef USBConfiguration * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBConfiguration { /** * Unique ID of the USB configuration * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - id: number; + id: int; /** * Configuration attributes * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - attributes: number; + attributes: int; /** * Maximum power consumption, in mA * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - maxPower: number; + maxPower: int; /** * Configuration name, which can be left empty * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ name: string; @@ -1229,7 +1290,8 @@ declare namespace usbManager { * * @type { boolean } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ isRemoteWakeup: boolean; @@ -1238,7 +1300,8 @@ declare namespace usbManager { * * @type { boolean } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ isSelfPowered: boolean; @@ -1247,7 +1310,8 @@ declare namespace usbManager { * * @type { Array } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interfaces: Array; } @@ -1257,33 +1321,37 @@ declare namespace usbManager { * * @typedef USBDevice * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBDevice { /** * Bus address * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - busNum: number; + busNum: int; /** * Device address * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - devAddress: number; + devAddress: int; /** * Device SN * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ serial: string; @@ -1292,7 +1360,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ name: string; @@ -1301,7 +1370,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ manufacturerName: string; @@ -1310,7 +1380,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ productName: string; @@ -1319,61 +1390,68 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ version: string; /** * Vendor ID * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - vendorId: number; + vendorId: int; /** * Product ID * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - productId: number; + productId: int; /** * Device class * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - clazz: number; + clazz: int; /** * Device subclass * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - subClass: number; + subClass: int; /** * Device protocol code * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - protocol: number; + protocol: int; /** * Device configuration descriptor information * * @type { Array } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ configs: Array; } @@ -1383,35 +1461,39 @@ declare namespace usbManager { * * @typedef USBDevicePipe * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBDevicePipe { /** * Bus address. * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - busNum: number; + busNum: int; /** * Device address * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - devAddress: number; + devAddress: int; } /** * Enumerates power role types. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum PowerRoleType { /** @@ -1419,7 +1501,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ NONE = 0, @@ -1428,7 +1511,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ SOURCE = 1, @@ -1437,7 +1521,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ SINK = 2 } @@ -1445,10 +1530,11 @@ declare namespace usbManager { /** * Enumerates data role types. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum DataRoleType { /** @@ -1456,7 +1542,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ NONE = 0, @@ -1465,7 +1552,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ HOST = 1, @@ -1474,7 +1562,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ DEVICE = 2 } @@ -1482,10 +1571,11 @@ declare namespace usbManager { /** * Enumerates port mode types * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum PortModeType { /** @@ -1493,7 +1583,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ NONE = 0, @@ -1502,7 +1593,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ UFP = 1, @@ -1511,7 +1603,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ DFP = 2, @@ -1520,7 +1613,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ DRP = 3, @@ -1529,7 +1623,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ NUM_MODES = 4 } @@ -1540,38 +1635,42 @@ declare namespace usbManager { * @typedef USBPortStatus * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBPortStatus { /** * USB mode * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - currentMode: number; + currentMode: int; /** * Power role * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - currentPowerRole: number; + currentPowerRole: int; /** * Data role * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - currentDataRole: number; + currentDataRole: int; } /** @@ -1580,18 +1679,20 @@ declare namespace usbManager { * @typedef USBPort * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBPort { /** * Unique ID of the USB port * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ - id: number; + id: int; /** * Mask combination for the supported mode list of the USB port @@ -1599,7 +1700,8 @@ declare namespace usbManager { * @type { PortModeType } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ supportedModes: PortModeType; @@ -1609,7 +1711,8 @@ declare namespace usbManager { * @type { USBPortStatus } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ status: USBPortStatus; } @@ -1690,60 +1793,67 @@ declare namespace usbManager { * * @typedef USBDeviceRequestParams * @syscap SystemCapability.USB.USBManager - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBDeviceRequestParams { /** * Bit map request type * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - bmRequestType: number; + bmRequestType: int; /** * Byte request * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - bRequest: number; + bRequest: int; /** * Request parameter word value * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - wValue: number; + wValue: int; /** * Word index of the parameter value * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - wIndex: number; + wIndex: int; /** * Word length of the parameter value * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - wLength: number; + wLength: int; /** * Data written to or read from the buffer * * @type { Uint8Array } * @syscap SystemCapability.USB.USBManager - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ data: Uint8Array; } @@ -1751,16 +1861,18 @@ declare namespace usbManager { /** * Enumerates USB request target types. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum USBRequestTargetType { /** * USB device * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_TARGET_DEVICE = 0, @@ -1768,7 +1880,8 @@ declare namespace usbManager { * USB interface * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_TARGET_INTERFACE = 1, @@ -1776,7 +1889,8 @@ declare namespace usbManager { * Endpoint * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_TARGET_ENDPOINT = 2, @@ -1784,7 +1898,8 @@ declare namespace usbManager { * Others * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_TARGET_OTHER = 3 } @@ -1792,16 +1907,18 @@ declare namespace usbManager { /** * Enumerates control request types. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum USBControlRequestType { /** * Standard * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_TYPE_STANDARD = 0, @@ -1809,7 +1926,8 @@ declare namespace usbManager { * Class * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_TYPE_CLASS = 1, @@ -1817,7 +1935,8 @@ declare namespace usbManager { * Vendor * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_TYPE_VENDOR = 2 } @@ -1825,16 +1944,18 @@ declare namespace usbManager { /** * Enumerates request directions. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum USBRequestDirection { /** * Request for writing data from the host to the device * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_DIR_TO_DEVICE = 0, @@ -1842,7 +1963,8 @@ declare namespace usbManager { * Request for reading data from the device to the host * * @syscap SystemCapability.USB.USBManager - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_REQUEST_DIR_FROM_DEVICE = 0x80 } @@ -1850,10 +1972,11 @@ declare namespace usbManager { /** * Enumerates function modes. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum FunctionType { /** @@ -1861,7 +1984,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ NONE = 0, @@ -1870,7 +1994,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ ACM = 1, @@ -1879,7 +2004,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ ECM = 2, @@ -1888,7 +2014,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ HDC = 4, @@ -1897,7 +2024,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ MTP = 8, @@ -1906,7 +2034,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ PTP = 16, @@ -1915,7 +2044,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ RNDIS = 32, @@ -1924,7 +2054,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ MIDI = 64, @@ -1933,7 +2064,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ AUDIO_SOURCE = 128, @@ -1942,7 +2074,8 @@ declare namespace usbManager { * * @syscap SystemCapability.USB.USBManager * @systemapi - * @since 9 + * @since arkts {'1.1':'9', '1.2':'20'} + * @arkts 1.1&1.2 */ NCM = 256 } @@ -1952,7 +2085,8 @@ declare namespace usbManager { * * @typedef USBAccessory * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBAccessory { /** @@ -1960,7 +2094,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ manufacturer: string; @@ -1969,7 +2104,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ product: string; @@ -1978,7 +2114,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ description: string; @@ -1987,7 +2124,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ version: string; @@ -1996,7 +2134,8 @@ declare namespace usbManager { * * @type { string } * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ serialNumber: string; } @@ -2006,32 +2145,36 @@ declare namespace usbManager { * * @typedef USBAccessoryHandle * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBAccessoryHandle { /** * The file descriptor of the accessory.The valid USBAccessoryHandle.accessoryFd is a positive value. * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 14 + * @since arkts {'1.1':'14', '1.2':'20'} + * @arkts 1.1&1.2 */ - accessoryFd: number; + accessoryFd: int; } /** * Usb transfer flag. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum UsbTransferFlags { /** * Report short frames as errors * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_TRANSFER_SHORT_NOT_OK = 0, @@ -2039,7 +2182,8 @@ declare namespace usbManager { * Automatically free transfer buffer * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_TRANSFER_FREE_BUFFER = 1, @@ -2047,7 +2191,8 @@ declare namespace usbManager { * Automatically free transfer after callback returns * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_TRANSFER_FREE_TRANSFER = 2, @@ -2055,7 +2200,8 @@ declare namespace usbManager { * Transmissions that are multiples of wMaxPacketSize will add an additional zero packet. * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ USB_TRANSFER_ADD_ZERO_PACKET = 3 } @@ -2063,16 +2209,18 @@ declare namespace usbManager { /** * Usb transfer status. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum UsbTransferStatus { /** * Transfer completed * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_COMPLETED = 0, @@ -2080,7 +2228,8 @@ declare namespace usbManager { * Transfer failed * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_ERROR = 1, @@ -2088,7 +2237,8 @@ declare namespace usbManager { * Transfer timed out * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_TIMED_OUT = 2, @@ -2096,7 +2246,8 @@ declare namespace usbManager { * Transfer was canceled * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_CANCELED = 3, @@ -2105,7 +2256,8 @@ declare namespace usbManager { * stalled). For control endpoints: control request not supported. * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_STALL = 4, @@ -2113,7 +2265,8 @@ declare namespace usbManager { * Device was disconnected * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_NO_DEVICE = 5, @@ -2121,7 +2274,8 @@ declare namespace usbManager { * Device sent more data than requested * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_OVERFLOW = 6 } @@ -2129,16 +2283,18 @@ declare namespace usbManager { /** * USB DATA transfer type. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum UsbEndpointTransferType { /** * Isochronous endpoint * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_TYPE_ISOCHRONOUS = 0x1, @@ -2146,7 +2302,8 @@ declare namespace usbManager { * Bulk endpoint * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_TYPE_BULK = 0x2, @@ -2154,7 +2311,8 @@ declare namespace usbManager { * Interrupt endpoint * * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ TRANSFER_TYPE_INTERRUPT = 0x3 } @@ -2164,61 +2322,68 @@ declare namespace usbManager { * * @typedef UsbIsoPacketDescriptor * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ interface UsbIsoPacketDescriptor { /** * Length of data to request in this packet * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - length: number; + length: int; /** * Amount of data that was actually transferred * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - actualLength: number; + actualLength: int; /** * Status code for this packet * * @type { UsbTransferStatus } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ status: UsbTransferStatus; } - /** + /** * submit transfer callback. * * @typedef SubmitTransferCallback * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ interface SubmitTransferCallback { /** * Actual length of data that was transferred. Read-only, and only for * use within transfer callback function. Not valid for isochronous endpoint transfers. * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - actualLength: number; + actualLength: int; /** * The status of the transfer. Read-only, and only for use within transfer callback function. * * @type { UsbTransferStatus } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ status: UsbTransferStatus; @@ -2227,7 +2392,8 @@ declare namespace usbManager { * * @type { Array> } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ isoPacketDescs: Array>; } @@ -2238,7 +2404,8 @@ declare namespace usbManager { * * @typedef UsbDataTransferParams * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ interface UsbDataTransferParams { /** @@ -2246,7 +2413,8 @@ declare namespace usbManager { * * @type { USBDevicePipe } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ devPipe: USBDevicePipe; @@ -2255,52 +2423,58 @@ declare namespace usbManager { * * @type { UsbTransferFlags } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ flags: UsbTransferFlags; /** * Address of the endpoint where this transfer will be sent. * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - endpoint: number; + endpoint: int; /** * Type of the transfer * * @type { UsbEndpointTransferType } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ type: UsbEndpointTransferType; /** * Timeout for this transfer in milliseconds. A value of 0 indicates no timeout. * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - timeout: number; + timeout: int; /** * Length of the data buffer. Must be non-negative. * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - length: number; + length: int; /** * Callback function. This will be invoked when the transfer completes, fails, or is canceled. * * @type { AsyncCallback } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ callback: AsyncCallback; @@ -2310,7 +2484,8 @@ declare namespace usbManager { * * @type { Uint8Array } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ userData: Uint8Array; @@ -2319,18 +2494,20 @@ declare namespace usbManager { * * @type { Uint8Array } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ buffer: Uint8Array; /** * Count of isochronous packets. Only used for I/O with isochronous endpoints. Must be non-negative. * - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ - isoPacketCount: number; + isoPacketCount: int; } /** @@ -2348,7 +2525,8 @@ declare namespace usbManager { *
1. Memory allocation failed. * @throws { BusinessError } 14400012 - Transmission I/O error. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function usbSubmitTransfer(transfer: UsbDataTransferParams): void; @@ -2363,7 +2541,8 @@ declare namespace usbManager { *
1.Unrecognized discard error code. * @throws { BusinessError } 14400011 - The transfer is not in progress, or is already complete or cancelled. * @syscap SystemCapability.USB.USBManager - * @since 18 + * @since arkts {'1.1':'18', '1.2':'20'} + * @arkts 1.1&1.2 */ function usbCancelTransfer(transfer: UsbDataTransferParams): void; @@ -2384,6 +2563,7 @@ declare namespace usbManager { *
2.The call chain used to obtain the input parameters is not reasonable. * @syscap SystemCapability.USB.USBManager * @since 20 + * @arkts 1.1&1.2 */ function resetUsbDevice(pipe: USBDevicePipe): boolean; diff --git a/api/@ohos.usbManager.serial.d.ts b/api/@ohos.usbManager.serial.d.ts index 5835faf219..a823b033de 100644 --- a/api/@ohos.usbManager.serial.d.ts +++ b/api/@ohos.usbManager.serial.d.ts @@ -22,7 +22,8 @@ * Provides APIs for managing USB-to-virtual serial ports and implementing USB-to-virtual serial port communication. * @namespace serialManager * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace serialManager { @@ -30,13 +31,14 @@ declare namespace serialManager { * Obtains the serial port device list. * @returns { Readonly[]} Returns the list of serial port devices obtained. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ function getPortList(): Readonly[]; /** * Checks whether a serial port device has the access right. The system applications have the access right by default. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @returns {boolean} Returns true if the device has the right; returns false otherwise. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. @@ -44,13 +46,14 @@ declare namespace serialManager { * @throws { BusinessError } 31400001 Serial port management exception. * @throws { BusinessError } 31400003 PortId does not exist. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function hasSerialRight(portId: number): boolean; + function hasSerialRight(portId: int): boolean; /** * Requests the right for accessing a serial port device from the user. The system applications do not need to call this API. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @returns { Promise} Promise used to return the result. * The value true means the user allows the access; * the value false means the opposite. @@ -60,15 +63,16 @@ declare namespace serialManager { * @throws { BusinessError } 31400001 Serial port management exception. * @throws { BusinessError } 31400003 PortId does not exist. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function requestSerialRight(portId: number): Promise; + function requestSerialRight(portId: int): Promise; /** * Adds the access right for a serial port device. * @permission ohos.permission.MANAGE_USB_CONFIG - * @param { number } tokenId Token ID of the target application. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int } tokenId Token ID of the target application. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @throws { BusinessError } 201 Permission verification failed. The application does not have the permission required to call the API. * @throws { BusinessError } 202 Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 Parameter error. Possible causes: @@ -78,13 +82,14 @@ declare namespace serialManager { * @throws { BusinessError } 31400003 PortId does not exist. * @syscap SystemCapability.USB.USBManager.Serial * @systemapi - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function addSerialRight(tokenId: number, portId: number): void; + function addSerialRight(tokenId: int, portId: int): void; /** * Cancels the access right for a serial port device. This API will not cancel the default access right of system applications. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 14400005 Database operation exception. @@ -92,13 +97,14 @@ declare namespace serialManager { * @throws { BusinessError } 31400002 Access denied. Call requestSerialRight to request user authorization first. * @throws { BusinessError } 31400003 PortId does not exist. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function cancelSerialRight(portId: number): void; + function cancelSerialRight(portId: int): void; /** * Opens a serial port device. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 31400001 Serial port management exception. @@ -106,26 +112,28 @@ declare namespace serialManager { * @throws { BusinessError } 31400003 PortId does not exist. * @throws { BusinessError } 31400004 The serial port device is occupied. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function open(portId: number): void; + function open(portId: int): void; /** * Closes a serial port device. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 31400001 Serial port management exception. * @throws { BusinessError } 31400003 PortId does not exist. * @throws { BusinessError } 31400005 The serial port device is not opened. Call the open API first. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function close(portId: number): void; + function close(portId: int): void; /** * Obtains the communication parameters of a serial port device. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @returns { Readonly} Communication parameters obtained, which are read-only. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. @@ -133,13 +141,14 @@ declare namespace serialManager { * @throws { BusinessError } 31400003 PortId does not exist. * @throws { BusinessError } 31400005 The serial port device is not opened. Call the open API first. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function getAttribute(portId: number): Readonly; + function getAttribute(portId: int): Readonly; /** * Sets the communication parameters for a serial port device. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @param { SerialAttribute} attribute Communication parameters to set. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. @@ -147,17 +156,18 @@ declare namespace serialManager { * @throws { BusinessError } 31400003 PortId does not exist. * @throws { BusinessError } 31400005 The serial port device is not opened. Call the open API first. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function setAttribute(portId: number, attribute: SerialAttribute): void; + function setAttribute(portId: int, attribute: SerialAttribute): void; /** * Reads data from a serial port device. This API uses a promise to return the result. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @param { Uint8Array } buffer Buffer for storing the data read, with a maximum length of 8192 bytes. - * @param { number } timeout Timeout duration for reading data. The value is a non-negative number. + * @param { int } timeout Timeout duration for reading data. The value is a non-negative number. * The default value 0 indicates that there is no time limit for data reading. - * @returns { Promise } Promise used to return the length of the data read. + * @returns { Promise } Promise used to return the length of the data read. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 31400001 Serial port management exception. @@ -168,17 +178,18 @@ declare namespace serialManager { *
1. The transfer was canceled. *
2. The device offered more data than allowed. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function read(portId: number, buffer: Uint8Array, timeout?: number): Promise; + function read(portId: int, buffer: Uint8Array, timeout?: int): Promise; /** * Reads data from a serial port device. This API returns the result synchronously. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @param { Uint8Array } buffer Buffer for storing the data read, with a maximum length of 8192 bytes. - * @param { number } timeout Timeout duration for reading data. The value is a non-negative number. + * @param { int } timeout Timeout duration for reading data. The value is a non-negative number. * The default value 0 indicates that there is no time limit for data reading. - * @returns {number} Length of the data read. + * @returns {int} Length of the data read. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 31400001 Serial port management exception. @@ -189,17 +200,18 @@ declare namespace serialManager { *
1. The transfer was canceled. *
2. The device offered more data than allowed. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function readSync(portId: number, buffer: Uint8Array, timeout?: number): number; + function readSync(portId: int, buffer: Uint8Array, timeout?: int): int; /** * Writes data to a serial port device. This API uses a promise to return the result. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @param { Uint8Array } buffer Buffer for storing the data written, with a maximum length of 128 KB. - * @param { number } timeout Timeout duration for writing data. The value is a non-negative number. + * @param { int } timeout Timeout duration for writing data. The value is a non-negative number. * The default value 0 indicates that there is no time limit for data writing. - * @returns { Promise } Promise used to return the length of the data written. + * @returns { Promise } Promise used to return the length of the data written. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 31400001 Serial port management exception. @@ -210,17 +222,18 @@ declare namespace serialManager { *
1. The transfer was canceled. *
2. The device offered more data than allowed. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function write(portId: number, buffer: Uint8Array, timeout?: number): Promise; + function write(portId: int, buffer: Uint8Array, timeout?: int): Promise; /** * Writes data to a serial port device. This API returns the result synchronously. - * @param { number} portId ID of the target device. For details, see SerialPort.portId. + * @param { int} portId ID of the target device. For details, see SerialPort.portId. * @param { Uint8Array } buffer Buffer for storing the data written, with a maximum length of 128 KB. - * @param { number } timeout Timeout duration for writing data. The value is a non-negative number. + * @param { int } timeout Timeout duration for writing data. The value is a non-negative number. * The default value 0 indicates that there is no time limit for data writing. - * @returns { number } Length of the data written. + * @returns { int } Length of the data written. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 31400001 Serial port management exception. @@ -231,31 +244,35 @@ declare namespace serialManager { *
1. The transfer was canceled. *
2. The device offered more data than allowed. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts{ '1.1':'19','1.2':'20'} + * @arkts 1.1&1.2 */ - function writeSync(portId: number, buffer: Uint8Array, timeout?: number): number; + function writeSync(portId: int, buffer: Uint8Array, timeout?: int): int; /** * Represents a serial port device. * @typedef SerialPort * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ interface SerialPort { /** * Serial port device ID. - * @type { number } + * @type { int } * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ - portId: number; + portId: int; /** * Serial port device name. * @type { string } * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ deviceName: string; } @@ -263,7 +280,8 @@ declare namespace serialManager { * Represents the communication parameters of a serial port device. * @typedef SerialAttribute * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ interface SerialAttribute { @@ -271,7 +289,8 @@ declare namespace serialManager { * Baud rate. * @type { BaudRates } * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ baudRate: BaudRates; @@ -280,7 +299,8 @@ declare namespace serialManager { * @type { DataBits } * @default DATABIT_8 * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ dataBits?: DataBits; @@ -289,7 +309,8 @@ declare namespace serialManager { * @type { Parity } * @default NONE * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ parity?: Parity; @@ -298,43 +319,49 @@ declare namespace serialManager { * @type { StopBits } * @default STOPBIT_1 * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ stopBits?: StopBits; } /** * Enumerates the baud rates of a serial port device, in bit/s. - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ enum BaudRates { /** * The baud rate is 50 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_50 = 50, /** * The baud rate is 75 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_75 = 75, /** * The baud rate is 110 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_110 = 110, /** * The baud rate is 134 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_134 = 134, @@ -342,283 +369,323 @@ declare namespace serialManager { * The baud rate is 150 bit/s. * * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_150 = 150, /** * The baud rate is 200 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_200 = 200, /** * The baud rate is 300 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_300 = 300, /** * The baud rate is 600 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_600 = 600, /** * The baud rate is 1200 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_1200 = 1200, /** * The baud rate is 1800 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_1800 = 1800, /** * The baud rate is 2400 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_2400 = 2400, /** * The baud rate is 4800 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_4800 = 4800, /** * The baud rate is 9600 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_9600 = 9600, /** * The baud rate is 19200 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_19200 = 19200, /** * The baud rate is 38400 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_38400 = 38400, /** * The baud rate is 57600 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_57600 = 57600, /** * The baud rate is 115200 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_115200 = 115200, /** * The baud rate is 230400 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_230400 = 230400, /** * The baud rate is 460800 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_460800 = 460800, /** * The baud rate is 500000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_500000 = 500000, /** * The baud rate is 576000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_576000 = 576000, /** * The baud rate is 921600 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_921600 = 921600, /** * The baud rate is 1000000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_1000000 = 1000000, /** * The baud rate is 1152000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_1152000 = 1152000, /** * The baud rate is 1500000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_1500000 = 1500000, /** * The baud rate is 2000000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_2000000 = 2000000, /** * The baud rate is 2500000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_2500000 = 2500000, /** * The baud rate is 3000000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_3000000 = 3000000, /** * The baud rate is 3500000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_3500000 = 3500000, /** * The baud rate is 4000000 bit/s. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ BAUDRATE_4000000 = 4000000 } /** * Enumerates the data bits of a serial port device. - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ enum DataBits { /** * The number of data bits is 8. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ DATABIT_8 = 8, /** * The number of data bits is 7. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ DATABIT_7 = 7, /** * The number of data bits is 6. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ DATABIT_6 = 6, /** * The number of data bits is 5. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ DATABIT_5 = 5 } /** * Enumerates the parity bits of a serial port device. - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ enum Parity { /** * No parity. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ PARITY_NONE = 0, /** * Odd parity. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ PARITY_ODD = 1, /** * Even parity. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ PARITY_EVEN = 2, /** * Mark parity, whose parity bit is always 1. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ PARITY_MARK = 3, /** * Space parity, whose parity bit is always 0. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ PARITY_SPACE = 4 } /** * Enumerates the stop bits for serial port communication. - * @enum { number } + * @enum { int } * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ enum StopBits { /** * The number of stop bits is 1. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ STOPBIT_1 = 0, /** * The number of stop bits is 2. * @syscap SystemCapability.USB.USBManager.Serial - * @since 19 + * @since arkts {'1.1':'19', '1.2':'20'} + * @arkts 1.1&1.2 */ STOPBIT_2 = 1 } -- Gitee