未验证 提交 3135ac01 编写于 作者: O openharmony_ci 提交者: Gitee

!9167 翻译已完成8997+8964+8660+8320+9052

Merge pull request !9167 from shawn_he/8997-a
......@@ -10,6 +10,8 @@ The HTTP request function is mainly implemented by the HTTP module.
To use related APIs, you must declare the **ohos.permission.INTERNET** permission.
For details about how to apply for permissions, see [Access Control Development](../security/accesstoken-guidelines.md).
The following table describes the related APIs.
| API | Description |
......@@ -65,7 +67,7 @@ httpRequest.request(
console.info('cookies:' + data.cookies); // 8+
} else {
console.info('error:' + JSON.stringify(err));
// Call the destroy() method to release resources after the call is complete.
// Call the destroy() method to destroy the request if it is no longer needed.
httpRequest.destroy();
}
}
......
# USB Service Development
The USB service provides the following functions: query of USB device list, bulk data transfer, control transfer, and access permission management.
## When to Use
In Host mode, you can obtain the list of connected devices, enable or disable the devices, manage device access permissions, and perform data transfer or control transfer.
## APIs
The USB service provides the following functions: query of USB device list, bulk data transfer, control transfer, and access permission management.
The following table lists the USB APIs currently available. For details, see the [API Reference](../reference/apis/js-apis-usb.md).
**Table 1** Open USB APIs
......@@ -21,7 +21,7 @@ The following table lists the USB APIs currently available. For details, see the
| setConfiguration(pipe: USBDevicePipe, config: USBConfig): number | Sets the USB device configuration. |
| setInterface(pipe: USBDevicePipe, iface: USBInterface): number | Sets a USB interface. |
| claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number | Claims a USB interface |
| bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise\<number> | Performs bulk transfer. |
| bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise\<number> | Performs bulk transfer. |
| closePipe(pipe: USBDevicePipe): number | Closes a USB device pipe. |
| releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | Releases a USB interface. |
| getFileDescriptor(pipe: USBDevicePipe): number | Obtains the file descriptor. |
......
......@@ -36,7 +36,7 @@ The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
```
```shell
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
......@@ -46,7 +46,7 @@ The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.
In this example, **~/bin** is used as an example installation directory. You can change the directory as needed.
```
```shell
mkdir ~/bin
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/bin/repo
chmod a+x ~/bin/repo
......@@ -55,7 +55,7 @@ The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.
5. Add the path of the **repo** tool to environment variables.
```
```shell
vim ~/.bashrc # Edit environment variables.
export PATH=~/bin:$PATH # Add the path of the **repo** tool to the end of environment variables.
source ~/.bashrc # Apply environment variables.
......@@ -73,7 +73,7 @@ The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
```shell
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
......@@ -81,7 +81,7 @@ The OpenHarmony source code is open to you as [HPM parts](../hpm-part/Readme-EN.
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
```shell
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
......@@ -112,19 +112,19 @@ You must install **Node.js** and HPM on your local PC. The installation procedur
Open the CMD window and run the following command:
```
```shell
npm install -g @ohos/hpm-cli
```
3. Run the following command to check whether the installation is successful. If the HPM version is displayed, the installation is successful.
```
```shell
hpm -V or hpm --version
```
4. Run the following command to upgrade the HPM version:
```
```shell
npm update -g @ohos/hpm-cli
```
......@@ -199,7 +199,7 @@ The table below provides only the sites for downloading the latest OpenHarmony L
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to GitHub. For details, see [Adding a new SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).\)
```
```shell
repo init -u git@github.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
......@@ -207,7 +207,7 @@ repo forall -c 'git lfs pull'
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
```shell
repo init -u https://github.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
......
......@@ -123,9 +123,8 @@ The following table describes the API for initializing a modem vendor library.
3. Run the **hdc\_std shell hilog** command to view the debug log, and check whether the **RilInitOps\(\)** function is successfully executed. The following debug log is for reference:
```
01-01 05:13:23.071 136 2319 D 00000/RilAdapterInit: [RilAdapterDispatch-(hril_hdf.c:55)] sbuf IPC obtain test success!
01-01 05:13:23.071 136 2319 D 00000/RilAdapterInit: [LoadVendor-(hril_hdf.c:33)] RilInit rilInit start
01-01 05:13:23.071 136 2319 D 00000/RilAdapterInit: [LoadVendor -(hril_hdf.c:45)] RilInit rilInit completed
09-02 07:40:47.807 455 455 I 01f08/HrilHdf: [LoadVendor-(hril_hdf.c:148)] RilInit LoadVendor start with rilLibPath:libril_vendor.z.so
09-02 07:40:47.830 455 455 I 01f08/HrilHdf: [LoadVendor-(hril_hdf.c:163)] HRilRegOps completed
```
......@@ -234,19 +233,12 @@ The following table describes the APIs for responding to modem service requests,
4. Open another terminal window, and run the **hdc\_std shell hilog** command. Then, view the log to check whether **ReqDial\(\)** is successfully executed. The following debug log is for reference:
```
01-01 05:27:27.419 136 408 D 02b01/Rilvendor: [SendCommandLock-(at_support.c:210)] SendCommandLock enter, cmd: ATD17620373527
01-01 05:27:27.419 136 408 D 02b01/Rilvendor: [SendCommandLock-(at_support.c:231)] SendCommandLock() command ATD17620373527
01-01 05:27:27.419 136 408 D 02b01/Rilvendor: [WriteATCommand-(channel.c:115)] WriteATCommand enter, cmd:ATD17620373527
01-01 05:27:27.421 136 187 D 02b01/Rilvendor: [ReadResponse-(channel.c:94)] g_bufferCur :
01-01 05:27:27.421 136 187 D 02b01/Rilvendor: OK
01-01 05:27:27.422 136 187 D 02b01/Rilvendor: [ProcessResponse-(at_support.c:144)] processLine line = OK
01-01 05:27:27.422 136 187 D 02b01/Rilvendor: [ReadResponse-(channel.c:81)] ReadResponse enter
01-01 05:27:27.422 136 187 D 02b01/Rilvendor: [ProcessLastResponse-(channel.c:37)] last data more than one line , FindEndOfLine g_bufferCur:
01-01 05:27:27.422 136 187 E 02b01/Rilvendor: [ProcessLastResponse-(channel.c:39)] g_bufferCur endLine is null
01-01 05:27:27.422 136 187 E 02b01/Rilvendor:^ORIG:1,0
01-01 05:27:27.422 136 408 E 02b01/Rilvendor: [SendCommandLock-(at_support.c:234)] processLine line = ^ORIG:1,0
01-01 05:27:27.422 136 408 E 02b01/Rilvendor: [SendCommandLock-(vendor_report.c:234)] enter to [^ORIG:1,0]: (null)
01-01 05:27:27.422 136 408 E 02b01/Rilvendor: [SendCommandLock-(at_support.c:264)] err = 0, cmd:ADT17620373527
09-02 07:55:09.073 455 2059 I 01f08/RilVendor: [SendCommandLock-(at_support.c:226)] command ATD18675231804;, NeedATPause:0, atCmd:AT
09-02 07:55:09.099 455 2053 I 01f08/Rilvendor: [ProcessResponse-(at_support.c:159)] processLine line = OK
09-02 07:55:09.100 455 2053 E 01f08/RilVendor: [ReportStrWith-(vendor_util.c:63)] str or prefix parameter is null.
09-02 07:55:09.100 455 2053 E 01f08/RilVendor: [ProcessLastResponse-(vendor_channel.c:77)] g_bufferCur endLine is null
09-02 07:55:09.100 455 2059 I 01f08/RilVendor: [SendCommandLock-(at_support.c:243)] err = 0
09-02 07:55:09.100 455 2053 I 01f08/RilVendor: [ProcessResponse-(at_support.c:159)] processLine line = ^ORIG:1,0
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册