> If multiple trace tasks with the same name need to be performed at the same time or a trace task needs to be performed multiple times concurrently, different task IDs must be specified in **startTrace**. If the trace tasks with the same name are not performed at the same time, the same taskId can be used. For details, see the bytrace.finishTrace example.
@@ -29,9 +33,6 @@ Marks the start of a timeslice trace task.
...
@@ -29,9 +33,6 @@ Marks the start of a timeslice trace task.
| taskId | number | Yes| ID of a timeslice trace task.|
| taskId | number | Yes| ID of a timeslice trace task.|
| expectedTime | number | No| Expected duration of the trace, in ms.|
| expectedTime | number | No| Expected duration of the trace, in ms.|
> **NOTE**
>
> If multiple trace tasks with the same name need to be performed at the same time or a trace task needs to be performed multiple times concurrently, different task IDs must be specified in **startTrace**. If the trace tasks with the same name are not performed at the same time, the same taskId can be used. For details, see the bytrace.finishTrace example.
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address. |
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| Device pipe, which is used to determine the bus number and device address. |
...
@@ -179,11 +190,13 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
...
@@ -179,11 +190,13 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| force | boolean | No| Whether to forcibly claim the USB interface. The default value is **false**, indicating not to forcibly claim the USB interface. |
| force | boolean | No| Whether to forcibly claim the USB interface. The default value is **false**, indicating not to forcibly claim the USB interface. |
-**Return value**
-**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| number | Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. |
| number | Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. |
-**Example**
-**Example**
```js
```js
letret=usb.claimInterface(devicepipe,interfaces);
letret=usb.claimInterface(devicepipe,interfaces);
console.log(`claimInterface = ${ret}`);
console.log(`claimInterface = ${ret}`);
...
@@ -201,17 +214,20 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c
...
@@ -201,17 +214,20 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device. |
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device. |
...
@@ -343,11 +372,13 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
...
@@ -343,11 +372,13 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout. |
| timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout. |
-**Return value**
-**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<number> | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs. |
| Promise<number> | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs. |
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device. |
| pipe | [USBDevicePipe](#usbdevicepipe) | Yes| USB device pipe, which is used to determine the USB device. |
...
@@ -374,11 +406,13 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
...
@@ -374,11 +406,13 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout. |
| timeout | number | No| Timeout duration. The default value is **0**, indicating no timeout. |
-**Return value**
-**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<number> | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs. |
| Promise<number> | Returns the size of the transmitted or received data block if the control transfer is successful; returns **-1** if an exception occurs. |
-**Example**
-**Example**
```js
```js
// Call usb.getDevices to obtain a data set. Then, obtain a USB device and its access permission.
// Call usb.getDevices to obtain a data set. Then, obtain a USB device and its access permission.
// Pass the obtained USB device as a parameter to usb.connectDevice. Then, call usb.connectDevice to connect the USB device.
// Pass the obtained USB device as a parameter to usb.connectDevice. Then, call usb.connectDevice to connect the USB device.
...
@@ -400,16 +434,19 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
...
@@ -400,16 +434,19 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
@@ -18,7 +18,7 @@ Hiview is a module that provides toolkits for device maintenance across differen
...
@@ -18,7 +18,7 @@ Hiview is a module that provides toolkits for device maintenance across differen
- The Faultlogger plugin processes fault-related events.
- The Faultlogger plugin processes fault-related events.
- The EventLogger plugin collects event-related log information.
- The EventLogger plugin collects event-related log information.
3. On completion of event processing, SysEventPipeline sends the events to the event subscription queue and then dispatches the events to the subscription plugin for processing.
3. On completion of event processing, SysEventPipeline sends the events to the event subscription queue and then dispatches the events to the subscription plugin for processing.