提交 50c57147 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 6232cd1a
......@@ -8,7 +8,7 @@ In Host mode, you can obtain the list of connected USB devices, enable or disabl
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).
The following table lists the USB APIs currently available. For details, see the [API Reference](../reference/apis/js-apis-usbManager.md).
**Table 1** Open USB APIs
......@@ -18,7 +18,7 @@ The following table lists the USB APIs currently available. For details, see the
| requestRight(deviceName: string): Promise\<boolean> | Requests the temporary permission for a given application to access the USB device. This API uses a promise to return the result. |
| connectDevice(device: USBDevice): Readonly\<USBDevicePipe> | Connects to the USB device based on the device list returned by `getDevices()`. |
| getDevices(): Array<Readonly\<USBDevice>> | Obtains the list of USB devices connected to the USB host. If no USB device is connected, an empty list is returned. |
| setConfiguration(pipe: USBDevicePipe, config: USBConfig): number | Sets the USB device configuration. |
| setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): 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. |
......@@ -36,7 +36,7 @@ You can set a USB device as the USB host to connect to other USB devices for dat
```js
// Import the USB API package.
import usb from '@ohos.usbV9';
import usb from '@ohos.usbManager';
// Obtain the USB device list.
let deviceList = usb.getDevices();
/*
......
......@@ -313,7 +313,7 @@
- [@ohos.systemParameterV9 (System Parameter)](js-apis-system-parameterV9.md)
- [@ohos.thermal (Thermal Management)](js-apis-thermal.md)
- [@ohos.update (Update)](js-apis-update.md)
- [@ohos.usbV9 (USB Management)](js-apis-usb.md)
- [@ohos.usbManager (USB Management)](js-apis-usbManager.md)
- [@ohos.vibrator (Vibrator)](js-apis-vibrator.md)
- Account Management
- [@ohos.account.appAccount (App Account Management)](js-apis-appAccount.md)
......@@ -371,7 +371,7 @@
- [@ohos.reminderAgent (Reminder Agent)](js-apis-reminderAgent.md)
- [@ohos.statfs (statfs)](js-apis-statfs.md)
- [@ohos.systemParameter (System Parameter)](js-apis-system-parameter.md)
- [@ohos.usb (USB Management)](js-apis-usb-deprecated.md)
- [@ohos.usbV9 (USB Management)](js-apis-usb.md)
- [@system.app (Application Context)](js-apis-system-app.md)
- [@system.battery (Battery Information)](js-apis-system-battery.md)
- [@system.bluetooth (Bluetooth)](js-apis-system-bluetooth.md)
......
......@@ -5,6 +5,7 @@ The **usb** module provides USB device management functions, including USB devic
> **NOTE**
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> This module is deprecated since API version 9. You are advised to use [`@ohos.usbManager`](js-apis-usbManager.md) instead.
## Modules to Import
......
此差异已折叠。
# Telephony Subsystem Changelog
## cl.telephony.1 Radio Module API Change
### Changed the `isNrSupported` API in the radio module of the telephone subsystem:
NR is a proper noun and must be capitalized.
You need to adapt your application.
**Change Impacts**
The JS API needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected.
**Key API/Component Changes**
- Involved APIs:
isNrSupported(): boolean;
isNrSupported(slotId: number): boolean;
- Before change:
```js
function isNrSupported(): boolean;
function isNrSupported(slotId: number): boolean;
```
- After change:
```js
function isNRSupported(): boolean;
function isNRSupported(slotId: number): boolean;
```
**Adaptation Guide**
Use the new API. The sample code is as follows:
```js
let result = radio.isNrSupported();
console.log("Result: "+ result);
```
```js
let slotId = 0;
let result = radio.isNRSupported(slotId);
console.log("Result: "+ result);
```
# Telephony Subsystem ChangeLog
# Telephony Subsystem Changelog
......@@ -56,4 +56,4 @@ promise.then(data => {
}).catch(err => {
console.error(`isImsSmsSupported failed, promise: err->${JSON.stringify(err)}`);
});
```
```
\ No newline at end of file
# USB Subsystem API Changelog
## cl.usb_manager.1 Bundle Name Change
For applications developed based on earlier versions, you need to change the name of the imported bundle. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
| Original Bundle Name | New Bundle Name |
|------------------ | ------------------- |
| ohos.usbV9.d.ts | ohos.usbManager.d.ts |
**Adaptation Guide**
Change **@ohos.usbV9** to **@ohos.usbManager** when importing the bundle.
## cl.usb_manager.2 API Parameter Type Change
For applications developed based on earlier versions, you need to modify the parameter type. Otherwise, the original service logic will be affected.
**Key API/Component Changes**
| Original Class Name | New Class Name |
|---------------| ------------- |
| interface USBConfig | interface USBConfiguration |
| Original Namespace | New Namespace |
|---------------| ------------- |
| @namespace usbV9 | @namespace usbManager |
| Bundle Name | Original API | New API |
| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| ohos.usbManager.d.ts | function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number; |
**Adaptation Guide**
When calling **setConfiguration**, change the parameter type from **USBConfig** to **USBConfiguration**.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册