From 492c794f07ef73761eb22a88262bd77ce7dd75cc Mon Sep 17 00:00:00 2001 From: luzhiye Date: Tue, 17 Jun 2025 15:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=80=E8=87=B4=E6=80=A7?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: luzhiye --- api/@ohos.usbManager.d.ts | 6 +++--- api/@ohos.usbManager.serial.d.ts | 16 +++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/api/@ohos.usbManager.d.ts b/api/@ohos.usbManager.d.ts index 892c6685f0..18bc9923bb 100644 --- a/api/@ohos.usbManager.d.ts +++ b/api/@ohos.usbManager.d.ts @@ -968,7 +968,7 @@ declare namespace usbManager { * @throws { BusinessError } 401 - Parameter error. Possible causes: *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. - * @throws { BusinessError } 14400001 - Permission denied. Call requestAccessoryRight to get the right first. + * @throws { BusinessError } 14400001 - Access right denied. Call requestRight to get the USBDevicePipe access right first. * @throws { BusinessError } 14400004 - Service exception. Possible causes: *
1. No accessory is plugged in. * @throws { BusinessError } 14401001 - The target USBAccessory not matched. @@ -986,7 +986,7 @@ declare namespace usbManager { *
1. Mandatory parameters are left unspecified. *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 14400001 - Permission denied. Call requestAccessoryRight to get the right first. + * @throws { BusinessError } 14400001 - Access right denied. Call requestRight to get the USBDevicePipe access right first. * @throws { BusinessError } 14400004 - Service exception. Possible causes: *
1. No accessory is plugged in. * @throws { BusinessError } 14401001 - The target USBAccessory not matched. @@ -2379,7 +2379,7 @@ declare namespace usbManager { * @throws { BusinessError } 14400010 - Other USB error. Possible causes: *
1.Unrecognized discard error code. * @throws { BusinessError } 14400013 - The USBDevicePipe validity check failed. Possible causes: - *
1.The input parameters fails the validation check. + *
1.The input parameters fail the validation check. *
2.The call chain used to obtain the input parameters is not reasonable. * @syscap SystemCapability.USB.USBManager * @since 20 diff --git a/api/@ohos.usbManager.serial.d.ts b/api/@ohos.usbManager.serial.d.ts index d458a2b833..75b9f30309 100644 --- a/api/@ohos.usbManager.serial.d.ts +++ b/api/@ohos.usbManager.serial.d.ts @@ -51,8 +51,11 @@ declare namespace serialManager { /** * 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. - * @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. + * @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. @@ -152,7 +155,8 @@ declare namespace serialManager { * 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 { 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. + * @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. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. @@ -192,7 +196,8 @@ declare namespace serialManager { * 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 { 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. + * @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. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. @@ -212,7 +217,8 @@ declare namespace serialManager { * 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 { 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. + * @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. * @throws { BusinessError } 401 Parameter error. Possible causes: * 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. -- Gitee