From 6643fe3369f33c2fdf8f2255ac447c36a573227d Mon Sep 17 00:00:00 2001 From: fengliucs Date: Tue, 17 Jun 2025 14:31:24 +0800 Subject: [PATCH] =?UTF-8?q?USB=E7=9A=84=E6=8E=A5=E5=8F=A3=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fengliucs --- api/@ohos.usbManager.d.ts | 3 ++- api/@ohos.usbManager.serial.d.ts | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/api/@ohos.usbManager.d.ts b/api/@ohos.usbManager.d.ts index 892c6685f0..1434a6213d 100644 --- a/api/@ohos.usbManager.d.ts +++ b/api/@ohos.usbManager.d.ts @@ -2374,12 +2374,13 @@ declare namespace usbManager { * @param { USBDevicePipe } pipe - Represents a USB device,which is the target object to be restarted.It cannot be empty. * @returns { boolean } If the restart operation is successful, return {@code true}; if the restart operation fails, return {@code false}. * @throws { BusinessError } 801 - Capability not supported. + * @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 } 14400008 - No such device(it may have been disconnected) * @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..2e9cbc1ac4 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. @@ -172,7 +176,8 @@ declare namespace serialManager { * 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 { 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 {number} 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 +197,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 +218,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