提交 135bd4ac 编写于 作者: S shawn_he

update doc

Signed-off-by: Nshawn_he <shawn.he@huawei.com>
上级 94b29e69
...@@ -77,43 +77,48 @@ When designing a color picker, you can have the mouse pointer switched to the co ...@@ -77,43 +77,48 @@ When designing a color picker, you can have the mouse pointer switched to the co
5. Set the mouse pointer to the default style. 5. Set the mouse pointer to the default style.
```js ```js
import pointer from '@ohos.multimodalInput.pointer';
import window from '@ohos.window'; import window from '@ohos.window';
// 1. Enable the color pickup function. // 1. Enable the color pickup function.
// 2. Obtain the window ID. // 2. Obtain the window ID.
window.getTopWindow((error, windowClass) => { window.getLastWindow(this.context, (error, windowClass) => {
windowClass.getProperties((error, data) => { if (error.code) {
var windowId = data.id; console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(error));
if (windowId < 0) { return;
console.log(`Invalid windowId`); }
return; var windowId = windowClass.getWindowProperties().id;
} if (windowId < 0) {
try { console.log(`Invalid windowId`);
// 3. Set the mouse pointer to the color picker style. return;
pointer.setPointerStyle(windowId, pointer.PointerStyle.COLOR_SUCKER).then(() => { }
console.log(`Successfully set mouse pointer style`); try {
}); // 3. Set the mouse pointer to the color picker style.
} catch (error) { pointer.setPointerStyle(windowId, pointer.PointerStyle.COLOR_SUCKER).then(() => {
console.log(`Failed to set the pointer style, error=${JSON.stringify(error)}, msg=${JSON.stringify(message)}`); console.log(`Successfully set mouse pointer style`);
} });
}); } catch (error) {
console.log(`Failed to set the pointer style, error=${JSON.stringify(error)}, msg=${JSON.stringify(`message`)}`);
}
}); });
// 4. End color pickup. // 4. End color pickup.
window.getTopWindow((error, windowClass) => { window.getLastWindow(this.context, (error, windowClass) => {
windowClass.getProperties((error, data) => { if (error.code) {
var windowId = data.id; console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(error));
if (windowId < 0) { return;
console.log(`Invalid windowId`); }
return; var windowId = windowClass.getWindowProperties().id;
} if (windowId < 0) {
try { console.log(`Invalid windowId`);
// 5. Set the mouse pointer to the default style. return;
pointer.setPointerStyle(windowId, pointer.PointerStyle.DEFAULT).then(() => { }
console.log(`Successfully set mouse pointer style`); try {
}); // 5. Set the mouse pointer to the default style.
} catch (error) { pointer.setPointerStyle(windowId, pointer.PointerStyle.DEFAULT).then(() => {
console.log(`Failed to set the pointer style, error=${JSON.stringify(error)}, msg=${JSON.stringify(message)}`); console.log(`Successfully set mouse pointer style`);
} });
}); } catch (error) {
console.log(`Failed to set the pointer style, error=${JSON.stringify(error)}, msg=${JSON.stringify(`message`)}`);
}
}); });
``` ```
...@@ -12,11 +12,11 @@ Application error management APIs are provided by the **errorManager** module. F ...@@ -12,11 +12,11 @@ Application error management APIs are provided by the **errorManager** module. F
| API | Description | | API | Description |
| ------------------------------------------------------------ | ---------------------------------------------------- | | ------------------------------------------------------------ | ---------------------------------------------------- |
| registerErrorObserver(observer: ErrorObserver): number | Registers an observer for application errors. A callback will be invoked when an application error is detected. This API works in a synchronous manner. The return value is the SN of the registered observer.| | on(type: "error", observer: ErrorObserver): number | Registers an observer for application errors. A callback will be invoked when an application error is detected. This API works in a synchronous manner. The return value is the SN of the registered observer.|
| unregisterErrorObserver(observerId: number, callback: AsyncCallback\<void\>): void | Unregisters an observer in callback mode. The number passed to this API is the SN of the registered observer. | | off(type: "error", observerId: number, callback: AsyncCallback\<void\>): void | Unregisters an observer in callback mode. The number passed to this API is the SN of the registered observer. |
| unregisterErrorObserver(observerId: number): Promise\<void\> | Unregisters an observer in promise mode. The number passed to this API is the SN of the registered observer. | | off(type: "error", observerId: number): Promise\<void\> | Unregisters an observer in promise mode. The number passed to this API is the SN of the registered observer. |
When an asynchronous callback is used, the return value can be processed directly in the callback. If a promise is used, the return value can also be processed in the promise in a similar way. For details about the result codes, see [Result Codes for Unregistering an Observer](#result-codes-for-unregistering-an-observer). When an asynchronous callback is used, the return value can be processed directly in the callback. If a promise is used, the return value can also be processed in the promise in a similar way. For details about the result codes, see [Result Codes for Unregistering an Observer](#result codes-for-unregistering-an-observer).
**Table 2** Description of the ErrorObserver API **Table 2** Description of the ErrorObserver API
...@@ -36,7 +36,7 @@ When an asynchronous callback is used, the return value can be processed directl ...@@ -36,7 +36,7 @@ When an asynchronous callback is used, the return value can be processed directl
## Development Example ## Development Example
```ts ```ts
import Ability from '@ohos.application.Ability' import UIAbility from '@ohos.app.ability.UIAbility';
import errorManager from '@ohos.app.ability.errorManager'; import errorManager from '@ohos.app.ability.errorManager';
let registerId = -1; let registerId = -1;
...@@ -45,15 +45,16 @@ let callback = { ...@@ -45,15 +45,16 @@ let callback = {
console.log(errMsg); console.log(errMsg);
} }
} }
export default class MainAbility extends Ability {
export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) { onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate") console.log("[Demo] EntryAbility onCreate")
registerId = errorManager.on("error", callback); registerId = errorManager.on("error", callback);
globalThis.abilityWant = want; globalThis.abilityWant = want;
} }
onDestroy() { onDestroy() {
console.log("[Demo] MainAbility onDestroy") console.log("[Demo] EntryAbility onDestroy")
errorManager.off("error", registerId, (result) => { errorManager.off("error", registerId, (result) => {
console.log("[Demo] result " + result.code + ";" + result.message) console.log("[Demo] result " + result.code + ";" + result.message)
}); });
...@@ -61,7 +62,7 @@ export default class MainAbility extends Ability { ...@@ -61,7 +62,7 @@ export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) { onWindowStageCreate(windowStage) {
// Main window is created for this ability. // Main window is created for this ability.
console.log("[Demo] MainAbility onWindowStageCreate") console.log("[Demo] EntryAbility onWindowStageCreate")
windowStage.loadContent("pages/index", (err, data) => { windowStage.loadContent("pages/index", (err, data) => {
if (err.code) { if (err.code) {
...@@ -74,17 +75,17 @@ export default class MainAbility extends Ability { ...@@ -74,17 +75,17 @@ export default class MainAbility extends Ability {
onWindowStageDestroy() { onWindowStageDestroy() {
// Main window is destroyed to release UI resources. // Main window is destroyed to release UI resources.
console.log("[Demo] MainAbility onWindowStageDestroy") console.log("[Demo] EntryAbility onWindowStageDestroy")
} }
onForeground() { onForeground() {
// Ability is brought to the foreground. // Ability is brought to the foreground.
console.log("[Demo] MainAbility onForeground") console.log("[Demo] EntryAbility onForeground")
} }
onBackground() { onBackground() {
// Ability is brought back to the background. // Ability is brought back to the background.
console.log("[Demo] MainAbility onBackground") console.log("[Demo] EntryAbility onBackground")
} }
}; };
``` ```
# @ohos.i18n (Internationalization) # @ohos.i18n (Internationalization)
The **i18n** module provides system-related or enhanced i18n capabilities, such as locale management, phone number formatting, and calendar, through supplementary i18n APIs that are not defined in ECMA 402. This module provides system-related or enhanced I18N capabilities, such as locale management, phone number formatting, and calendar, through supplementary I18N APIs that are not defined in ECMA 402.
The [intl](js-apis-intl.md) module provides basic i18n capabilities through the standard i18n APIs defined in ECMA 402. It works with the i18n module to provide a complete suite of i18n capabilities. The [Intl](js-apis-intl.md) module provides basic I18N capabilities through the standard I18N APIs defined in ECMA 402. It works with the I18N module to provide a complete suite of I18N capabilities.
> **NOTE** > **NOTE**
> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> >
> - This module provides system-related or enhanced i18n capabilities, such as locale management, phone number formatting, and calendar, through supplementary i18n APIs that are not defined in ECMA 402. For details about the basic i18n capabilities, see [intl](js-apis-intl.md). > - This module provides system-related or enhanced I18N capabilities, such as locale management, phone number formatting, and calendar, through supplementary I18N APIs that are not defined in ECMA 402. For details about the basic I18N capabilities, see [Intl](js-apis-intl.md).
## Modules to Import ## Modules to Import
...@@ -42,7 +42,7 @@ Obtains the localized script for the specified country. ...@@ -42,7 +42,7 @@ Obtains the localized script for the specified country.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -81,7 +81,7 @@ Obtains the localized script for the specified language. ...@@ -81,7 +81,7 @@ Obtains the localized script for the specified language.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -112,7 +112,7 @@ Obtains the list of system languages. For details about languages, see [Instanti ...@@ -112,7 +112,7 @@ Obtains the list of system languages. For details about languages, see [Instanti
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -149,7 +149,7 @@ Obtains the list of countries and regions supported for the specified language. ...@@ -149,7 +149,7 @@ Obtains the list of countries and regions supported for the specified language.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -187,7 +187,7 @@ Checks whether the system language matches the specified region. ...@@ -187,7 +187,7 @@ Checks whether the system language matches the specified region.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -218,7 +218,7 @@ Obtains the system language. For details about languages, see [Instantiating the ...@@ -218,7 +218,7 @@ Obtains the system language. For details about languages, see [Instantiating the
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -239,7 +239,7 @@ static setSystemLanguage(language: string): void ...@@ -239,7 +239,7 @@ static setSystemLanguage(language: string): void
Sets the system language. Currently, this API does not support real-time updating of the system language. Sets the system language. Currently, this API does not support real-time updating of the system language.
**System API**: This is a system API. This is a system API.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION **Permission required**: ohos.permission.UPDATE_CONFIGURATION
...@@ -253,7 +253,7 @@ Sets the system language. Currently, this API does not support real-time updatin ...@@ -253,7 +253,7 @@ Sets the system language. Currently, this API does not support real-time updatin
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -284,7 +284,7 @@ Obtains the system region. For details about system regions, see [Instantiating ...@@ -284,7 +284,7 @@ Obtains the system region. For details about system regions, see [Instantiating
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -305,7 +305,7 @@ static setSystemRegion(region: string): void ...@@ -305,7 +305,7 @@ static setSystemRegion(region: string): void
Sets the system region. Sets the system region.
**System API**: This is a system API. This is a system API.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION **Permission required**: ohos.permission.UPDATE_CONFIGURATION
...@@ -319,7 +319,7 @@ Sets the system region. ...@@ -319,7 +319,7 @@ Sets the system region.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -350,7 +350,7 @@ Obtains the system locale. For details about system locales, see [Instantiating ...@@ -350,7 +350,7 @@ Obtains the system locale. For details about system locales, see [Instantiating
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -371,7 +371,7 @@ static setSystemLocale(locale: string): void ...@@ -371,7 +371,7 @@ static setSystemLocale(locale: string): void
Sets the system locale. Sets the system locale.
**System API**: This is a system API. This is a system API.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION **Permission required**: ohos.permission.UPDATE_CONFIGURATION
...@@ -385,7 +385,7 @@ Sets the system locale. ...@@ -385,7 +385,7 @@ Sets the system locale.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -416,7 +416,7 @@ Checks whether the 24-hour clock is used. ...@@ -416,7 +416,7 @@ Checks whether the 24-hour clock is used.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -437,7 +437,7 @@ static set24HourClock(option: boolean): void ...@@ -437,7 +437,7 @@ static set24HourClock(option: boolean): void
Sets the 24-hour clock. Sets the 24-hour clock.
**System API**: This is a system API. This is a system API.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION **Permission required**: ohos.permission.UPDATE_CONFIGURATION
...@@ -451,7 +451,7 @@ Sets the 24-hour clock. ...@@ -451,7 +451,7 @@ Sets the 24-hour clock.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -473,7 +473,7 @@ static addPreferredLanguage(language: string, index?: number): void ...@@ -473,7 +473,7 @@ static addPreferredLanguage(language: string, index?: number): void
Adds a preferred language to the specified position on the preferred language list. Adds a preferred language to the specified position on the preferred language list.
**System API**: This is a system API. This is a system API.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION **Permission required**: ohos.permission.UPDATE_CONFIGURATION
...@@ -488,7 +488,7 @@ Adds a preferred language to the specified position on the preferred language li ...@@ -488,7 +488,7 @@ Adds a preferred language to the specified position on the preferred language li
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -512,7 +512,7 @@ static removePreferredLanguage(index: number): void ...@@ -512,7 +512,7 @@ static removePreferredLanguage(index: number): void
Deletes a preferred language from the specified position on the preferred language list. Deletes a preferred language from the specified position on the preferred language list.
**System API**: This is a system API. This is a system API.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION **Permission required**: ohos.permission.UPDATE_CONFIGURATION
...@@ -526,7 +526,7 @@ Deletes a preferred language from the specified position on the preferred langua ...@@ -526,7 +526,7 @@ Deletes a preferred language from the specified position on the preferred langua
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -547,7 +547,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod ...@@ -547,7 +547,7 @@ For details about the error codes, see [i18n Error Codes](../errorcodes/errorcod
static getPreferredLanguageList(): Array&lt;string&gt; static getPreferredLanguageList(): Array&lt;string&gt;
Obtains the preferred language list. Obtains the list of preferred languages.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
...@@ -555,11 +555,11 @@ Obtains the preferred language list. ...@@ -555,11 +555,11 @@ Obtains the preferred language list.
| Type | Description | | Type | Description |
| ------------------- | --------- | | ------------------- | --------- |
| Array&lt;string&gt; | Preferred language list.| | Array&lt;string&gt; | List of preferred languages.|
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -590,7 +590,7 @@ Obtains the first language in the preferred language list. ...@@ -590,7 +590,7 @@ Obtains the first language in the preferred language list.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -621,7 +621,7 @@ Obtains the preferred language of an application. ...@@ -621,7 +621,7 @@ Obtains the preferred language of an application.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -642,7 +642,7 @@ static setUsingLocalDigit(flag: boolean): void ...@@ -642,7 +642,7 @@ static setUsingLocalDigit(flag: boolean): void
Specifies whether to enable use of local digits. Specifies whether to enable use of local digits.
**System API**: This is a system API. This is a system API.
**Permission required**: ohos.permission.UPDATE_CONFIGURATION **Permission required**: ohos.permission.UPDATE_CONFIGURATION
...@@ -652,11 +652,11 @@ Specifies whether to enable use of local digits. ...@@ -652,11 +652,11 @@ Specifies whether to enable use of local digits.
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---- | ------- | ---- | ------------------------------- | | ---- | ------- | ---- | ------------------------------- |
| flag | boolean | Yes | Whether to enable the local digit switch. The value **true** means to enable the local digit switch, and the value **false** indicates the opposite.| | flag | boolean | Yes | Whether to turn on the local digit switch. The value **true** means to turn on the local digit switch, and the value **false** indicates the opposite.|
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -687,7 +687,7 @@ Checks whether use of local digits is enabled. ...@@ -687,7 +687,7 @@ Checks whether use of local digits is enabled.
**Error codes** **Error codes**
For details about the error codes, see [i18n Error Codes](../errorcodes/errorcode-i18n.md). For details about the error codes, see [I18N Error Codes](../errorcodes/errorcode-i18n.md).
| ID | Error Message | | ID | Error Message |
| ------ | ---------------------- | | ------ | ---------------------- |
...@@ -1194,7 +1194,7 @@ Creates an **IndexUtil** object. ...@@ -1194,7 +1194,7 @@ Creates an **IndexUtil** object.
**Example** **Example**
```js ```js
let indexUtil= I18n.getInstance("zh-CN"); let indexUtil = I18n.getInstance("zh-CN");
``` ```
...@@ -1267,7 +1267,7 @@ Obtains the index of a text object. ...@@ -1267,7 +1267,7 @@ Obtains the index of a text object.
**Example** **Example**
```js ```js
let indexUtil= I18n.getInstance("zh-CN"); let indexUtil = I18n.getInstance("zh-CN");
let index = indexUtil.getIndex("hi"); // index = "H" let index = indexUtil.getIndex("hi"); // index = "H"
``` ```
...@@ -1382,7 +1382,7 @@ Puts the [BreakIterator](#breakiterator8) object to the first text boundary, whi ...@@ -1382,7 +1382,7 @@ Puts the [BreakIterator](#breakiterator8) object to the first text boundary, whi
**Example** **Example**
```js ```js
let iterator = i18n.getLineInstance("en"); let iterator = I18n.getLineInstance("en");
iterator.setLineBreakText("Apple is my favorite fruit."); iterator.setLineBreakText("Apple is my favorite fruit.");
let firstPos = iterator.first(); // firstPos = 0 let firstPos = iterator.first(); // firstPos = 0
``` ```
...@@ -1689,7 +1689,7 @@ Obtains the list of time zone city IDs supported by the system. ...@@ -1689,7 +1689,7 @@ Obtains the list of time zone city IDs supported by the system.
static getCityDisplayName(cityID: string, locale: string): string static getCityDisplayName(cityID: string, locale: string): string
Obtains the localized representation of a time zone city in the specified locale. Obtains the localized display of a time zone city in the specified locale.
**System capability**: SystemCapability.Global.I18n **System capability**: SystemCapability.Global.I18n
...@@ -2363,7 +2363,7 @@ This API is supported since API version 8 and is deprecated since API version 9. ...@@ -2363,7 +2363,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
getPreferredLanguageList(): Array&lt;string&gt; getPreferredLanguageList(): Array&lt;string&gt;
Obtains the preferred language list. Obtains the list of preferred languages.
This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.getPreferredLanguageList](#getpreferredlanguagelist9) instead. This API is supported since API version 8 and is deprecated since API version 9. You are advised to use [System.getPreferredLanguageList](#getpreferredlanguagelist9) instead.
...@@ -2373,7 +2373,7 @@ This API is supported since API version 8 and is deprecated since API version 9. ...@@ -2373,7 +2373,7 @@ This API is supported since API version 8 and is deprecated since API version 9.
| Type | Description | | Type | Description |
| ------------------- | --------- | | ------------------- | --------- |
| Array&lt;string&gt; | Preferred language list.| | Array&lt;string&gt; | List of preferred languages.|
**Example** **Example**
```js ```js
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
The **pointer** module provides APIs related to pointer attribute management. The **pointer** module provides APIs related to pointer attribute management.
> **NOTE**<br> > **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -237,6 +238,8 @@ Obtains the mouse movement speed. This API uses a promise to return the result. ...@@ -237,6 +238,8 @@ Obtains the mouse movement speed. This API uses a promise to return the result.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer **System capability**: SystemCapability.MultimodalInput.Input.Pointer
**System API**: This is a system API.
**Return value** **Return value**
| Name | Description | | Name | Description |
...@@ -263,8 +266,6 @@ Obtains the mouse pointer style. This API uses an asynchronous callback to retur ...@@ -263,8 +266,6 @@ Obtains the mouse pointer style. This API uses an asynchronous callback to retur
**System capability**: SystemCapability.MultimodalInput.Input.Pointer **System capability**: SystemCapability.MultimodalInput.Input.Pointer
**System API**: This is a system API.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
...@@ -277,21 +278,23 @@ Obtains the mouse pointer style. This API uses an asynchronous callback to retur ...@@ -277,21 +278,23 @@ Obtains the mouse pointer style. This API uses an asynchronous callback to retur
```js ```js
import window from '@ohos.window'; import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getLastWindow(this.context, (error, win) => {
win.getWindowProperties((error, properties) => { if (error.code) {
let windowId = properties.id; console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(error));
if (windowId < 0) { return;
console.log(`Invalid windowId`); }
return; let windowId = win.getWindowProperties().id;
} if (windowId < 0) {
try { console.log(`Invalid windowId`);
pointer.getPointerStyle(windowId, (error, style) => { return;
console.log(`Get pointer style success, style: ${JSON.stringify(style)}`); }
}); try {
} catch (error) { pointer.getPointerStyle(windowId, (error, style) => {
console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`); console.log(`Get pointer style success, style: ${JSON.stringify(style)}`);
} });
}); } catch (error) {
console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}
}); });
``` ```
...@@ -320,21 +323,23 @@ Obtains the mouse pointer style. This API uses a promise to return the result. ...@@ -320,21 +323,23 @@ Obtains the mouse pointer style. This API uses a promise to return the result.
```js ```js
import window from '@ohos.window'; import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getLastWindow(this.context, (error, win) => {
win.getWindowProperties((error, properties) => { if (error.code) {
let windowId = properties.id; console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(error));
if (windowId < 0) { return;
console.log(`Invalid windowId`); }
return; let windowId = win.getWindowProperties().id;
} if (windowId < 0) {
try { console.log(`Invalid windowId`);
pointer.getPointerStyle(windowId).then((style) => { return;
console.log(`Get pointer style success, style: ${JSON.stringify(style)}`); }
}); try {
} catch (error) { pointer.getPointerStyle(windowId).then((style) => {
console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`); console.log(`Get pointer style success, style: ${JSON.stringify(style)}`);
} });
}); } catch (error) {
console.log(`Get pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}
}); });
``` ```
...@@ -359,21 +364,23 @@ Sets the mouse pointer style. This API uses an asynchronous callback to return t ...@@ -359,21 +364,23 @@ Sets the mouse pointer style. This API uses an asynchronous callback to return t
```js ```js
import window from '@ohos.window'; import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getLastWindow(this.context, (error, win) => {
win.getWindowProperties((error, properties) => { if (error.code) {
let windowId = properties.id; console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(error));
if (windowId < 0) { return;
console.log(`Invalid windowId`); }
return; let windowId = win.getWindowProperties().id;
} if (windowId < 0) {
try { console.log(`Invalid windowId`);
pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS, error => { return;
console.log(`Set pointer style success`); }
}); try {
} catch (error) { pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS, error => {
console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`); console.log(`Set pointer style success`);
} });
}); } catch (error) {
console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}
}); });
``` ```
## pointer.setPointerStyle<sup>9+</sup> ## pointer.setPointerStyle<sup>9+</sup>
...@@ -397,21 +404,23 @@ Sets the mouse pointer style. This API uses a promise to return the result. ...@@ -397,21 +404,23 @@ Sets the mouse pointer style. This API uses a promise to return the result.
```js ```js
import window from '@ohos.window'; import window from '@ohos.window';
window.getTopWindow((error, win) => { window.getLastWindow(this.context, (error, win) => {
win.getWindowProperties((error, properties) => { if (error.code) {
let windowId = properties.id; console.error('Failed to obtain the top window. Cause: ' + JSON.stringify(error));
if (windowId < 0) { return;
console.log(`Invalid windowId`); }
return; let windowId = win.getWindowProperties().id;
} if (windowId < 0) {
try { console.log(`Invalid windowId`);
pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS).then(() => { return;
console.log(`Set pointer style success`); }
}); try {
} catch (error) { pointer.setPointerStyle(windowId, pointer.PointerStyle.CROSS).then(() => {
console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`); console.log(`Set pointer style success`);
} });
}); } catch (error) {
console.log(`Set pointer style failed, error: ${JSON.stringify(error, [`code`, `message`])}`);
}
}); });
``` ```
## PointerStyle<sup>9+</sup> ## PointerStyle<sup>9+</sup>
...@@ -444,8 +453,8 @@ Enumerates mouse pointer styles. ...@@ -444,8 +453,8 @@ Enumerates mouse pointer styles.
| HAND_POINTING | 19 | Hand-shaped pointer |![Hand_Poniting.png](./figures/Hand_Pointing.png)| | HAND_POINTING | 19 | Hand-shaped pointer |![Hand_Poniting.png](./figures/Hand_Pointing.png)|
| HELP | 20 | Help |![Help.png](./figures/Help.png)| | HELP | 20 | Help |![Help.png](./figures/Help.png)|
| MOVE | 21 | Move |![Move.png](./figures/Move.png)| | MOVE | 21 | Move |![Move.png](./figures/Move.png)|
| RESIZE_LEFT_RIGHT | 22 | Left-and-right resizing|![Resize_Left_Right.png](./figures/Resize_Left_Right.png)| | RESIZE_LEFT_RIGHT | 22 | Left and right resizing|![Resize_Left_Right.png](./figures/Resize_Left_Right.png)|
| RESIZE_UP_DOWN | 23 | Up-and-down resizing|![Resize_Up_Down.png](./figures/Resize_Up_Down.png)| | RESIZE_UP_DOWN | 23 | Up and down resizing|![Resize_Up_Down.png](./figures/Resize_Up_Down.png)|
| SCREENSHOT_CHOOSE | 24 | Screenshot crosshair|![Screenshot_Cross.png](./figures/Screenshot_Cross.png)| | SCREENSHOT_CHOOSE | 24 | Screenshot crosshair|![Screenshot_Cross.png](./figures/Screenshot_Cross.png)|
| SCREENSHOT_CURSOR | 25 | Screenshot cursor |![Screenshot_Cursor.png](./figures/Screenshot_Cursor.png)| | SCREENSHOT_CURSOR | 25 | Screenshot cursor |![Screenshot_Cursor.png](./figures/Screenshot_Cursor.png)|
| TEXT_CURSOR | 26 | Text cursor |![Text_Cursor.png](./figures/Text_Cursor.png)| | TEXT_CURSOR | 26 | Text cursor |![Text_Cursor.png](./figures/Text_Cursor.png)|
......
# @ohos.usb (USB Management) # @ohos.usb (USB)
The **usb** module provides USB device management functions, including USB device list query, bulk data transfer, control transfer, and permission control. The **usb** module provides USB device management functions, including USB device list query, bulk data transfer, control transfer, and permission control.
> **NOTE** > **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. > 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.
>
> The APIs provided by this module are no longer maintained since API version 9. You are advised to use [`@ohos.usbV9`](js-apis-usb.md).
## Modules to Import ## Modules to Import
...@@ -24,13 +26,13 @@ Obtains the USB device list. ...@@ -24,13 +26,13 @@ Obtains the USB device list.
| Type | Description | | Type | Description |
| ---------------------------------------------------- | ------- | | ---------------------------------------------------- | ------- |
| Array&lt;Readonly&lt;[USBDevice](#usbdevice)&gt;&gt; | Device information list.| | Array&lt;Readonly&lt;[USBDevice](#usbdevice)&gt;&gt; | USB device list.|
**Example** **Example**
```js ```js
let devicesList = usb.getDevices(); let devicesList = usb.getDevices();
console.log(`devicesList = ${JSON.stringify(devicesList)}`); console.log(`devicesList = ${devicesList}`);
// devicesList is a list of USB devices. // devicesList is a list of USB devices.
// A simple example of devicesList is provided as follows: // A simple example of devicesList is provided as follows:
[ [
...@@ -109,7 +111,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -109,7 +111,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
```js ```js
let devicepipe= usb.connectDevice(device); let devicepipe= usb.connectDevice(device);
console.log(`devicepipe = ${JSON.stringify(devicepipe)}`); console.log(`devicepipe = ${devicepipe}`);
``` ```
## usb.hasRight ## usb.hasRight
...@@ -130,7 +132,7 @@ Checks whether the application has the permission to access the device. ...@@ -130,7 +132,7 @@ Checks whether the application has the permission to access the device.
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| boolean | The value **true** indicates that the application has the permission to access the device, and the value **false** indicates the opposite.| | boolean | Returns **true** if the application has the permission to access the device; returns **false** otherwise.|
**Example** **Example**
...@@ -144,7 +146,7 @@ console.log(bool); ...@@ -144,7 +146,7 @@ console.log(bool);
requestRight(deviceName: string): Promise&lt;boolean&gt; requestRight(deviceName: string): Promise&lt;boolean&gt;
Requests the temporary permission for the application to access the USB device. This API uses a promise to return the result. Requests the temporary permission for the application to access a USB device. This API uses a promise to return the result.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
...@@ -158,14 +160,14 @@ Requests the temporary permission for the application to access the USB device. ...@@ -158,14 +160,14 @@ Requests the temporary permission for the application to access the USB device.
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;boolean&gt; | Promise used to return the result. The value **true** indicates that the temporary device access permissions are granted, and the value **false** indicates the opposite.| | Promise&lt;boolean&gt; | Promise used to return the result. The value **true** indicates that the temporary device access permissions are granted; and the value **false** indicates the opposite.|
**Example** **Example**
```js ```js
let devicesName="1-1"; let devicesName="1-1";
usb.requestRight(devicesName).then((ret) => { usb.requestRight(devicesName).then((ret) => {
console.log(`requestRight = ${JSON.stringify(ret)}`); console.log(`requestRight = ${ret}`);
}); });
``` ```
...@@ -191,7 +193,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -191,7 +193,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| number | The value **0** indicates that the USB interface is successfully claimed, and an error code indicates the opposite.| | number | Returns **0** if the USB interface is successfully claimed; returns an error code otherwise.|
**Example** **Example**
...@@ -221,7 +223,7 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c ...@@ -221,7 +223,7 @@ Before you do this, ensure that you have claimed the interface by calling [usb.c
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| number | The value **0** indicates that the USB interface is successfully released, and an error code indicates the opposite.| | number | Returns **0** if the USB interface is successfully released; returns an error code otherwise.|
**Example** **Example**
...@@ -251,7 +253,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -251,7 +253,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| number | The value **0** indicates that the USB configuration is successfully set, and an error code indicates the opposite.| | number | Returns **0** if the USB configuration is successfully set; returns an error code otherwise.|
**Example** **Example**
...@@ -281,7 +283,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -281,7 +283,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| number | The value **0** indicates that the USB interface is successfully set, and an error code indicates the opposite.| | number | Returns **0** if the USB interface is successfully set; returns an error code otherwise.|
**Example** **Example**
...@@ -310,7 +312,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -310,7 +312,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Uint8Array | The return value is the raw USB descriptor if the operation is successful, or **undefined** if the operation has failed.| | Uint8Array | Returns the raw USB descriptor if the operation is successful; returns **undefined** otherwise.|
**Example** **Example**
...@@ -338,7 +340,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -338,7 +340,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| Type | Description | | Type | Description |
| ------ | -------------------- | | ------ | -------------------- |
| number | The return value is the file descriptor of the USB device if the operation is successful, or **-1** if the operation has failed.| | number | Returns the file descriptor of the USB device if the operation is successful; returns **-1** otherwise.|
**Example** **Example**
...@@ -373,8 +375,9 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -373,8 +375,9 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**Example** **Example**
```js ```js
usb.controlTransfer(devicepipe, USBControlParams).then((ret) => { let param = new usb.USBControlParams();
console.log(`controlTransfer = ${JSON.stringify(ret)}`); usb.controlTransfer(devicepipe, param).then((ret) => {
console.log(`controlTransfer = ${ret}`);
}) })
``` ```
...@@ -410,7 +413,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -410,7 +413,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
// 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.
// Call usb.claimInterface to claim the USB interface. After that, call usb.bulkTransfer to start bulk transfer. // Call usb.claimInterface to claim the USB interface. After that, call usb.bulkTransfer to start bulk transfer.
usb.bulkTransfer(devicepipe, endpoint, buffer).then((ret) => { usb.bulkTransfer(devicepipe, endpoint, buffer).then((ret) => {
console.log(`bulkTransfer = ${JSON.stringify(ret)}`); console.log(`bulkTransfer = ${ret}`);
}); });
``` ```
...@@ -434,7 +437,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -434,7 +437,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| number | The value **0** indicates that the USB device pipe is closed successfully, and an error code indicates the opposite.| | number | Returns **0** if the USB device pipe is closed successfully; returns an error code otherwise.|
**Example** **Example**
...@@ -497,7 +500,7 @@ Converts the USB function list in the numeric mask format to a string in Device ...@@ -497,7 +500,7 @@ Converts the USB function list in the numeric mask format to a string in Device
**Example** **Example**
```js ```js
let funcs = ACM | ECM; let funcs = usb.ACM | usb.ECM;
let ret = usb.usbFunctionsToString(funcs); let ret = usb.usbFunctionsToString(funcs);
``` ```
...@@ -526,7 +529,7 @@ Sets the current USB function list in Device mode. ...@@ -526,7 +529,7 @@ Sets the current USB function list in Device mode.
**Example** **Example**
```js ```js
let funcs = HDC; let funcs = usb.HDC;
let ret = usb.setCurrentFunctions(funcs); let ret = usb.setCurrentFunctions(funcs);
``` ```
...@@ -629,7 +632,12 @@ Sets the role types supported by a specified port, which can be **powerRole** (f ...@@ -629,7 +632,12 @@ Sets the role types supported by a specified port, which can be **powerRole** (f
**Example** **Example**
```js ```js
let ret = usb.getSupportedModes(0); let portId = 1;
usb.setPortRoles(portId, usb.PowerRoleType.SOURCE, usb.DataRoleType.HOST).then(() => {
console.info('usb setPortRoles successfully.');
}).catch(err => {
console.error('usb setPortRoles failed: ' + err.code + ' message: ' + err.message);
});
``` ```
## USBEndpoint ## USBEndpoint
...@@ -638,16 +646,16 @@ Represents the USB endpoint from which data is sent or received. You can obtain ...@@ -638,16 +646,16 @@ Represents the USB endpoint from which data is sent or received. You can obtain
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ------- | --------- | ----------- | | ------------- | ------------------------------------------- | ------------- |------------ |
| address | number | Yes | Endpoint address. | | address | number | Yes |Endpoint address. |
| attributes | number | Yes | Endpoint attributes. | | attributes | number | Yes |Endpoint attributes. |
| interval | number | Yes | Endpoint interval. | | interval | number | Yes |Endpoint interval. |
| maxPacketSize | number | Yes | Maximum size of data packets on the endpoint. | | maxPacketSize | number | Yes |Maximum size of data packets on the endpoint. |
| direction | [USBRequestDirection](#usbrequestdirection) | Yes | Endpoint direction. | | direction | [USBRequestDirection](#usbrequestdirection) | Yes |Endpoint direction. |
| number | number | Yes | Endpoint number. | | number | number | Yes |Endpoint number. |
| type | number | Yes | Endpoint type. | | type | number | Yes |Endpoint type. |
| interfaceId | number | Yes | Unique ID of the interface to which the endpoint belongs.| | interfaceId | number | Yes |Unique ID of the interface to which the endpoint belongs.|
## USBInterface ## USBInterface
...@@ -655,15 +663,15 @@ Represents a USB interface. One [USBConfig](#usbconfig) can contain multiple **U ...@@ -655,15 +663,15 @@ Represents a USB interface. One [USBConfig](#usbconfig) can contain multiple **U
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory |Description |
| -------- | ------- | --------- | ----------- | | ---------------- | ---------------------------------------- | ------------- |--------------------- |
| id | number | Yes | Unique ID of the USB interface. | | id | number | Yes |Unique ID of the USB interface. |
| protocol | number | Yes | Interface protocol. | | protocol | number | Yes |Interface protocol. |
| clazz | number | Yes | Device type. | | clazz | number | Yes |Device type. |
| subClass | number | Yes | Device subclass. | | subClass | number | Yes |Device subclass. |
| alternateSetting | number | Yes | Settings for alternating between descriptors of the same USB interface.| | alternateSetting | number | Yes |Settings for alternating between descriptors of the same USB interface.|
| name | string | Yes | Interface name. | | name | string | Yes |Interface name. |
| endpoints | Array&lt;[USBEndpoint](#usbendpoint)&gt; | Yes | Endpoints that belong to the USB interface. | | endpoints | Array&lt;[USBEndpoint](#usbendpoint)&gt; | Yes |Endpoints that belong to the USB interface. |
## USBConfig ## USBConfig
...@@ -671,15 +679,15 @@ Represents the USB configuration. One [USBDevice](#usbdevice) can contain multip ...@@ -671,15 +679,15 @@ Represents the USB configuration. One [USBDevice](#usbdevice) can contain multip
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory |Description |
| -------- | ------- | --------- | ----------- | | -------------- | ------------------------------------------------ | --------------- |----------- |
| id | number | Yes | Unique ID of the USB configuration. | | id | number | Yes |Unique ID of the USB configuration. |
| attributes | number | Yes | Configuration attributes. | | attributes | number | Yes |Configuration attributes. |
| maxPower | number | Yes | Maximum power consumption, in mA. | | maxPower | number | Yes |Maximum power consumption, in mA. |
| name | string | Yes | Configuration name, which can be left empty. | | name | string | Yes |Configuration name, which can be left empty. |
| isRemoteWakeup | boolean | Yes | Support for remote wakeup.| | isRemoteWakeup | boolean | Yes |Support for remote wakeup.|
| isSelfPowered | boolean | Yes | Support for independent power supplies.| | isSelfPowered | boolean | Yes |Support for independent power supplies.|
| interfaces | Array&nbsp;&lt;[USBInterface](#usbinterface)&gt; | Yes | Supported interface attributes. | | interfaces | Array&nbsp;&lt;[USBInterface](#usbinterface)&gt; | Yes |Supported interface attributes. |
## USBDevice ## USBDevice
...@@ -687,21 +695,21 @@ Represents the USB device information. ...@@ -687,21 +695,21 @@ Represents the USB device information.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory |Description |
| -------- | ------- | --------- | ----------- | | ---------------- | ------------------------------------ | ---------- |---------- |
| busNum | number | Yes | Bus address. | | busNum | number | Yes |Bus address. |
| devAddress | number | Yes | Device address. | | devAddress | number | Yes |Device address. |
| serial | string | Yes | Sequence number. | | serial | string | Yes |Sequence number. |
| name | string | Yes | Device name. | | name | string | Yes |Device name. |
| manufacturerName | string | Yes | Device manufacturer. | | manufacturerName | string | Yes |Device manufacturer. |
| productName | string | Yes | Product name. | | productName | string | Yes |Product name. |
| version | string | Yes | Version number. | | version | string | Yes |Version. |
| vendorId | number | Yes | Vendor ID. | | vendorId | number | Yes |Vendor ID. |
| productId | number | Yes | Product ID. | | productId | number | Yes |Product ID. |
| clazz | number | Yes | Device class. | | clazz | number | Yes |Device class. |
| subClass | number | Yes | Device subclass. | | subClass | number | Yes |Device subclass. |
| protocol | number | Yes | Device protocol code. | | protocol | number | Yes |Device protocol code. |
| configs | Array&lt;[USBConfig](#usbconfig)&gt; | Yes | Device configuration descriptor information.| | configs | Array&lt;[USBConfig](#usbconfig)&gt; | Yes |Device configuration descriptor information.|
## USBDevicePipe ## USBDevicePipe
...@@ -709,10 +717,10 @@ Represents a USB device pipe, which is used to determine a USB device. ...@@ -709,10 +717,10 @@ Represents a USB device pipe, which is used to determine a USB device.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory |Description |
| -------- | ------- | --------- | ----------- | | ---------- | ------ | ----- |----- |
| busNum | number | Yes | Bus address.| | busNum | number | Yes |Bus address.|
| devAddress | number | Yes | Device address.| | devAddress | number | Yes |Device address.|
## USBControlParams ## USBControlParams
...@@ -720,14 +728,14 @@ Represents control transfer parameters. ...@@ -720,14 +728,14 @@ Represents control transfer parameters.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory|Description |
| -------- | ------- | --------- | ----------- | | ------- | ----------------------------------------------- | ---------------- |---------------- |
| request | number | Yes | Request type. | | request | number | Yes |Request type. |
| target | [USBRequestTargetType](#usbrequesttargettype) | Yes | Request target type. | | target | [USBRequestTargetType](#usbrequesttargettype) | Yes |Request target type. |
| reqType | [USBControlRequestType](#usbcontrolrequesttype) | Yes | Control request type. | | reqType | [USBControlRequestType](#usbcontrolrequesttype) | Yes |Control request type. |
| value | number | Yes | Request parameter value. | | value | number | Yes |Request parameter value. |
| index | number | Yes | Index of the request parameter value.| | index | number | Yes |Index of the request parameter value.|
| data | Uint8Array | Yes | Buffer for writing or reading data. | | data | Uint8Array | Yes |Buffer for writing or reading data. |
## USBPort<sup>9+</sup> ## USBPort<sup>9+</sup>
...@@ -737,11 +745,11 @@ Represents a USB port. ...@@ -737,11 +745,11 @@ Represents a USB port.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type | Mandatory|Description |
| -------- | ------- | --------- | ----------- | | -------------- | -------------------------------- | -------------- |----------------------------------- |
| id | number | Yes | Unique identifier of a USB port. | | id | number | Yes |Unique identifier of a USB port. |
| supportedModes | [PortModeType](#portmodetype9) | Yes | Numeric mask combination for the supported mode list.| | supportedModes | [PortModeType](#portmodetype9) | Yes |Numeric mask combination for the supported mode list.|
| status | [USBPortStatus](#usbportstatus9) | Yes | USB port role. | | status | [USBPortStatus](#usbportstatus9) | Yes |USB port role. |
## USBPortStatus<sup>9+</sup> ## USBPortStatus<sup>9+</sup>
...@@ -751,11 +759,11 @@ Enumerates USB port roles. ...@@ -751,11 +759,11 @@ Enumerates USB port roles.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Type | Mandatory | Description | | Name | Type| Mandatory|Description |
| -------- | ------- | --------- | ----------- | | ---------------- | -------- | ----------- |---------------------- |
| currentMode | number | Yes | Current USB mode. | | currentMode | number | Yes |Current USB mode. |
| currentPowerRole | number | Yes | Current power role. | | currentPowerRole | number | Yes |Current power role. |
| currentDataRole | number | Yes | Current data role. | | currentDataRole | number | Yes |Current data role.|
## USBRequestTargetType ## USBRequestTargetType
...@@ -840,7 +848,7 @@ Enumerates power role types. ...@@ -840,7 +848,7 @@ Enumerates power role types.
| Name | Value | Description | | Name | Value | Description |
| ------ | ---- | ---------- | | ------ | ---- | ---------- |
| NONE | 0 | None. | | NONE | 0 | None |
| SOURCE | 1 | External power supply.| | SOURCE | 1 | External power supply.|
| SINK | 2 | Internal power supply.| | SINK | 2 | Internal power supply.|
...@@ -854,6 +862,6 @@ Enumerates data role types. ...@@ -854,6 +862,6 @@ Enumerates data role types.
| Name | Value | Description | | Name | Value | Description |
| ------ | ---- | ------------ | | ------ | ---- | ------------ |
| NONE | 0 | None. | | NONE | 0 | None |
| HOST | 1 | USB host.| | HOST | 1 | USB host.|
| DEVICE | 2 | USB device.| | DEVICE | 2 | USB device.|
# @ohos.usbV9 (USB Management) # @ohos.usbV9 (USB)
The **usb** module provides USB device management functions, including USB device list query, bulk data transfer, control transfer, and permission control on the host side as well as port management, and function switch and query on the device side. The USB module provides USB device management functions, including USB device list query, bulk data transfer, control transfer, and permission control on the host side as well as port management, and function switch and query on the device side.
> **NOTE**<br> > **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -29,7 +30,7 @@ Obtains the list of USB devices connected to the host. If no device is connected ...@@ -29,7 +30,7 @@ Obtains the list of USB devices connected to the host. If no device is connected
```js ```js
let devicesList = usb.getDevices(); let devicesList = usb.getDevices();
console.log(`devicesList = ${JSON.stringify(devicesList)}`); console.log(`devicesList = ${devicesList}`);
// devicesList is a list of USB devices. // devicesList is a list of USB devices.
// A simple example of devicesList is provided as follows: // A simple example of devicesList is provided as follows:
[ [
...@@ -86,7 +87,7 @@ console.log(`devicesList = ${JSON.stringify(devicesList)}`); ...@@ -86,7 +87,7 @@ console.log(`devicesList = ${JSON.stringify(devicesList)}`);
connectDevice(device: USBDevice): Readonly&lt;USBDevicePipe&gt; connectDevice(device: USBDevice): Readonly&lt;USBDevicePipe&gt;
Connects to a USB device based on the device list obtained by using **getDevices()**. Connects to the USB device based on the device information returned by **getDevices()**.
Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB device list and device information, and then call [usb.requestRight](#usbrequestright) to request the device access permission. Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB device list and device information, and then call [usb.requestRight](#usbrequestright) to request the device access permission.
...@@ -118,13 +119,12 @@ For details about the error codes, see [USB Error Codes](../errorcodes/errorcode ...@@ -118,13 +119,12 @@ For details about the error codes, see [USB Error Codes](../errorcodes/errorcode
let devicesList = usb.getDevices(); let devicesList = usb.getDevices();
if (devicesList.length == 0) { if (devicesList.length == 0) {
console.log(`device list is empty`); console.log(`device list is empty`);
return;
} }
let device = devicesList[0]; let device = devicesList[0];
usb.requestRight(device.name); usb.requestRight(device.name);
let devicepipe = usb.connectDevice(device); let devicepipe = usb.connectDevice(device);
console.log(`devicepipe = ${JSON.stringify(devicepipe)}`); console.log(`devicepipe = ${devicepipe}`);
``` ```
## usb.hasRight ## usb.hasRight
...@@ -133,7 +133,7 @@ hasRight(deviceName: string): boolean ...@@ -133,7 +133,7 @@ hasRight(deviceName: string): boolean
Checks whether the application has the permission to access the device. Checks whether the application has the permission to access the device.
The value **true** is returned if the device access permission is available; the value **false** is returned otherwise. Checks whether the user, for example, the application or system, has the device access permissions. The value **true** is returned if the user has the device access permissions; the value **false** is returned otherwise.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
...@@ -182,7 +182,7 @@ Requests the temporary permission for the application to access a USB device. Th ...@@ -182,7 +182,7 @@ Requests the temporary permission for the application to access a USB device. Th
```js ```js
let devicesName="1-1"; let devicesName="1-1";
usb.requestRight(devicesName).then((ret) => { usb.requestRight(devicesName).then((ret) => {
console.log(`requestRight = ${JSON.stringify(ret)}`); console.log(`requestRight = ${ret}`);
}); });
``` ```
...@@ -210,7 +210,7 @@ Removes the permission for the application to access a USB device. ...@@ -210,7 +210,7 @@ Removes the permission for the application to access a USB device.
```js ```js
let devicesName="1-1"; let devicesName="1-1";
if (usb.removeRight(devicesName) { if usb.removeRight(devicesName) {
console.log(`Succeed in removing right`); console.log(`Succeed in removing right`);
} }
``` ```
...@@ -245,7 +245,7 @@ Adds the permission for the application to access a USB device. ...@@ -245,7 +245,7 @@ Adds the permission for the application to access a USB device.
```js ```js
let devicesName = "1-1"; let devicesName = "1-1";
let bundleName = "com.example.hello"; let bundleName = "com.example.hello";
if (usb.addRight(bundleName, devicesName) { if usb.addRight(bundleName, devicesName) {
console.log(`Succeed in adding right`); console.log(`Succeed in adding right`);
} }
``` ```
...@@ -454,8 +454,9 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -454,8 +454,9 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
**Example** **Example**
```js ```js
usb.controlTransfer(devicepipe, USBControlParams).then((ret) => { let param = new usb.USBControlParams();
console.log(`controlTransfer = ${JSON.stringify(ret)}`); usb.controlTransfer(devicepipe, param).then((ret) => {
console.log(`controlTransfer = ${ret}`);
}) })
``` ```
...@@ -491,7 +492,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi ...@@ -491,7 +492,7 @@ Before you do this, call [usb.getDevices](#usbgetdevices) to obtain the USB devi
// 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.
// Call usb.claimInterface to claim the USB interface. After that, call usb.bulkTransfer to start bulk transfer. // Call usb.claimInterface to claim the USB interface. After that, call usb.bulkTransfer to start bulk transfer.
usb.bulkTransfer(devicepipe, endpoint, buffer).then((ret) => { usb.bulkTransfer(devicepipe, endpoint, buffer).then((ret) => {
console.log(`bulkTransfer = ${JSON.stringify(ret)}`); console.log(`bulkTransfer = ${ret}`);
}); });
``` ```
...@@ -578,7 +579,7 @@ Converts the USB function list in the numeric mask format to a string in Device ...@@ -578,7 +579,7 @@ Converts the USB function list in the numeric mask format to a string in Device
**Example** **Example**
```js ```js
let funcs = ACM | ECM; let funcs = usb.ACM | usb.ECM;
let ret = usb.usbFunctionsToString(funcs); let ret = usb.usbFunctionsToString(funcs);
``` ```
...@@ -607,7 +608,7 @@ Sets the current USB function list in Device mode. ...@@ -607,7 +608,7 @@ Sets the current USB function list in Device mode.
**Example** **Example**
```js ```js
let funcs = HDC; let funcs = usb.HDC;
let ret = usb.setCurrentFunctions(funcs); let ret = usb.setCurrentFunctions(funcs);
``` ```
...@@ -710,7 +711,12 @@ Sets the role types supported by a specified port, which can be **powerRole** (f ...@@ -710,7 +711,12 @@ Sets the role types supported by a specified port, which can be **powerRole** (f
**Example** **Example**
```js ```js
let ret = usb.getSupportedModes(0); let portId = 1;
usb.setPortRoles(portId, usb.PowerRoleType.SOURCE, usb.DataRoleType.HOST).then(() => {
console.info('usb setPortRoles successfully.');
}).catch(err => {
console.error('usb setPortRoles failed: ' + err.code + ' message: ' + err.message);
});
``` ```
## USBEndpoint ## USBEndpoint
...@@ -721,14 +727,14 @@ Represents the USB endpoint from which data is sent or received. You can obtain ...@@ -721,14 +727,14 @@ Represents the USB endpoint from which data is sent or received. You can obtain
| Name | Type | Mandatory |Description | | Name | Type | Mandatory |Description |
| ------------- | ------------------------------------------- | ------------- |------------- | | ------------- | ------------------------------------------- | ------------- |------------- |
| address | number | Yes | Endpoint address. | | address | number | Yes|Endpoint address. |
| attributes | number | Yes | Endpoint attributes. | | attributes | number | Yes|Endpoint attributes. |
| interval | number | Yes | Endpoint interval. | | interval | number | Yes|Endpoint interval. |
| maxPacketSize | number | Yes | Maximum size of data packets on the endpoint. | | maxPacketSize | number | Yes|Maximum size of data packets on the endpoint. |
| direction | [USBRequestDirection](#usbrequestdirection) | Yes | Endpoint direction. | | direction | [USBRequestDirection](#usbrequestdirection) | Yes|Endpoint direction. |
| number | number | Yes | Endpoint number. | | number | number | Yes|Endpoint number. |
| type | number | Yes | Endpoint type. | | type | number | Yes|Endpoint type. |
| interfaceId | number | Yes | Unique ID of the interface to which the endpoint belongs.| | interfaceId | number | Yes|Unique ID of the interface to which the endpoint belongs.|
## USBInterface ## USBInterface
...@@ -738,13 +744,13 @@ Represents a USB interface. One [USBConfig](#usbconfig) can contain multiple **U ...@@ -738,13 +744,13 @@ Represents a USB interface. One [USBConfig](#usbconfig) can contain multiple **U
| Name | Type | Mandatory |Description | | Name | Type | Mandatory |Description |
| ---------------- | ---------------------------------------- | ------------- |--------------------- | | ---------------- | ---------------------------------------- | ------------- |--------------------- |
| id | number | Yes | Unique ID of the USB interface. | | id | number | Yes|Unique ID of the USB interface. |
| protocol | number | Yes | Interface protocol. | | protocol | number | Yes|Interface protocol. |
| clazz | number | Yes | Device type. | | clazz | number | Yes|Device type. |
| subClass | number | Yes | Device subclass. | | subClass | number | Yes|Device subclass. |
| alternateSetting | number | Yes | Settings for alternating between descriptors of the same USB interface.| | alternateSetting | number | Yes|Settings for alternating between descriptors of the same USB interface.|
| name | string | Yes | Interface name. | | name | string | Yes|Interface name. |
| endpoints | Array&lt;[USBEndpoint](#usbendpoint)&gt; | Yes | Endpoints that belong to the USB interface. | | endpoints | Array&lt;[USBEndpoint](#usbendpoint)&gt; | Yes|Endpoints that belong to the USB interface. |
## USBConfig ## USBConfig
...@@ -754,13 +760,13 @@ Represents the USB configuration. One [USBDevice](#usbdevice) can contain multip ...@@ -754,13 +760,13 @@ Represents the USB configuration. One [USBDevice](#usbdevice) can contain multip
| Name | Type | Mandatory |Description | | Name | Type | Mandatory |Description |
| -------------- | ------------------------------------------------ | --------------- |--------------- | | -------------- | ------------------------------------------------ | --------------- |--------------- |
| id | number | Yes | Unique ID of the USB configuration. | | id | number | Yes|Unique ID of the USB configuration. |
| attributes | number | Yes | Configuration attributes. | | attributes | number | Yes|Configuration attributes. |
| maxPower | number | Yes | Maximum power consumption, in mA. | | maxPower | number | Yes|Maximum power consumption, in mA. |
| name | string | Yes | Configuration name, which can be left empty. | | name | string | Yes|Configuration name, which can be left empty. |
| isRemoteWakeup | boolean | Yes | Support for remote wakeup.| | isRemoteWakeup | boolean | Yes|Support for remote wakeup.|
| isSelfPowered | boolean | Yes | Support for independent power supplies.| | isSelfPowered | boolean | Yes| Support for independent power supplies.|
| interfaces | Array&nbsp;&lt;[USBInterface](#usbinterface)&gt; | Yes | Supported interface attributes. | | interfaces | Array&nbsp;&lt;[USBInterface](#usbinterface)&gt; | Yes|Supported interface attributes. |
## USBDevice ## USBDevice
...@@ -770,19 +776,19 @@ Represents the USB device information. ...@@ -770,19 +776,19 @@ Represents the USB device information.
| Name | Type | Mandatory |Description | | Name | Type | Mandatory |Description |
| ---------------- | ------------------------------------ | ---------- |---------- | | ---------------- | ------------------------------------ | ---------- |---------- |
| busNum | number | Yes | Bus address. | | busNum | number | Yes|Bus address. |
| devAddress | number | Yes | Device address. | | devAddress | number | Yes|Device address. |
| serial | string | Yes | Sequence number. | | serial | string | Yes|Sequence number. |
| name | string | Yes | Device name. | | name | string | Yes|Device name. |
| manufacturerName | string | Yes | Device manufacturer. | | manufacturerName | string | Yes| Device manufacturer. |
| productName | string | Yes | Product name. | | productName | string | Yes|Product name. |
| version | string | Yes | Version number. | | version | string | Yes|Version number. |
| vendorId | number | Yes | Vendor ID. | | vendorId | number | Yes|Vendor ID. |
| productId | number | Yes | Product ID. | | productId | number | Yes|Product ID. |
| clazz | number | Yes | Device class. | | clazz | number | Yes|Device class. |
| subClass | number | Yes | Device subclass. | | subClass | number | Yes|Device subclass. |
| protocol | number | Yes | Device protocol code. | | protocol | number | Yes|Device protocol code. |
| configs | Array&lt;[USBConfig](#usbconfig)&gt; | Yes | Device configuration descriptor information.| | configs | Array&lt;[USBConfig](#usbconfig)&gt; | Yes|Device configuration descriptor information.|
## USBDevicePipe ## USBDevicePipe
...@@ -803,12 +809,12 @@ Represents control transfer parameters. ...@@ -803,12 +809,12 @@ Represents control transfer parameters.
| Name | Type | Mandatory |Description | | Name | Type | Mandatory |Description |
| ------- | ----------------------------------------------- | ---------------- |---------------- | | ------- | ----------------------------------------------- | ---------------- |---------------- |
| request | number | Yes | Request type. | | request | number | Yes |Request type. |
| target | [USBRequestTargetType](#usbrequesttargettype) | Yes | Request target type. | | target | [USBRequestTargetType](#usbrequesttargettype) | Yes |Request target type. |
| reqType | [USBControlRequestType](#usbcontrolrequesttype) | Yes | Control request type. | | reqType | [USBControlRequestType](#usbcontrolrequesttype) | Yes |Control request type. |
| value | number | Yes | Request parameter value. | | value | number | Yes |Request parameter value. |
| index | number | Yes | Index of the request parameter value.| | index | number | Yes |Index of the request parameter value.|
| data | Uint8Array | Yes | Buffer for writing or reading data. | | data | Uint8Array | Yes |Buffer for writing or reading data. |
## USBPort ## USBPort
...@@ -820,9 +826,9 @@ Represents a USB port. ...@@ -820,9 +826,9 @@ Represents a USB port.
| Name | Type | Mandatory |Description | | Name | Type | Mandatory |Description |
| -------------- | ------------------------------- | ------------------- |------------------------ | | -------------- | ------------------------------- | ------------------- |------------------------ |
| id | number | Yes | Unique identifier of a USB port. | | id | number | Yes |Unique identifier of a USB port. |
| supportedModes | [PortModeType](#portmodetype) | Yes | Numeric mask combination for the supported mode list.| | supportedModes | [PortModeType](#portmodetype) | Yes |Numeric mask combination for the supported mode list.|
| status | [USBPortStatus](#usbportstatus) | Yes | USB port role. | | status | [USBPortStatus](#usbportstatus) | Yes |USB port role. |
## USBPortStatus ## USBPortStatus
...@@ -834,9 +840,9 @@ Enumerates USB port roles. ...@@ -834,9 +840,9 @@ Enumerates USB port roles.
| Name | Type| Mandatory |Description | | Name | Type| Mandatory |Description |
| ---------------- | -------- | ---------------- |---------------------- | | ---------------- | -------- | ---------------- |---------------------- |
| currentMode | number | Yes | Current USB mode. | | currentMode | number | Yes|Current USB mode. |
| currentPowerRole | number | Yes | Current power role. | | currentPowerRole | number | Yes |Current power role. |
| currentDataRole | number | Yes | Current data role.| | currentDataRole | number | Yes |Current data role.|
## USBRequestTargetType ## USBRequestTargetType
...@@ -844,12 +850,12 @@ Enumerates request target types. ...@@ -844,12 +850,12 @@ Enumerates request target types.
**System capability**: SystemCapability.USB.USBManager **System capability**: SystemCapability.USB.USBManager
| Name | Value | Description | | Name | Value | Description |
| ---------------------------- | ----- | ----------- | | ---------------------------- | ---- | ------ |
| USB_REQUEST_TARGET_DEVICE | 0 | Device | | USB_REQUEST_TARGET_DEVICE | 0 | Device|
| USB_REQUEST_TARGET_INTERFACE | 1 | Interface | | USB_REQUEST_TARGET_INTERFACE | 1 | Interface|
| USB_REQUEST_TARGET_ENDPOINT | 2 | Endpoint | | USB_REQUEST_TARGET_ENDPOINT | 2 | Endpoint|
| USB_REQUEST_TARGET_OTHER | 3 | Other | | USB_REQUEST_TARGET_OTHER | 3 | Other|
## USBControlRequestType ## USBControlRequestType
......
...@@ -74,6 +74,7 @@ Before using the Docker environment, perform the following operations: ...@@ -74,6 +74,7 @@ Before using the Docker environment, perform the following operations:
> >
> You do not need to obtain the source code for the HPM-based Docker environment. > You do not need to obtain the source code for the HPM-based Docker environment.
3. Perform subsequent operations as a user who has the root permission or has been granted the permission to use Docker.
## Standalone Docker Environment<a name="section2858536103611"></a> ## Standalone Docker Environment<a name="section2858536103611"></a>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册