未验证 提交 488f809c 编写于 作者: O openharmony_ci 提交者: Gitee

!14025 翻译完成:13133 Sync worker document change

Merge pull request !14025 from wusongqing/TR13133
...@@ -26,7 +26,7 @@ The following table lists the USB APIs currently available. For details, see the ...@@ -26,7 +26,7 @@ The following table lists the USB APIs currently available. For details, see the
| releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | Releases a USB interface. | | releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | Releases a USB interface. |
| getFileDescriptor(pipe: USBDevicePipe): number | Obtains the file descriptor. | | getFileDescriptor(pipe: USBDevicePipe): number | Obtains the file descriptor. |
| getRawDescriptor(pipe: USBDevicePipe): Uint8Array | Obtains the raw USB descriptor. | | getRawDescriptor(pipe: USBDevicePipe): Uint8Array | Obtains the raw USB descriptor. |
| controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout ?: number): Promise\<number> | Performs control transfer. | | controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout ?: number): Promise\<number> | Performs control transfer. |
## How to Develop ## How to Develop
...@@ -118,11 +118,11 @@ You can set a USB device as the USB host to connect to other USB devices for dat ...@@ -118,11 +118,11 @@ You can set a USB device as the USB host to connect to other USB devices for dat
4. Perform data transfer. 4. Perform data transfer.
```js ```js
/* /*
Read data. Select the corresponding RX endpoint from deviceList for data transfer. Read data. Select the corresponding RX endpoint from deviceList for data transfer.
(endpoint.direction == 0x80); dataUint8Array indicates the data to read. The data type is Uint8Array. (endpoint.direction == 0x80); dataUint8Array indicates the data to read. The data type is Uint8Array.
*/ */
let inEndpoint = interface1.endpoints[2]; let inEndpoint = interface1.endpoints[2];
let outEndpoint = interface1.endpoints[1]; let outEndpoint = interface1.endpoints[1];
let dataUint8Array = new Uint8Array(1024); let dataUint8Array = new Uint8Array(1024);
...@@ -147,7 +147,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat ...@@ -147,7 +147,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat
}).catch(error => { }).catch(error => {
console.info("usb writeData error : " + JSON.stringify(error)); console.info("usb writeData error : " + JSON.stringify(error));
}); });
``` ```
5. Release the USB interface, and close the USB device. 5. Release the USB interface, and close the USB device.
......
...@@ -107,7 +107,7 @@ In the FA model: ...@@ -107,7 +107,7 @@ In the FA model:
"buildOption": { "buildOption": {
"sourceOption": { "sourceOption": {
"workers": [ "workers": [
"./src/main/ets/entryability/workers/worker.ts" "./src/main/ets/MainAbility/workers/worker.ts"
] ]
} }
} }
...@@ -1192,7 +1192,7 @@ In the FA model: ...@@ -1192,7 +1192,7 @@ In the FA model:
"buildOption": { "buildOption": {
"sourceOption": { "sourceOption": {
"workers": [ "workers": [
"./src/main/ets/entryability/workers/worker.ts" "./src/main/ets/MainAbility/workers/worker.ts"
] ]
} }
} }
...@@ -2114,7 +2114,7 @@ Configuration of the **build-profile.json5** file: ...@@ -2114,7 +2114,7 @@ Configuration of the **build-profile.json5** file:
"buildOption": { "buildOption": {
"sourceOption": { "sourceOption": {
"workers": [ "workers": [
"./src/main/ets/entryability/workers/worker.ts" "./src/main/ets/MainAbility/workers/worker.ts"
] ]
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册