diff --git a/api/@ohos.app.ability.DriverExtensionAbility.d.ts b/api/@ohos.app.ability.DriverExtensionAbility.d.ts index e2573372ec5691c21f44fe38eaeb4bfc434e5924..bd373b2c2dafeac3ac7678d100dc510122c7ed78 100644 --- a/api/@ohos.app.ability.DriverExtensionAbility.d.ts +++ b/api/@ohos.app.ability.DriverExtensionAbility.d.ts @@ -27,7 +27,8 @@ import _DriverExtensionContext from './application/DriverExtensionContext'; * * @typedef { _DriverExtensionContext } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ export type DriverExtensionContext = _DriverExtensionContext; @@ -35,16 +36,18 @@ export type DriverExtensionContext = _DriverExtensionContext; * class of driver extension ability. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ -export default class DriverExtensionAbility { +declare class DriverExtensionAbility { /** * Indicates driver extension ability context. * * @type { DriverExtensionContext } * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ context: DriverExtensionContext; @@ -53,7 +56,8 @@ export default class DriverExtensionAbility { * @param { Want } want - Indicates the want of created driver extension. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onInit(want: Want): void; @@ -61,7 +65,8 @@ export default class DriverExtensionAbility { * Called back before a driver extension is destroyed. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onRelease(): void; @@ -71,7 +76,8 @@ export default class DriverExtensionAbility { * @returns { rpc.RemoteObject | Promise } Rpc remoteObject. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onConnect(want: Want): rpc.RemoteObject | Promise; @@ -85,6 +91,17 @@ export default class DriverExtensionAbility { */ onDisconnect(want: Want): void | Promise; + /** + * Called back when all abilities connected to a driver extension are disconnected. + * @param { Want } want - Indicates disconnection information about the driver extension. + * @returns { undefined | Promise } + * @syscap SystemCapability.Driver.ExternalDevice + * @stagemodelonly + * @since 20 + * @arkts 1.2 + */ + onDisconnect(want: Want): undefined | Promise; + /** * Called when dump client information is required. * It is recommended that developers don't DUMP sensitive information. @@ -92,7 +109,17 @@ export default class DriverExtensionAbility { * @returns { Array } The dump info array. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ onDump(params: Array): Array; } + +/** + * class of driver extension ability. + * @syscap SystemCapability.Driver.ExternalDevice + * @stagemodelonly + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 + */ +export default DriverExtensionAbility; diff --git a/api/@ohos.driver.deviceManager.d.ts b/api/@ohos.driver.deviceManager.d.ts index 86be9a130bb65a9a972b6dde00767d8960fa2bd0..df0effd0de7826ffcd4d7fb5d8d187383823b446 100644 --- a/api/@ohos.driver.deviceManager.d.ts +++ b/api/@ohos.driver.deviceManager.d.ts @@ -26,21 +26,23 @@ import type rpc from './@ohos.rpc'; * * @namespace deviceManager * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace deviceManager { /** * Query the external device list. * * @permission ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER - * @param { number } busType - The bus type of device to be queried. + * @param { int } busType - The bus type of device to be queried. * @returns { Array> } External device list. * @throws { BusinessError } 201 - The permission check failed. * @throws { BusinessError } 22900001 - ExternalDeviceManager service exception or busType parameter error. * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - function queryDevices(busType?: number): Array>; + function queryDevices(busType?: int): Array>; /** * Bind the device based on the device information returned by queryDevices(). @@ -57,7 +59,7 @@ declare namespace deviceManager { * @throws { BusinessError } 22900001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @since 10 - * @deprecated since 19 + * @deprecated since 18 * @useinstead ohos.driver.deviceManager/deviceManager#bindDriverWithDeviceId */ function bindDevice(deviceId: number, onDisconnect: AsyncCallback, @@ -78,7 +80,7 @@ declare namespace deviceManager { * @throws { BusinessError } 22900001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @since 11 - * @deprecated since 19 + * @deprecated since 18 * @useinstead ohos.driver.deviceManager/deviceManager#bindDriverWithDeviceId */ function bindDeviceDriver(deviceId: number, onDisconnect: AsyncCallback, @@ -99,7 +101,7 @@ declare namespace deviceManager { * @throws { BusinessError } 22900001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @since 10 - * @deprecated since 19 + * @deprecated since 18 * @useinstead ohos.driver.deviceManager/deviceManager#bindDriverWithDeviceId */ function bindDevice(deviceId: number, onDisconnect: AsyncCallback): Promise<{deviceId: number; @@ -119,7 +121,7 @@ declare namespace deviceManager { * @throws { BusinessError } 22900001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @since 11 - * @deprecated since 19 + * @deprecated since 18 * @useinstead ohos.driver.deviceManager/deviceManager#bindDriverWithDeviceId */ function bindDeviceDriver(deviceId: number, onDisconnect: AsyncCallback): Promise; @@ -135,7 +137,7 @@ declare namespace deviceManager { * @throws { BusinessError } 22900001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @since 10 - * @deprecated since 19 + * @deprecated since 18 * @useinstead ohos.driver.deviceManager/deviceManager#unbindDriverWithDeviceId */ function unbindDevice(deviceId: number, callback: AsyncCallback): void; @@ -152,7 +154,7 @@ declare namespace deviceManager { * @throws { BusinessError } 22900001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @since 10 - * @deprecated since 19 + * @deprecated since 18 * @useinstead ohos.driver.deviceManager/deviceManager#unbindDriverWithDeviceId */ function unbindDevice(deviceId: number): Promise; @@ -161,7 +163,7 @@ declare namespace deviceManager { * Queries external device information. * * @permission ohos.permission.ACCESS_EXTENSIONAL_DEVICE_DRIVER - * @param { number } deviceId - ID of device to query. + * @param { long } deviceId - ID of device to query. * @returns { Array> } Device information obtained. * @throws { BusinessError } 201 - The permission check failed. * @throws { BusinessError } 202 - Permission denied. A non-system application cannot call a system API. @@ -169,9 +171,10 @@ declare namespace deviceManager { * @throws { BusinessError } 26300001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - function queryDeviceInfo(deviceId?: number): Array>; + function queryDeviceInfo(deviceId?: long): Array>; /** * Queries driver information. @@ -185,53 +188,58 @@ declare namespace deviceManager { * @throws { BusinessError } 26300001 - ExternalDeviceManager service exception. * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ function queryDriverInfo(driverUid?: string): Array>; - /** - * Bind the device based on the device information returned by queryDevices(). - * - * @permission ohos.permission.ACCESS_DDK_DRIVERS - * @param { number } deviceId - Device id on the device list returned by queryDevices(). - * @param { AsyncCallback } onDisconnect - Callback is invoked when device is disconnected after bind - * success. - * @returns { Promise } Indicates the bind result including device ID and remote object. - * @throws { BusinessError } 201 - The permission check failed. - * @throws { BusinessError } 26300001 - ExternalDeviceManager service exception. - * @throws { BusinessError } 26300002 - The driver service does not allow any client to bind. - * @syscap SystemCapability.Driver.ExternalDevice - * @since 19 - */ - function bindDriverWithDeviceId(deviceId: number, onDisconnect: AsyncCallback): Promise; +/** +* Bind the device based on the device information returned by queryDevices(). +* +* @permission ohos.permission.ACCESS_DDK_DRIVERS +* @param { long } deviceId - Device id on the device list returned by queryDevices(). +* @param { AsyncCallback } onDisconnect - Callback is invoked when device is disconnected after bind +* success. +* @returns { Promise } Indicates the bind result including device ID and remote object. +* @throws { BusinessError } 201 - The permission check failed. +* @throws { BusinessError } 26300001 - ExternalDeviceManager service exception. +* @throws { BusinessError } 26300002 - The driver service does not allow any client to bind. +* @syscap SystemCapability.Driver.ExternalDevice +* @since arkts{ '1.1':'19','1.2':'20'} +* @arkts 1.1&1.2 +*/ + function bindDriverWithDeviceId(deviceId: long, onDisconnect: AsyncCallback): Promise; - /** - * Unbind the device based on the device information returned by queryDevices(). - * - * @permission ohos.permission.ACCESS_DDK_DRIVERS - * @param { number } deviceId - Device id on the device list returned by queryDevices(). - * @returns { Promise } - Indicates the unbind result invoked when unbind is finished. - * @throws { BusinessError } 201 - The permission check failed. - * @throws { BusinessError } 26300001 - ExternalDeviceManager service exception. - * @throws { BusinessError } 26300003 - There is no binding relationship. - * @syscap SystemCapability.Driver.ExternalDevice - * @since 19 - */ - function unbindDriverWithDeviceId(deviceId: number): Promise; +/** +* Unbind the device based on the device information returned by queryDevices(). +* +* @permission ohos.permission.ACCESS_DDK_DRIVERS +* @param { long } deviceId - Device id on the device list returned by queryDevices(). +* @returns { Promise } - Indicates the unbind result invoked when unbind is finished. +* @throws { BusinessError } 201 - The permission check failed. +* @throws { BusinessError } 26300001 - ExternalDeviceManager service exception. +* @throws { BusinessError } 26300003 - There is no binding relationship. +* @syscap SystemCapability.Driver.ExternalDevice +* @since arkts{ '1.1':'19','1.2':'20'} +* @arkts 1.1&1.2 +*/ + function unbindDriverWithDeviceId(deviceId: long): Promise; /** * Enumerates the bus types. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ export enum BusType { /** * USB device type * * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ USB = 1, } @@ -241,7 +249,8 @@ declare namespace deviceManager { * * @typedef Device * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ interface Device { /** @@ -249,25 +258,28 @@ declare namespace deviceManager { * * @type { BusType } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ busType: BusType; /** * Device ID. * - * @type { number } + * @type { long } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - deviceId: number; + deviceId: long; /** * Description of the device. * * @type { string } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ description: string; } @@ -278,26 +290,29 @@ declare namespace deviceManager { * @typedef USBDevice * @extends Device * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBDevice extends Device { /** * Vendor ID. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - vendorId: number; + vendorId: int; /** * Product ID. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ - productId: number; + productId: int; } /** @@ -305,24 +320,27 @@ declare namespace deviceManager { * * @typedef RemoteDeviceDriver * @syscap SystemCapability.Driver.ExternalDevice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ interface RemoteDeviceDriver { /** * Device ID. * - * @type { number } + * @type { long } * @syscap SystemCapability.Driver.ExternalDevice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ - deviceId: number; + deviceId: long; /** * Remote driver object. * * @type { rpc.IRemoteObject } * @syscap SystemCapability.Driver.ExternalDevice - * @since 11 + * @since arkts {'1.1':'11', '1.2':'20'} + * @arkts 1.1&1.2 */ remote: rpc.IRemoteObject; } @@ -333,48 +351,53 @@ declare namespace deviceManager { * @typedef USBInterfaceDesc * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBInterfaceDesc { /** * Interface number. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - bInterfaceNumber: number; + bInterfaceNumber: int; /** * Interface class code. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - bClass: number; + bClass: int; /** * Interface subclass code. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - bSubClass: number; + bSubClass: int; /** * Interface protocol. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - bProtocol: number; + bProtocol: int; } @@ -384,18 +407,20 @@ declare namespace deviceManager { * @typedef DeviceInfo * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ interface DeviceInfo { /** * Device ID. * - * @type { number } + * @type { long } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - deviceId: number; + deviceId: long; /** * Whether the device has a matched driver. @@ -403,7 +428,8 @@ declare namespace deviceManager { * @type { boolean } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ isDriverMatched: boolean; @@ -413,7 +439,8 @@ declare namespace deviceManager { * @type { ?string } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ driverUid?: string; } @@ -425,28 +452,31 @@ declare namespace deviceManager { * @extends DeviceInfo * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBDeviceInfo extends DeviceInfo { /** * Vendor ID. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - vendorId: number; + vendorId: int; /** * Product ID. * - * @type { number } + * @type { int } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - productId: number; + productId: int; /** * List of USB interface descriptors. @@ -454,7 +484,8 @@ declare namespace deviceManager { * @type { Array> } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ interfaceDescList: Array>; } @@ -465,7 +496,8 @@ declare namespace deviceManager { * @typedef DriverInfo * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ interface DriverInfo { /** @@ -474,7 +506,8 @@ declare namespace deviceManager { * @type { BusType } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ busType: BusType; @@ -484,7 +517,8 @@ declare namespace deviceManager { * @type { string } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ driverUid: string; @@ -494,7 +528,8 @@ declare namespace deviceManager { * @type { string } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ driverName: string; @@ -504,7 +539,8 @@ declare namespace deviceManager { * @type { string } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ driverVersion: string; @@ -514,7 +550,8 @@ declare namespace deviceManager { * @type { string } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ driverSize: string; @@ -524,7 +561,8 @@ declare namespace deviceManager { * @type { string } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ description: string; } @@ -536,28 +574,31 @@ declare namespace deviceManager { * @extends DriverInfo * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ interface USBDriverInfo extends DriverInfo { /** * IDs of supported products. * - * @type { Array } + * @type { Array } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - productIdList: Array; + productIdList: Array; /** * IDs of supported vendors. * - * @type { Array } + * @type { Array } * @syscap SystemCapability.Driver.ExternalDevice * @systemapi - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - vendorIdList: Array; + vendorIdList: Array; } } diff --git a/api/@ohos.usbManager.serial.d.ts b/api/@ohos.usbManager.serial.d.ts index 621b6a5918e014125856affabd2c68a989565107..838f6c3b509e92bd7f6093ed21ec1b89f170e432 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,214 +31,230 @@ 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. * @throws { BusinessError } 14400005 Database operation exception. * @throws { BusinessError } 31400001 Serial port management exception. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device 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. * @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. * @throws { BusinessError } 31400001 Serial port management exception. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device 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: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 14400005 Database operation exception. * @throws { BusinessError } 31400001 Serial port management exception. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device 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. * @throws { BusinessError } 31400001 Serial port management exception. * @throws { BusinessError } 31400002 Access denied. Call requestSerialRight to request user authorization first. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device 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. * @throws { BusinessError } 31400002 Access denied. Call requestSerialRight to request user authorization first. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device 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 } 31400003 Device 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. * @throws { BusinessError } 31400001 Serial port management exception. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device 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. * @throws { BusinessError } 31400001 Serial port management exception. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device 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. 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. + * @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. * @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 } 31400003 Device does not exist. * @throws { BusinessError } 31400005 The serial port device is not opened. Call the open API first. * @throws { BusinessError } 31400006 Data transfer timed out. * @throws { BusinessError } 31400007 I/O exception. Possible causes: *
1. The transfer was canceled. - *
2. The device offered more data than allowed. + *
2. The device offered more data. * @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. The default value 0 indicates that there is no time limit for data reading. - * @returns {number} Length of the data read. + * @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 { 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. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device does not exist. * @throws { BusinessError } 31400005 The serial port device is not opened. Call the open API first. * @throws { BusinessError } 31400006 Data transfer timed out. * @throws { BusinessError } 31400007 I/O exception. Possible causes: *
1. The transfer was canceled. - *
2. The device offered more data than allowed. + *
2. The device offered more data. * @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. 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. + * @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. * @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 } 31400003 Device does not exist. * @throws { BusinessError } 31400005 The serial port device is not opened. Call the open API first. * @throws { BusinessError } 31400006 Data transfer timed out. * @throws { BusinessError } 31400007 I/O exception. Possible causes: *
1. The transfer was canceled. - *
2. The device offered more data than allowed. + *
2. The device offered more data. * @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. The default value 0 indicates that there is no time limit for data writing. - * @returns { number } Length of the data written. + * @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 { 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. - * @throws { BusinessError } 31400003 PortId does not exist. + * @throws { BusinessError } 31400003 Device does not exist. * @throws { BusinessError } 31400005 The serial port device is not opened. Call the open API first. * @throws { BusinessError } 31400006 Data transfer timed out. * @throws { BusinessError } 31400007 I/O exception. Possible causes: *
1. The transfer was canceled. - *
2. The device offered more data than allowed. + *
2. The device offered more data. * @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; } @@ -245,7 +262,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 { @@ -253,7 +271,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; @@ -262,7 +281,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; @@ -271,7 +291,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; @@ -280,43 +301,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, @@ -324,286 +351,326 @@ 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 } } -export default serialManager; \ No newline at end of file +export default serialManager; diff --git a/api/application/DriverExtensionContext.d.ts b/api/application/DriverExtensionContext.d.ts index 6a87f00f86f6edd33cbbc860c39e688e07c8f4d7..6c64f808fd6632b45f20ab1af840ebbf1123ef4a 100644 --- a/api/application/DriverExtensionContext.d.ts +++ b/api/application/DriverExtensionContext.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -27,16 +27,26 @@ import ExtensionContext from './ExtensionContext'; * @extends ExtensionContext * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ -export default class DriverExtensionContext extends ExtensionContext { - - +declare class DriverExtensionContext extends ExtensionContext { /** * update the state of driver extension. * @syscap SystemCapability.Driver.ExternalDevice * @StageModelOnly - * @since 10 + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 */ updateDriverState(): void; -} \ No newline at end of file +} +/** + * Define a DriverExtensionContext. + * + * @typedef { DriverExtensionContext } + * @syscap SystemCapability.Driver.ExternalDevice + * @stagemodelonly + * @since arkts {'1.1':'10', '1.2':'20'} + * @arkts 1.1&1.2 + */ +export default DriverExtensionContext;