diff --git a/en/application-dev/application-models/Readme-EN.md b/en/application-dev/application-models/Readme-EN.md index 65d5dc91d92ae7622d7a5824759798230f3a4806..aca0bbb39f14d5110bf82d2a610eca7d8b05dd6c 100644 --- a/en/application-dev/application-models/Readme-EN.md +++ b/en/application-dev/application-models/Readme-EN.md @@ -20,7 +20,7 @@ - [AccessibilityExtensionAbility](accessibilityextensionability.md) - [EnterpriseAdminExtensionAbility](enterprise-extensionAbility.md) - [InputMethodExtensionAbility](inputmethodextentionability.md) - - [WindowExtensionAbility](windowextensionability.md) + - [WindowExtensionAbility (for System Applications Only)](windowextensionability.md) - Service Widget Development in Stage Model - [Service Widget Overview](service-widget-overview.md) - Developing an ArkTS Widget @@ -36,9 +36,10 @@ - [Applying Custom Drawing in the Widget](arkts-ui-widget-page-custom-drawing.md) - Widget Event Development - [Widget Event Capability Overview](arkts-ui-widget-event-overview.md) - - [Redirecting to a Specified Page Through the Router Event](arkts-ui-widget-event-router.md) - - [Updating Widget Content Through FormExtensionAbility](arkts-ui-widget-event-formextensionability.md) - - [Updating Widget Content Through UIAbility](arkts-ui-widget-event-uiability.md) + - [Redirecting to a UIAbility Through the router Event](arkts-ui-widget-event-router.md) + - [Launching a UIAbility in the Background Through the call Event](arkts-ui-widget-event-call.md) + - [Updating Widget Content Through the message Event](arkts-ui-widget-event-formextensionability.md) + - [Updating Widget Content Through the router or call Event](arkts-ui-widget-event-uiability.md) - Widget Data Interaction - [Widget Data Interaction Overview](arkts-ui-widget-interaction-overview.md) - [Configuring a Widget to Update Periodically](arkts-ui-widget-update-by-time.md) @@ -52,7 +53,7 @@ - [Want Overview](want-overview.md) - [Matching Rules of Explicit Want and Implicit Want](explicit-implicit-want-mappings.md) - [Common action and entities Values](actions-entities.md) - - [Using Explicit Want to Start an Ability](ability-startup-with-explicit-want.md) + - [Using Explicit Want to Start an Application Component](ability-startup-with-explicit-want.md) - [Using Implicit Want to Open a Website](ability-startup-with-implicit-want.md) - [Using Want to Share Data Between Applications](data-share-via-want.md) - [Component Startup Rules](component-startup-rules.md) @@ -71,7 +72,7 @@ - [Subscribing to Common Events in Static Mode (for System Applications Only)](common-event-static-subscription.md) - [Unsubscribing from Common Events](common-event-unsubscription.md) - [Publishing Common Events](common-event-publish.md) - - [Removing Sticky Common Events](common-event-remove-sticky.md) + - [Removing Sticky Common Events (for System Applications Only)](common-event-remove-sticky.md) - [Background Services](background-services.md) - Thread Model - [Thread Model Overview](thread-model-stage.md) diff --git a/en/application-dev/application-models/ability-startup-with-explicit-want.md b/en/application-dev/application-models/ability-startup-with-explicit-want.md index 6b61b06311a519e959e87d826e4a27c8b2b3d208..36d41c555bd8d4a5cd0d4d0b7bd291bb2569cee3 100644 --- a/en/application-dev/application-models/ability-startup-with-explicit-want.md +++ b/en/application-dev/application-models/ability-startup-with-explicit-want.md @@ -1,4 +1,4 @@ -# Using Explicit Want to Start an Ability +# Using Explicit Want to Start an Application Component When a user touches a button in an application, the application often needs to start a UIAbility component to complete a specific task. If the **abilityName** and **bundleName** parameters are specified when starting a UIAbility, then the explicit Want is used. diff --git a/en/application-dev/application-models/ability-startup-with-implicit-want.md b/en/application-dev/application-models/ability-startup-with-implicit-want.md index dbd65bb560d7531bb6e00b21c004815fda1a997c..7d92fbccbd1ebb49dc2a89de0ea825a1e2a8c873 100644 --- a/en/application-dev/application-models/ability-startup-with-implicit-want.md +++ b/en/application-dev/application-models/ability-startup-with-implicit-want.md @@ -5,21 +5,21 @@ This section uses the operation of using a browser to open a website as an examp ```json { "module": { - // ... + ... "abilities": [ { - // ... + ... "skills": [ { "entities": [ "entity.system.home", "entity.system.browsable" - // ... + ... ], "actions": [ "action.system.home", "ohos.want.action.viewData" - // ... + ... ], "uris": [ { @@ -31,9 +31,9 @@ This section uses the operation of using a browser to open a website as an examp }, { "scheme": "http", - // ... + ... } - // ... + ... ] } ] @@ -59,19 +59,18 @@ function implicitStartAbility() { 'uri': 'https://www.test.com:8080/query/student' } context.startAbility(wantInfo).then(() => { - // ... + ... }).catch((err) => { - // ... + ... }) } ``` The matching process is as follows: -1. If **action** in the passed **want** parameter is specified and is included in **actions** under **skills** of the ability to match, the matching is successful. -2. If **entities** in the passed **want** parameter is specified and is included in **entities** under **skills** of the ability to match, the matching is successful. -3. If **uri** in the passed **want** parameter is included in **uris** under **skills** of the ability to match, which is concatenated into https://www.test.com:8080/query* (where * is a wildcard), the matching is successful. -4. If **type** in the passed **want** parameter is specified and is included in **type** under **skills** of the ability to match, the matching is successful. +1. If **action** in the passed **want** parameter is specified and is included in **actions** under **skills** of the application component to match, the matching is successful. +2. If **entities** in the passed **want** parameter is specified and is included in **entities** under **skills** of the application component to match, the matching is successful. +3. If **uri** in the passed **want** parameter is included in **uris** under **skills** of the application component to match, which is concatenated into https://www.test.com:8080/query* (where * is a wildcard), the matching is successful. If there are multiple matching applications, the system displays a dialog box for you to select one of them. The following figure shows an example. diff --git a/en/application-dev/application-models/abilitystage.md b/en/application-dev/application-models/abilitystage.md index 769c6b4540856a553ca30f02c0a689e1c32f2307..da764a445a6d1a79a601719f069798191641a986 100644 --- a/en/application-dev/application-models/abilitystage.md +++ b/en/application-dev/application-models/abilitystage.md @@ -24,7 +24,7 @@ AbilityStage is not automatically generated in the default project of DevEco Stu // When the HAP of the application is loaded for the first time, initialize the module. } onAcceptWant(want) { - // Triggered only for the ability with the specified launch type. + // Triggered only for the UIAbility with the specified launch type. return "MyAbilityStage"; } } @@ -37,7 +37,7 @@ AbilityStage is not automatically generated in the default project of DevEco Stu "name": "entry", "type": "entry", "srcEntry": "./ets/myabilitystage/MyAbilityStage.ts", - // ... + ... } } ``` diff --git a/en/application-dev/application-models/accessibilityextensionability.md b/en/application-dev/application-models/accessibilityextensionability.md index 688eaefa4bc10723d23f880dfbb4c1502cb42053..c14b4b95921f8adef52c83b20253d26b774b16fa 100644 --- a/en/application-dev/application-models/accessibilityextensionability.md +++ b/en/application-dev/application-models/accessibilityextensionability.md @@ -12,17 +12,31 @@ The **AccessibilityExtensionAbility** module provides accessibility extension ca This document is organized as follows: -- [AccessibilityExtensionAbility Development](#accessibilityextensionability-development) - - [Creating an Accessibility Extension Service](#creating-an-accessibility-extension-service) - - [Creating a Project](#creating-a-project) - - [Creating an AccessibilityExtAbility File](#creating-an-accessibilityextability-file) - - [Processing an Accessibility Event](#processing-an-accessibility-event) - - [Declaring Capabilities of Accessibility Extension Services](#declaring-capabilities-of-accessibility-extension-services) - - [Enabling a Custom Accessibility Extension Service](#enabling-a-custom-accessibility-extension-service) +- [AccessibilityExtensionAbility Overview](#accessibilityextensionability-overview) +- [Creating an Accessibility Extension Service](#creating-an-accessibility-extension-service) +- [Processing an Accessibility Event](#processing-an-accessibility-event) +- [Declaring Capabilities of Accessibility Extension Services](#declaring-capabilities-of-accessibility-extension-services) +- [Enabling a Custom Accessibility Extension Service](#enabling-a-custom-accessibility-extension-service) + +## AccessibilityExtensionAbility Overview + +Accessibility is about giving equal access to everyone so that they can access and use information equally and conveniently under any circumstances. It helps narrow the digital divide between people of different classes, regions, ages, and health status in terms of information understanding, information exchange, and information utilization, so that they can participate in social life more conveniently and enjoy the benefits of technological advances. + +AccessibilityExtensionAbility is an accessibility extension service framework. It allows you to develop your own extension services and provides a standard mechanism for exchanging information between applications and extension services. You can make use of the provided capabilities and APIs to develop accessibility features for users with disabilities or physical limitations. For example, you can develop a screen reader for users with vision impairments. + +Below shows the AccessibilityExtensionAbility framework. + +![AccessibilityFramework](figures/AccessibilityFramework.png) + +1. Accessibility app: extension service application developed based on the AccessibilityExtensionAbility framework, for example, a screen reader application. +2. Target app: application assisted by the accessibility app. +3. AccessibilityAbilityManagerService (AAMS): main service of the AccessibilityExtensionAbility framework, which is used to manage the lifecycle of accessibility apps and provide a bridge for information exchange between accessibility apps and target apps. +4. AccessibilityAbility (AAkit): ability that is used by the accessibility app to build an extension service ability operating environment and that provides interfaces for the accessibility app to query and operate the target app, including performing click/long press operations. +5. AccessibilitySystemAbilityClient (ASACkit): used by the target app to send accessibility events, such as content change events, to AAMS, and respond to the instructions (such as performing click/long press operations) sent by the accessibility app through AAMS. ## Creating an Accessibility Extension Service -You can create an accessibility extension service by creating a project from scratch or adding the service to an existing project. +You can create an accessibility extension service by creating a project from scratch or adding the service to an existing project. Only one accessibility extension service can be created for a project. ### Creating a Project @@ -40,15 +54,15 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens class AccessibilityExtAbility extends AccessibilityExtensionAbility { onConnect() { - console.log('AccessibilityExtAbility onConnect'); + console.info('AccessibilityExtAbility onConnect'); } onDisconnect() { - console.log('AccessibilityExtAbility onDisconnect'); + console.info('AccessibilityExtAbility onDisconnect'); } onAccessibilityEvent(accessibilityEvent) { - console.log('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent)); + console.info('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent)); } } @@ -69,9 +83,9 @@ You can process the service logic for accessibility events in the **onAccessibil ```typescript onAccessibilityEvent(accessibilityEvent) { - console.log('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent)); + console.info('AccessibilityExtAbility onAccessibilityEvent: ' + JSON.stringify(accessibilityEvent)); if (accessibilityEvent.eventType === 'pageStateUpdate') { - console.log('AccessibilityExtAbility onAccessibilityEvent: pageStateUpdate'); + console.info('AccessibilityExtAbility onAccessibilityEvent: pageStateUpdate'); // TODO: Develop custom logic. } } @@ -119,3 +133,4 @@ To enable or disable an accessibility extension service, run the following comma In the preceding commands, **AccessibilityExtAbility** indicates the name of the accessibility extension service, **com.example.demo** indicates the bundle name, and **rg** indicates the capabilities (**r** is short for retrieve). If the service is enabled or disabled successfully, the message "enable ability successfully" or "disable ability successfully" is displayed. + diff --git a/en/application-dev/application-models/actions-entities.md b/en/application-dev/application-models/actions-entities.md index 5c5aed302c6f8f570238fac6bd73c263840244d6..38119a1b1fe16067f7e89629811327ad079a5d15 100644 --- a/en/application-dev/application-models/actions-entities.md +++ b/en/application-dev/application-models/actions-entities.md @@ -1,9 +1,8 @@ # Common action and entities Values -**action**: Action to take, such as viewing, sharing, and application details, by the caller. In implicit Want, you can define this field and use it together with **uri** or **parameters** to specify the operation to be performed on the data, for example, viewing URI data. For example, if the URI is a website and the action is **ohos.want.action.viewData**, the ability that supports website viewing is matched. Declaring the **action** field in Want indicates that the invoked application should support the declared operation. The **actions** field under **skills** in the configuration file indicates the operations supported by the application. +The **action** field specifies the common operation (such as viewing, sharing, and application details) to be performed by the caller. In implicit [Want](../reference/apis/js-apis-app-ability-want.md), you can define this field and use it together with **uri** or **parameters** to specify the operation to be performed on the data, for example, viewing URI data. For example, if the URI is a website and the action is **ohos.want.action.viewData**, the application component that supports website viewing is matched. Declaring the **action** field in [Want](../reference/apis/js-apis-app-ability-want.md) indicates that the invoked application is expected to support the declared operation. The **actions** field under **skills** in the configuration file indicates the operations supported by the application. - -**Common action Values** +The following **action** values are available: - **ACTION_HOME**: action of starting the application entry component. It must be used together with **ENTITY_HOME**. The application icon on the home screen is an explicit entry component. Users can touch the icon to start the entry component. Multiple entry components can be configured for an application. @@ -14,14 +13,13 @@ - **ACTION_VIEW_MULTIPLE_DATA**: action of launching the UI for sending multiple data records. -**entities**: Category information (such as browser and video player) of the target ability. It is a supplement to **action** in implicit Want. You can define this field to filter application categories, for example, browser. Declaring the **entities** field in Want indicates that the invoked application should belong to the declared category. The **entities** field under **skills** in the configuration file indicates the categories supported by the application. - +The **entities** field specify the category information (such as browser and video player) of the target application component. It is a supplement to **action** in implicit Want. You can define this field to filter application categories, for example, browser. Declaring the **entities** field in Want indicates that the invoked application should belong to the declared category. The **entities** field under **skills** in the configuration file indicates the categories supported by the application. -**Common entities Values** +The following **entities** values are available: - **ENTITY_DEFAULT**: default category, which is meaningless. -- **ENTITY_HOME**: abilities with an icon displayed on the home screen. +- **ENTITY_HOME**: application components with an icon displayed on the home screen. - **ENTITY_BROWSABLE**: browser type. diff --git a/en/application-dev/application-models/app-deviceconfig-switch.md b/en/application-dev/application-models/app-deviceconfig-switch.md index 1092c21081cd9a8d62c92a1a68ba434efee7c8c9..6c872f0c167bd4779516d611ee07d9036ca550ee 100644 --- a/en/application-dev/application-models/app-deviceconfig-switch.md +++ b/en/application-dev/application-models/app-deviceconfig-switch.md @@ -22,7 +22,7 @@ OpenHarmony has reconstructed the [deviceConfig](../quick-start/deviceconfig-str | deviceConfig in the FA Model| Description| Stage Model| Difference| | -------- | -------- | -------- | -------- | | deviceConfig| Device information.| / | This tag is no longer available in the stage model. In the stage model, device information is configured under the **app** tag.| -| process | Name of the process running the application or ability. If the **process** attribute is configured in the **deviceConfig** tag, all abilities of the application run in this process. You can set the **process** attribute for a specific ability in the **abilities** attribute, so that the ability can run in the particular process.| / | The stage model does not support the configuration of process names.| +| process | Name of the process running the application or UIAbility. If the **process** attribute is configured in the **deviceConfig** tag, all UIAbilities of the application run in this process. You can set the **process** attribute for a specific UIAbility in the **abilities** attribute, so that the UIAbility can run in the particular process.| / | The stage model does not support the configuration of process names.| | keepAlive | Whether the application is always running. This attribute applies only to system applications and does not take effect for third-party applications.| / | The stage model does not support changing of the model control mode for system applications.| | supportBackup | Whether the application supports data backup and restore.| / | This configuration is not supported in the stage model.| | compressNativeLibs | Whether the **libs** libraries are packaged in the HAP file after being compressed.| / | This configuration is not supported in the stage model.| diff --git a/en/application-dev/application-models/application-component-configuration-fa.md b/en/application-dev/application-models/application-component-configuration-fa.md index 4cc1c9ad6831f0e54ae4c70f4f7229a7abc7c62f..336ad698d0f2298045b00fe0af1563574bccfd24 100644 --- a/en/application-dev/application-models/application-component-configuration-fa.md +++ b/en/application-dev/application-models/application-component-configuration-fa.md @@ -22,7 +22,7 @@ When developing an application, you may need to configure certain tags to identi "actions": ["action.system.home"] } ] - // ... + ... } ``` diff --git a/en/application-dev/application-models/application-component-configuration-stage.md b/en/application-dev/application-models/application-component-configuration-stage.md index bcf9b095464ba0110c35be9cfef44b078a091ffb..b50d40b4a694ecdf55338d249a20ff458d36ba20 100644 --- a/en/application-dev/application-models/application-component-configuration-stage.md +++ b/en/application-dev/application-models/application-component-configuration-stage.md @@ -1,10 +1,12 @@ # Application- or Component-Level Configuration (Stage Model) +When developing an application, you may need to configure certain tags to identify the application, such as the bundle name and application icon. This topic describes key tags that need to be configured during application development. -When developing an application, you may need to configure certain tags to identify the application, such as the bundle name and application icon. This topic describes key tags that need to be configured during application development. Icons and labels are usually configured together. There is the application icon, application label, entry icon, and entry label, which correspond to the **icon** and **label** fields in the [app.json5 file](../quick-start/app-configuration-file.md) and [module.json5 file](../quick-start/module-configuration-file.md). The application icon and label are used in **Settings**. For example, they are displayed in the application list in **Settings**. The entry icon is displayed on the device's home screen after the application is installed. The entry icon maps to a [UIAbility](uiability-overview.md) component. Therefore, an application can have multiple entry icons and labels. When you touch one of them, the corresponding UIAbility page is displayed. +Icons and labels are usually configured together. There is the application icon, application label, entry icon, and entry label, which correspond to the **icon** and **label** fields in the [app.json5 file](../quick-start/app-configuration-file.md) and [module.json5 file](../quick-start/module-configuration-file.md). +The application icon and label are used in **Settings**. For example, they are displayed in the application list in **Settings**. The entry icon is displayed on the device's home screen after the application is installed. The entry icon maps to a [UIAbility](uiability-overview.md) component. Therefore, an application can have multiple entry icons and entry labels. When you touch one of them, the corresponding UIAbility page is displayed. - **Figure 1** Icons and labels +**Figure 1** Icons and labels ![application-component-configuration-stage](figures/application-component-configuration-stage.png) @@ -22,13 +24,13 @@ When developing an application, you may need to configure certain tags to identi The application label is specified by the **label** field in the [app.json5 file](../quick-start/app-configuration-file.md) in the **AppScope** module of the project. The **label** field specifies the application name displayed to users. It must be set to the index of a string resource. ```json - { - "app": { - "icon": "$media:app_icon", - "label": "$string:app_name" - // ... - } + { + "app": { + "icon": "$media:app_icon", + "label": "$string:app_name" + ... } + } ``` - **Configuring the entry icon and label** @@ -40,7 +42,7 @@ When developing an application, you may need to configure certain tags to identi ```json { "module": { - // ... + ... "abilities": [ { // The information starting with $ is the resource value. @@ -61,6 +63,35 @@ When developing an application, you may need to configure certain tags to identi } } ``` + OpenHarmony strictly controls applications without icons to prevent malicious applications from deliberately configuring no icon to block uninstall attempts. + + To hide an application icon from the home screen, you must configure the **AllowAppDesktopIconHide** privilege. For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md). The rules for displaying the entry icon and entry label are as follows: + + 1. The HAP file contains UIAbility configuration. + * An entry icon is set in the **abilities** field of the **module.json5** file. + * The application does not have the privilege to hide its icon from the home screen. + * The system uses the icon configured for the UIAbility as the entry icon and displays it on the home screen. Touching this icon will direct the user to the home page of the UIAbility. + * The system uses the label configured for the UIAbility as the entry label and displays it on the home screen. If no label is configured, the system uses the label specified in the **app.json5** file as the entry label and displays it on the home screen. + * The application has the privilege to hide its icon from the home screen. + * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen. + * No entry icon is set in the **abilities** field of the **module.json5** file. + * The application does not have the privilege to hide its icon from the home screen. + * The system uses the icon specified in the **app.json5** file as the entry icon and displays it on the home screen. Touching this icon will direct the user to the application details page, as shown below. + * The system uses the label specified in the **app.json5** file as the entry label and displays it on the home screen. + * The application has the privilege to hide its icon from the home screen. + * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen. + + 2. The HAP file does not contain UIAbility configuration. + * The application does not have the privilege to hide its icon from the home screen. + * The system uses the icon specified in the **app.json5** file as the entry icon and displays it on the home screen. Touching this icon will direct the user to the application details page, as shown below. + * The system uses the label specified in the **app.json5** file as the entry label and displays it on the home screen. + * The application has the privilege to hide its icon from the home screen. + * The application information is not returned when the home screen queries the information, and the entry icon and label of the application are not displayed on the home screen. + + **Figure 2** Application details page + + ![Application details page](figures/application_details.jpg) + - **Configuring application version declaration** To declare the application version, configure the **versionCode** and **versionName** fields in the [app.json5 file](../quick-start/app-configuration-file.md) in the **AppScope** directory of the project. **versionCode** specifies the version number of the application. The value is a 32-bit non-negative integer. It is used only to determine whether a version is later than another version. A larger value indicates a later version. **versionName** provides the text description of the version number. diff --git a/en/application-dev/application-models/application-context-stage.md b/en/application-dev/application-models/application-context-stage.md index 3fc6df944c5b9b137c585f59a8f83cd61db226f9..2063eee286c25e360a1700d3e1771d865b875f1c 100644 --- a/en/application-dev/application-models/application-context-stage.md +++ b/en/application-dev/application-models/application-context-stage.md @@ -1,19 +1,16 @@ # Context (Stage Model) - ## Overview -[Context](../reference/apis/js-apis-inner-application-context.md) is the context of an object in an application. It provides basic information about the application, for example, **resourceManager**, **applicationInfo**, **dir** (application development path), and **area** (encryption level). It also provides basic methods such as **createBundleContext()** and **getApplicationContext()**. The UIAbility component and ExtensionAbility derived class components have their own **Context** classes, for example, the base class **Context**, **ApplicationContext**, **AbilityStageContext**, **UIAbilityContext**, **ExtensionContext**, and **ServiceExtensionContext**. +[Context](../reference/apis/js-apis-inner-application-context.md) is the context of an object in an application. It provides basic information about the application, for example, **resourceManager**, **applicationInfo**, **dir** (application development path), and **area** (encrypted level). It also provides basic methods such as **createBundleContext()** and **getApplicationContext()**. The UIAbility component and ExtensionAbility derived class components have their own **Context** classes, for example, the base class **Context**, **ApplicationContext**, **AbilityStageContext**, **UIAbilityContext**, **ExtensionContext**, and **ServiceExtensionContext**. - The figure below illustrates the inheritance relationship of contexts. - ![context-inheritance](figures/context-inheritance.png) - + - The figure below illustrates the holding relationship of contexts. - ![context-holding](figures/context-holding.png) -- The following describes the information provided by different contexts. +The following describes the information provided by different contexts. - [UIAbilityContext](../reference/apis/js-apis-inner-application-uiAbilityContext.md): Each UIAbility has the **Context** attribute, which provides APIs to operate an application component, obtain the application component configuration, and more. ```ts @@ -21,7 +18,7 @@ export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { let uiAbilityContext = this.context; - // ... + ... } } ``` @@ -36,7 +33,7 @@ export default class MyService extends ServiceExtensionAbility { onCreate(want) { let serviceExtensionContext = this.context; - // ... + ... } } ``` @@ -47,7 +44,7 @@ export default class MyAbilityStage extends AbilityStage { onCreate() { let abilityStageContext = this.context; - // ... + ... } } ``` @@ -58,7 +55,7 @@ export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { let applicationContext = this.context.getApplicationContext(); - // ... + ... } } ``` @@ -84,13 +81,13 @@ The following table describes the application development paths obtained from co | Name| Type| Readable| Writable| Description| | -------- | -------- | -------- | -------- | -------- | -| bundleCodeDir | string | Yes | No | Path for storing the application's installation package, that is, installation directory of the application on the internal storage. Do not access resource files by concatenating paths. Use [@ohos.resourceManager] instead. | -| cacheDir | string | Yes| No| Path for storing the application's cache files, that is, cache directory of the application on the internal storage.
It is the content of **Storage** of an application under **Settings > Apps & services > Apps**.| -| filesDir | string | Yes | No | Path for storing the application's common files, that is, file directory of the application on the internal storage.
Files in this directory may be synchronized to other directories during application migration or backup.| -| preferencesDir | string | Yes | Yes | Path for storing the application's preference files, that is, preferences directory of the application. | -| tempDir | string | Yes | No | Path for storing the application's temporary files.
Files in this directory are deleted after the application is uninstalled.| +| bundleCodeDir | string | Yes | No | Path for storing the application's installation package, that is, installation directory of the application on the internal storage. | +| cacheDir | string | Yes| No| Path for storing the cache files, that is, cache directory of the application on the internal storage.
It is the content of **Storage** of an application under **Settings > Apps & services > Apps**.| +| filesDir | string | Yes | No | Path for storing the common files, that is, file directory of the application on the internal storage.
Files in this directory may be synchronized to other directories during application migration or backup.| +| preferencesDir | string | Yes | Yes | Path for storing the preference files, that is, preferences directory of the application. | +| tempDir | string | Yes | No | Path for storing the temporary files.
Files in this directory are deleted after the application is uninstalled.| | databaseDir | string | Yes | No | Path for storing the application's database, that is, storage directory of the local database. | -| distributedFilesDir | string | Yes| No| Path for storing the application's distributed files.| +| distributedFilesDir | string | Yes| No| Path for storing the distributed files.| The capability of obtaining the application development path is provided by the base class **Context**. This capability is also provided by **ApplicationContext**, **AbilityStageContext**, **UIAbilityContext**, and **ExtensionContext**. However, the paths obtained from different contexts may differ, as shown below. @@ -135,7 +132,7 @@ export default class EntryAbility extends UIAbility { let bundleCodeDir = this.context.bundleCodeDir; let distributedFilesDir = this.context.distributedFilesDir; let preferencesDir = this.context.preferencesDir; - // ... + ... } } ``` @@ -187,13 +184,13 @@ The base class **Context** provides [createBundleContext(bundleName:string)](../ > **NOTE** > > To obtain the context of another application: - > + > > - Request the **ohos.permission.GET_BUNDLE_INFO_PRIVILEGED** permission. For details, see [Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file). - > + > > - This is a system API and cannot be called by third-party applications. For example, application information displayed on the home screen includes the application name and icon. The home screen application calls the foregoing method to obtain the context information, so as to obtain the resource information including the application name and icon. - + ```ts import UIAbility from '@ohos.app.ability.UIAbility'; @@ -202,7 +199,7 @@ The base class **Context** provides [createBundleContext(bundleName:string)](../ let bundleName2 = 'com.example.application'; let context2 = this.context.createBundleContext(bundleName2); let label2 = context2.applicationInfo.label; - // ... + ... } } ``` @@ -224,7 +221,7 @@ The base class **Context** provides [createBundleContext(bundleName:string)](../ let bundleName2 = 'com.example.application'; let moduleName2 = 'module1'; let context2 = this.context.createModuleContext(bundleName2, moduleName2); - // ... + ... } } ``` @@ -238,7 +235,7 @@ The base class **Context** provides [createBundleContext(bundleName:string)](../ onCreate(want, launchParam) { let moduleName2 = 'module1'; let context2 = this.context.createModuleContext(moduleName2); - // ... + ... } } ``` @@ -266,53 +263,53 @@ export default class EntryAbility extends UIAbility { let abilityLifecycleCallback = { // Called when a UIAbility is created. onAbilityCreate(uiAbility) { - console.log(TAG, `onAbilityCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onAbilityCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); }, // Called when a window is created. onWindowStageCreate(uiAbility, windowStage: window.WindowStage) { - console.log(TAG, `onWindowStageCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); - console.log(TAG, `onWindowStageCreate windowStage: ${JSON.stringify(windowStage)}`); + console.info(TAG, `onWindowStageCreate uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onWindowStageCreate windowStage: ${JSON.stringify(windowStage)}`); }, // Called when the window becomes active. onWindowStageActive(uiAbility, windowStage: window.WindowStage) { - console.log(TAG, `onWindowStageActive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); - console.log(TAG, `onWindowStageActive windowStage: ${JSON.stringify(windowStage)}`); + console.info(TAG, `onWindowStageActive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onWindowStageActive windowStage: ${JSON.stringify(windowStage)}`); }, // Called when the window becomes inactive. onWindowStageInactive(uiAbility, windowStage: window.WindowStage) { - console.log(TAG, `onWindowStageInactive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); - console.log(TAG, `onWindowStageInactive windowStage: ${JSON.stringify(windowStage)}`); + console.info(TAG, `onWindowStageInactive uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onWindowStageInactive windowStage: ${JSON.stringify(windowStage)}`); }, // Called when the window is destroyed. onWindowStageDestroy(uiAbility, windowStage: window.WindowStage) { - console.log(TAG, `onWindowStageDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); - console.log(TAG, `onWindowStageDestroy windowStage: ${JSON.stringify(windowStage)}`); + console.info(TAG, `onWindowStageDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onWindowStageDestroy windowStage: ${JSON.stringify(windowStage)}`); }, // Called when the UIAbility is destroyed. onAbilityDestroy(uiAbility) { - console.log(TAG, `onAbilityDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onAbilityDestroy uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); }, // Called when the UIAbility is switched from the background to the foreground. onAbilityForeground(uiAbility) { - console.log(TAG, `onAbilityForeground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onAbilityForeground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); }, // Called when the UIAbility is switched from the foreground to the background. onAbilityBackground(uiAbility) { - console.log(TAG, `onAbilityBackground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onAbilityBackground uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); }, // Called when UIAbility is continued on another device. onAbilityContinue(uiAbility) { - console.log(TAG, `onAbilityContinue uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); + console.info(TAG, `onAbilityContinue uiAbility.launchWant: ${JSON.stringify(uiAbility.launchWant)}`); } } // Obtain the application context. let applicationContext = this.context.getApplicationContext(); // Register the application lifecycle callback. this.lifecycleId = applicationContext.on('abilityLifecycle', abilityLifecycleCallback); - console.log(TAG, `register callback number: ${this.lifecycleId}`); + console.info(TAG, `register callback number: ${this.lifecycleId}`); } - // ... + ... onDestroy() { // Obtain the application context. diff --git a/en/application-dev/application-models/application-model-description.md b/en/application-dev/application-models/application-model-description.md index 0cdfa7323c6ef367a47a44e2c30104d3201ca159..20fa9019d10c8d242e34b309debec78e722e6c27 100644 --- a/en/application-dev/application-models/application-model-description.md +++ b/en/application-dev/application-models/application-model-description.md @@ -12,10 +12,9 @@ Along its evolution, OpenHarmony has provided two application models: The stage model is designed based on the following considerations, which make it become the recommended model: 1. **Designed for complex applications** - - In the stage model, multiple application components share an ArkTS engine (VM running the programming language ArkTS) instance, making it easy for application components to share objects and status while requiring less memory. - The object-oriented development mode makes the code of complex applications easy to read, maintain, and scale. - + 2. **Native support for [cross-device migration](hop-cross-device-migration.md) and [multi-device collaboration](hop-multi-device-collaboration.md) at the application component level** The stage model decouples application components from User Interfaces (UIs). @@ -38,7 +37,7 @@ The stage model is designed based on the following considerations, which make it The stage model redefines the boundary of application capabilities to well balance application capabilities and system management costs. - - Diverse application components (such as widgets and input methods) for specific scenarios. + - Diverse application components (such as service widgets and input methods) for specific scenarios. - Standardized background process management. To deliver a better user experience, the stage model manages background application processes in a more orderly manner. Applications cannot reside in the background randomly, and their background behavior is strictly managed to minimize malicious behavior. @@ -52,8 +51,8 @@ The table below describes their differences in detail. | Item| FA model| Stage model| | -------- | -------- | -------- | -| **Application component**| 1. Component classification
![fa-model-component](figures/fa-model-component.png)
- PageAbility: has the UI and supports user interaction For details, see [PageAbility Component Overview](pageability-overview.md).
- ServiceAbility: provides background services and has no UI. For details, see [ServiceAbility Component Overview](serviceability-overview.md).
- DataAbility: provides the data sharing capability and has no UI. For details, see [DataAbility Component Overview](dataability-overview.md).
2. Development mode
Application components are specified by exporting anonymous objects and fixed entry files. You cannot perform derivation. It is inconvenient for capability expansion. | 1. Component classification
![stage-model-component](figures/stage-model-component.png)
- UIAbility: has the UI and supports user interaction. For details, see [UIAbility Component Overview](uiability-overview.md).
- ExtensionAbility: provides extension capabilities (such as widget and input methods) for specific scenarios. For details, see [ExtensionAbility Component Overview](extensionability-overview.md).
2. Development mode
The object-oriented mode is used to provide open application components as classes. You can derive application components for capability expansion. | -| **Process model**| There are two types of processes:
1. Main process
2. Rendering process
For details, see [Process Model (FA Model)](process-model-fa.md).| There are three types of processes:
1. Main process
2. ExtensionAbility process
3. Rendering process
For details, see [Process Model (Stage Model)](process-model-stage.md).| -| **Thread model**| 1. ArkTS engine instance creation
A process can run multiple application component instances, and each application component instance runs in an independent ArkTS engine instance.
2. Thread model
Each ArkTS engine instance is created on an independent thread (non-main thread). The main thread does not have an ArkTS engine instance.
3. Intra-process object sharing: not supported.
For details, see [Thread Model (FA Model)](thread-model-fa.md).| 1. ArkTS engine instance creation
A process can run multiple application component instances, and all application component instances share one ArkTS engine instance.
2. Thread model
The ArkTS engine instance is created on the main thread.
3. Intra-process object sharing: supported.
For details, see [Thread Model (Stage Model)](thread-model-stage.md).| +| **Application component**| 1. Component classification
![fa-model-component](figures/fa-model-component.png)
- PageAbility: has the UI and supports user interaction For details, see [PageAbility Component Overview](pageability-overview.md).
- ServiceAbility: provides background services and has no UI. For details, see [ServiceAbility Component Overview](serviceability-overview.md).
- DataAbility: provides the data sharing capability and has no UI. For details, see [DataAbility Component Overview](dataability-overview.md).
2. Development mode
Application components are specified by exporting anonymous objects and fixed entry files. You cannot perform derivation. It is inconvenient for capability expansion.| 1. Component classification
![stage-model-component](figures/stage-model-component.png)
- UIAbility: has the UI and supports user interaction. For details, see [UIAbility Component Overview](uiability-overview.md).
- ExtensionAbility: provides extension capabilities (such as widget and input methods) for specific scenarios. For details, see [ExtensionAbility Component Overview](extensionability-overview.md).
2. Development mode
The object-oriented mode is used to provide open application components as classes. You can derive application components for capability expansion.| +| **Process model**| There are two types of processes:
1. Main process
2. Rendering process
For details, see [Process Model Overview (FA Model)](process-model-fa.md). | There are three types of processes:
1. Main process
2. ExtensionAbility process
3. Rendering process
For details, see [Process Model Overview (Stage Model)](process-model-stage.md). | +| **Thread model**| 1. ArkTS engine instance creation
A process can run multiple application component instances, and each application component instance runs in an independent ArkTS engine instance.
2. Thread model
Each ArkTS engine instance is created on an independent thread (non-main thread). The main thread does not have an ArkTS engine instance.
3. Intra-process object sharing: not supported.
For details, see [Thread Model Overview (FA Model)](thread-model-fa.md). | 1. ArkTS engine instance creation
A process can run multiple application component instances, and all application component instances share one ArkTS engine instance.
2. Thread model
The ArkTS engine instance is created on the main thread.
3. Intra-process object sharing: supported.
For details, see [Thread Model Overview (Stage Model)](thread-model-stage.md). | | **Mission management model**| - A mission is created for each PageAbility component instance.
- Missions are stored persistently until the number of missions exceeds the maximum (customized based on the product configuration) or users delete missions.
- PageAbility components do not form a stack structure.
For details, see [Mission Management Scenarios](mission-management-overview.md).| - A mission is created for each UIAbility component instance.
- Missions are stored persistently until the number of missions exceeds the maximum (customized based on the product configuration) or users delete missions.
- UIAbility components do not form a stack structure.
For details, see [Mission Management Scenarios](mission-management-overview.md).| | **Application configuration file**| The **config.json** file is used to describe the application, HAP, and application component information.
For details, see [Application Configuration File Overview (FA Model)](../quick-start/application-configuration-file-overview-fa.md).| The **app.json5** file is used to describe the application information, and the **module.json5** file is used to describe the HAP and application component information.
For details, see [Application Configuration File Overview (Stage Model)](../quick-start/application-configuration-file-overview-stage.md).| diff --git a/en/application-dev/application-models/arkts-ui-widget-event-call.md b/en/application-dev/application-models/arkts-ui-widget-event-call.md new file mode 100644 index 0000000000000000000000000000000000000000..073506706053e31402d7c69d645138ec7ab112cc --- /dev/null +++ b/en/application-dev/application-models/arkts-ui-widget-event-call.md @@ -0,0 +1,89 @@ +# Launching a UIAbility in the Background Through the call Event + + +There may be cases you want to provide in a widget access to features available in your application when it is running in the foreground, for example, the play, pause, and stop buttons in a music application widget. This is where the **call** capability of the **postCardAction** API comes in handy. This capability, when used in a widget, can start the specified UIAbility of the widget provider in the background. It also allows the widget to call the specified method of the application and transfer data so that the application, while in the background, can behave accordingly in response to touching of the buttons on the widget. + + +Generally, buttons are used to trigger the **call** event. Below is an example. + + +- In this example, two buttons are laid out on the widget page. When one button is clicked, the **postCardAction** API is called to send a **call** event to the target UIAbility. Note that the **method** parameter in the API indicates the method to call in the target UIAbility. It is mandatory and of the string type. + + ```ts + @Entry + @Component + struct WidgetCard { + build() { + Column() { + Button ('Feature A') + .margin('20%') + .onClick(() => { + console.info('call EntryAbility funA'); + postCardAction(this, { + 'action': 'call', + 'abilityName': 'EntryAbility', // Only the UIAbility of the current application is allowed. + 'params': { + 'method': 'funA' // Set the name of the method to call in the EntryAbility. + } + }); + }) + + Button ('Feature B') + .margin('20%') + .onClick(() => { + console.info('call EntryAbility funB'); + postCardAction(this, { + 'action': 'call', + 'abilityName': 'EntryAbility', // Only the UIAbility of the current application is allowed. + 'params': { + 'method': 'funB', // Set the name of the method to call in the EntryAbility. + 'num': 1 // Set other parameters to be transferred. + } + }); + }) + } + .width('100%') + .height('100%') + } + } + ``` + +- The UIAbility receives the **call** event and obtains the transferred parameters. It then executes the target method specified by the **method** parameter. Other data can be obtained in readString mode. Listen for the method required by the **call** event in the **onCreate** callback of the UIAbility. + + ```ts + import UIAbility from '@ohos.app.ability.UIAbility'; + + function FunACall(data) { + // Obtain all parameters transferred in the call event. + console.info('FunACall param:' + JSON.stringify(data.readString())); + return null; + } + + function FunBCall(data) { + console.info('FunACall param:' + JSON.stringify(data.readString())); + return null; + } + + export default class CameraAbility extends UIAbility { + // If the UIAbility is started for the first time, the onCreate lifecycle callback is triggered after the call event is received. + onCreate(want, launchParam) { + try { + // Listen for the method required by the call event. + this.callee.on('funA', FunACall); + this.callee.on('funB', FunBCall); + } catch (error) { + console.error(`Failed to register callee on. Cause: ${JSON.stringify(err)}`); + } + } + + // Deregister the listener when the process exits. + onDestroy() { + try { + this.callee.off('funA'); + this.callee.off('funB'); + } catch (err) { + console.error(`Failed to register callee off. Cause: ${JSON.stringify(err)}`); + } + } + }; + ``` diff --git a/en/application-dev/application-models/arkts-ui-widget-event-formextensionability.md b/en/application-dev/application-models/arkts-ui-widget-event-formextensionability.md index 861f5ca66eea9a06ee50c7b1448e1f6ed040c01a..be7761d8d78da5102afadd2c37043c228dfcd53e 100644 --- a/en/application-dev/application-models/arkts-ui-widget-event-formextensionability.md +++ b/en/application-dev/application-models/arkts-ui-widget-event-formextensionability.md @@ -1,7 +1,7 @@ -# Updating Widget Content Through FormExtensionAbility +# Updating Widget Content Through the message Event -On the widget page, the **postCardAction** API can be used to trigger a message event to the FormExtensionAbility, which then updates the widget content. The following is an example of this widget update mode. +On the widget page, the **postCardAction** API can be used to trigger a message event to start a FormExtensionAbility, which then updates the widget content. The following is an example of this widget update mode. - On the widget page, register the **onClick** event callback of the button and call the **postCardAction** API in the callback to trigger the event to the FormExtensionAbility. @@ -57,10 +57,10 @@ On the widget page, the **postCardAction** API can be used to trigger a message }) } - // ... + ... } ``` The figure below shows the effect. - + ![WidgetUpdatePage](figures/WidgetUpdatePage.png) diff --git a/en/application-dev/application-models/arkts-ui-widget-event-overview.md b/en/application-dev/application-models/arkts-ui-widget-event-overview.md index fbc77b97a27b52b0f7b2a3b0cebc5b5cb5940f72..ed029fc3017d00a7d4c2cf14e1b905139bd7eb49 100644 --- a/en/application-dev/application-models/arkts-ui-widget-event-overview.md +++ b/en/application-dev/application-models/arkts-ui-widget-event-overview.md @@ -1,40 +1,31 @@ # Widget Event Capability Overview - The ArkTS widget provides the **postCardAction()** API for interaction between the widget internal and the provider application. Currently, this API supports the router, message, and call events and can be called only in the widget. - ![WidgetPostCardAction](figures/WidgetPostCardAction.png) +**Definition**: postCardAction(component: Object, action: Object): void -Definition: postCardAction(component: Object, action: Object): void - - -Parameters: - +**Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | component | Object | Yes| Instance of the current custom component. Generally, **this** is transferred.| | action | Object | Yes| Action description. For details, see the following table.| +**Description of the action parameter** -Description of the action parameter - - -| **Key** | **Value** | Description| +| Key | Value | Description| | -------- | -------- | -------- | -| "action" | string | Action type.
- **"router"**: application redirection. If this type of action is triggered, the corresponding UIAbility is displayed. Only the UIAbility of the current application can be displayed.
- **"message"**: custom message. If this type of action is triggered, the [onFormEvent()](../reference/apis/js-apis-app-form-formExtensionAbility.md#onformevent) lifecycle callback of the provider FormExtensionAbility is called.
- **"call"**: application startup in the background. If this type of action is triggered, the corresponding UIAbility is started but does not run in the foreground. The target application must have the permission to run in the background ([ohos.permission.KEEP_BACKGROUND_RUNNING](../security/permission-list.md#ohospermissionkeep_background_running)).| +| "action" | string | Action type.
- **"router"**: redirection to the specified UIAbility of the widget provider.
- **"message"**: custom message. If this type of action is triggered, the [onFormEvent()](../reference/apis/js-apis-app-form-formExtensionAbility.md#onformevent) lifecycle callback of the provider FormExtensionAbility is called.
- **"call"**: launch of the widget provider in the background. If this type of action is triggered, the specified UIAbility of the widget provider is started in the background, but not displayed in the foreground. This action type requires that the widget provider should have the [ohos.permission.KEEP_BACKGROUND_RUNNING](../security/permission-list.md#ohospermissionkeep_background_running) permission.| | "bundleName" | string | Name of the target bundle when **action** is **"router"** or **"call"**. This parameter is optional.| | "moduleName" | string | Name of the target module when **action** is **"router"** or **"call"**. This parameter is optional.| | "abilityName" | string | Name of the target UIAbility when **action** is **"router"** or **"call"**. This parameter is mandatory.| -| "params" | Object | Additional parameters carried in the current action. The value is a key-value pair in JSON format.| +| "params" | Object | Additional parameters carried in the current action. The value is a key-value pair in JSON format. For the **"call"** action type, the **method** parameter must be set and its value type must be string. This parameter is mandatory.| Sample code of the **postCardAction()** API: - - ```typescript Button ('Jump') .width('40%') @@ -45,18 +36,26 @@ Button ('Jump') 'bundleName': 'com.example.myapplication', 'abilityName': 'EntryAbility', 'params': { - 'message': 'testForRouter' // Customize the message to be sent. + 'message': 'testForRouter' // Customize the message to send. } }); }) -``` - - -The following are typical widget development scenarios that can be implemented through widget events: +Button ('Start in Background') + .width('40%') + .height('20%') + .onClick(() => { + postCardAction(this, { + 'action': 'call', + 'bundleName': 'com.example.myapplication', + 'abilityName': 'EntryAbility', + 'params': { + 'method': 'fun', // Set the name of the method to call. It is mandatory. + 'message': 'testForcall' // Customize the message to send. + } + }); + }) +``` -- [Updating Widget Content Through FormExtensionAbility](arkts-ui-widget-event-formextensionability.md) - -- [Updating Widget Content Through UIAbility](arkts-ui-widget-event-uiability.md) -- [Redirecting to a Specified Page Through the Router Event](arkts-ui-widget-event-router.md) +Read on to learn the typical widget development scenarios that can be implemented through widget events. diff --git a/en/application-dev/application-models/arkts-ui-widget-event-router.md b/en/application-dev/application-models/arkts-ui-widget-event-router.md index 371cbc6b2729a7985ed2fd183297ed771fddb11d..733ff7f59b57ec4295fa21cb4d83ae8a5b2b8eb4 100644 --- a/en/application-dev/application-models/arkts-ui-widget-event-router.md +++ b/en/application-dev/application-models/arkts-ui-widget-event-router.md @@ -1,8 +1,6 @@ -# Redirecting to a Specified Page Through the Router Event - - -The **router** capability of the **postCardAction** API can be used in a widget to quickly start the widget provider application. An application can provide different buttons through the widget so that users can jump to different pages at the touch of a button. For example, a camera widget provides the buttons that direct the user to respective pages, such as the page for taking a photo and the page for recording a video. +# Redirecting to a UIAbility Through the router Event +The **router** capability of the **postCardAction** API can be used in a widget to quickly start a specific UIAbility of the widget provider. By leveraging this capability, an application can provide in the widget multiple buttons, each of which targets a different target UIAbility. For example, a camera widget can provide the buttons that redirect the user to the UIAbility for taking a photo and the UIAbility for recording a video. ![WidgerCameraCard](figures/WidgerCameraCard.png) diff --git a/en/application-dev/application-models/arkts-ui-widget-event-uiability.md b/en/application-dev/application-models/arkts-ui-widget-event-uiability.md index 0d6cb33a3749c81b6b41dd4904ba64c89a7942ae..ca66e20aa2d258a0e05002296dac39c19ac131c3 100644 --- a/en/application-dev/application-models/arkts-ui-widget-event-uiability.md +++ b/en/application-dev/application-models/arkts-ui-widget-event-uiability.md @@ -1,10 +1,11 @@ -# Updating Widget Content Through UIAbility +# Updating Widget Content Through the router or call Event -On the widget page, the **postCardAction** API can be used to trigger a router or call event to start the UIAbility, which then updates the widget content. The following is an example of this widget update mode. +On the widget page, the **postCardAction** API can be used to trigger a router or call event to start a UIAbility, which then updates the widget content. The following is an example of this widget update mode. +## Updating Widget Content Through the router Event -- On the widget page, register the **onClick** event callback of the button and call the **postCardAction** API in the callback to trigger the event to the FormExtensionAbility. +- On the widget page, register the **onClick** event callback of the button and call the **postCardAction** API in the callback to trigger the **router** event to the FormExtensionAbility. ```ts let storage = new LocalStorage(); @@ -84,3 +85,104 @@ On the widget page, the **postCardAction** API can be used to trigger a router o ... } ``` + +## Updating Widget Content Through the call Event + +- When using the **call** event of the **postCardAction** API, the value of **formId** must be updated in the **onAddForm** callback of the FormExtensionAbility. + + ```ts + import formBindingData from '@ohos.app.form.formBindingData'; + import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; + + export default class EntryFormAbility extends FormExtensionAbility { + onAddForm(want) { + let formId = want.parameters["ohos.extra.param.key.form_identity"]; + let dataObj1 = { + "formId": formId + }; + let obj1 = formBindingData.createFormBindingData(dataObj1); + return obj1; + } + + ... + }; + ``` + +- On the widget page, register the **onClick** event callback of the button and call the **postCardAction** API in the callback to trigger the event to the UIAbility. + + ```ts + let storage = new LocalStorage(); + @Entry(storage) + @Component + struct WidgetCard { + @LocalStorageProp('detail') detail: string = 'init'; + @LocalStorageProp('formId') formId: string = '0'; + + build() { + Column() { + Button ('Start in Background') + .margin('20%') + .onClick(() => { + console.info('postCardAction to EntryAbility'); + postCardAction(this, { + 'action': 'call', + 'abilityName': 'EntryAbility', // Only the UIAbility of the current application is allowed. + 'params': { + 'method': 'funA', + 'formId': this.formId, + 'detail': 'CallFromCard' + } + }); + }) + Text(`${this.detail}`).margin('20%') + } + .width('100%') + .height('100%') + } + } + ``` + +- Listen for the method required by the **call** event in the **onCreate** callback of the UIAbility, and then call the [updateForm](../reference/apis/js-apis-app-form-formProvider.md#updateform) API in the corresponding method to update the widget. + + ```ts + import UIAbility from '@ohos.app.ability.UIAbility'; + import formBindingData from '@ohos.app.form.formBindingData'; + import formProvider from '@ohos.app.form.formProvider'; + import formInfo from '@ohos.app.form.formInfo'; + + const MSG_SEND_METHOD: string = 'funA'; + + // After the call event is received, the method listened for by the callee is triggered. + function FunACall(data) { + // Obtain all parameters transferred in the call event. + let params = JSON.parse(data.readString()) + if (params.formId !== undefined) { + let curFormId = params.formId; + let message = params.detail; + console.info(`UpdateForm formId: ${curFormId}, message: ${message}`); + let formData = { + "detail": message + }; + let formMsg = formBindingData.createFormBindingData(formData) + formProvider.updateForm(curFormId, formMsg).then((data) => { + console.info('updateForm success.' + JSON.stringify(data)); + }).catch((error) => { + console.error('updateForm failed:' + JSON.stringify(error)); + }) + } + return null; + } + export default class EntryAbility extends UIAbility { + // If the UIAbility is started for the first time, the onCreate lifecycle callback is triggered after the call event is received. + onCreate(want, launchParam) { + console.info('Want:' + JSON.stringify(want)); + try { + // Listen for the method required by the call event. + this.callee.on(MSG_SEND_METHOD, FunACall); + } catch (error) { + console.info(`${MSG_SEND_METHOD} register failed with error ${JSON.stringify(error)}`) + } + } + ... + } + ``` diff --git a/en/application-dev/application-models/arkts-ui-widget-image-update.md b/en/application-dev/application-models/arkts-ui-widget-image-update.md index 4862fbf747c0275d179eb4a2f988280379f2d262..dfe6dbf0e9249c66c3fb1d0723f1c7b296443381 100644 --- a/en/application-dev/application-models/arkts-ui-widget-image-update.md +++ b/en/application-dev/application-models/arkts-ui-widget-image-update.md @@ -1,10 +1,10 @@ # Updating Local and Online Images in the Widget -Generally, local images or online images downloaded from the network need to be displayed on a widget. To obtain local and online images, use the FormExtensionAbility. The following exemplifies how to show local and online images on a widget. +Typically, a widget includes local images or online images downloaded from the network. To obtain local and online images, use the FormExtensionAbility. The following exemplifies how to show local and online images on a widget. -1. Internet access is required for downloading online images. Therefore, you need to apply for the **ohos.permission.INTERNET** permission. For details, see [Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md). +1. For the widget to download online images, declare the **ohos.permission.INTERNET** permission for the widget. For details, see [Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md). 2. Update local files in the **onAddForm** lifecycle callback of the EntryFormAbility. @@ -44,7 +44,7 @@ Generally, local images or online images downloaded from the network need to be } ``` -3. Update online files in the onFormEvent lifecycle callback of the EntryFormAbility. +3. Update online images in the **onFormEvent** lifecycle callback of the EntryFormAbility. ```ts import formBindingData from '@ohos.app.form.formBindingData'; @@ -60,8 +60,8 @@ Generally, local images or online images downloaded from the network need to be 'text': 'Updating...' }) formProvider.updateForm(formId, formInfo) - // Note: The FormExtensionAbility is started when the lifecycle callback is triggered. It can run in the background for only 5 seconds. - // When possible, limit the size of the image to download. If an image cannot be downloaded within 5 seconds, it cannot be updated to the widget page. + // Note: After being started with the triggering of the lifecycle callback, the FormExtensionAbility can run in the background for only 5 seconds. + // When possible, limit the size of the image to download. If an image cannot be downloaded within 5 seconds, it will not be updated to the widget page. let netFile = 'https://xxxx/xxxx.png'; // Specify the URL of the image to download. let tempDir = this.context.getApplicationContext().tempDir; let fileName = 'file' + Date.now(); @@ -161,6 +161,6 @@ Generally, local images or online images downloaded from the network need to be ``` > **NOTE** -> - The **\** component displays images in the remote memory based on the **memory://** identifier in the input parameter (**memory://fileName**). The **fileName** value must be consistent with the key in the object (**'formImages': {key: fd}**) passed by the EntryFormAbility. +> - The **\** component displays images in the remote memory based on the **memory://** identifier in the input parameter (**memory://fileName**). The value of **fileName** must be consistent with the key in the object (**'formImages': {key: fd}**) passed by the EntryFormAbility. > -> - The **\** component determines whether to update the image based on whether the input parameter is changed. Therefore, the value of **imgName** passed by the EntryFormAbility each time must be different. If the two values of **imgName** passed consecutively are identical, the image is not updated. +> - The **\** component determines whether to update the image by comparing the values of **imgName** consecutively passed by the EntryFormAbility. It updates the image only when the values are different. diff --git a/en/application-dev/application-models/arkts-ui-widget-lifecycle.md b/en/application-dev/application-models/arkts-ui-widget-lifecycle.md index 4cb68536312e26e0f7c98546839134c0ab435a8c..fb25fd362f67646d65853b870a6a9cb518c4d760 100644 --- a/en/application-dev/application-models/arkts-ui-widget-lifecycle.md +++ b/en/application-dev/application-models/arkts-ui-widget-lifecycle.md @@ -92,4 +92,5 @@ When creating an ArkTS widget, you need to implement the [FormExtensionAbility]( > **NOTE** -> The FormExtensionAbility cannot reside in the background. Therefore, continuous tasks cannot be processed in the widget lifecycle callbacks. The FormExtensionAbility persists for 5 seconds after the lifecycle callback is completed and will exit if no new lifecycle callback is invoked during this time frame. For the service logic that may take more than 5 seconds to complete, it is recommended that you [start the application](arkts-ui-widget-event-uiability.md). After the processing is complete, use the [updateForm](../reference/apis/js-apis-app-form-formProvider.md#updateform) to notify the widget of the update. +> +> The FormExtensionAbility cannot reside in the background. It persists for 5 seconds after the lifecycle callback is completed and exist if no new lifecycle callback is invoked during this time frame. This means that continuous tasks cannot be processed in the widget lifecycle callbacks. For the service logic that may take more than 5 seconds to complete, it is recommended that you [start the application](arkts-ui-widget-event-uiability.md) for processing. After the processing is complete, use [updateForm()](../reference/apis/js-apis-app-form-formProvider.md#updateform) to notify the widget of the update. diff --git a/en/application-dev/application-models/arkts-ui-widget-modules.md b/en/application-dev/application-models/arkts-ui-widget-modules.md index 5084b7ea5045002759ca57f10c055ef5623eb7d0..b9a411426db84a4c1af12e70eab956adc8f25806 100644 --- a/en/application-dev/application-models/arkts-ui-widget-modules.md +++ b/en/application-dev/application-models/arkts-ui-widget-modules.md @@ -1,7 +1,7 @@ # ArkTS Widget Related Modules +**Figure 1** ArkTS widget related modules - **Figure 1** ArkTS widget related modules ![WidgetModules](figures/WidgetModules.png) @@ -15,10 +15,10 @@ - [formBindingData](../reference/apis/js-apis-app-form-formBindingData.md): provides APIs for widget data binding. You can use the APIs to create a **FormBindingData** object and obtain related information. -- [Page Layout (Card.ets)](arkts-ui-widget-page-overview.md): provides APIs for a declarative paradigm UI. - - [ArkTS widget capabilities](arkts-ui-widget-event-overview.md): include the **postCardAction** API used for interaction between the widget internal and the provider application and can be called only in the widget. - - [ArkTS widget capability list](arkts-ui-widget-page-overview.md#page-capabilities-supported-by-arkts-widgets): lists the APIs, components, events, attributes, and lifecycle callbacks that can be used in ArkTS widgets. +- [Page layout (Card.ets)](arkts-ui-widget-page-overview.md): provides APIs for a declarative paradigm UI. + - [Capabilities exclusive to ArkTS widgets](arkts-ui-widget-event-overview.md): include the **postCardAction** API used for interaction between the widget internal and the provider application and can be called only in the widget. + - [ArkTS widget capability list](arkts-ui-widget-page-overview.md#page-capabilities-supported-by-arkts-widgets): contain the APIs, components, events, attributes, and lifecycle callbacks that can be used in ArkTS widgets. - [Widget configuration](arkts-ui-widget-configuration.md): includes FormExtensionAbility configuration and widget configuration. - - Configure FormExtensionAbility information under **extensionAbilities** in the [module.json5 file](../quick-start/module-configuration-file.md). + - Configure the FormExtensionAbility information under **extensionAbilities** in the [module.json5 file](../quick-start/module-configuration-file.md). - Configure the widget configuration information (**WidgetCard.ets**) in the [form_config.json](arkts-ui-widget-configuration.md) file in **resources/base/profile**. diff --git a/en/application-dev/application-models/arkts-ui-widget-page-animation.md b/en/application-dev/application-models/arkts-ui-widget-page-animation.md index 9a940aeecb62682a185ba8c0529adc38017c8e2d..0cb8e356c61155d367e55c0f39bbf491d03e2e12 100644 --- a/en/application-dev/application-models/arkts-ui-widget-page-animation.md +++ b/en/application-dev/application-models/arkts-ui-widget-page-animation.md @@ -1,10 +1,10 @@ # Using Animations in the Widget -To make your ArkTS widget more engaging, you can apply animations to it, including [explicit animation](../reference/arkui-ts/ts-explicit-animation.md), [attribute animation](../reference/arkui-ts/ts-animatorproperty.md), and [component transition](../reference/arkui-ts/ts-transition-animation-component.md). Note the following restrictions when using the animations in ArkTS widgets. +To make your ArkTS widget more engaging, you can apply animations to it, including [explicit animation](../reference/arkui-ts/ts-explicit-animation.md), [attribute animation](../reference/arkui-ts/ts-animatorproperty.md), and [component transition](../reference/arkui-ts/ts-transition-animation-component.md). Just note the following restrictions when using the animations in ArkTS widgets. - **Table 1** Restrictions on animation parameters +**Table 1** Restrictions on animation parameters | Name| Description| Description| | -------- | -------- | -------- | @@ -13,14 +13,10 @@ To make your ArkTS widget more engaging, you can apply animations to it, includi | delay | Animation delay duration.| Do not set this parameter in the widget. Use the default value 0.| | iterations | Number of times that the animation is played.| Do not set this parameter in the widget. Use the default value 1.| - The following sample code implements the animation effect of button rotation: - ![WidgetAnimation](figures/WidgetAnimation.gif) - - ```ts @Entry @Component diff --git a/en/application-dev/application-models/arkts-ui-widget-page-custom-drawing.md b/en/application-dev/application-models/arkts-ui-widget-page-custom-drawing.md index 49523d60af886db40b55fc90d80c9bd5027cade8..a55cb9cd17cda67cc2989e5916db19c5cf36cc47 100644 --- a/en/application-dev/application-models/arkts-ui-widget-page-custom-drawing.md +++ b/en/application-dev/application-models/arkts-ui-widget-page-custom-drawing.md @@ -1,9 +1,9 @@ # Applying Custom Drawing in the Widget - You can apply custom drawing in your ArkTS widget to create a more vibrant experience. Use the [Canvas](../reference/arkui-ts/ts-components-canvas-canvas.md) component to create a canvas on the widget, and then use the [CanvasRenderingContext2D](../reference/arkui-ts/ts-canvasrenderingcontext2d.md) object to draw custom graphics on the canvas. The following code shows how to draw a smiling face in the center of the canvas. +You can apply custom drawing in your ArkTS widget to create a more vibrant experience. Use the [Canvas](../reference/arkui-ts/ts-components-canvas-canvas.md) component to create a canvas on the widget, and then use the [CanvasRenderingContext2D](../reference/arkui-ts/ts-canvasrenderingcontext2d.md) object to draw custom graphics on the canvas. The following code snippet draws a smiling face in the center of a canvas. -```typescript +```ts @Entry @Component struct Card { @@ -30,41 +30,41 @@ struct Card { this.context.fillRect(0, 0, this.canvasWidth, this.canvasHeight); // Draw a red circle in the center of the canvas. this.context.beginPath(); - let radius = this.context.width / 3 - let circleX = this.context.width / 2 - let circleY = this.context.height / 2 + let radius = this.context.width / 3; + let circleX = this.context.width / 2; + let circleY = this.context.height / 2; this.context.moveTo(circleX - radius, circleY); this.context.arc(circleX, circleY, radius, 2 * Math.PI, 0, true); this.context.closePath(); this.context.fillStyle = 'red'; this.context.fill(); // Draw the left eye of the smiling face. - let leftR = radius / 4 - let leftX = circleX - (radius / 2) - let leftY = circleY - (radius / 3.5) + let leftR = radius / 4; + let leftX = circleX - (radius / 2); + let leftY = circleY - (radius / 3.5); this.context.beginPath(); this.context.arc(leftX, leftY, leftR, 0, Math.PI, true); - this.context.strokeStyle = '#ffff00' - this.context.lineWidth = 10 - this.context.stroke() + this.context.strokeStyle = '#ffff00'; + this.context.lineWidth = 10; + this.context.stroke(); // Draw the right eye of the smiling face. - let rightR = radius / 4 - let rightX = circleX + (radius / 2) - let rightY = circleY - (radius / 3.5) + let rightR = radius / 4; + let rightX = circleX + (radius / 2); + let rightY = circleY - (radius / 3.5); this.context.beginPath(); this.context.arc(rightX, rightY, rightR, 0, Math.PI, true); - this.context.strokeStyle = '#ffff00' - this.context.lineWidth = 10 - this.context.stroke() + this.context.strokeStyle = '#ffff00'; + this.context.lineWidth = 10; + this.context.stroke(); // Draw the mouth of the smiling face. - let mouthR = radius / 2.5 - let mouthX = circleX - let mouthY = circleY + (radius / 3) + let mouthR = radius / 2.5; + let mouthX = circleX; + let mouthY = circleY + (radius / 3); this.context.beginPath(); this.context.arc(mouthX, mouthY, mouthR, Math.PI, 0, true); - this.context.strokeStyle = '#ffff00' - this.context.lineWidth = 10 - this.context.stroke() + this.context.strokeStyle = '#ffff00'; + this.context.lineWidth = 10; + this.context.stroke(); }) } }.height('100%').width('100%') @@ -72,8 +72,6 @@ struct Card { } ``` - The figure below shows the effect. - -![WidgetCanvasDemo](figures/WidgetCanvasDemo.jpeg) +![WidgetCanvasDemo](figures/WidgetCanvasDemo.png) \ No newline at end of file diff --git a/en/application-dev/application-models/arkts-ui-widget-update-by-status.md b/en/application-dev/application-models/arkts-ui-widget-update-by-status.md index 8952b8dff4ecdd3acad6b1a65513d8e529c4dc70..b27958c66d3e174a66c80c90e46cdd71f5ecf668 100644 --- a/en/application-dev/application-models/arkts-ui-widget-update-by-status.md +++ b/en/application-dev/application-models/arkts-ui-widget-update-by-status.md @@ -1,7 +1,7 @@ # Updating Widget Content by State -Multiple widgets of the same application can be configured to implement different features. For example, two weather widgets can be added to the home screen: one for displaying the weather of London, and the other Beijing. The widget is set to be updated at 07:00 every morning. It needs to detect the configured city, and then updates the city-specific weather information. The following example describes how to dynamically update the widget content based on the state. +There are cases where multiple copies of the same widget are added to the home screen to accommodate different needs. In these cases, the widget content needs to be dynamically updated based on the state. This topic exemplifies how this is implemented. In the following example, two weather widgets are added to the home screen: one for displaying the weather of London, and the other Beijing, both configured to be updated at 07:00 every morning. The widget provider detects the target city, and then displays the city-specific weather information on the widgets. - Widget configuration file: Configure the widget to be updated at 07:00 every morning. @@ -74,7 +74,7 @@ Multiple widgets of the same application can be configured to implement differen } Row() {// Content that is updated only in state A - Text('State A: ') + Text ('State A:') Text(this.textA) } @@ -167,4 +167,5 @@ Multiple widgets of the same application can be configured to implement differen > **NOTE** +> > When the local database is used for widget information persistence, it is recommended that [TEMPORARY_KEY](../reference/apis/js-apis-app-form-formInfo.md#formparam) be used to determine whether the currently added widget is a normal one in the [onAddForm](../reference/apis/js-apis-app-form-formExtensionAbility.md#onaddform) lifecycle callback. If the widget is a normal one, the widget information is directly persisted. If the widget is a temporary one, the widget information is persisted when the widget is converted to a normal one ([onCastToNormalForm](../reference/apis/js-apis-app-form-formExtensionAbility.md#oncasttonormalform)). In addition, the persistent widget information needs to be deleted when the widget is destroyed ([onRemoveForm](../reference/apis/js-apis-app-form-formExtensionAbility.md#onremoveform)), preventing the database size from continuously increasing due to repeated widget addition and deletion. diff --git a/en/application-dev/application-models/arkts-ui-widget-update-by-time.md b/en/application-dev/application-models/arkts-ui-widget-update-by-time.md index 5b27a636f83f144110c5533a3d43baf0087c3716..2c2643c802aff436656f5855d67c00e1a3c38dcd 100644 --- a/en/application-dev/application-models/arkts-ui-widget-update-by-time.md +++ b/en/application-dev/application-models/arkts-ui-widget-update-by-time.md @@ -5,7 +5,7 @@ Before configuring a widget to update periodically, enable the periodic update f The widget framework provides the following modes of updating widgets periodically: -- Set the update interval: The widget will be updated at the specified interval. You can specify the interval by setting the [updateDuration](arkts-ui-widget-configuration.md) field in the **form_config.json** file. For example, you can configure the widget to update once an hour. +- Set the update interval: The widget will be updated at the specified interval by calling [onUpdateForm](../reference/apis/js-apis-app-form-formExtensionAbility.md#onupdateform). You can specify the interval by setting the [updateDuration](arkts-ui-widget-configuration.md) field in the **form_config.json** file. For example, you can configure the widget to update once an hour. > **NOTE** > diff --git a/en/application-dev/application-models/common-event-overview.md b/en/application-dev/application-models/common-event-overview.md index e8be9abaa3015a5512c47af55d2f364be0de79ad..3f532865e686592282b9080f234c088ee24a64f8 100644 --- a/en/application-dev/application-models/common-event-overview.md +++ b/en/application-dev/application-models/common-event-overview.md @@ -7,8 +7,7 @@ OpenHarmony provides Common Event Service (CES) for applications to subscribe to Common events are classified into system common events and custom common events. -- System common events: defined in CES. Only system applications and system services can publish system common events, such as HAP installation, update, and uninstall. For details about the supported system common events, see [Support](../reference/apis/js-apis-commonEventManager.md#support). - +- System common events: defined in CES. Currently, only system applications and system services can publish system common events, such as HAP installation, update, and uninstall. For details about the supported system common events, see [System Common Events](../reference/apis/commonEventManager-definitions.md). - Custom common events: customized by applications to implement cross-process event communication. @@ -16,9 +15,7 @@ Common events are also classified into unordered, ordered, and sticky common eve - Unordered common events: common events that CES forwards regardless of whether subscribers receive the events and when they subscribe to the events. - -- Ordered common events: common events that CES forwards based on the subscriber priority. CES forwards common events to the subscriber with lower priority only after receiving a reply from the previous subscriber with higher priority. Subscribers with the same priority receive common events in a random order. - +- Ordered common events: common events that CES forwards based on the subscriber priority. CES preferentially forwards an ordered common event to the subscriber with higher priority, waits until the subscriber receives the event, and then forwards the events to the subscriber with lower priority. Subscribers with the same priority receive common events in a random order. - Sticky common events: common events that can be sent to a subscriber before or after they initiate a subscription. Only system applications and system services can send sticky common events, which remain in the system after being sent. The sends must first request the **ohos.permission.COMMONEVENT_STICKY** permission. For details about the configuration, see [Permission Application Guide](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file). diff --git a/en/application-dev/application-models/common-event-remove-sticky.md b/en/application-dev/application-models/common-event-remove-sticky.md index 358cf8ccf912e0c329684ff904207b933713835b..2ad907a9c7962d496f0a791c88a25aaab54a9d25 100644 --- a/en/application-dev/application-models/common-event-remove-sticky.md +++ b/en/application-dev/application-models/common-event-remove-sticky.md @@ -1,4 +1,4 @@ -# Removing Sticky Common Events +# Removing Sticky Common Events (for System Applications Only) ## When to Use @@ -16,21 +16,26 @@ For details, see [Common Event](../reference/apis/js-apis-commonEventManager.md) ## How to Develop -1. Import the module. - +1. Request the **ohos.permission.COMMONEVENT_STICKY** permission. For details, see [Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md#declaring-permissions-in-the-configuration-file). + +2. Import the module. + ```ts import commonEventManager from '@ohos.commonEventManager'; ``` -2. The sticky common event to be removed must have been released by the application. For details about how to release sticky common events, see [Publishing Common Events](common-event-publish.md). +3. Call the [removeStickyCommonEvent()](../reference/apis/js-apis-commonEventManager.md#commoneventmanagerremovestickycommonevent10) API to remove the target sticky common event. + + > **NOTE** + > + > The sticky common event to be removed must have been released by the application. For details about how to release sticky common events, see [Publishing Common Events](common-event-publish.md). ```ts - CommonEventManager.removeStickyCommonEvent("sticky_event", (err) => { // sticky_event indicates the name of the sticky common event to remove. - if (err) { - console.info(`Remove sticky event AsyncCallback failed, errCode: ${err.code}, errMes: ${err.message}`); - return; - } - console.info(`Remove sticky event AsyncCallback success`); - } + commonEventManager.removeStickyCommonEvent("sticky_event", (err) => { // sticky_event indicates the name of the target sticky common event. + if (err) { + console.error(`Failed to remove sticky common event. Code is ${err.code}, message is ${err.message}`); + return; + } + console.info(`Succeeded in removeing sticky event.`); }); ``` diff --git a/en/application-dev/application-models/common-event-static-subscription.md b/en/application-dev/application-models/common-event-static-subscription.md index 53e014abe38ac3f8ec89fe8a21dc9280184a280b..7005c86ae2e29eb7c635f55b5da05f658ccd8360 100644 --- a/en/application-dev/application-models/common-event-static-subscription.md +++ b/en/application-dev/application-models/common-event-static-subscription.md @@ -2,38 +2,46 @@ ## When to Use -A static subscriber is started once it receives a target event published by the system or application. At the same time, the **onReceiveEvent** callback is triggered, in which you can implement the service logic. For example, if an application needs to execute some initialization tasks during device power-on, the application can subscribe to the power-on event in static mode. After receiving the power-on event, the application is started to execute the initialization tasks. Subscribing to a common event in static mode is achieved by configuring a declaration file and implementing a class that inherits from **StaticSubscriberExtensionAbility**. Note that this subscribing mode has negative impact on system power consumption. Therefore, exercise caution when using this mode. +A static subscriber is started once it receives a target event published by the system or application. At the same time, the [onReceiveEvent()](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md#staticsubscriberextensionabilityonreceiveevent) callback is triggered. + +You can implement the service logic in the [onReceiveEvent()](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md#staticsubscriberextensionabilityonreceiveevent) callback. For example, if an application needs to execute some initialization tasks during device power-on, the application can subscribe to the power-on event in static mode. After receiving the power-on event, the application is started to execute the initialization tasks. + +Subscribing to a common event in static mode is achieved by configuring a declaration file and implementing a class that inherits from [StaticSubscriberExtensionAbility](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md). + +> **NOTE** +> +> The static subscription mode has negative impact on system power consumption. Therefore, exercise caution when using this mode. ## How to Develop -1. Declaring a Static Subscriber +1. Declaring a static subscriber. - To declare a static subscriber, create an ExtensionAbility, which is derived from the **StaticSubscriberExtensionAbility** class, in the project. The sample code is as follows: + To declare a static subscriber, create an ExtensionAbility, which is derived from the **StaticSubscriberExtensionAbility** class, in the project. + + You can implement service logic in the **onReceiveEvent()** callback. ```ts import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriberExtensionAbility' export default class StaticSubscriber extends StaticSubscriberExtensionAbility { - onReceiveEvent(event) { - console.log('onReceiveEvent, event:' + event.event); - } + onReceiveEvent(event) { + console.info('onReceiveEvent, event: ' + event.event); + } } ``` - You can implement service logic in the **onReceiveEvent** callback. - -2. Project Configuration for a Static Subscriber +2. Configure static subscriber settings. - After writing the static subscriber code, configure the subscriber in the **module.json5** file. The configuration format is as follows: + After writing the static subscriber code, configure the subscriber in the [module.json5](../quick-start/module-configuration-file.md) file. ```ts { "module": { - ...... + ... "extensionAbilities": [ { "name": "StaticSubscriber", - "srcEntry": "./ets/StaticSubscriber/StaticSubscriber.ts", + "srcEntry": "./ets/staticsubscriber/StaticSubscriber.ts", "description": "$string:StaticSubscriber_desc", "icon": "$media:icon", "label": "$string:StaticSubscriber_label", @@ -47,14 +55,14 @@ A static subscriber is started once it receives a target event published by the ] } ] - ...... + ... } } ``` - Pay attention to the following fields in the JSON file: + Some fields in the file are described as follows: - - **srcEntry**: entry file path of the ExtensionAbility, that is, the file path of the static subscriber declared in Step 2. + - **srcEntry **: entry file path of the ExtensionAbility, that is, the file path of the static subscriber declared in Step 2. - **type**: ExtensionAbility type. For a static subscriber, set this field to **staticSubscriber**. @@ -62,42 +70,46 @@ A static subscriber is started once it receives a target event published by the - **name**: name of the ExtensionAbility. For a static subscriber, declare the name as **ohos.extension.staticSubscriber** for successful identification. - **resource**: path that stores the ExtensionAbility configuration, which is customizable. In this example, the path is **resources/base/profile/subscribe.json**. - A level-2 configuration file pointed to by **metadata** must be in the following format: - ```ts - { - "commonEvents": [ - { - "name": "xxx", - "permission": "xxx", - "events":[ - "xxx" - ] - } - ] - } - ``` +3. Configure the level-2 configuration file to which the metadata points. - If the level-2 configuration file is not declared in this format, the file cannot be identified. The fields are described as follows: + ```json + { + "commonEvents": [ + { + "name": "xxx", + "permission": "xxx", + "events":[ + "xxx" + ] + } + ] + } + ``` - - **name**: name of the ExtensionAbility, which must be the same as the name of **extensionAbility** declared in **module.json5**. + If the level-2 configuration file is not declared in this format, the file cannot be identified. Some fields in the file are described as follows: - - **permission**: permission required for the publisher. If a publisher without the required permission attempts to publish an event, the event is regarded as invalid and will not be published. + - **name**: name of the ExtensionAbility, which must be the same as the name of **extensionAbility** declared in **module.json5**. + - **permission**: permission required for the publisher. If a publisher without the required permission attempts to publish an event, the event is regarded as invalid and will not be published. + - **events**: list of target events to subscribe to. - - **events**: list of target events to subscribe to. +4. Modify the [preset configuration file](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/preinstall-config/install_list_permissions.json) of the device, that is, the **/system/etc/app/install_list_permission.json** file on the device. When the device is started, this file is read. During application installation, the common event type specified by **allowCommonEvent** in the file is authorized. The **install_list_permission.json** file contains the following fields: -3. Device System Configuration + - **bundleName**: bundle name of the application. + - **app_signature**: fingerprint information of the application. For details, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md#configuration-in-install_list_capabilityjson). + - **allowCommonEvent**: type of common event that can be started by static broadcast. - In the device system configuration file **/system/etc/app/install_list_capability.json**, add the bundle name of the static subscriber. + > **NOTE** + > + > The **install_list_permissions.json** file is available only for preinstalled applications. - ```json - { - "install_list": [ - { - "bundleName": "ohos.extension.staticSubscriber", - "allowCommonEvent": ["usual.event.A", "usual.event.B"], - } - ] - } + ```json + [ + { + "bundleName": "com.example.myapplication", + "app_signature": ["****"], + "allowCommonEvent": ["usual.event.A", "usual.event.B"] + } + ] ``` diff --git a/en/application-dev/application-models/common-event-subscription-overview.md b/en/application-dev/application-models/common-event-subscription-overview.md index 20064af92d3df2e6f7ab7d62c4f71f911848057a..262f30c87e6018fed4e417a196dcaeeb58e42ae2 100644 --- a/en/application-dev/application-models/common-event-subscription-overview.md +++ b/en/application-dev/application-models/common-event-subscription-overview.md @@ -1,7 +1,7 @@ # Common Event Subscription Overview -​The common event service provides two subscription modes: dynamic and static. The biggest difference between these two modes is that dynamic subscription requires the application to be running, while static subscription does not. +The common event service provides two subscription modes: dynamic and static. The biggest difference between these two modes is that dynamic subscription requires the application to be running, while static subscription does not. - In dynamic subscription mode, a subscriber subscribes to common events by calling an API during the running period. For details, see [Subscribing to Common Events in Dynamic Mode](common-event-subscription.md). -- In static subscription mode, a subscriber subscribes to common events by configuring a declaration file and implementing a class that inherits from StaticSubscriberExtensionAbility. For details, see [Subscribing to Common Events in Static Mode](common-event-static-subscription.md). +- In static subscription mode, a subscriber subscribes to common events by configuring a declaration file and implementing a class that inherits from **StaticSubscriberExtensionAbility**. For details, see [Subscribing to Common Events in Static Mode](common-event-static-subscription.md). diff --git a/en/application-dev/application-models/common-event-subscription.md b/en/application-dev/application-models/common-event-subscription.md index 6cdc52ef9b798e48a911892f965db8fbf2aaa67f..c3e3ebfa52415d5e0ebade26973f78a589fb348f 100644 --- a/en/application-dev/application-models/common-event-subscription.md +++ b/en/application-dev/application-models/common-event-subscription.md @@ -32,7 +32,7 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common let subscriber = null; // Subscriber information. let subscribeInfo = { - events: ["usual.event.SCREEN_OFF"], // Subscribe to the common event screen-off. + events: ["usual.event.SCREEN_OFF"], // Subscribe to the common event screen-off. } ``` @@ -41,13 +41,13 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common ```ts // Callback for subscriber creation. commonEventManager.createSubscriber(subscribeInfo, (err, data) => { - if (err) { - console.error(`[CommonEvent] CreateSubscriberCallBack err=${JSON.stringify(err)}`); - } else { - console.info(`[CommonEvent] CreateSubscriber success`); - subscriber = data; - // Callback for common event subscription. - } + if (err) { + console.error(`Failed to create subscriber. Code is ${err.code}, message is ${err.message}`); + return; + } + console.info('Succeeded in creating subscriber.'); + subscriber = data; + // Callback for common event subscription. }) ``` @@ -56,14 +56,13 @@ For details about the APIs, see [API Reference](../reference/apis/js-apis-common ```ts // Callback for common event subscription. if (subscriber !== null) { - commonEventManager.subscribe(subscriber, (err, data) => { - if (err) { - console.error(`[CommonEvent] SubscribeCallBack err=${JSON.stringify(err)}`); - } else { - console.info(`[CommonEvent] SubscribeCallBack data=${JSON.stringify(data)}`); - } - }) + commonEventManager.subscribe(subscriber, (err, data) => { + if (err) { + console.error(`Failed to subscribe common event. Code is ${err.code}, message is ${err.message}`); + return; + } + }) } else { - console.error(`[CommonEvent] Need create subscriber`); + console.error(`Need create subscriber`); } ``` diff --git a/en/application-dev/application-models/data-share-via-want.md b/en/application-dev/application-models/data-share-via-want.md index d5512e0c446b94dcf384504f11ff25d458cfeafc..28184edbc9304e7c6fbfbfe673cf1b8deca7d635 100644 --- a/en/application-dev/application-models/data-share-via-want.md +++ b/en/application-dev/application-models/data-share-via-want.md @@ -48,9 +48,9 @@ function implicitStartAbility() { } } context.startAbility(wantInfo).then(() => { - // ... + ... }).catch((err) => { - // ... + ... }) } ``` @@ -66,8 +66,7 @@ In the preceding code, under the custom field **parameters**, the following **ab - **ability.picker.fileSizes**: file size, in bytes. - **ability.picker.fileNames** and **ability.picker.fileSizes** are arrays and have a one-to-one mapping. -The following figure shows an example. - +The following figure shows an example. ![](figures/ability-startup-with-implicit-want2.png) ## Shared Party @@ -77,17 +76,17 @@ To enable the shared party to identify the shared content, configure **skills** ```json { "module": { - // ... + ... "abilities": [ { - // ... + ... "skills": [ { - // ... + ... "actions": [ "action.system.home", "ohos.want.action.sendData" - // ... + ... ], "uris": [ { @@ -102,7 +101,7 @@ To enable the shared party to identify the shared content, configure **skills** } ``` -After the user selects an application, the Want nested in the **ability.want.params.INTENT** field is passed to that application. The UIAbility of the shared party, after being started, can call [onCreate()](../reference/apis/js-apis-app-ability-uiAbility.md#uiabilityoncreate) or [onNewWant()](../reference/apis/js-apis-app-ability-uiAbility.md#uiabilityonnewwant) to obtain the passed Want. +After the user selects an application, the Want nested in the **ability.want.params.INTENT** field is passed to that application. After the UIAbility of the application starts, the application obtains **want** information from [**onCreate()**](../reference/apis/js-apis-app-ability-uiAbility.md#uiabilityoncreate) or [**onNewWant()**](../reference/apis/js-apis-app-ability-uiAbility.md#uiabilityonnewwant). The following is an example of the Want obtained. You can use the FD of the shared file to perform required operations. diff --git a/en/application-dev/application-models/explicit-implicit-want-mappings.md b/en/application-dev/application-models/explicit-implicit-want-mappings.md index 9e748a31795e3afc713e7091067a8164e8a623cc..454fc89d718fb4adfe84c0eab67ebc332117ed26 100644 --- a/en/application-dev/application-models/explicit-implicit-want-mappings.md +++ b/en/application-dev/application-models/explicit-implicit-want-mappings.md @@ -1,28 +1,28 @@ # Matching Rules of Explicit Want and Implicit Want -Both explicit Want and implicit Want can be used to match an ability to start based on certain rules. These rules determine how the parameters set in Want match the configuration file declared by the target ability. +Both explicit [Want](../reference/apis/js-apis-app-ability-want.md) and implicit [Want](../reference/apis/js-apis-app-ability-want.md) can be used to match an application component to start based on certain rules. These rules determine how the parameters set in [want](../reference/apis/js-apis-app-ability-want.md) match the configuration file declared by the target application component. ## Matching Rules of Explicit Want -The table below describes the matching rules of explicit Want. +The table below describes the matching rules of explicit [Want](../reference/apis/js-apis-app-ability-want.md). | Name| Type| Matching Item| Mandatory| Rule Description| | -------- | -------- | -------- | -------- | -------- | -| deviceId | string | Yes| No| If this field is unspecified, only abilities on the local device are matched.| +| deviceId | string | Yes| No| If this field is unspecified, only application components on the local device are matched.| | bundleName | string | Yes| Yes| If **abilityName** is specified but **bundleName** is unspecified, the matching fails.| -| moduleName | string | Yes| No| If this field is unspecified and multiple modules with the same ability name exist in the application, the first ability is matched by default.| +| moduleName | string | Yes| No| If this field is unspecified and multiple modules with the same ability name exist in the application, the first application component is matched by default.| | abilityName | string | Yes| Yes| To use explicit Want, this field must be specified.| -| uri | string | No| No| This field is not used for matching. It is passed to the target ability as a parameter.| -| type | string | No| No| This field is not used for matching. It is passed to the target ability as a parameter.| -| action | string | No| No| This field is not used for matching. It is passed to the target ability as a parameter.| -| entities | Array<string> | No| No| This field is not used for matching. It is passed to the target ability as a parameter.| +| uri | string | No| No| This field is not used for matching. It is passed to the target application component as a parameter.| +| type | string | No| No| This field is not used for matching. It is passed to the target application component as a parameter.| +| action | string | No| No| This field is not used for matching. It is passed to the target application component as a parameter.| +| entities | Array<string> | No| No| This field is not used for matching. It is passed to the target application component as a parameter.| | flags | number | No| No| This field is not used for matching and is directly transferred to the system for processing. It is generally used to set runtime information, such as URI data authorization.| -| parameters | {[key: string]: any} | No| No| This field is not used for matching. It is passed to the target ability as a parameter.| +| parameters | {[key: string]: any} | No| No| This field is not used for matching. It is passed to the target application component as a parameter.| ## Matching Rules for Implicit Want -The table below describes the matching rules of implicit Want. +The table below describes the matching rules of implicit [Want](../reference/apis/js-apis-app-ability-want.md). | Name | Type | Matching Item| Mandatory| Rule Description | | ----------- | ------------------------------ | ------ | ---- | ------------------------------------------------------------ | @@ -35,30 +35,32 @@ The table below describes the matching rules of implicit Want. | action | string | Yes | No | | | entities | Array<string> | Yes | No | | | flags | number | No | No | This field is not used for matching and is directly transferred to the system for processing. It is generally used to set runtime information, such as URI data authorization.| -| parameters | {[key: string]: any} | No | No | This field is not used for matching. It is passed to the target ability as a parameter. | +| parameters | {[key: string]: any} | No | No | This field is not used for matching. It is passed to the target application component as a parameter. | Get familiar with the following about implicit Want: - The **want** parameter passed by the caller indicates the operation to be performed by the caller. It also provides data and application type restrictions. -- The **skills** field declares the capabilities of the target ability. For details, see [the skills tag](../quick-start/module-configuration-file.md#skills) in the [module.json5 file](../quick-start/module-configuration-file.md). +- The **skills** field declares the capabilities of the target application component. For details, see [the skills tag](../quick-start/module-configuration-file.md#skills) in the [module.json5 file](../quick-start/module-configuration-file.md). -The system matches the **want** parameter (including the **action**, **entities**, **uri**, and **type** attributes) passed by the caller against the **skills** configuration (including the **actions**, **entities**, **uris**, and **type** attributes) of the abilities one by one. When all the four attributes are matched, a dialog box is displayed for users to select a matched application. +The system matches the **want** parameter (including the **action**, **entities**, **uri**, and **type** attributes) passed by the caller against the **skills** configuration (including the **actions**, **entities**, **uris**, and **type** attributes) of the application components one by one. When all the four attributes are matched, a dialog box is displayed for users to select a matched application. ### Matching Rules of action in the want Parameter -The system matches the **action** attribute in the **want** parameter passed by the caller against **actions** under **skills** of the abilities. +The system matches the **action** attribute in the **want** parameter passed by the caller against **actions** under **skills** of the application components. -- If **action** in the passed **want** parameter is specified but **actions** under **skills** of an ability is unspecified, the matching fails. +- If **action** in the passed **want** parameter is unspecified and **actions** under **skills** of an application component is unspecified, the matching fails. -- If **action** in the passed **want** parameter is unspecified but **actions** under **skills** of an ability is specified, the matching is successful. +- If **action** in the passed **want** parameter is specified but **actions** under **skills** of an application component is unspecified, the matching fails. -- If **action** in the passed **want** parameter is specified, and **actions** under **skills** of an ability is specified and contains **action** in the passed **want** parameter, the matching is successful. +- If **action** in the passed **want** parameter is unspecified but **actions** under **skills** of an application component is specified, the matching is successful. -- If **action** in the passed **want** parameter is specified, and **actions** under **skills** of an ability is specified but does not contain **action** in the passed **want** parameter, the matching fails. +- If **action** in the passed **want** parameter is specified, and **actions** under **skills** of an application component is specified and contains **action** in the passed **want** parameter, the matching is successful. + +- If **action** in the passed **want** parameter is specified, and **actions** under **skills** of an application component is specified but does not contain **action** in the passed **want** parameter, the matching fails. **Figure 1** Matching rules of action in the want parameter @@ -67,55 +69,56 @@ The system matches the **action** attribute in the **want** parameter passed by ### Matching Rules of entities in the want Parameter -The system matches the **entities** attribute in the **want** parameter passed by the caller against **entities** under **skills** of the abilities. +The system matches the **entities** attribute in the **want** parameter passed by the caller against **entities** under **skills** of the application components. -- If **entities** in the passed **want** parameter is unspecified but **entities** under **skills** of an ability is specified, the matching is successful. +- If **entities** in the passed **want** parameter is unspecified but **entities** under **skills** of an application component is specified, the matching is successful. -- If **entities** in the passed **want** parameter is unspecified but **entities** under **skills** of an ability is unspecified, the matching is successful. +- If **entities** in the passed **want** parameter is unspecified but **entities** under **skills** of an application component is unspecified, the matching is successful. -- If **entities** in the passed **want** parameter is specified but **entities** under **skills** of an ability is unspecified, the matching fails. +- If **entities** in the passed **want** parameter is specified but **entities** under **skills** of an application component is unspecified, the matching fails. -- If **entities** in the passed **want** parameter is specified, and **entities** under **skills** of an ability is specified and contains **entities** in the passed **want** parameter, the matching is successful. +- If **entities** in the passed **want** parameter is specified, and **entities** under **skills** of an application component is specified and contains **entities** in the passed **want** parameter, the matching is successful. -- If **entities** in the passed **want** parameter is specified, and **entities** under **skills** of an ability is specified but does not contain **entities** in the passed **want** parameter, the matching fails. +- If **entities** in the passed **want** parameter is specified, and **entities** under **skills** of an application component is specified but does not contain **entities** in the passed **want** parameter, the matching fails. - **Figure 2** Matching rule of entities in the want parameter + **Figure 2** Matching rules of entities in the want parameter ![want-entities](figures/want-entities.png) ### Matching Rules of uri and type in the want Parameter -When the **uri** and **type** parameters are specified in the **want** parameter to initiate a component startup request, the system traverses the list of installed components and matches the **uris** array under **skills** of the abilities one by one. If one of the **uris** arrays under **skills** matches the **uri** and **type** in the passed **want**, the matching is successful. +When the **uri** and **type** parameters are specified in the **want** parameter to initiate an application component startup request, the system traverses the list of installed components and matches the **uris** array under **skills** of the application components one by one. If one of the **uris** arrays under **skills** matches the **uri** and **type** in the passed **want**, the matching is successful. There are four combinations of **uri** and **type** settings. The matching rules are as follows: - Neither **uri** or **type** is specified in the **want** parameter. - - If the **uris** array under **skills** of an ability is unspecified, the matching is successful. - - If the **uris** array under **skills** of an ability contains an URI element whose **scheme** and **type** are unspecified, the matching is successful. + - If the **uris** array under **skills** of an application component is unspecified, the matching is successful. + - If the **uris** array under **skills** of an application component contains an URI element whose **scheme** and **type** are unspecified, the matching is successful. - In other cases, the matching fails. - Only **uri** is specified in the **want** parameter. - - If the **uris** array under **skills** of an ability is unspecified, the matching fails. - - If the **uris** array under **skills** of an ability contains an element whose [uri is matched](#matching-rules-of-uri) and **type** is unspecified, the matching is successful. Otherwise, the matching fails. + - If the **uris** array under **skills** of an application component is unspecified, the matching fails. + - If the **uris** array under **skills** of an application component contains an element whose [uri is matched](#matching-rules-of-uri) and **type** is unspecified, the matching is successful. Otherwise, the matching fails. - Only **type** is specified in the **want** parameter. - - If the **uris** array under **skills** of an ability is unspecified, the matching fails. - - If the **uris** array under **skills** of an ability contains an URI element whose **scheme** is unspecified and [type is matched](#matching-rules-of-type), the matching is successful. Otherwise, the matching fails. + - If the **uris** array under **skills** of an application component is unspecified, the matching fails. + - If the **uris** array under **skills** of an application component contains an URI element whose **scheme** is unspecified and [type is matched](#matching-rules-of-type), the matching is successful. Otherwise, the matching fails. -- Both **uri** and **type** are specified in the **want** parameter, as shown in Figure 3. - - If the **uris** array under **skills** of an ability is unspecified, the matching fails. - - If the **uris** array under **skills** of an ability contains an element whose [uri is matched](#matching-rules-of-uri) and [type is matched](#matching-rules-of-type), the matching is successful. Otherwise, the matching fails. +- Both **uri** and **type** are specified in the **want** parameter, as shown below. + - If the **uris** array under **skills** of an application component is unspecified, the matching fails. + - If the **uris** array under **skills** of an application component contains an element whose [uri is matched](#matching-rules-of-uri) and [type is matched](#matching-rules-of-type), the matching is successful. Otherwise, the matching fails. -Leftmost URI matching: When only **scheme**, a combination of **scheme** and **host**, or a combination of **scheme**, **host**, and **port** is configured in the **uris** array under **skills** of the ability, -the matching is successful only if the leftmost URI in the passed **want** parameter matches **scheme**, the combination of **scheme** and **host**, or the combination of **scheme**, **host**, and **port**. +Leftmost URI matching: When only **scheme**, a combination of **scheme** and **host**, or a combination of **scheme**, **host**, and **port** is configured in the **uris** array under **skills** of the application component, the matching is successful only if the leftmost URI in the passed **want** parameter matches **scheme**, the combination of **scheme** and **host**, or the combination of **scheme**, **host**, and **port**. **Figure 3** Matching rules when uri and type are specified in the want parameter - ![want-uri-type1](figures/want-uri-type1.png) +![want-uri-type1](figures/want-uri-type1.png) +To simplify the description: -To simplify the description, **uri** and **type** passed in the **want** parameter are called **w_uri** and **w_type**, respectively; the **uris** array under **skills** of an ability to match is called **s_uris**; each element in the array is called **s_uri**. Matching is performed from top to bottom. +- **uri** in the **want** parameter passed in by the caller is called **w_uri**; each element in the **uris** array under **skills** of the application component to match is called **s_uri**. +- **type** in the **want** parameter passed in by the caller is called **w_type**; the type in the **uris** array under **skills** of the application component to match is called **s_type**. **Figure 4** Matching rules of uri and type in the want parameter @@ -124,7 +127,7 @@ To simplify the description, **uri** and **type** passed in the **want** paramet ### Matching Rules of uri -To simplify the description, **uri** in the passed **want** parameter is called **w_uri**; **uri** under **skills** of an ability to match is called **s_uri**. The matching rules are as follows: +The rules are as follows: - If **scheme** of **s_uri** is unspecified and **w_uri** is unspecified, the matching is successful. Otherwise, the matching fails. @@ -142,18 +145,15 @@ To simplify the description, **uri** in the passed **want** parameter is called > **NOTE** > -> The **scheme**, **host**, **port**, **path**, **pathStartWith**, and **pathRegex** attributes of **uris** under **skills** of an ability are concatenated. If **path**, **pathStartWith**, and **pathRegex** are declared in sequence, **uris** can be concatenated into the following expressions: -> -> - **Full path expression**: `scheme://host:port/path` -> -> - **Prefix expression**: `scheme://host:port/pathStartWith` -> -> - **Regular expression**: `scheme://host:port/pathRegex` +> The **scheme**, **host**, **port**, **path**, **pathStartWith**, and **pathRegex** attributes of **uris** under **skills** of an application component are concatenated. If **path**, **pathStartWith**, and **pathRegex** are declared in sequence, **uris** can be concatenated into the following expressions: > > - **Prefix URI expression**: When only **scheme**, a combination of **scheme** and **host**, or a combination of **scheme**, **host**, and **port** is configured in the configuration file, the matching is successful if a URI prefixed with the configuration file is passed in. > * `scheme://` > * `scheme://host` > * `scheme://host:port` +> - **Full path expression**: `scheme://host:port/path` +> - **Prefix expression**: `scheme://host:port/pathStartWith` +> - **Regular expression**: `scheme://host:port/pathRegex` ### Matching Rules of type @@ -162,7 +162,7 @@ To simplify the description, **uri** in the passed **want** parameter is called > > The matching rules of **type** described in this section are based on the fact that **type** in the **want** parameter is specified. If **type** is unspecified, follow the [matching rules of uri and type in the want parameter](#matching-rules-of-uri-and-type-in-the-want-parameter). -To simplify the description, **uri** in the passed **want** parameter is called **w_type**, and **type** of **uris** under **skills** of an ability to match is called **s_type**. The matching rules are as follows: +The matching rules are as follows: - If **s_type** is unspecified, the matching fails. diff --git a/en/application-dev/application-models/extensionability-overview.md b/en/application-dev/application-models/extensionability-overview.md index d176b2d5322b215ab3d730b59cfc5a8e1f6dfb99..f55686f33a6d37917b8d7ff75d441d6f5c6c921f 100644 --- a/en/application-dev/application-models/extensionability-overview.md +++ b/en/application-dev/application-models/extensionability-overview.md @@ -11,17 +11,17 @@ An [ExtensionAbilityType](../reference/apis/js-apis-bundleManager.md#extensionab - [WorkSchedulerExtensionAbility](../reference/apis/js-apis-WorkSchedulerExtensionAbility.md): ExtensionAbility component of the work_scheduler type, which provides callbacks for Work Scheduler tasks. -- [InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod.md): ExtensionAbility component of the input_method type, which provides an input method framework that can be used to hide the keyboard, obtain the list of installed input methods, display the dialog box for input method selection, and more. +- [InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod.md): ExtensionAbility component of the input_method type, which is used to develop input method applications. - [ServiceExtensionAbility](../reference/apis/js-apis-app-ability-serviceExtensionAbility.md): ExtensionAbility component of the service type, which provides APIs related to background service scenarios. - [AccessibilityExtensionAbility](../reference/apis/js-apis-application-accessibilityExtensionAbility.md): ExtensionAbility component of the accessibility type, which provides APIs related to the accessibility feature. -- [DataShareExtensionAbility](../reference/apis/js-apis-application-dataShareExtensionAbility.md): ExtensionAbility component of the data_share type, which provides APIs for data sharing. +- [DataShareExtensionAbility (for system applications only)](../reference/apis/js-apis-application-dataShareExtensionAbility.md): ExtensionAbility component of the data_share type, which provides APIs for data sharing. - [StaticSubscriberExtensionAbility](../reference/apis/js-apis-application-staticSubscriberExtensionAbility.md): ExtensionAbility component of the static_subscriber type, which provides APIs for static broadcast. -- [WindowExtensionAbility](../reference/apis/js-apis-application-windowExtensionAbility.md): ExtensionAbility component of the window type, which allows a system application to be embedded in and displayed over another application. +- [WindowExtensionAbility (for system applications only)](../reference/apis/js-apis-application-windowExtensionAbility.md): ExtensionAbility component of the window type, which allows a system application to be embedded in and displayed over another application. - [EnterpriseAdminExtensionAbility](../reference/apis/js-apis-EnterpriseAdminExtensionAbility.md): ExtensionAbility component of the enterprise_admin type, which provides APIs for processing enterprise management events, such as application installation events on devices and events indicating too many incorrect screen-lock password attempts. @@ -56,13 +56,11 @@ You do not need to care when to add or delete a widget. The lifecycle of the For > **NOTE** > > For an application, all ExtensionAbility components of the same type run in an independent process, whereas UIAbility, ServiceExtensionAbility, and DataShareExtensionAbility run in another independent process. For details, see [Process Model (Stage Model)](process-model-stage.md). -> +> > For example, an application has one UIAbility component, one ServiceExtensionAbility, one DataShareExtensionAbility, two FormExtensionAbility, and one ImeExtensionAbility. When the application is running, there are three processes: -> +> > - UIAbility, ServiceExtensionAbility, and DataShareExtensionAbility run in an independent process. -> +> > - The two FormExtensionAbility components run in an independent process. -> +> > - The two ImeExtensionAbility components run in an independent process. - - \ No newline at end of file diff --git a/en/application-dev/application-models/fa-model-development-overview.md b/en/application-dev/application-models/fa-model-development-overview.md index 07e7ef8a0bdaea927762c15e4123ae728c026cb7..295e1863556cd37c7bc7e8cb588eaabbb9decb14 100644 --- a/en/application-dev/application-models/fa-model-development-overview.md +++ b/en/application-dev/application-models/fa-model-development-overview.md @@ -8,8 +8,8 @@ During application development based on the Feature Ability (FA) model, the foll | Task| Introduction| Guide| | -------- | -------- | -------- | -| Application component development| Use the PageAbility, ServiceAbility, DataAbility, and widgets of the FA model to develop applications.| - [Application- or Component-Level Configuration](application-component-configuration-fa.md)
- [PageAbility Component](pageability-overview.md)
- [ServiceAbility Component](serviceability-overview.md)
- [DataAbility Component](dataability-overview.md)
- [Widget Development](Widget-development-fa.md)
- [Context](application-context-fa.md)
- [Want](want-fa.md) | -| Inter-process communication (IPC)| Learn the process model and common IPC modes of the FA model.| [Common Events](common-event-fa.md)
[Background Services](rpc.md) | -| Inter-thread communication| Learn the thread model and common inter-thread communication modes of the FA model.| [Inter-Thread Communication](itc-fa-overview.md)| +| Application component development| Use the PageAbility, ServiceAbility, DataAbility, and widgets of the FA model to develop applications.| - [Application- or Component-Level Configuration](application-component-configuration-fa.md)
- [PageAbility Component](pageability-overview.md)
- [ServiceAbility Component](serviceability-overview.md)
- [DataAbility Component](dataability-overview.md)
- [Widget Development](widget-development-fa.md)
- [Context](application-context-fa.md)
- [Want](want-fa.md)| +| Process model| Learn the process model and common IPC modes of the FA model.| [Common Events](common-event-fa.md)
[Background Services](rpc.md)| +| Thread model| Learn the thread model and common inter-thread communication modes of the FA model.| [Inter-Thread Communication](itc-fa-overview.md)| | Mission management| Learn the basic concepts and typical scenarios of mission management in the FA model.| [Mission Management](mission-management-fa.md)| -| Application configuration file| Learn the requirements for developing application configuration files in the FA model.| [Application Configuration File](config-file-fa.md) | +| Application configuration file| Learn the requirements for developing application configuration files in the FA model.| [Application Configuration File](config-file-fa.md)| diff --git a/en/application-dev/application-models/figures/AccessibilityFramework.png b/en/application-dev/application-models/figures/AccessibilityFramework.png new file mode 100644 index 0000000000000000000000000000000000000000..786233e6ac160972f62b9786397eb077f7ee767c Binary files /dev/null and b/en/application-dev/application-models/figures/AccessibilityFramework.png differ diff --git a/en/application-dev/application-models/figures/WidgetCanvasDemo.jpeg b/en/application-dev/application-models/figures/WidgetCanvasDemo.jpeg deleted file mode 100644 index 9c797ff4575ae0aaf9aad27ae5d4d701181faf97..0000000000000000000000000000000000000000 Binary files a/en/application-dev/application-models/figures/WidgetCanvasDemo.jpeg and /dev/null differ diff --git a/en/application-dev/application-models/figures/WidgetCanvasDemo.png b/en/application-dev/application-models/figures/WidgetCanvasDemo.png new file mode 100644 index 0000000000000000000000000000000000000000..c09c82dd88cf002020990b5b8327701c445eeaaf Binary files /dev/null and b/en/application-dev/application-models/figures/WidgetCanvasDemo.png differ diff --git a/en/application-dev/application-models/figures/application_details.jpg b/en/application-dev/application-models/figures/application_details.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e849a47b3d10faefafbf76a7b6309da305a2e9b0 Binary files /dev/null and b/en/application-dev/application-models/figures/application_details.jpg differ diff --git a/en/application-dev/application-models/figures/stage-concepts.png b/en/application-dev/application-models/figures/stage-concepts.png index 42e99447a780b167adaf6ddd196bea4437dfa1a7..9d753f27fca4d507da20b5d5060f9b3d28e616b0 100644 Binary files a/en/application-dev/application-models/figures/stage-concepts.png and b/en/application-dev/application-models/figures/stage-concepts.png differ diff --git a/en/application-dev/application-models/figures/want-action.png b/en/application-dev/application-models/figures/want-action.png index 0d8e18ce5870bea777c26b832d3f29674c2fa261..b907e8158bd9fd183ceabb181a13aa813f01e77e 100644 Binary files a/en/application-dev/application-models/figures/want-action.png and b/en/application-dev/application-models/figures/want-action.png differ diff --git a/en/application-dev/application-models/hop-cross-device-migration.md b/en/application-dev/application-models/hop-cross-device-migration.md index c51e82e15f4e14f4b42b25e656543a01d84406fb..418eac519cb62c7339048df4f8663e20df8ef185 100644 --- a/en/application-dev/application-models/hop-cross-device-migration.md +++ b/en/application-dev/application-models/hop-cross-device-migration.md @@ -55,21 +55,21 @@ The table below describes the main APIs used for cross-device migration. For det Configure the application to support migration. Set the **continuable** field in the **module.json5** file to **true**. The default value is **false**. If this parameter is set to **false**, the application cannot be continued on the target device. - - - ```json - { - "module": { - // ... - "abilities": [ - { - // ... - "continuable": true, - } - ] - } - } - ``` + + + ```json + { + "module": { + ... + "abilities": [ + { + ... + "continuable": true, + } + ] + } + } + ``` Configure the application launch type. For details, see [UIAbility Component Launch Type](uiability-launch-type.md). @@ -83,19 +83,19 @@ The table below describes the main APIs used for cross-device migration. For det The sample code is as follows: - ```ts - import UIAbility from '@ohos.app.ability.UIAbility'; - import AbilityConstant from '@ohos.app.ability.AbilityConstant'; - - onContinue(wantParam : {[key: string]: any}) { - console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`) - let workInput = AppStorage.Get('ContinueWork'); - // Set the user input data into wantParam. - wantParam["work"] = workInput // set user input data into want params - console.info(`onContinue input = ${wantParam["input"]}`); - return AbilityConstant.OnContinueResult.AGREE - } - ``` + ```ts + import UIAbility from '@ohos.app.ability.UIAbility'; + import AbilityConstant from '@ohos.app.ability.AbilityConstant'; + + onContinue(wantParam : {[key: string]: any}) { + console.info(`onContinue version = ${wantParam.version}, targetDevice: ${wantParam.targetDevice}`) + let workInput = AppStorage.Get('ContinueWork'); + // Set the user input data into wantParam. + wantParam["work"] = workInput // set user input data into want params + console.info(`onContinue input = ${wantParam["input"]}`); + return AbilityConstant.OnContinueResult.AGREE + } + ``` 5. Implement **onCreate()** and **onNewWant()** in the UIAbility of the target application to implement data restoration. - Implementation example of **onCreate** in the multi-instance scenario diff --git a/en/application-dev/application-models/hop-multi-device-collaboration.md b/en/application-dev/application-models/hop-multi-device-collaboration.md index b761037182f27367e9c01488de41aaa23b6b25d2..a6e767964e4d1ee83fb1e837b2ddeb55786c9739 100644 --- a/en/application-dev/application-models/hop-multi-device-collaboration.md +++ b/en/application-dev/application-models/hop-multi-device-collaboration.md @@ -63,7 +63,7 @@ On device A, touch the **Start** button provided by the initiator application to // createDeviceManager is a system API. deviceManager.createDeviceManager('ohos.samples.demo', (err, dm) => { if (err) { - // ... + ... return } dmClass = dm @@ -94,13 +94,13 @@ On device A, touch the **Start** button provided by the initiator application to } // context is the AbilityContext of the initiator UIAbility. this.context.startAbility(want).then(() => { - // ... + ... }).catch((err) => { - // ... + ... }) ``` -5. Call stopServiceExtensionAbility(../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstopserviceextensionability) to stop the ServiceExtensionAbility when it is no longer required on device B. (This API cannot be used to stop a UIAbility. Users must manually stop a UIAbility through task management.) +5. Call [stopServiceExtensionAbility](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstopserviceextensionability) to stop the ServiceExtensionAbility when it is no longer required on device B. (This API cannot be used to stop a UIAbility. Users must manually stop a UIAbility through task management.) ```ts let want = { @@ -150,9 +150,9 @@ On device A, touch the **Start** button provided by the initiator application to } // context is the AbilityContext of the initiator UIAbility. this.context.startAbilityForResult(want).then((data) => { - // ... + ... }).catch((err) => { - // ... + ... }) ``` @@ -170,7 +170,7 @@ On device A, touch the **Start** button provided by the initiator application to } // context is the AbilityContext of the target UIAbility. this.context.terminateSelfWithResult(abilityResult, (err) => { - // ... + ... }); ``` @@ -179,17 +179,17 @@ On device A, touch the **Start** button provided by the initiator application to ```ts const RESULT_CODE: number = 1001; - // ... + ... // context is the UIAbilityContext of the initiator UIAbility. this.context.startAbilityForResult(want).then((data) => { if (data?.resultCode === RESULT_CODE) { // Parse the information returned by the target UIAbility. let info = data.want?.parameters?.info - // ... + ... } }).catch((err) => { - // ... + ... }) ``` @@ -444,10 +444,10 @@ The following describes how to implement multi-device collaboration through cros // Register the onRemoteStateChange listener of the CallerAbility. try { caller.onRemoteStateChange((str) => { - console.log('Remote state changed ' + str); + console.info('Remote state changed ' + str); }); } catch (error) { - console.log('Caller.onRemoteStateChange catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}'); + console.info('Caller.onRemoteStateChange catch error, error.code: ${JSON.stringify(error.code)}, error.message: ${JSON.stringify(error.message)}'); } } }).catch((error) => { diff --git a/en/application-dev/application-models/inputmethodextentionability.md b/en/application-dev/application-models/inputmethodextentionability.md index 2b3910707ecdb6f964822380a85b14857ec8fd29..b36cf2a050cd15c1d4047410406ed46343f604e5 100644 --- a/en/application-dev/application-models/inputmethodextentionability.md +++ b/en/application-dev/application-models/inputmethodextentionability.md @@ -1,11 +1,11 @@ # InputMethodExtensionAbility Development -[InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md) is an ExtensionAbility component of the inputMethod type that provides extension capabilities for the input method framework. +## When to Use +[InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md), inherited from [ExtensionAbility](extensionability-overview.md), is used for developing input method applications. -InputMethodExtensionAbility can be started or connected by other application components to process transactions in the background based on the request of the caller. +The entire lifecycle of the [InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md) instance and the owning ExtensionAbility process is scheduled and managed by the input method framework. The input method framework provides the [InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md) base class. Derive this base class to implement initialization and resource clearing. - -InputMethodExtensionAbility provides related capabilities through the [InputMethodExtensionContext](../reference/apis/js-apis-inputmethod-extension-context.md). +[InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md) provides related capabilities through [InputMethodExtensionContext](../reference/apis/js-apis-inputmethod-extension-context.md). ## Implementing an Input Method Application @@ -13,15 +13,13 @@ InputMethodExtensionAbility provides related capabilities through the [InputMeth InputMethodExtensionAbility provides the **onCreate()** and **onDestory()** callbacks, as described below. Override them as required. - **onCreate** - This callback is triggered when a service is created for the first time. You can perform initialization operations, for example, registering a common event listener. - + > **NOTE** > > If a service has been created, starting it again does not trigger the **onCreate()** callback. - + - **onDestroy** - This callback is triggered when the service is no longer used and the instance is ready for destruction. You can clear resources in this callback, for example, deregister the listener. @@ -29,7 +27,7 @@ InputMethodExtensionAbility provides the **onCreate()** and **onDestory()** call To implement an input method application, manually create an InputMethodExtensionAbility component in DevEco Studio. The procedure is as follows: -In the **ets** directory of the target module, right-click and choose **New** > **Extention Ability** > **InputMethod** to a minimum template of InputMethodExtensionAbility. +In the **ets** directory of the target module, right-click and choose **New** > **Extension Ability** > **InputMethod** to a minimum template of InputMethodExtensionAbility. > **NOTE** > @@ -70,7 +68,7 @@ The minimum template contains four files: **KeyboardController.ts**, **InputMeth onDestroy() { console.log("onDestroy."); - this.context.destroy(); + this.keyboardController.onDestroy(); // Destroy the window and deregister the event listener. } } ``` @@ -109,7 +107,6 @@ The minimum template contains four files: **KeyboardController.ts**, **InputMeth this.unRegisterListener(); // Deregister the event listener. let win = windowManager.findWindow(this.windowName); win.destroyWindow(); // Destroy the window. - this.mContext.terminateSelf(); // Terminate the InputMethodExtensionAbility service. } private initWindow(): void // Initialize the window. @@ -159,7 +156,7 @@ The minimum template contains four files: **KeyboardController.ts**, **InputMeth }) globalThis.inputAbility.on('inputStop', (imeId) => { if (imeId == "Bundle name/Ability name") { - this.onDestroy(); + this.mContext.destroy(); // Destroy the InputMethodExtensionAbility service. } }); } @@ -233,7 +230,7 @@ The minimum template contains four files: **KeyboardController.ts**, **InputMeth Add the path to this file to the **src** field in the **resources/base/profile/main_pages.json** file. - ```ts + ```ets import { numberSourceListData, sourceListType } from './keyboardKeyData' @Component @@ -342,12 +339,12 @@ The minimum template contains four files: **KeyboardController.ts**, **InputMeth } ``` - Register the InputMethodExtensionAbility in the [module.json5 file](../quick-start/module-configuration-file.md) corresponding to the target module. Set **type** to **"inputMethod"** and **srcEntry** to the code path of the InputMethodExtensionAbility component. +5. Register the InputMethodExtensionAbility in the [module.json5 file](../quick-start/module-configuration-file.md) corresponding to the **Module** project. Set **type** to **"inputMethod"** and **srcEntry** to the code path of the InputMethodExtensionAbility component. ```ts { "module": { - // ... + ... "extensionAbilities": [ { "description": "inputMethod", @@ -364,3 +361,47 @@ The minimum template contains four files: **KeyboardController.ts**, **InputMeth +## Restrictions + +To reduce the risk of abuse of the InputMethodExtensionAbility by third-party applications, the invoking of APIs in the following modules is restricted in the InputMethodExtensionAbility: + +> **NOTE** +> +> - If a restricted module is imported, no error is reported during compilation, but an incorrect value (**undefined**) is returned during running. As a result, the module does not take effect. +> - Currently, access to the [@ohos.multimedia.audio (Audio Management)](../reference/apis/js-apis-audio.md) module is allowed, with compliance with the following rules: +> - Users who deny the recording permission should still be allowed to use the non-voice-input features of the input method application. +> - Recording-related services are allowed only when the InputMethodExtensionAbility is in the foreground. For example, perform recording only when the soft keyboard is in the foreground and the user is proactively using the voice input method; stop recording when the application is switched to the background. +> - Applications will see increasingly stringent measures against violations with the preceding rules, and any violation may result in function exceptions. + +**Restricted modules:** + +- [@ohos.ability.featureAbility (FeatureAbility)](../reference/apis/js-apis-ability-featureAbility.md) +- [@ohos.ability.particleAbility (ParticleAbility)](../reference/apis/js-apis-ability-particleAbility.md) +- [@ohos.account.distributedAccount (Distributed Account Management)](../reference/apis/js-apis-distributed-account.md) +- [@ohos.backgroundTaskManager (Background Task Management)](../reference/apis/js-apis-backgroundTaskManager.md) +- [@ohos.bluetooth (Bluetooth)](../reference/apis/js-apis-bluetooth.md) +- [@ohos.bluetoothManager (Bluetooth)](../reference/apis/js-apis-bluetoothManager.md) +- [@ohos.connectedTag (Active Tags)](../reference/apis/js-apis-connectedTag.md) +- [@ohos.geolocation (Geolocation)](../reference/apis/js-apis-geolocation.md) +- [@ohos.geoLocationManager (Geolocation Manager)](../reference/apis/js-apis-geoLocationManager.md) +- [@ohos.nfc.cardEmulation (Standard NFC Card Emulation)](../reference/apis/js-apis-cardEmulation.md) +- [@ohos.nfc.controller (Standard NFC)](../reference/apis/js-apis-nfcController.md) +- [@ohos.nfc.tag (Standard NFC Tags)](../reference/apis/js-apis-nfcTag.md) +- [@ohos.reminderAgent (Reminder Agent)](../reference/apis/js-apis-reminderAgent.md) +- [@ohos.reminderAgentManager (reminderAgentManager)](../reference/apis/js-apis-reminderAgentManager.md) +- [@ohos.sensor (Sensor)](../reference/apis/js-apis-sensor.md) +- [@ohos.telephony.call (Call)](../reference/apis/js-apis-call.md) +- [@ohos.telephony.data (Cellular Data)](../reference/apis/js-apis-telephony-data.md) +- [@ohos.telephony.observer (observer)](../reference/apis/js-apis-observer.md) +- [@ohos.telephony.radio (Network Search)](../reference/apis/js-apis-radio.md) +- [@ohos.telephony.sim (SIM Management)](../reference/apis/js-apis-sim.md) +- [@ohos.telephony.sms (SMS)](../reference/apis/js-apis-sms.md) +- [@ohos.wallpaper (Wallpaper)](../reference/apis/js-apis-wallpaper.md) +- [@ohos.wifiext (WLAN Extension)](../reference/apis/js-apis-wifiext.md) +- [@ohos.wifiManager (WLAN)](../reference/apis/js-apis-wifiManager.md) +- [@ohos.wifiManagerExt (WLAN Extension Interface)](../reference/apis/js-apis-wifiManagerExt.md) +- [@system.geolocation (Geolocation)](../reference/apis/js-apis-system-location.md) +- [nfctech (Standard NFC Technologies)](../reference/apis/js-apis-nfctech.md) +- [tagSession (Standard NFC Tag Session)](../reference/apis/js-apis-tagSession.md) + + diff --git a/en/application-dev/application-models/itc-with-emitter.md b/en/application-dev/application-models/itc-with-emitter.md index 2966bd8eea41e04893814f20a3c5b2f9e4e456c9..43a5dc67be7349bb1d51a7e4141920b8739f7beb 100644 --- a/en/application-dev/application-models/itc-with-emitter.md +++ b/en/application-dev/application-models/itc-with-emitter.md @@ -13,12 +13,12 @@ To develop the Emitter mode, perform the following steps: // Define an event with eventId 1. let event = { - eventId: 1 + eventId: 1 }; // Trigger the callback after the event with eventId 1 is received. let callback = (eventData) => { - console.info('event callback'); + console.info('event callback'); }; // Subscribe to the event with eventId 1. @@ -29,21 +29,21 @@ To develop the Emitter mode, perform the following steps: ```ts import emitter from "@ohos.events.emitter"; - + // Define an event with eventId 1 and priority Low. let event = { - eventId: 1, - priority: emitter.EventPriority.LOW + eventId: 1, + priority: emitter.EventPriority.LOW }; - + let eventData = { - data: { - "content": "c", - "id": 1, - "isEmpty": false, - } + data: { + "content": "c", + "id": 1, + "isEmpty": false, + } }; - + // Emit the event with eventId 1 and event content eventData. emitter.emit(event, eventData); ``` diff --git a/en/application-dev/application-models/itc-with-worker.md b/en/application-dev/application-models/itc-with-worker.md index 996ab941b0244571dff6116a45ab5e2165cf1184..1f105d4f0ce31acdf135ab254e7bdb66e30d1ecf 100644 --- a/en/application-dev/application-models/itc-with-worker.md +++ b/en/application-dev/application-models/itc-with-worker.md @@ -9,13 +9,13 @@ To develop the Worker mode, perform the following steps: 1. Configure the **buildOption** field in the [module-level build-profile.json5](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-building-configuration-0000001218440654#section6887184182020) file of the project. ```ts - "buildOption": { - "sourceOption": { - "workers": [ - "./src/main/ets/workers/worker.ts" - ] - } + "buildOption": { + "sourceOption": { + "workers": [ + "./src/main/ets/workers/worker.ts" + ] } + } ``` 2. Create the **worker.ts** file based on the configuration in **build-profile.json5**. @@ -27,9 +27,9 @@ To develop the Worker mode, perform the following steps: // Process messages from the main thread. parent.onmessage = function(message) { - console.info("onmessage: " + message) - // Send a message to the main thread. - parent.postMessage("message from worker thread.") + console.info("onmessage: " + message) + // Send a message to the main thread. + parent.postMessage("message from worker thread.") } ``` @@ -46,10 +46,10 @@ To develop the Worker mode, perform the following steps: // Process messages from the worker thread. wk.onmessage = function(message) { - console.info("message from worker: " + message) + console.info("message from worker: " + message) - // Stop the worker thread based on service requirements. - wk.terminate() + // Stop the worker thread based on service requirements. + wk.terminate(); } ``` @@ -57,23 +57,22 @@ To develop the Worker mode, perform the following steps: ```ts import worker from '@ohos.worker'; - + let wk = new worker.ThreadWorker("../workers/worker.ts"); - + // Send a message to the worker thread. wk.postMessage("message from main thread.") - + // Process messages from the worker thread. wk.onmessage = function(message) { - console.info("message from worker: " + message) - - // Stop the worker thread based on service requirements. - wk.terminate() + console.info("message from worker: " + message) + + // Stop the worker thread based on service requirements. + wk.terminate(); } ``` > **NOTE** -> +> > - If the relative path of **worker.ts** configured in **build-profile.json5** is **./src/main/ets/workers/worker.ts**, pass in the path **entry/ets/workers/worker.ts** when creating a worker thread in the stage model, and pass in the path **../workers/worker.ts** when creating a worker thread in the FA model. -> > - For details about the data types supported between the main thread and worker thread, see [Sequenceable Data Types](../reference/apis/js-apis-worker.md#sequenceable-data-types). diff --git a/en/application-dev/application-models/mission-set-icon-name-for-task-snapshot.md b/en/application-dev/application-models/mission-set-icon-name-for-task-snapshot.md index c98d39ff8348f330d58138db89afcc2a0d5995ca..a5da1eeaa1d232b943f388b714b5a06f10d77be0 100644 --- a/en/application-dev/application-models/mission-set-icon-name-for-task-snapshot.md +++ b/en/application-dev/application-models/mission-set-icon-name-for-task-snapshot.md @@ -21,8 +21,10 @@ Call [UIAbilityContext.setMissionIcon()](../reference/apis/js-apis-inner-applica ```ts let imagePixelMap: PixelMap = undefined; // Obtain the PixelMap information. -this.context.setMissionIcon(imagePixelMap, (err) => { - console.error(`setMissionLabel failed, code is ${err.code}, message is ${err.message}`); +context.setMissionIcon(imagePixelMap, (err) => { + if (err.code) { + console.error(`Failed to set mission icon. Code is ${err.code}, message is ${err.message}`); + } }) ``` @@ -38,9 +40,9 @@ Call [UIAbilityContext.setMissionLabel()](../reference/apis/js-apis-inner-applic ```ts this.context.setMissionLabel('test').then(() => { - console.info('setMissionLabel succeeded.'); + console.info('Succeeded in seting mission label.'); }).catch((err) => { - console.error(`setMissionLabel failed, code is ${err.code}, message is ${err.message}`); + console.error(`Failed to set mission label. Code is ${err.code}, message is ${err.message}`); }); ``` diff --git a/en/application-dev/application-models/module-switch.md b/en/application-dev/application-models/module-switch.md index 9f31f892cda1a077301773a129f4f7915cd25c82..749c41ebdd4ebe5c4c2a1e0b9628c5fbfe74cea4 100644 --- a/en/application-dev/application-models/module-switch.md +++ b/en/application-dev/application-models/module-switch.md @@ -3,7 +3,7 @@ When switching an application from the FA model to the stage model, you must migrate the configurations under the **module** tag in the **config.json** file to the **module** tag in the **module.json5** file. -### Table 1 module Comparison +**Table 1** module comparison | Field Name in the FA Model| Field Description| Field Name in the Stage Model| Difference| | -------- | -------- | -------- | -------- | @@ -15,8 +15,8 @@ When switching an application from the FA model to the stage model, you must mig | moduleType in the distro object| Type of the HAP file. The value can be **entry** or **feature**. For the HAR type, set this field to **har**.| type | The field name is changed.| | installationFree in the distro object| Whether the HAP file supports the installation-free feature.| installationFree | The field name is changed.| | deliveryWithInstall in the distro object| Whether the HAP file is installed with the application.| deliveryWithInstall | The field name is changed.| -| metaData | Metadata of the HAP file.| metadata | See [Table 2](#table-2-metadata-comparison).| -| abilities | All abilities in the current module.| abilities | See [Table 5](#table-5-abilities-comparison).| +| metaData | Metadata of the HAP file.| metadata | For details, see Table 2.| +| abilities | All abilities in the current module.| abilities | For details, see Table 5.| | js | A set of JS modules developed using ArkUI. Each element in the set represents the information about a JS module.| pages | The stage model retains **pages** under the **module** tag. The window configuration is the lower level of **pages**.| | shortcuts | Shortcuts of the application.| shortcut_config.json| In the stage model, the **shortcut_config.json** file is defined in **resources/base/profile** in the development view.| | reqPermissions | Permissions that the application requests from the system when it is running.| requestPermissions | The field name is changed.| @@ -27,38 +27,38 @@ When switching an application from the FA model to the stage model, you must mig | entryTheme | Keyword of an OpenHarmony internal theme.| / | This configuration is not supported in the stage model.| -### Table 2 metaData Comparison +**Table 2** metaData comparison -| Field Name Under metaData in the FA Model| Field Description| Field Name Under metaData in the Stage Model| Difference| +| Field Name in the FA Model| Field Description| Field Name in the Stage Model| Difference| | -------- | -------- | -------- | -------- | | parameters | Metadata of the parameters to be passed for calling the ability.| / | This configuration is not supported in the stage model.| | results | Metadata of the ability return value.| / | This configuration is not supported in the stage model.| -| customizeData | Custom metadata of the parent component. **parameters** and **results** cannot be configured in **application**.| metadata | See [Table 3](#table-3-comparison-between-customizedata-under-metadata-in-the-fa-model-and-metadata-in-the-stage-model).| +| customizeData | Custom metadata of the parent component. **parameters** and **results** cannot be configured in **application**.| metadata | **For details**, see Table 3.| -### Table 3 Comparison Between customizeData Under metaData in the FA Model and metadata in the Stage Model +**Table 3** Comparison between customizeData under metaData in the FA model and metadata in the stage Model -| Field Name Under customizeData in metaData in the FA Model| Field Description| Field Name Under metaData in the Stage Model| Difference| +| Field Name in the FA Model| Field Description| Field Name in the Stage Model| Difference| | -------- | -------- | -------- | -------- | | name | Key name that identifies a data item. The value is a string with a maximum of 255 bytes.| name | None.| | value | Value of the data item. The value is a string with a maximum of 255 bytes.| value | None.| -| extra | Format of the current custom data. The value is the resource value of **extra**.| resource | The field name is changed. For details, see [Table 4](#table 4-metadata-examples).| +| extra | Format of the current custom data. The value is the resource value of **extra**.| resource | The field name is changed. For details, see Table 4.| -### Table 4 metaData Examples +**Table 4** metaData examples | Example in the FA Model| Example in the Stage Model| | -------- | -------- | | "meteData": {
"customizeDate": [{
"name": "label",
"value": "string",
"extra": "$string:label",
}]
} | "meteData": [{
"name": "label",
"value": "string",
"resource": "$string:label",
}] | -### Table 5 abilities Comparison +**Table 5** abilities comparison | Field Name Under abilities in the FA Model| Field Description| Field Name Under abilities in the Stage Model| Difference| | -------- | -------- | -------- | -------- | | process | Name of the process running the application or ability.| / | The stage model does not support configuration of **process** under **abilities**. The configuration of **process** is available under the **module** tag.| | uri | URI of the ability.| / | This configuration is not supported in the stage model.| | deviceCapability | Device capabilities required to run the ability.| / | This configuration is not supported in the stage model.| -| metaData | Metadata of the ability.| metadata | See [Table 2](#table-2-metadata-comparison).| +| metaData | Metadata of the ability.| metadata | For details, see Table 2.| | type | Ability type.| / | This configuration is not supported in the stage model.| | grantPermission | Whether permissions can be granted for any data in the ability.| / | The stage model does not support such a configuration under **abilities**.| | readPermission | Permission required for reading data in the ability. This field applies only to the ability using the Data template.| / | In the stage model, this configuration is available under **extensionAbilities**, but not **abilities**.| diff --git a/en/application-dev/application-models/page-mission-stack.md b/en/application-dev/application-models/page-mission-stack.md index 702cb9ba928d5266ce6720d10538df6109b0cbeb..cdb7ce724f2a29c711d4d056bcda5716f265ba48 100644 --- a/en/application-dev/application-models/page-mission-stack.md +++ b/en/application-dev/application-models/page-mission-stack.md @@ -5,7 +5,8 @@ A single UIAbility component can implement multiple pages and redirection between these pages. The redirection relationship inside the UIAbility component is called page stack, which is managed by the ArkUI framework. For example, Page1 -> Page2 -> Page3 of UIAbility1 and PageA -> PageB -> PageC of UIAbility2 in the figure below are two page stacks. - **Figure 1** Page stack +**Figure 1** Page stack + ![mission-record](figures/mission-record.png) - A page stack is formed as follows (Steps 2, 3, 5, and 6 are page redirection and managed by ArkUI): diff --git a/en/application-dev/application-models/pageability-launch-type.md b/en/application-dev/application-models/pageability-launch-type.md index 3b75ff6a60899f19f08aad5235fb3dc49632cb01..1e5d14c3037261e66fb2decdede6779c079651bc 100644 --- a/en/application-dev/application-models/pageability-launch-type.md +++ b/en/application-dev/application-models/pageability-launch-type.md @@ -5,7 +5,7 @@ Depending on the launch type, the action performed when the PageAbility starts d **Table 1** PageAbility launch types -| Launch Type| Meaning | Description| +| Launch Type| Meaning| Description | | -------- | -------- | -------- | | singleton | Singleton mode| Each time **startAbility()** is called, if an ability instance of this type already exists in the application process, the instance is reused. There is only one ability instance of this type in **Recents**.
A typical scenario is as follows: When a user opens a video playback application and watches a video, returns to the home screen, and opens the video playback application again, the video that the user watched before returning to the home screen is still played.| | standard | Multiton mode| Default type. Each time **startAbility()** is called, a new ability instance is created in the application process. Multiple ability instances of this type are displayed in **Recents**.
A typical scenario is as follows: When a user opens a document application and touches **New**, a new document task is created. Multiple new document missions are displayed in **Recents**.| @@ -16,13 +16,13 @@ You can set **launchType** in the **config.json** file to configure the launch t ```json { "module": { - // ... + ... "abilities": [ { // singleton means the singleton mode. // standard means the multiton mode. "launchType": "standard", - // ... + ... } ] } diff --git a/en/application-dev/application-models/redirection-rules.md b/en/application-dev/application-models/redirection-rules.md index 4e9f65a8b3439fe4dde4761fbcb3d341151ba4f3..19c74c605cd7ca1451cef6809f6ec5238cec36df 100644 --- a/en/application-dev/application-models/redirection-rules.md +++ b/en/application-dev/application-models/redirection-rules.md @@ -21,11 +21,11 @@ To enable an ability to be called by any application, configure the **config.jso ```ts { "module": { - // ... + ... "abilities": [ { "visible": "true", - // ... + ... } ] } diff --git a/en/application-dev/application-models/service-widget-overview.md b/en/application-dev/application-models/service-widget-overview.md index 3739129f2a07765b2ebe015910d1d6e3d8d721d0..528d9d4c134107c30de75f7f9e84ab42be514224 100644 --- a/en/application-dev/application-models/service-widget-overview.md +++ b/en/application-dev/application-models/service-widget-overview.md @@ -6,7 +6,7 @@ A service widget (also called widget) is a set of UI components that display imp ## Service Widget Architecture - **Figure 1** Service widget architecture +**Figure 1** Service widget architecture ![WidgetArchitecture](figures/WidgetArchitecture.png) @@ -24,7 +24,7 @@ Before you get started, it would be helpful if you have a basic understanding of Below is the typical procedure of using the widget: - **Figure 2** Typical procedure of using the widget +**Figure 2** Typical procedure of using the widget ![WidgetUse](figures/WidgetUse.png) @@ -55,4 +55,4 @@ ArkTS widgets and JS widgets have different implementation principles and featur | Custom drawing| Not supported| Supported| | Logic code execution (excluding the import capability)| Not supported| Supported| -As can be seen above, ArkTS widgets have more capabilities and use cases than JS widgets. Therefore, ArkTS widgets are always recommended, except for the case where the widget consists of only static pages. +As can be seen above, ArkTS widgets provide more capabilities and use cases than JS widgets. Therefore, ArkTS widgets are always recommended, except for the case where the widget consists of only static pages. diff --git a/en/application-dev/application-models/serviceextensionability.md b/en/application-dev/application-models/serviceextensionability.md index 2e9aaeb48100d86d0cd1c7a0e69ea01bf4ef2340..3f9e96cf03318d900b428348bdb1bdfb0151f611 100644 --- a/en/application-dev/application-models/serviceextensionability.md +++ b/en/application-dev/application-models/serviceextensionability.md @@ -29,6 +29,7 @@ Note the following: [ServiceExtensionAbility](../reference/apis/js-apis-app-ability-serviceExtensionAbility.md) provides the callbacks **onCreate()**, **onRequest()**, **onConnect()**, **onDisconnect()**, and **onDestory()**. Override them as required. The following figure shows the lifecycle of ServiceExtensionAbility. **Figure 1** ServiceExtensionAbility lifecycle + ![ServiceExtensionAbility-lifecycle](figures/ServiceExtensionAbility-lifecycle.png) - **onCreate** @@ -61,7 +62,7 @@ Note the following: Only system applications can implement ServiceExtensionAbility. You must make the following preparations before development: -- **Switching to the full SDK**: All APIs related to ServiceExtensionAbility are marked as system APIs and hidden by default. Therefore, you must manually obtain the full SDK from the mirror and switch to it in DevEco Studio. For details, see [Guide to Switching to Full SDK](../quick-start/full-sdk-switch-guide.md). +- **Switching to the full SDK**: All APIs related to ServiceExtensionAbility are marked as system APIs and hidden by default. Therefore, you must manually obtain the full SDK from the mirror and switch to it in DevEco Studio. For details, see [Guide to Switching to Full SDK](../faqs/full-sdk-switch-guide.md). - **Requesting the AllowAppUsePrivilegeExtension privilege**: Only applications with the **AllowAppUsePrivilegeExtension** privilege can develop ServiceExtensionAbility. For details about how to request the privilege, see [Application Privilege Configuration Guide](../../device-dev/subsystems/subsys-app-privilege-config-guide.md). @@ -109,7 +110,7 @@ export default class ServiceExtImpl extends IdlServiceExtStub { insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void { // Implement service logic. - console.log(TAG, `insertDataToMap, key: ${key} val: ${val}`); + console.info(TAG, `insertDataToMap, key: ${key} val: ${val}`); callback(ERR_OK); } } @@ -175,7 +176,7 @@ To manually create a ServiceExtensionAbility in the DevEco Studio project, perfo ```json { "module": { - // ... + ... "extensionAbilities": [ { "name": "ServiceExtAbility", @@ -201,41 +202,43 @@ A system application uses the [startServiceExtensionAbility()](../reference/apis 1. Start a new ServiceExtensionAbility in a system application. For details about how to obtain the context, see [Obtaining the Context of UIAbility](uiability-usage.md#obtaining-the-context-of-uiability). ```ts + let context = ...; // UIAbilityContext let want = { - "deviceId": "", - "bundleName": "com.example.myapplication", - "abilityName": "ServiceExtAbility" + "deviceId": "", + "bundleName": "com.example.myapplication", + "abilityName": "ServiceExtAbility" }; - this.context.startServiceExtensionAbility(want).then(() => { - console.info('startServiceExtensionAbility success'); - }).catch((error) => { - console.info('startServiceExtensionAbility failed'); + context.startServiceExtensionAbility(want).then(() => { + console.info('Succeeded in starting ServiceExtensionAbility.'); + }).catch((err) => { + console.error(`Failed to start ServiceExtensionAbility. Code is ${err.code}, message is ${err.message}`); }) ``` 2. Stop ServiceExtensionAbility in the system application. ```ts + let context = ...; // UIAbilityContext let want = { - "deviceId": "", - "bundleName": "com.example.myapplication", - "abilityName": "ServiceExtAbility" + "deviceId": "", + "bundleName": "com.example.myapplication", + "abilityName": "ServiceExtAbility" }; - this.context.stopServiceExtensionAbility(want).then(() => { - console.info('stopServiceExtensionAbility success'); - }).catch((error) => { - console.info('stopServiceExtensionAbility failed'); + context.stopServiceExtensionAbility(want).then(() => { + console.info('Succeeded in stoping ServiceExtensionAbility.'); + }).catch((err) => { + console.error(`Failed to stop ServiceExtensionAbility. Code is ${err.code}, message is ${err.message}`); }) ``` 3. ServiceExtensionAbility stops itself. ```ts - // this is the current ServiceExtensionAbility component. - this.context.terminateSelf().then(() => { - console.info('terminateSelf success'); - }).catch((error) => { - console.info('terminateSelf failed'); + let context = ...; // ServiceExtensionContext + context.terminateSelf().then(() => { + console.info('Succeeded in terminating self.'); + }).catch((err) => { + console.error(`Failed to terminate self. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -257,27 +260,27 @@ The ServiceExtensionAbility component returns an IRemoteObject in the **onConnec ```ts let want = { - "deviceId": "", - "bundleName": "com.example.myapplication", - "abilityName": "ServiceExtAbility" + "deviceId": "", + "bundleName": "com.example.myapplication", + "abilityName": "ServiceExtAbility" }; let options = { - onConnect(elementName, remote) { - /* The input parameter remote is the object returned by ServiceExtensionAbility in the onConnect lifecycle callback. - * This object is used for communication with ServiceExtensionAbility. For details, see the section below. - */ - console.info('onConnect callback'); - if (remote === null) { - console.info(`onConnect remote is null`); - return; - } - }, - onDisconnect(elementName) { - console.info('onDisconnect callback') - }, - onFailed(code) { - console.info('onFailed callback') + onConnect(elementName, remote) { + /* The input parameter remote is the object returned by ServiceExtensionAbility in the onConnect lifecycle callback. + * This object is used for communication with ServiceExtensionAbility. For details, see the section below. + */ + console.info('onConnect callback'); + if (remote === null) { + console.info(`onConnect remote is null`); + return; } + }, + onDisconnect(elementName) { + console.info('onDisconnect callback') + }, + onFailed(code) { + console.info('onFailed callback') + } } // The ID returned after the connection is set up must be saved. The ID will be passed for service disconnection. let connectionId = this.context.connectServiceExtensionAbility(want, options); @@ -288,9 +291,9 @@ The ServiceExtensionAbility component returns an IRemoteObject in the **onConnec ```ts // connectionId is returned when connectServiceExtensionAbility is called and needs to be manually maintained. this.context.disconnectServiceExtensionAbility(connectionId).then((data) => { - console.info('disconnectServiceExtensionAbility success'); + console.info('disconnectServiceExtensionAbility success'); }).catch((error) => { - console.error('disconnectServiceExtensionAbility failed'); + console.error('disconnectServiceExtensionAbility failed'); }) ``` @@ -305,27 +308,27 @@ After obtaining the [rpc.RemoteObject](../reference/apis/js-apis-rpc.md#iremoteo import IdlServiceExtProxy from '../IdlServiceExt/idl_service_ext_proxy'; let options = { - onConnect(elementName, remote) { - console.info('onConnect callback'); - if (remote === null) { - console.info(`onConnect remote is null`); - return; - } - let serviceExtProxy = new IdlServiceExtProxy(remote); - // Communication is carried out by interface calling, without exposing RPC details. - serviceExtProxy.processData(1, (errorCode, retVal) => { - console.log(`processData, errorCode: ${errorCode}, retVal: ${retVal}`); - }); - serviceExtProxy.insertDataToMap('theKey', 1, (errorCode) => { - console.log(`insertDataToMap, errorCode: ${errorCode}`); - }) - }, - onDisconnect(elementName) { - console.info('onDisconnect callback') - }, - onFailed(code) { - console.info('onFailed callback') + onConnect(elementName, remote) { + console.info('onConnect callback'); + if (remote === null) { + console.info(`onConnect remote is null`); + return; } + let serviceExtProxy = new IdlServiceExtProxy(remote); + // Communication is carried out by interface calling, without exposing RPC details. + serviceExtProxy.processData(1, (errorCode, retVal) => { + console.info(`processData, errorCode: ${errorCode}, retVal: ${retVal}`); + }); + serviceExtProxy.insertDataToMap('theKey', 1, (errorCode) => { + console.info(`insertDataToMap, errorCode: ${errorCode}`); + }) + }, + onDisconnect(elementName) { + console.info('onDisconnect callback') + }, + onFailed(code) { + console.info('onFailed callback') + } } ``` @@ -333,40 +336,40 @@ After obtaining the [rpc.RemoteObject](../reference/apis/js-apis-rpc.md#iremoteo ```ts import rpc from '@ohos.rpc'; - + const REQUEST_CODE = 1; let options = { - onConnect(elementName, remote) { - console.info('onConnect callback'); - if (remote === null) { - console.info(`onConnect remote is null`); - return; - } - // Directly call the RPC interface to send messages to the server. The client needs to serialize the input parameters and deserialize the return values. The process is complex. - let option = new rpc.MessageOption(); - let data = new rpc.MessageSequence(); - let reply = new rpc.MessageSequence(); - data.writeInt(100); - - // @param code Indicates the service request code sent by the client. - // @param data Indicates the {@link MessageSequence} object sent by the client. - // @param reply Indicates the response message object sent by the remote service. - // @param options Specifies whether the operation is synchronous or asynchronous. - // - // @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. - remote.sendMessageRequest(REQUEST_CODE, data, reply, option).then((ret) => { - let msg = reply.readInt(); - console.info(`sendMessageRequest ret:${ret} msg:${msg}`); - }).catch((error) => { - console.info('sendMessageRequest failed'); - }); - }, - onDisconnect(elementName) { - console.info('onDisconnect callback') - }, - onFailed(code) { - console.info('onFailed callback') + onConnect(elementName, remote) { + console.info('onConnect callback'); + if (remote === null) { + console.info(`onConnect remote is null`); + return; } + // Directly call the RPC interface to send messages to the server. The client needs to serialize the input parameters and deserialize the return values. The process is complex. + let option = new rpc.MessageOption(); + let data = new rpc.MessageSequence(); + let reply = new rpc.MessageSequence(); + data.writeInt(100); + + // @param code Indicates the service request code sent by the client. + // @param data Indicates the {@link MessageSequence} object sent by the client. + // @param reply Indicates the response message object sent by the remote service. + // @param options Specifies whether the operation is synchronous or asynchronous. + // + // @return Returns {@code true} if the operation is successful; returns {@code false} otherwise. + remote.sendMessageRequest(REQUEST_CODE, data, reply, option).then((ret) => { + let msg = reply.readInt(); + console.info(`sendMessageRequest ret:${ret} msg:${msg}`); + }).catch((error) => { + console.info('sendMessageRequest failed'); + }); + }, + onDisconnect(elementName) { + console.info('onDisconnect callback') + }, + onFailed(code) { + console.info('onFailed callback') + } } ``` @@ -381,8 +384,8 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i ```ts import rpc from '@ohos.rpc'; import bundleManager from '@ohos.bundle.bundleManager'; - import {processDataCallback} from './i_idl_service_ext'; - import {insertDataToMapCallback} from './i_idl_service_ext'; + import { processDataCallback } from './i_idl_service_ext'; + import { insertDataToMapCallback } from './i_idl_service_ext'; import IdlServiceExtStub from './idl_service_ext_stub'; const ERR_OK = 0; @@ -397,7 +400,7 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i bundleManager.getBundleNameByUid(callerUid).then((callerBundleName) => { console.info(TAG, 'getBundleNameByUid: ' + callerBundleName); // Identify the bundle name of the client. - if (callerBundleName != 'com.example.connectextapp') { // The verification fails. + if (callerBundleName != 'com.example.connectextapp') { // The verification fails. console.info(TAG, 'The caller bundle is not in whitelist, reject'); return; } @@ -409,7 +412,7 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void { // Implement service logic. - console.log(TAG, `insertDataToMap, key: ${key} val: ${val}`); + console.info(TAG, `insertDataToMap, key: ${key} val: ${val}`); callback(ERR_OK); } } @@ -425,15 +428,15 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i import {processDataCallback} from './i_idl_service_ext'; import {insertDataToMapCallback} from './i_idl_service_ext'; import IdlServiceExtStub from './idl_service_ext_stub'; - + const ERR_OK = 0; const ERR_DENY = -1; const TAG: string = "[IdlServiceExtImpl]"; - + export default class ServiceExtImpl extends IdlServiceExtStub { processData(data: number, callback: processDataCallback): void { console.info(TAG, `processData: ${data}`); - + let callerTokenId = rpc.IPCSkeleton.getCallingTokenId(); let accessManger = abilityAccessCtrl.createAtManager(); // The permission to be verified varies depending on the service requirements. ohos.permission.SET_WALLPAPER is only an example. @@ -446,10 +449,10 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i } callback(ERR_OK, data + 1); // The verification is successful, and service logic is executed normally. } - + insertDataToMap(key: string, val: number, callback: insertDataToMapCallback): void { // Implement service logic. - console.log(TAG, `insertDataToMap, key: ${key} val: ${val}`); + console.info(TAG, `insertDataToMap, key: ${key} val: ${val}`); callback(ERR_OK); } } diff --git a/en/application-dev/application-models/stage-model-development-overview.md b/en/application-dev/application-models/stage-model-development-overview.md index 451649bdb1a63147b79f8c7e2d4523d6c651c548..d4ad1d87c602c169e13b9ff99b8b491a33babd0a 100644 --- a/en/application-dev/application-models/stage-model-development-overview.md +++ b/en/application-dev/application-models/stage-model-development-overview.md @@ -12,7 +12,7 @@ The following figure shows the basic concepts used in the stage model. The stage model provides two types of application components: UIAbility and ExtensionAbility. Both have specific classes and support object-oriented development. - - UIAbility has the UI and is mainly used for user interaction. For example, with UIAbility, the Gallery application can display images in the liquid layout. After a user selects an image, it uses a new UI to display the image details. The user can touch the **Back** button to return to the liquid layout. The lifecycle of the UIAbility component contains the creation, destruction, foreground, and background states. Display-related states are exposed through WindowStage events. + - UIAbility is a type of application component that provides the UI for user interaction. For example, with UIAbility, the Gallery application can display images in the liquid layout. After a user selects an image, it uses a new UI to display the image details. The user can touch the **Back** button to return to the liquid layout. The lifecycle of the UIAbility component contains the creation, destruction, foreground, and background states. Display-related states are exposed through WindowStage events. - ExtensionAbility is oriented to specific scenarios. You cannot derive directly from ExtensionAbility. Instead, use the derived classes of ExtensionAbility for your scenarios, such as FormExtensionAbility for widget scenarios, InputMethodExtensionAbility for input method scenarios, and WorkSchedulerExtensionAbility for Work Scheduled task scenarios. For example, to enable a user to create an application widget on the home screen, you must derive FormExtensionAbility, implement the callback functions, and configure the capability in the configuration file. The derived class instances are created by developers and their lifecycles are managed by the system. In the stage model, you must use the derived classes of ExtensionAbility to develop custom services based on your service scenarios. - [WindowStage](../windowmanager/application-window-stage.md) @@ -37,7 +37,7 @@ During application development based on the stage model, the following tasks are | Task| Introduction| Guide| | -------- | -------- | -------- | | Application component development| Use the UIAbility and ExtensionAbility components of the stage model to develop applications.| - [Application- or Component-Level Configuration](application-component-configuration-stage.md)
- [UIAbility Component](uiability-overview.md)
- [ExtensionAbility Component](extensionability-overview.md)
- [AbilityStage Container Component](abilitystage.md)
- [Context](application-context-stage.md)
- [Component Startup Rules](component-startup-rules.md)| -| Inter-process communication (IPC)| Learn the process model and common IPC modes of the stage model.| - [Common Events](common-event-overview.md)
- [Background Services](background-services.md)| -| Inter-thread communication| Learn the thread model and common inter-thread communication modes of the stage model.| - [Emitter](itc-with-emitter.md)
- [Worker](itc-with-worker.md)| +| Process model| Learn the process model and common IPC modes of the stage model.| - [Common Events](common-event-overview.md)
- [Background Services](background-services.md)| +| Thread model| Learn the thread model and common inter-thread communication modes of the stage model.| - [Emitter](itc-with-emitter.md)
- [Worker](itc-with-worker.md)| | Mission management| Learn the basic concepts and typical scenarios of mission management in the stage model.| - [Mission Management Scenarios](mission-management-overview.md)
- [Mission Management and Launch Type](mission-management-launch-type.md)
- [Page Stack and Mission List](page-mission-stack.md)| | Application configuration file| Learn the requirements for developing application configuration files in the stage model.| [Application Configuration File](config-file-stage.md)| diff --git a/en/application-dev/application-models/start-page.md b/en/application-dev/application-models/start-page.md index 5831ea0c6f6b6fa9d954134ef723f70e925e3ed7..1def472cd5fa2567fda123fc272542787b1f985c 100644 --- a/en/application-dev/application-models/start-page.md +++ b/en/application-dev/application-models/start-page.md @@ -83,7 +83,7 @@ struct Index { @State message: string = 'Hello World' build() { - // ... + ... Button("startAbility") .onClick(() => { featureAbility.startAbility({ @@ -98,7 +98,7 @@ struct Index { console.info("startAbility failed errcode:" + err.code) }) }) - // ... + ... Button("page2") .onClick(() => { featureAbility.startAbility({ @@ -113,7 +113,7 @@ struct Index { console.info("startAbility failed errcode:" + err.code) }) }) - // ... + ... } } ``` @@ -136,7 +136,7 @@ export default { }) }, onDestroy() { - // ... + ... }, } ``` diff --git a/en/application-dev/application-models/start-pageability-from-stage.md b/en/application-dev/application-models/start-pageability-from-stage.md index 9d1b7ed27f6780ce56d1e90b3be5d196cf3b1187..bd6a11187fdfbc81c63bcc6601f8a8e82b0dbe4c 100644 --- a/en/application-dev/application-models/start-pageability-from-stage.md +++ b/en/application-dev/application-models/start-pageability-from-stage.md @@ -21,7 +21,7 @@ export default class EntryAbility extends UIAbility { onWindowStageCreate(windowStage) { console.info("EntryAbility onWindowStageCreate") windowStage.loadContent('pages/Index', (err, data) => { - // ... + ... }); let want = { bundleName: "com.ohos.fa", @@ -66,7 +66,7 @@ export default class EntryAbility extends UIAbility { onWindowStageCreate(windowStage) { console.info("EntryAbility onWindowStageCreate") windowStage.loadContent('pages/Index', (err, data) => { - // ... + ... }); let want = { bundleName: "com.ohos.fa", diff --git a/en/application-dev/application-models/start-remote-pageability.md b/en/application-dev/application-models/start-remote-pageability.md index 36ee305b49698c1f6e6cf216174f77212f1d53e4..a52378af306c9719b086b23f0909f87d7bf376b3 100644 --- a/en/application-dev/application-models/start-remote-pageability.md +++ b/en/application-dev/application-models/start-remote-pageability.md @@ -83,28 +83,31 @@ After obtaining the data synchronization permission, obtain the trusted device l The following sample code shows how to use **getTrustedDeviceListSync()** to obtain the trusted device list. ```ts -import deviceManager from '@ohos.distributedHardware.deviceManager'; -let dmClass; +import deviceManager from '@ohos.distributedHardware.deviceManager'; + +let dmClass; + function getDeviceManager() { - deviceManager.createDeviceManager('ohos.example.distributedService', (error, dm) => { - if (error) { - console.info('create device manager failed with ' + error) - } - dmClass = dm; - }) + deviceManager.createDeviceManager('ohos.example.distributedService', (error, dm) => { + if (error) { + console.info('create device manager failed with ' + error) + } + dmClass = dm; + }) } -function getRemoteDeviceId() { - if (typeof dmClass === 'object' && dmClass != null) { - let list = dmClass.getTrustedDeviceListSync(); - if (typeof (list) == 'undefined' || typeof (list.length) == 'undefined') { - console.info("EntryAbility onButtonClick getRemoteDeviceId err: list is null"); - return; - } - console.info("EntryAbility onButtonClick getRemoteDeviceId success:" + list[0].deviceId); - return list[0].deviceId; - } else { - console.info("EntryAbility onButtonClick getRemoteDeviceId err: dmClass is null"); - } + +function getRemoteDeviceId() { + if (typeof dmClass === 'object' && dmClass != null) { + let list = dmClass.getTrustedDeviceListSync(); + if (typeof (list) == 'undefined' || typeof (list.length) == 'undefined') { + console.info("EntryAbility onButtonClick getRemoteDeviceId err: list is null"); + return; + } + console.info("EntryAbility onButtonClick getRemoteDeviceId success:" + list[0].deviceId); + return list[0].deviceId; + } else { + console.info("EntryAbility onButtonClick getRemoteDeviceId err: dmClass is null"); + } } ``` @@ -116,21 +119,22 @@ The following sample code shows how to explicitly start a remote PageAbility thr ```ts import featureAbility from '@ohos.ability.featureAbility'; -function onStartRemoteAbility() { - console.info('onStartRemoteAbility begin'); - let params; - let wantValue = { - bundleName: 'ohos.samples.etsDemo', - abilityName: 'ohos.samples.etsDemo.RemoteAbility', - deviceId: getRemoteDeviceId(), // getRemoteDeviceId is defined in the preceding sample code. - parameters: params - }; - console.info('onStartRemoteAbility want=' + JSON.stringify(wantValue)); - featureAbility.startAbility({ - want: wantValue - }).then((data) => { - console.info('onStartRemoteAbility finished, ' + JSON.stringify(data)); - }); - console.info('onStartRemoteAbility end'); + +function onStartRemoteAbility() { + console.info('onStartRemoteAbility begin'); + let params; + let wantValue = { + bundleName: 'ohos.samples.etsDemo', + abilityName: 'ohos.samples.etsDemo.RemoteAbility', + deviceId: getRemoteDeviceId(), // getRemoteDeviceId is defined in the preceding sample code. + parameters: params + }; + console.info('onStartRemoteAbility want=' + JSON.stringify(wantValue)); + featureAbility.startAbility({ + want: wantValue + }).then((data) => { + console.info('onStartRemoteAbility finished, ' + JSON.stringify(data)); + }); + console.info('onStartRemoteAbility end'); } ``` diff --git a/en/application-dev/application-models/subscribe-system-environment-variable-changes.md b/en/application-dev/application-models/subscribe-system-environment-variable-changes.md index c231f483e9bcd8f83faf49d40007730d0f854de5..4eecf15808da492ca69d933fdabf39aa82347ce5 100644 --- a/en/application-dev/application-models/subscribe-system-environment-variable-changes.md +++ b/en/application-dev/application-models/subscribe-system-environment-variable-changes.md @@ -54,7 +54,7 @@ In OpenHarmony, you can subscribe to system environment variable changes in the // Page display. build() { - // ... + ... } } ``` @@ -77,7 +77,7 @@ In OpenHarmony, you can subscribe to system environment variable changes in the // Page display. build() { - // ... + ... } } ``` @@ -99,19 +99,19 @@ import AbilityStage from '@ohos.app.ability.AbilityStage'; let systemLanguage: string; // System language in use. export default class MyAbilityStage extends AbilityStage { - onCreate() { - systemLanguage = this.context.config.language; // Obtain the system language in use when the AbilityStage instance is loaded for the first time. - console.info(`systemLanguage is ${systemLanguage} `); - } + onCreate() { + systemLanguage = this.context.config.language; // Obtain the system language in use when the AbilityStage instance is loaded for the first time. + console.info(`systemLanguage is ${systemLanguage} `); + } - onConfigurationUpdate(newConfig) { - console.info(`onConfigurationUpdated systemLanguage is ${systemLanguage}, newConfig: ${JSON.stringify(newConfig)}`); + onConfigurationUpdate(newConfig) { + console.info(`onConfigurationUpdated systemLanguage is ${systemLanguage}, newConfig: ${JSON.stringify(newConfig)}`); - if (systemLanguage !== newConfig.language) { - console.info(`systemLanguage from ${systemLanguage} changed to ${newConfig.language}`); - systemLanguage = newConfig.language; // Save the new system language as the system language in use, which will be used for comparison. - } + if (systemLanguage !== newConfig.language) { + console.info(`systemLanguage from ${systemLanguage} changed to ${newConfig.language}`); + systemLanguage = newConfig.language; // Save the new system language as the system language in use, which will be used for comparison. } + } } ``` @@ -131,21 +131,21 @@ import UIAbility from '@ohos.app.ability.UIAbility'; let systemLanguage: string; // System language in use. export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - systemLanguage = this.context.config.language; // Obtain the system language in use when the UIAbility instance is loaded for the first time. - console.info(`systemLanguage is ${systemLanguage} `); - } + onCreate(want, launchParam) { + systemLanguage = this.context.config.language; // Obtain the system language in use when the UIAbility instance is loaded for the first time. + console.info(`systemLanguage is ${systemLanguage} `); + } - onConfigurationUpdate(newConfig) { - console.info(`onConfigurationUpdated systemLanguage is ${systemLanguage}, newConfig: ${JSON.stringify(newConfig)}`); + onConfigurationUpdate(newConfig) { + console.info(`onConfigurationUpdated systemLanguage is ${systemLanguage}, newConfig: ${JSON.stringify(newConfig)}`); - if (systemLanguage !== newConfig.language) { - console.info(`systemLanguage from ${systemLanguage} changed to ${newConfig.language}`); - systemLanguage = newConfig.language; // Save the new system language as the system language in use, which will be used for comparison. - } + if (systemLanguage !== newConfig.language) { + console.info(`systemLanguage from ${systemLanguage} changed to ${newConfig.language}`); + systemLanguage = newConfig.language; // Save the new system language as the system language in use, which will be used for comparison. } + } - // ... + ... } ``` @@ -163,10 +163,10 @@ The code snippet below uses FormExtensionAbility as an example to describe how t import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; export default class EntryFormAbility extends FormExtensionAbility { - onConfigurationUpdate(newConfig) { - console.info(`newConfig is ${JSON.stringify(newConfig)}`); - } + onConfigurationUpdate(newConfig) { + console.info(`newConfig is ${JSON.stringify(newConfig)}`); + } - // ... + ... } ``` diff --git a/en/application-dev/application-models/thread-model-stage.md b/en/application-dev/application-models/thread-model-stage.md index 7343b9b619a5d68354e65e254a22a2b078ca44ee..2b1f855980a14eeba89a18184c69d46eebaea6ac 100644 --- a/en/application-dev/application-models/thread-model-stage.md +++ b/en/application-dev/application-models/thread-model-stage.md @@ -17,5 +17,6 @@ Based on the OpenHarmony thread model, different services run on different threa > **NOTE** > -> - The stage model provides only the main thread and worker thread. Emitter is mainly used for event synchronization within the main thread or between the main thread and worker thread. -> - To view thread information about an application process, run the **hdc shell** command to enter the shell CLI of the device, and then run the **ps -p ** -T command**, where ** indicates the ID of the application process. +> - The stage model provides only the main thread and worker thread. Emitter is mainly used for event synchronization within the worker thread or between the main thread and worker thread. +> - The UIAbility and UI are in the main thread. For details about data synchronization between them, see [Data Synchronization Between UIAbility and UI](uiability-data-sync-with-ui.md). +> - To view thread information about an application process, run the **hdc shell** command to enter the shell CLI of the device, and then run the **ps -p ** -T command**, where ** indicates the [process ID](process-model-stage.md) of the application. diff --git a/en/application-dev/application-models/uiability-data-sync-with-ui.md b/en/application-dev/application-models/uiability-data-sync-with-ui.md index 52967c25c86966710853378c95c74d5e6e13e432..6998001c763a464e51f8cef4a0c64aec6f1db5e8 100644 --- a/en/application-dev/application-models/uiability-data-sync-with-ui.md +++ b/en/application-dev/application-models/uiability-data-sync-with-ui.md @@ -22,21 +22,21 @@ Before using the APIs provided by **EventHub**, you must obtain an **EventHub** const TAG: string = '[Example].[Entry].[EntryAbility]'; export default class EntryAbility extends UIAbility { - func1(...data) { - // Trigger the event to complete the service operation. - console.info(TAG, '1. ' + JSON.stringify(data)); - } - - onCreate(want, launch) { - // Obtain an eventHub object. - let eventhub = this.context.eventHub; - // Subscribe to the event. - eventhub.on('event1', this.func1); - eventhub.on('event1', (...data) => { - // Trigger the event to complete the service operation. - console.info(TAG, '2. ' + JSON.stringify(data)); - }); - } + func1(...data) { + // Trigger the event to complete the service operation. + console.info(TAG, '1. ' + JSON.stringify(data)); + } + + onCreate(want, launch) { + // Obtain an eventHub object. + let eventhub = this.context.eventHub; + // Subscribe to the event. + eventhub.on('event1', this.func1); + eventhub.on('event1', (...data) => { + // Trigger the event to complete the service operation. + console.info(TAG, '2. ' + JSON.stringify(data)); + }); + } } ``` @@ -62,7 +62,7 @@ Before using the APIs provided by **EventHub**, you must obtain an **EventHub** // Page display. build() { - // ... + ... } } ``` @@ -90,8 +90,7 @@ Before using the APIs provided by **EventHub**, you must obtain an **EventHub** **globalThis** is a global object inside the [ArkTS engine instance](thread-model-stage.md) and can be used by UIAbility, ExtensionAbility, and Page inside the engine. Therefore, you can use **globalThis** for data synchronization. **Figure 1** Using globalThis for data synchronization - - ![globalThis1](figures/globalThis1.png) +![globalThis1](figures/globalThis1.png) The following describes how to use **globalThis** in three scenarios. Precautions are provided as well. @@ -105,18 +104,18 @@ The following describes how to use **globalThis** in three scenarios. Precaution By binding attributes or methods to **globalThis**, you can implement data synchronization between the UIAbility component and UI. For example, if you bind the **want** parameter in the UIAbility component, you can use the **want** parameter information on the UI corresponding to the UIAbility component. -1. When [startAbility()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability) is called to start a UIAbility instance, the **onCreate()** callback is invoked, and the **want** parameter can be passed in the callback. Therefore, you can bind the **want** parameter to **globalThis**. +1. When [startAbility()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability) is called to start a UIAbility instance, the [onCreate()](../reference/apis/js-apis-app-ability-uiAbility.md#uiabilityoncreate) callback is invoked, and the **want** parameter can be passed in the callback. Therefore, you can bind the **want** parameter to **globalThis**. ```ts import UIAbility from '@ohos.app.ability.UIAbility'; export default class EntryAbility extends UIAbility { - onCreate(want, launch) { - globalThis.entryAbilityWant = want; - // ... - } + onCreate(want, launch) { + globalThis.entryAbilityWant = want; + ... + } - // ... + ... } ``` @@ -124,17 +123,17 @@ By binding attributes or methods to **globalThis**, you can implement data synch ```ts let entryAbilityWant; - + @Entry @Component struct Index { aboutToAppear() { entryAbilityWant = globalThis.entryAbilityWant; } - + // Page display. build() { - // ... + ... } } ``` @@ -150,10 +149,10 @@ To implement data synchronization between two UIAbility components in the same a import UIAbility from '@ohos.app.ability.UIAbility' export default class UIAbilityA extends UIAbility { - onCreate(want, launch) { - globalThis.entryAbilityStr = 'UIAbilityA'; // UIAbilityA stores the string "UIAbilityA" to globalThis. - // ... - } + onCreate(want, launch) { + globalThis.entryAbilityStr = 'UIAbilityA'; // UIAbilityA stores the string "UIAbilityA" to globalThis. + ... + } } ``` @@ -161,13 +160,13 @@ To implement data synchronization between two UIAbility components in the same a ```ts import UIAbility from '@ohos.app.ability.UIAbility' - + export default class UIAbilityB extends UIAbility { - onCreate(want, launch) { - // UIAbilityB reads name from globalThis and outputs it. - console.info('name from entryAbilityStr: ' + globalThis.entryAbilityStr); - // ... - } + onCreate(want, launch) { + // UIAbilityB reads name from globalThis and outputs it. + console.info('name from entryAbilityStr: ' + globalThis.entryAbilityStr); + ... + } } ``` @@ -182,11 +181,11 @@ To implement data synchronization between the UIAbility and ExtensionAbility com import UIAbility from '@ohos.app.ability.UIAbility' export default class UIAbilityA extends UIAbility { - onCreate(want, launch) { - // UIAbilityA stores the string "UIAbilityA" to globalThis. - globalThis.entryAbilityStr = 'UIAbilityA'; - // ... - } + onCreate(want, launch) { + // UIAbilityA stores the string "UIAbilityA" to globalThis. + globalThis.entryAbilityStr = 'UIAbilityA'; + ... + } } ``` @@ -194,21 +193,20 @@ To implement data synchronization between the UIAbility and ExtensionAbility com ```ts import Extension from '@ohos.app.ability.ServiceExtensionAbility' - + export default class ServiceExtAbility extends Extension { - onCreate(want) { - / / ServiceExtAbility reads name from globalThis and outputs it. - console.info('name from entryAbilityStr: ' + globalThis.entryAbilityStr); - // ... - } + onCreate(want) { + / / ServiceExtAbility reads name from globalThis and outputs it. + console.info('name from entryAbilityStr: ' + globalThis.entryAbilityStr); + ... + } } ``` ### Precautions for Using globalThis -**Figure 2** Precautions for globalThis - +**Figure 2** Precautions for globalThis ![globalThis2](figures/globalThis2.png) - In the stage model, all the UIAbility components in a process share one ArkTS engine instance. When using **globalThis**, do not store objects with the same name. For example, if UIAbilityA and UIAbilityB use **globalThis** to store two objects with the same name, the object stored earlier will be overwritten. @@ -225,10 +223,10 @@ The following provides an example to describe the object overwritten problem in import UIAbility from '@ohos.app.ability.UIAbility' export default class UIAbilityA extends UIAbility { - onCreate(want, launch) { - globalThis.context = this.context; // UIAbilityA stores the context in globalThis. - // ... - } + onCreate(want, launch) { + globalThis.context = this.context; // UIAbilityA stores the context in globalThis. + ... + } } ``` @@ -243,7 +241,7 @@ The following provides an example to describe the object overwritten problem in } // Page display. build() { - // ... + ... } } ``` @@ -254,11 +252,11 @@ The following provides an example to describe the object overwritten problem in import UIAbility from '@ohos.app.ability.UIAbility' export default class UIAbilityB extends UIAbility { - onCreate(want, launch) { - // UIAbilityB overwrites the context stored by UIAbilityA in globalThis. - globalThis.context = this.context; - // ... - } + onCreate(want, launch) { + // UIAbilityB overwrites the context stored by UIAbilityA in globalThis. + globalThis.context = this.context; + ... + } } ``` @@ -273,7 +271,7 @@ The following provides an example to describe the object overwritten problem in } // Page display. build() { - // ... + ... } } ``` @@ -284,10 +282,10 @@ The following provides an example to describe the object overwritten problem in import UIAbility from '@ohos.app.ability.UIAbility' export default class UIAbilityA extends UIAbility { - onCreate(want, launch) { // UIAbilityA will not enter this lifecycle. - globalThis.context = this.context; - // ... - } + onCreate(want, launch) { // UIAbilityA will not enter this lifecycle. + globalThis.context = this.context; + ... + } } ``` @@ -302,7 +300,7 @@ The following provides an example to describe the object overwritten problem in } // Page display. build() { - // ... + ... } } ``` @@ -310,5 +308,3 @@ The following provides an example to describe the object overwritten problem in ## Using AppStorage or LocalStorage for Data Synchronization ArkUI provides AppStorage and LocalStorage to implement application- and UIAbility-level data synchronization, respectively. Both solutions can be used to manage the application state, enhance application performance, and improve user experience. The AppStorage is a global state manager and is applicable when multiple UIAbilities share the same state data. The LocalStorage is a local state manager that manages state data used inside a single UIAbility. They help you control the application state more flexibly and improve the maintainability and scalability of applications. For details, see [State Management of Application-Level Variables](../quick-start/arkts-application-state-management-overview.md). - - \ No newline at end of file diff --git a/en/application-dev/application-models/uiability-intra-device-interaction.md b/en/application-dev/application-models/uiability-intra-device-interaction.md index 9dbbc2be90107d2131a1cdae21e576cb4771966e..208fd1af3bb9912439a8a50d3ce35f5a5d58596e 100644 --- a/en/application-dev/application-models/uiability-intra-device-interaction.md +++ b/en/application-dev/application-models/uiability-intra-device-interaction.md @@ -32,20 +32,20 @@ Assume that your application has two UIAbility components: EntryAbility and Func ```ts let context = ...; // UIAbilityContext - let wantInfo = { + let want = { deviceId: '', // An empty deviceId indicates the local device. bundleName: 'com.example.myapplication', abilityName: 'FuncAbility', - moduleName: 'module1', // moduleName is optional. + moduleName: 'func', // moduleName is optional. parameters: {// Custom information. info: 'From the Index page of EntryAbility', }, } // context is the UIAbilityContext of the initiator UIAbility. - context.startAbility(wantInfo).then(() => { - // ... + context.startAbility(want).then(() => { + console.info('Succeeded in starting ability.'); }).catch((err) => { - // ... + console.error(`Failed to start ability. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -53,18 +53,17 @@ Assume that your application has two UIAbility components: EntryAbility and Func ```ts import UIAbility from '@ohos.app.ability.UIAbility'; - import window from '@ohos.window'; export default class FuncAbility extends UIAbility { onCreate(want, launchParam) { // Receive the parameters passed by the initiator UIAbility. let funcAbilityWant = want; let info = funcAbilityWant?.parameters?.info; - // ... + ... } } ``` - + > **NOTE**
> > In FuncAbility started, you can obtain the PID and bundle name of the UIAbility through **parameters** in the passed **want** parameter. @@ -76,11 +75,14 @@ Assume that your application has two UIAbility components: EntryAbility and Func // context is the UIAbilityContext of the UIAbility instance to stop. context.terminateSelf((err) => { - // ... + if (err.code) { + console.error(`Failed to terminate Self. Code is ${err.code}, message is ${err.message}`); + return; + } }); ``` - > **NOTE** + > **NOTE**
> > When [terminateSelf()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextterminateself) is called to stop the **UIAbility** instance, the snapshot of the instance is retained by default. That is, the mission corresponding to the instance is still displayed in Recents. If you do not want to retain the snapshot, set **removeMissionAfterTerminate** under the [abilities](../quick-start/module-configuration-file.md#abilities) tag to **true** in the [module.json5 file](../quick-start/module-configuration-file.md) of the corresponding UIAbility. @@ -95,20 +97,20 @@ When starting FuncAbility from EntryAbility, you want the result to be returned ```ts let context = ...; // UIAbilityContext - let wantInfo = { + let want = { deviceId: '', // An empty deviceId indicates the local device. bundleName: 'com.example.myapplication', abilityName: 'FuncAbility', - moduleName: 'module1', // moduleName is optional. + moduleName: 'func', // moduleName is optional. parameters: {// Custom information. info: 'From the Index page of EntryAbility', }, } // context is the UIAbilityContext of the initiator UIAbility. - context.startAbilityForResult(wantInfo).then((data) => { - // ... + context.startAbilityForResult(want).then((data) => { + ... }).catch((err) => { - // ... + console.error(`Failed to start ability for result. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -122,7 +124,7 @@ When starting FuncAbility from EntryAbility, you want the result to be returned want: { bundleName: 'com.example.myapplication', abilityName: 'FuncAbility', - moduleName: 'module1', + moduleName: 'func', parameters: { info: 'From the Index page of FuncAbility', }, @@ -130,7 +132,10 @@ When starting FuncAbility from EntryAbility, you want the result to be returned } // context is the AbilityContext of the target UIAbility. context.terminateSelfWithResult(abilityResult, (err) => { - // ... + if (err.code) { + console.error(`Failed to terminate self with result. Code is ${err.code}, message is ${err.message}`); + return; + } }); ``` @@ -140,17 +145,17 @@ When starting FuncAbility from EntryAbility, you want the result to be returned let context = ...; // UIAbilityContext const RESULT_CODE: number = 1001; - // ... + ... // context is the UIAbilityContext of the initiator UIAbility. - context.startAbilityForResult(wantInfo).then((data) => { + context.startAbilityForResult(want).then((data) => { if (data?.resultCode === RESULT_CODE) { // Parse the information returned by the target UIAbility. let info = data.want?.parameters?.info; - // ... + ... } }).catch((err) => { - // ... + console.error(`Failed to start ability for result. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -174,15 +179,15 @@ This section describes how to start the UIAbility of another application through "module": { "abilities": [ { - // ... + ... "skills": [ { "entities": [ - // ... + ... "entity.system.default" ], "actions": [ - // ... + ... "ohos.want.action.viewData" ] } @@ -197,7 +202,7 @@ This section describes how to start the UIAbility of another application through ```ts let context = ...; // UIAbilityContext - let wantInfo = { + let want = { deviceId: '', // An empty deviceId indicates the local device. // Uncomment the line below if you want to implicitly query data only in the specific bundle. // bundleName: 'com.example.myapplication', @@ -207,14 +212,14 @@ This section describes how to start the UIAbility of another application through } // context is the UIAbilityContext of the initiator UIAbility. - context.startAbility(wantInfo).then(() => { - // ... + context.startAbility(want).then(() => { + console.info('Succeeded in starting ability.'); }).catch((err) => { - // ... + console.error(`Failed to start ability. Code is ${err.code}, message is ${err.message}`); }) ``` - The following figure shows the effect. When you click **Open PDF**, a dialog box is displayed for you to select. + The following figure shows the effect. When you click **Open PDF**, a dialog box is displayed for you to select. ![](figures/uiability-intra-device-interaction.png) 3. To stop the **UIAbility** instance after the document application is used, call [terminateSelf()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextterminateself). @@ -224,7 +229,10 @@ This section describes how to start the UIAbility of another application through // context is the UIAbilityContext of the UIAbility instance to stop. context.terminateSelf((err) => { - // ... + if (err.code) { + console.error(`Failed to terminate self. Code is ${err.code}, message is ${err.message}`); + return; + } }); ``` @@ -240,15 +248,15 @@ If you want to obtain the return result when using implicit Want to start the UI "module": { "abilities": [ { - // ... + ... "skills": [ { "entities": [ - // ... + ... "entity.system.default" ], "actions": [ - // ... + ... "ohos.want.action.editData" ] } @@ -263,20 +271,20 @@ If you want to obtain the return result when using implicit Want to start the UI ```ts let context = ...; // UIAbilityContext - let wantInfo = { + let want = { deviceId: '', // An empty deviceId indicates the local device. // Uncomment the line below if you want to implicitly query data only in the specific bundle. // bundleName: 'com.example.myapplication', action: 'ohos.want.action.editData', // entities can be omitted. - entities: ['entity.system.default'], + entities: ['entity.system.default'] } // context is the UIAbilityContext of the initiator UIAbility. - context.startAbilityForResult(wantInfo).then((data) => { - // ... + context.startAbilityForResult(want).then((data) => { + ... }).catch((err) => { - // ... + console.error(`Failed to start ability for result. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -298,7 +306,10 @@ If you want to obtain the return result when using implicit Want to start the UI } // context is the AbilityContext of the target UIAbility. context.terminateSelfWithResult(abilityResult, (err) => { - // ... + if (err.code) { + console.error(`Failed to terminate self with result. Code is ${err.code}, message is ${err.message}`); + return; + } }); ``` @@ -317,10 +328,10 @@ If you want to obtain the return result when using implicit Want to start the UI if (data?.resultCode === RESULT_CODE) { // Parse the information returned by the target UIAbility. let payResult = data.want?.parameters?.payResult; - // ... + ... } }).catch((err) => { - // ... + console.error(`Failed to start ability for result. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -352,27 +363,28 @@ For details about how to obtain the context, see [Obtaining the Context of UIAbi import AbilityConstant from '@ohos.app.ability.AbilityConstant'; let context = ...; // UIAbilityContext -let wantInfo = { +let want = { deviceId: '', // An empty deviceId indicates the local device. bundleName: 'com.example.myapplication', abilityName: 'FuncAbility', - moduleName: 'module1', // moduleName is optional. + moduleName: 'func', // moduleName is optional. parameters: {// Custom information. info: 'From the Index page of EntryAbility', }, } let options = { windowMode: AbilityConstant.WindowMode.WINDOW_MODE_FLOATING -} +}; // context is the UIAbilityContext of the initiator UIAbility. -context.startAbility(wantInfo, options).then(() => { - // ... +context.startAbility(want, options).then(() => { + console.info('Succeeded in starting ability.'); }).catch((err) => { - // ... + console.error(`Failed to start ability. Code is ${err.code}, message is ${err.message}`); }) ``` -The display effect is shown below. +The display effect is shown below. + ![](figures/start-uiability-floating-window.png) ## Starting a Specified Page of UIAbility @@ -387,20 +399,20 @@ When the initiator UIAbility starts another UIAbility, it usually needs to redir ```ts let context = ...; // UIAbilityContext -let wantInfo = { +let want = { deviceId: '', // An empty deviceId indicates the local device. bundleName: 'com.example.myapplication', abilityName: 'FuncAbility', - moduleName: 'module1', // moduleName is optional. + moduleName: 'func', // moduleName is optional. parameters: {// Custom parameter used to pass the page information. router: 'funcA', }, } // context is the UIAbilityContext of the initiator UIAbility. -context.startAbility(wantInfo).then(() => { - // ... +context.startAbility(want).then(() => { + console.info('Succeeded in starting ability.'); }).catch((err) => { - // ... + console.error(`Failed to start ability. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -431,7 +443,7 @@ export default class FuncAbility extends UIAbility { } } windowStage.loadContent(url, (err, data) => { - // ... + ... }); } } @@ -455,7 +467,7 @@ In summary, when a UIAbility instance of application A has been created and the onNewWant(want, launchParam) { // Receive the parameters passed by the initiator UIAbility. globalThis.funcAbilityWant = want; - // ... + ... } } ``` @@ -480,7 +492,7 @@ In summary, when a UIAbility instance of application A has been created and the // Page display. build() { - // ... + ... } } ``` @@ -494,11 +506,11 @@ In summary, when a UIAbility instance of application A has been created and the Call is an extension of the UIAbility capability. It enables the UIAbility to be invoked by and communicate with external systems. The UIAbility invoked can be either started in the foreground or created and run in the background. You can use the call to implement data sharing between two UIAbility instances (CallerAbility and CalleeAbility) through IPC. -The core API used for the call is **startAbilityByCall**, which differs from **startAbility** in the following ways: +The core API used for the call is **startAbilityByCall()**, which differs from **startAbility()** in the following ways: -- **startAbilityByCall** supports UIAbility launch in the foreground and background, whereas **startAbility** supports UIAbility launch in the foreground only. +- **startAbilityByCall()** supports UIAbility launch in the foreground and background, whereas **startAbility()** supports UIAbility launch in the foreground only. -- The CallerAbility can use the caller object returned by **startAbilityByCall** to communicate with the CalleeAbility, but **startAbility** does not provide the communication capability. +- The CallerAbility can use the caller object returned by **startAbilityByCall()** to communicate with the CalleeAbility, but **startAbility()** does not provide the communication capability. Call is usually used in the following scenarios: @@ -506,6 +518,7 @@ Call is usually used in the following scenarios: - Starting the CalleeAbility in the background + **Table 1** Terms used in the call | **Term**| Description| @@ -517,9 +530,9 @@ Call is usually used in the following scenarios: The following figure shows the call process. - Figure 1 Call process +Figure 1 Call process - ![call](figures/call.png) +![call](figures/call.png) - The CallerAbility uses **startAbilityByCall** to obtain a caller object and uses **call()** of the caller object to send data to the CalleeAbility. @@ -537,7 +550,7 @@ The following figure shows the call process. The following table describes the main APIs used for the call. For details, see [AbilityContext](../reference/apis/js-apis-app-ability-uiAbility.md#caller). - **Table 2** Call APIs +**Table 2** Call APIs | API| Description| | -------- | -------- | @@ -571,7 +584,6 @@ For the CalleeAbility, implement the callback to receive data and the methods to ``` 3. Define the agreed parcelable data. - The data formats sent and received by the CallerAbility and CalleeAbility must be consistent. In the following example, the data formats are number and string. @@ -588,7 +600,7 @@ For the CalleeAbility, implement the callback to receive data and the methods to marshalling(messageSequence) { messageSequence.writeInt(this.num); messageSequence.writeString(this.str); - return true + return true; } unmarshalling(messageSequence) { @@ -600,9 +612,9 @@ For the CalleeAbility, implement the callback to receive data and the methods to ``` 4. Implement **Callee.on** and **Callee.off**. - + The time to register a listener for the CalleeAbility depends on your application. The data sent and received before the listener is registered and that after the listener is deregistered are not processed. In the following example, the **MSG_SEND_METHOD** listener is registered in **onCreate** of the UIAbility and deregistered in **onDestroy**. After receiving parcelable data, the application processes the data and returns the data result. You need to implement processing based on service requirements. The sample code is as follows: - + ```ts const TAG: string = '[CalleeAbility]'; @@ -625,16 +637,16 @@ For the CalleeAbility, implement the callback to receive data and the methods to onCreate(want, launchParam) { try { this.callee.on(MSG_SEND_METHOD, sendMsgCallback); - } catch (error) { - console.info(`${MSG_SEND_METHOD} register failed with error ${JSON.stringify(error)}`); + } catch (err) { + console.error(`Failed to register. Code is ${err.code}, message is ${err.message}`); } } onDestroy() { try { this.callee.off(MSG_SEND_METHOD); - } catch (error) { - console.error(TAG, `${MSG_SEND_METHOD} unregister failed with error ${JSON.stringify(error)}`); + } catch (err) { + console.error(`Failed to unregister. Code is ${err.code}, message is ${err.message}`); } } } @@ -661,9 +673,9 @@ For the CalleeAbility, implement the callback to receive data and the methods to caller.on('release', (msg) => { console.info(`caller onRelease is called ${msg}`); }) - console.info('caller register OnRelease succeed'); - } catch (error) { - console.info(`caller register OnRelease failed with ${error}`); + console.info('Succeeded in registering on release.'); + } catch (err) { + console.err(`Failed to caller register on release. Code is ${err.code}, message is ${err.message}`); } } @@ -672,15 +684,15 @@ For the CalleeAbility, implement the callback to receive data and the methods to this.caller = await context.startAbilityByCall({ bundleName: 'com.samples.CallApplication', abilityName: 'CalleeAbility' - }) + }); if (this.caller === undefined) { console.info('get caller failed') - return + return; } console.info('get caller success') this.regOnRelease(this.caller) - } catch (error) { - console.info(`get caller failed with ${error}`) + } (err) { + console.err(`Failed to get caller. Code is ${err.code}, message is ${err.message}`); } } ``` diff --git a/en/application-dev/application-models/uiability-launch-type.md b/en/application-dev/application-models/uiability-launch-type.md index 8f5762fcde0a766f454a2540708368048e1b01aa..c7aac3d4bc3acdb2601580646024ec1f8117473f 100644 --- a/en/application-dev/application-models/uiability-launch-type.md +++ b/en/application-dev/application-models/uiability-launch-type.md @@ -17,7 +17,8 @@ The launch type of the UIAbility component refers to the state of the UIAbility Each time [startAbility()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability) is called, if a UIAbility instance of this type already exists in the application process, the instance is reused. Therefore, only one UIAbility instance of this type exists in the system, that is, displayed in **Recents**. -**Figure 1** Demonstration effect in singleton mode +**Figure 1** Demonstration effect in singleton mode + ![uiability-launch-type1](figures/uiability-launch-type1.gif) > **NOTE** @@ -30,11 +31,11 @@ To use the singleton mode, set **launchType** in the [module.json5 configuration ```json { "module": { - // ... + ... "abilities": [ { "launchType": "singleton", - // ... + ... } ] } @@ -56,11 +57,11 @@ To use the multiton mode, set **launchType** in the [module.json5 file](../quick ```json { "module": { - // ... + ... "abilities": [ { "launchType": "multiton", - // ... + ... } ] } @@ -73,6 +74,7 @@ To use the multiton mode, set **launchType** in the [module.json5 file](../quick The **specified** mode is used in some special scenarios. For example, in a document application, you want a document instance to be created each time you create a document, but you want to use the same document instance when you repeatedly open an existing document. **Figure 3** Demonstration effect in specified mode + ![uiability-launch-type3](figures/uiability-launch-type3.gif) For example, there are two UIAbility components: EntryAbility and SpecifiedAbility (with the launch type **specified**). You are required to start SpecifiedAbility from EntryAbility. @@ -82,11 +84,11 @@ For example, there are two UIAbility components: EntryAbility and SpecifiedAbili ```json { "module": { - // ... + ... "abilities": [ { "launchType": "specified", - // ... + ... } ] } @@ -99,23 +101,24 @@ For example, there are two UIAbility components: EntryAbility and SpecifiedAbili // Configure an independent key for each UIAbility instance. // For example, in the document usage scenario, use the document path as the key. function getInstance() { - // ... + ... } + let context =...; // context is the UIAbilityContext of the initiator UIAbility. let want = { - deviceId: '', // An empty deviceId indicates the local device. - bundleName: 'com.example.myapplication', - abilityName: 'SpecifiedAbility', - moduleName: 'module1', // moduleName is optional. - parameters: {// Custom information. - instanceKey: getInstance(), - }, + deviceId: '', // An empty deviceId indicates the local device. + bundleName: 'com.example.myapplication', + abilityName: 'SpecifiedAbility', + moduleName: 'specified', // moduleName is optional. + parameters: {// Custom information. + instanceKey: getInstance(), + }, } - // context is the UIAbilityContext of the initiator UIAbility. - this.context.startAbility(want).then(() => { - // ... + + context.startAbility(want).then(() => { + console.info('Succeeded in starting ability.'); }).catch((err) => { - // ... + console.error(`Failed to start ability. Code is ${err.code}, message is ${err.message}`); }) ``` @@ -127,16 +130,16 @@ For example, there are two UIAbility components: EntryAbility and SpecifiedAbili import AbilityStage from '@ohos.app.ability.AbilityStage'; export default class MyAbilityStage extends AbilityStage { - onAcceptWant(want): string { - // In the AbilityStage instance of the callee, a key value corresponding to a UIAbility instance is returned for UIAbility whose launch type is specified. - // In this example, SpecifiedAbility of module1 is returned. - if (want.abilityName === 'SpecifiedAbility') { - // The returned key string is a custom string. - return `SpecifiedAbilityInstance_${want.parameters.instanceKey}`; - } - - return ''; + onAcceptWant(want): string { + // In the AbilityStage instance of the callee, a key value corresponding to a UIAbility instance is returned for UIAbility whose launch type is specified. + // In this example, SpecifiedAbility of module1 is returned. + if (want.abilityName === 'SpecifiedAbility') { + // The returned key string is a custom string. + return `SpecifiedAbilityInstance_${want.parameters.instanceKey}`; } + + return ''; + } } ``` @@ -154,4 +157,3 @@ For example, there are two UIAbility components: EntryAbility and SpecifiedAbili 3. Return to the home screen and open file B. A new UIAbility instance is started, for example, UIAbility instance 3. 4. Return to the home screen and open file A again. UIAbility instance 2 is started. This is because the system automatically matches the key of the UIAbility instance and starts the UIAbility instance that has a matching key. In this example, UIAbility instance 2 has the same key as file A. Therefore, the system pulls back UIAbility instance 2 and focuses it without creating a new instance. - \ No newline at end of file diff --git a/en/application-dev/application-models/uiability-lifecycle.md b/en/application-dev/application-models/uiability-lifecycle.md index 57200abb8fbfb625e2e6c8999da5ad817e2e85b4..8a8506a71ffe130d4f39ed10a8fe60fbdead281e 100644 --- a/en/application-dev/application-models/uiability-lifecycle.md +++ b/en/application-dev/application-models/uiability-lifecycle.md @@ -9,7 +9,7 @@ The lifecycle of UIAbility has four states: **Create**, **Foreground**, **Backgr **Figure 1** UIAbility lifecycle states -![Ability-Life-Cycle](figures/Ability-Life-Cycle.png) +![Ability-Life-Cycle](figures/Ability-Life-Cycle.png) ## Description of Lifecycle States @@ -22,24 +22,25 @@ The **Create** state is triggered when the UIAbility instance is created during ```ts import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - // Initialize the application. - } - // ... + onCreate(want, launchParam) { + // Initialize the application. + } + ... } ``` +> **NOTE** +> +> [Want](../reference/apis/js-apis-app-ability-want.md) is used as the carrier to transfer information between application components. For details, see [Want](want-overview.md). ### WindowStageCreate and WindowStageDestory After the UIAbility instance is created but before it enters the **Foreground** state, the system creates a WindowStage instance and triggers the **onWindowStageCreate()** callback. You can set UI loading and WindowStage event subscription in the callback. -**Figure 2** WindowStageCreate and WindowStageDestory - -![Ability-Life-Cycle-WindowStage](figures/Ability-Life-Cycle-WindowStage.png) +**Figure 2** WindowStageCreate and WindowStageDestory +![Ability-Life-Cycle-WindowStage](figures/Ability-Life-Cycle-WindowStage.png) In the **onWindowStageCreate()** callback, use [loadContent()](../reference/apis/js-apis-window.md#loadcontent9-2) to set the page to be loaded, and call [on('windowStageEvent')](../reference/apis/js-apis-window.md#onwindowstageevent9) to subscribe to [WindowStage events](../reference/apis/js-apis-window.md#windowstageeventtype9), for example, having or losing focus, or becoming visible or invisible. @@ -48,29 +49,44 @@ import UIAbility from '@ohos.app.ability.UIAbility'; import window from '@ohos.window'; export default class EntryAbility extends UIAbility { - // ... - - onWindowStageCreate(windowStage: Window.WindowStage) { - // Subscribe to the WindowStage events (having or losing focus, or becoming visible or invisible). - try { - windowStage.on('windowStageEvent', (data) => { - console.info('Succeeded in enabling the listener for window stage event changes. Data: ' + - JSON.stringify(data)); - }); - } catch (exception) { - console.error('Failed to enable the listener for window stage event changes. Cause:' + - JSON.stringify(exception)); - }; - - // Set the UI loading. - windowStage.loadContent('pages/Index', (err, data) => { - // ... - }); + ... + + onWindowStageCreate(windowStage: window.WindowStage) { + // Subscribe to the WindowStage events (having or losing focus, or becoming visible or invisible). + try { + windowStage.on('windowStageEvent', (data) => { + let stageEventType: window.WindowStageEventType = data; + switch (stageEventType) { + case window.WindowStageEventType.SHOWN: // Switch to the foreground. + console.info('windowStage foreground.'); + break; + case window.WindowStageEventType.ACTIVE: // Gain focus. + console.info('windowStage active.'); + break; + case window.WindowStageEventType.INACTIVE: // Lose focus. + console.info('windowStage inactive.'); + break; + case window.WindowStageEventType.HIDDEN: // Switch to the background. + console.info('windowStage background.'); + break; + default: + break; + } + }); + } catch (exception) { + console.error('Failed to enable the listener for window stage event changes. Cause:' + + JSON.stringify(exception)); } + + // Set UI loading. + windowStage.loadContent('pages/Index', (err, data) => { + ... + }); + } } ``` -> **NOTE** +> **NOTE**
> > For details about how to use WindowStage, see [Window Development](../windowmanager/application-window-stage.md). @@ -82,18 +98,23 @@ import UIAbility from '@ohos.app.ability.UIAbility'; import window from '@ohos.window'; export default class EntryAbility extends UIAbility { - // ... - - onWindowStageDestroy() { - // Release UI resources. - // Unsubscribe from the WindowStage events such as having or losing focus in the onWindowStageDestroy() callback. - try { - windowStage.off('windowStageEvent'); - } catch (exception) { - console.error('Failed to disable the listener for window stage event changes. Cause:' + - JSON.stringify(exception)); - }; - } + windowStage: window.WindowStage; + ... + + onWindowStageCreate(windowStage: window.WindowStage) { + this.windowStage = windowStage; + ... + } + + onWindowStageDestroy() { + // Release UIresources. + // Unsubscribe from the WindowStage events such as having or losing focus in the onWindowStageDestroy() callback. + try { + this.windowStage.off('windowStageEvent'); + } catch (err) { + console.error(`Failed to disable the listener for window stage event changes. Code is ${err.code}, message is ${err.message}`); + }; + } } ``` @@ -115,16 +136,16 @@ When the application is switched to the background, you can disable positioning import UIAbility from '@ohos.app.ability.UIAbility'; export default class EntryAbility extends UIAbility { - // ... + ... - onForeground() { - // Apply for the resources required by the system or re-apply for the resources released in onBackground(). - } + onForeground() { + // Apply for the resources required by the system or re-apply for the resources released in onBackground(). + } - onBackground() { - // Release useless resources when the UI is invisible, or perform time-consuming operations in this callback, - // for example, saving the status. - } + onBackground() { + // Release useless resources when the UI is invisible, or perform time-consuming operations in this callback, + // for example, saving the status. + } } ``` @@ -137,13 +158,12 @@ The UIAbility instance is destroyed when **terminateSelf()** is called or the us ```ts import UIAbility from '@ohos.app.ability.UIAbility'; -import window from '@ohos.window'; export default class EntryAbility extends UIAbility { - // ... + ... - onDestroy() { - // Release system resources and save data. - } + onDestroy() { + // Release system resources and save data. + } } ``` diff --git a/en/application-dev/application-models/uiability-overview.md b/en/application-dev/application-models/uiability-overview.md index e9a904e060e30e2523902aa4014664f6f0100e3a..5aa0ca79c49bd9f7566e7e0cc1ea977cea8c83d5 100644 --- a/en/application-dev/application-models/uiability-overview.md +++ b/en/application-dev/application-models/uiability-overview.md @@ -11,7 +11,9 @@ The following design philosophy is behind UIAbility: 2. Support for multiple device types and window forms -For details, see [Interpretation of the Application Model] (application-model-description.md). +> **NOTE** +> +> For details, see [Interpretation of the Application Model](application-model-description.md). The UIAbility division principles and suggestions are as follows: @@ -33,7 +35,7 @@ To enable an application to properly use a UIAbility component, declare the UIAb ```json { "module": { - // ... + ... "abilities": [ { "name": "EntryAbility", // Name of the UIAbility component. @@ -43,7 +45,7 @@ To enable an application to properly use a UIAbility component, declare the UIAb "label": "$string:EntryAbility_label", // Label of the UIAbility component. "startWindowIcon": "$media:icon", // Index of the icon resource file. "startWindowBackground": "$color:start_window_background", // Index of the background color resource file. - // ... + ... } ] } diff --git a/en/application-dev/application-models/uiability-usage.md b/en/application-dev/application-models/uiability-usage.md index fa8badc6d48c7e550922cb60a15d02eab9cc80b6..46959284ef3bfe179d465f5dae92b6f8538f680a 100644 --- a/en/application-dev/application-models/uiability-usage.md +++ b/en/application-dev/application-models/uiability-usage.md @@ -14,14 +14,14 @@ import UIAbility from '@ohos.app.ability.UIAbility'; import window from '@ohos.window'; export default class EntryAbility extends UIAbility { - onWindowStageCreate(windowStage: window.WindowStage) { - // Main window is created. Set a main page for this ability. - windowStage.loadContent('pages/Index', (err, data) => { - // ... - }); - } + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created. Set a main page for this ability. + windowStage.loadContent('pages/Index', (err, data) => { + ... + }); + } - // ... + ... } ``` @@ -40,15 +40,14 @@ The UIAbility class has its own context, which is an instance of the [UIAbilityC import UIAbility from '@ohos.app.ability.UIAbility'; export default class EntryAbility extends UIAbility { - onCreate(want, launchParam) { - // Obtain the context of the UIAbility instance. - let context = this.context; - - // ... - } + onCreate(want, launchParam) { + // Obtain the context of the UIAbility instance. + let context = this.context; + ... + } } ``` - + - Import the context module and define the **context** variable in the component. ```ts @@ -68,7 +67,7 @@ The UIAbility class has its own context, which is an instance of the [UIAbilityC // Page display. build() { - // ... + ... } } ``` @@ -93,7 +92,7 @@ The UIAbility class has its own context, which is an instance of the [UIAbilityC // Page display. build() { - // ... + ... } } ``` diff --git a/en/application-dev/application-models/want-overview.md b/en/application-dev/application-models/want-overview.md index 1ce771daf195a09250a5fde05e0ce5a7acc60355..cf5cac43999a5efbe59659252b6b3db325cacd8a 100644 --- a/en/application-dev/application-models/want-overview.md +++ b/en/application-dev/application-models/want-overview.md @@ -6,43 +6,46 @@ [Want](../reference/apis/js-apis-app-ability-want.md) is an object that transfers information between application components. It is often used as a parameter of [startAbility()](../reference/apis/js-apis-inner-application-uiAbilityContext.md#uiabilitycontextstartability). For example, when UIAbilityA needs to start UIAbilityB and transfer some data to UIAbilityB, it can use the **want** parameter in **startAbility()** to transfer the data. **Figure 1** Want usage + ![usage-of-want](figures/usage-of-want.png) ## Types of Want -- **Explicit Want**: If **abilityName** and **bundleName** are specified when starting an ability, explicit Want is used. - Explicit Want is usually used to start a known target ability in the same application. The target ability is started by specifying **bundleName** of the application where the target ability is located and **abilityName** in the **Want** object. When there is an explicit object to process the request, explicit Want is a simple and effective way to start the target ability. - +- **Explicit Want**: If **abilityName** and **bundleName** are specified in the **want** parameter when starting an an application component, explicit Want is used. + + Explicit Want is usually used to start a known target application component in the same application. The target application component is started by specifying **bundleName** of the application where the target application component is located and **abilityName** in the **Want** object. When there is an explicit object to process the request, explicit Want is a simple and effective way to start the target application component. + ```ts let wantInfo = { - deviceId: '', // An empty deviceId indicates the local device. - bundleName: 'com.example.myapplication', - abilityName: 'FuncAbility', + deviceId: '', // An empty deviceId indicates the local device. + bundleName: 'com.example.myapplication', + abilityName: 'FuncAbility', } ``` - -- **Implicit Want**: If **abilityName** is not specified when starting the ability, implicit Want is used. + +- **Implicit Want**: If **abilityName** is not specified in the **want** parameter when starting the an application component, implicit Want is used. + Implicit Want can be used when the object used to process the request is unclear and the current application wants to use a capability (defined by the [skills tag](../quick-start/module-configuration-file.md#skills)) provided by another application. The system matches all applications that declare to support the capability. For example, for a link open request, the system matches all applications that support the request and provides the available ones for users to select. - + ```ts let wantInfo = { - // Uncomment the line below if you want to implicitly query data only in the specific bundle. - // bundleName: 'com.example.myapplication', - action: 'ohos.want.action.search', - // entities can be omitted. - entities: [ 'entity.system.browsable' ], - uri: 'https://www.test.com:8080/query/student', - type: 'text/plain', + // Uncomment the line below if you want to implicitly query data only in the specific bundle. + // bundleName: 'com.example.myapplication', + action: 'ohos.want.action.search', + // entities can be omitted. + entities: [ 'entity.system.browsable' ], + uri: 'https://www.test.com:8080/query/student', + type: 'text/plain', }; ``` - + > **NOTE** - > - Depending on the ability matching result, the following cases may be possible when you attempt to use implicit Want to start the ability. - > - No ability is matched. The startup fails. - > - An ability that meets the conditions is matched. That ability is started. - > - Multiple abilities that meet the conditions are matched. A dialog box is displayed for users to select one of them. + > - Depending on the application component matching result, the following cases may be possible when you attempt to use implicit Want to start the application component. + > - No application component is matched. The startup fails. + > - An application component that meets the conditions is matched. That application component is started. + > - Multiple application components that meet the conditions are matched. A dialog box is displayed for users to select one of them. > > - If the **want** parameter passed does not contain **abilityName** or **bundleName**, the ServiceExtensionAbility components of all applications cannot be started through implicit Want. > diff --git a/en/application-dev/application-models/widget-development-fa.md b/en/application-dev/application-models/widget-development-fa.md index b766c3420f56a7406bc345911a09bbf91bb6a187..3aa1a9fd29495b36a02d155e5d2ad48e94bce5ad 100644 --- a/en/application-dev/application-models/widget-development-fa.md +++ b/en/application-dev/application-models/widget-development-fa.md @@ -20,7 +20,7 @@ Before you get started, it would be helpful if you have a basic understanding of Figure 1 shows the working principles of the widget framework. -**Figure 1** Widget framework working principles in the FA model +**Figure 1** Widget framework working principles in the FA model ![form-extension](figures/form-extension.png) The widget host consists of the following modules: @@ -122,48 +122,48 @@ To create a widget in the FA model, implement the widget lifecycle callbacks. Ge ```ts export default { - onCreate(want) { - console.info('FormAbility onCreate'); - // Called when the widget is created. The widget provider should return the widget data binding class. - let obj = { - "title": "titleOnCreate", - "detail": "detailOnCreate" - }; - let formData = formBindingData.createFormBindingData(obj); - return formData; - }, - onCastToNormal(formId) { - // Called when the widget host converts the temporary widget into a normal one. The widget provider should do something to respond to the conversion. - console.info('FormAbility onCastToNormal'); - }, - onUpdate(formId) { - // Override this method to support scheduled updates, periodic updates, or updates requested by the widget host. - console.info('FormAbility onUpdate'); - let obj = { - "title": "titleOnUpdate", - "detail": "detailOnUpdate" - }; - let formData = formBindingData.createFormBindingData(obj); - formProvider.updateForm(formId, formData).catch((error) => { - console.info('FormAbility updateForm, error:' + JSON.stringify(error)); - }); - }, - onVisibilityChange(newStatus) { - // Called when the widget host initiates an event about visibility changes. The widget provider should do something to respond to the notification. This callback takes effect only for system applications. - console.info('FormAbility onVisibilityChange'); - }, - onEvent(formId, message) { - // If the widget supports event triggering, override this method and implement the trigger. - console.info('FormAbility onEvent'); - }, - onDestroy(formId) { - // Delete widget data. - console.info('FormAbility onDestroy'); - }, - onAcquireFormState(want) { - console.info('FormAbility onAcquireFormState'); - return formInfo.FormState.READY; - }, + onCreate(want) { + console.info('FormAbility onCreate'); + // Called when the widget is created. The widget provider should return the widget data binding class. + let obj = { + "title": "titleOnCreate", + "detail": "detailOnCreate" + }; + let formData = formBindingData.createFormBindingData(obj); + return formData; + }, + onCastToNormal(formId) { + // Called when the widget host converts the temporary widget into a normal one. The widget provider should do something to respond to the conversion. + console.info('FormAbility onCastToNormal'); + }, + onUpdate(formId) { + // Override this method to support scheduled updates, periodic updates, or updates requested by the widget host. + console.info('FormAbility onUpdate'); + let obj = { + "title": "titleOnUpdate", + "detail": "detailOnUpdate" + }; + let formData = formBindingData.createFormBindingData(obj); + formProvider.updateForm(formId, formData).catch((error) => { + console.info('FormAbility updateForm, error:' + JSON.stringify(error)); + }); + }, + onVisibilityChange(newStatus) { + // Called when the widget host initiates an event about visibility changes. The widget provider should do something to respond to the notification. This callback takes effect only for system applications. + console.info('FormAbility onVisibilityChange'); + }, + onEvent(formId, message) { + // If the widget supports event triggering, override this method and implement the trigger. + console.info('FormAbility onEvent'); + }, + onDestroy(formId) { + // Delete widget data. + console.info('FormAbility onDestroy'); + }, + onAcquireFormState(want) { + console.info('FormAbility onAcquireFormState'); + return formInfo.FormState.READY; + }, } ``` @@ -188,15 +188,15 @@ The widget configuration file is named **config.json**. Find the **config.json** ```json - "js": [{ - "name": "widget", - "pages": ["pages/index/index"], - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "type": "form" - }] + "js": [{ + "name": "widget", + "pages": ["pages/index/index"], + "window": { + "designWidth": 720, + "autoDesignWidth": true + }, + "type": "form" + }] ``` - The **abilities** module in the **config.json** file corresponds to **FormAbility** of the widget. The internal structure is described as follows: @@ -275,7 +275,7 @@ async function storeFormInfo(formId: string, formName: string, tempFlag: boolean } } -// ... +... onCreate(want) { console.info('FormAbility onCreate'); @@ -293,7 +293,7 @@ async function storeFormInfo(formId: string, formName: string, tempFlag: boolean let formData = formBindingData.createFormBindingData(obj); return formData; } -// ... +... ``` You should override **onDestroy** to implement widget data deletion. @@ -313,14 +313,14 @@ async function deleteFormInfo(formId: string) { } } -// ... +... onDestroy(formId) { console.info('FormAbility onDestroy'); // Delete the persistent widget instance data. // Implement this API based on project requirements. deleteFormInfo(formId); } -// ... +... ``` For details about how to implement persistent data storage, see [Application Data Persistence Overview](../database/app-data-persistence-overview.md). @@ -543,4 +543,3 @@ The following is an example: } } ``` - diff --git a/en/application-dev/application-models/windowextensionability.md b/en/application-dev/application-models/windowextensionability.md index 0f6e28b89790cfa1dd7dc471ed3a450280f19a4a..3c1d364cd50e73c8232c5ba2482e04b2ca2a6077 100644 --- a/en/application-dev/application-models/windowextensionability.md +++ b/en/application-dev/application-models/windowextensionability.md @@ -11,7 +11,7 @@ the context is [WindowExtensionContext](../reference/apis/js-apis-inner-applicat > **NOTE** > -> **WindowExtensionAbility** is a system API. To embed a third-party application in another application and display it over the application, switch to the full SDK by following the instructions provided in [Guide to Switching to Full SDK](../../application-dev/quick-start/full-sdk-switch-guide.md). +> **WindowExtensionAbility** is a system API. To embed a third-party application in another application and display it over the application, switch to the full SDK by following the instructions provided in [Guide to Switching to Full SDK](../faqs/full-sdk-switch-guide.md). > @@ -43,7 +43,7 @@ To implement an embedded application, manually create a WindowExtensionAbility i onWindowReady(window) { window.loadContent('WindowExtAbility/pages/index1').then(() => { window.getProperties().then((pro) => { - console.log("WindowExtension " + JSON.stringify(pro)); + console.info("WindowExtension " + JSON.stringify(pro)); }) window.show(); }) @@ -110,4 +110,5 @@ System applications can load the created WindowExtensionAbility through the Abil .backgroundColor(0x64BB5c) } } - ``` \ No newline at end of file + ``` + diff --git a/en/application-dev/connectivity/net-connection-manager.md b/en/application-dev/connectivity/net-connection-manager.md index 5ee75a717882c3344612e741b2e197fa6e57509d..c443c93759caddbc5203b65022426882c0bb960b 100644 --- a/en/application-dev/connectivity/net-connection-manager.md +++ b/en/application-dev/connectivity/net-connection-manager.md @@ -39,7 +39,7 @@ For the complete list of APIs and example code, see [Network Connection Manageme | ---- | ---- | ---- | | ohos.net.connection | function getDefaultNet(callback: AsyncCallback\): void; |Creates a **NetHandle** object that contains the **netId** of the default network. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function getGlobalHttpProxy10+(callback: AsyncCallback\): void;| Obtains the global HTTP proxy for the network. This API uses an asynchronous callback to return the result.| -| ohos.net.connection | function setGlobalHttpProxy10+(httpProxy: HttpProxy, callback: AsyncCallback): void;| Sets the global HTTP proxy for the network. This API uses an asynchronous callback to return the result.| +| ohos.net.connection | function setGlobalHttpProxy10+(httpProxy: HttpProxy, callback: AsyncCallback\): void;| Sets the global HTTP proxy for the network. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function getAppNet9+(callback: AsyncCallback\): void;| Obtains a **NetHandle** object that contains the **netId** of the network bound to the application. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function setAppNet9+(netHandle: NetHandle, callback: AsyncCallback\): void;| Binds an application to the specified network. The application can access the external network only through this network. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function getDefaultNetSync9+(): NetHandle; |Obtains the default active data network in synchronous mode. You can use **getNetCapabilities** to obtain information such as the network type and capabilities.| @@ -47,7 +47,7 @@ For the complete list of APIs and example code, see [Network Connection Manageme | ohos.net.connection | function getAllNets(callback: AsyncCallback\>): void;| Obtains the list of **NetHandle** objects of the connected network. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback\): void; |Obtains link information of the default network. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback\): void; |Obtains the capability set of the default network. This API uses an asynchronous callback to return the result.| -| ohos.net.connection | function isDefaultNetMetered9+(callback: AsyncCallback): void; |Checks whether the data traffic usage on the current network is metered. This API uses an asynchronous callback to return the result.| +| ohos.net.connection | function isDefaultNetMetered9+(callback: AsyncCallback\): void; |Checks whether the data traffic usage on the current network is metered. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function reportNetConnected(netHandle: NetHandle, callback: AsyncCallback\): void;| Reports a **netAavailable** event to NetManager. If this API is called, the application considers that its network status (ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED) is inconsistent with that of NetManager. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback\): void;| Reports a **netAavailable** event to NetManager. If this API is called, the application considers that its network status (ohos.net.connection.NetCap.NET_CAPABILITY_VAILDATED) is inconsistent with that of NetManager. This API uses an asynchronous callback to return the result.| | ohos.net.connection | function getAddressesByName(host: string, callback: AsyncCallback\>): void; |Obtains all IP addresses of the specified network by resolving the domain name. This API uses an asynchronous callback to return the result.| diff --git a/en/application-dev/connectivity/net-mgmt-overview.md b/en/application-dev/connectivity/net-mgmt-overview.md index 043d41768f89dd851839eae893b7ba4409395f5e..f03d7668edc9fc27ef22c4ef4d69b186f7b4c3d9 100644 --- a/en/application-dev/connectivity/net-mgmt-overview.md +++ b/en/application-dev/connectivity/net-mgmt-overview.md @@ -5,7 +5,6 @@ Network management functions include: - [HTTP data request](http-request.md): initiates a data request through HTTP. - [WebSocket connection](websocket-connection.md): establishes a bidirectional connection between the server and client through WebSocket. - [Socket connection](socket-connection.md): transmits data through Socket. -- [Network policy management](net-policy-management.md): restricts network capabilities by setting network policies, including cellular network policy, sleep/power-saving mode policy, and background network policy, and resets network policies as needed. - [Network sharing](net-sharing.md): shares a device's Internet connection with other connected devices by means of Wi-Fi hotspot, Bluetooth, and USB sharing, and queries the network sharing state and shared mobile data volume. - [Ethernet connection](net-ethernet.md): provides wired network capabilities, which allow you to set the IP address, subnet mask, gateway, and Domain Name System (DNS) server of a wired network. - [Network connection management](net-connection-manager.md): provides basic network management capabilities, including management of Wi-Fi/cellular/Ethernet connection priorities, network quality evaluation, subscription to network connection status changes, query of network connection information, and DNS resolution. diff --git a/en/application-dev/device/usb-guidelines.md b/en/application-dev/device/usb-guidelines.md index 68c8c3de013e75d56854bf0cf0e3a71aca9eb261..ef09e1ee89940220f8b9d1936362d34ebf8bf7a6 100644 --- a/en/application-dev/device/usb-guidelines.md +++ b/en/application-dev/device/usb-guidelines.md @@ -1,156 +1,161 @@ # USB Service Development + ## When to Use In Host mode, you can obtain the list of connected USB devices, enable or disable the devices, manage device access permissions, and perform data transfer or control transfer. -## APIs + +## Available 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-usbManager.md). -**Table 1** Open USB APIs +**Table 1** Open USB APIs -| API | Description | +| Name | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | -| hasRight(deviceName: string): boolean | Checks whether the user has the device access permissions. | -| requestRight(deviceName: string): Promise\ | 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\ | Connects to the USB device based on the device list returned by `getDevices()`. | -| getDevices(): Array> | 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: 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\ | 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. | -| getRawDescriptor(pipe: USBDevicePipe): Uint8Array | Obtains the raw USB descriptor. | -| controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout ?: number): Promise<number> | Performs control transfer. | +| hasRight(deviceName: string): boolean | Checks whether the user has the device access permissions.| +| requestRight(deviceName: string): Promise<boolean> | Requests the device access permissions for the application. This API uses a promise to return the result. | +| removeRight(deviceName: string): boolean | Revokes the device access permissions of the application.| +| connectDevice(device: USBDevice): Readonly<USBDevicePipe> | Connects to the USB device based on the device information returned by `getDevices()`. | +| getDevices(): Array<Readonly<USBDevice>> | Obtains the list of USB devices connected to the host. If no device is connected, an empty list is returned. | +| 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. | +| 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. | +| getRawDescriptor(pipe: USBDevicePipe): Uint8Array | Obtains the raw USB descriptor. | +| controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout ?: number): Promise<number> | Performs control transfer. | + ## How to Develop -You can set a USB device as the USB host to connect to other USB devices for data transfer. The development procedure is as follows: - -1. Obtain the USB device list. - - ```js - // Import the USB API package. - import usb from '@ohos.usbManager'; - // Obtain the USB device list. - let deviceList = usb.getDevices(); - /* - Example deviceList structure - [ - { - name: "1-1", - serial: "", - manufacturerName: "", - productName: "", - version: "", - vendorId: 7531, - productId: 2, - clazz: 9, - subClass: 0, - protocol: 1, - devAddress: 1, - busNum: 1, - configs: [ - { - id: 1, - attributes: 224, - isRemoteWakeup: true, - isSelfPowered: true, - maxPower: 0, - name: "1-1", - interfaces: [ - { - id: 0, - protocol: 0, - clazz: 9, - subClass: 0, - alternateSetting: 0, - name: "1-1", - endpoints: [ - { - address: 129, - attributes: 3, - interval: 12, - maxPacketSize: 4, - direction: 128, - number: 1, - type: 3, - interfaceId: 0, - } - ] - } - ] - } - ] - } - ] - */ - ``` - +You can set a USB device as a host to connect to a device for data transfer. The development procedure is as follows: + + +1. Obtain the USB device list. + + ```js + // Import the USB API package. + import usb from '@ohos.usbManager'; + // Obtain the USB device list. + let deviceList = usb.getDevices(); + /* + Example deviceList structure: + [ + { + name: "1-1", + serial: "", + manufacturerName: "", + productName: "", + version: "", + vendorId: 7531, + productId: 2, + clazz: 9, + subClass: 0, + protocol: 1, + devAddress: 1, + busNum: 1, + configs: [ + { + id: 1, + attributes: 224, + isRemoteWakeup: true, + isSelfPowered: true, + maxPower: 0, + name: "1-1", + interfaces: [ + { + id: 0, + protocol: 0, + clazz: 9, + subClass: 0, + alternateSetting: 0, + name: "1-1", + endpoints: [ + { + address: 129, + attributes: 3, + interval: 12, + maxPacketSize: 4, + direction: 128, + number: 1, + type: 3, + interfaceId: 0, + } + ] + } + ] + } + ] + } + ] + */ + ``` 2. Obtain the device operation permissions. - ```js - let deviceName = deviceList[0].name; - // Request the permissions to operate a specified device. - usb.requestRight(deviceName).then(hasRight => { - console.info("usb device request right result: " + hasRight); - }).catch(error => { - console.info("usb device request right failed : " + error); - }); - ``` + ```js + let deviceName = deviceList[0].name; + // Request the permissions to operate a specified device. + usb.requestRight(deviceName).then(hasRight => { + console.info("usb device request right result: " + hasRight); + }).catch(error => { + console.info("usb device request right failed : " + error); + }); + ``` 3. Open the device. - ```js - // Open the device, and obtain the USB device pipe for data transfer. - let interface1 = deviceList[0].configs[0].interfaces[0]; - /* - Claim the corresponding interface from deviceList. - interface1 must be one present in the device configuration. - */ - usb.claimInterface(pipe, interface1, true); - ``` + ```js + // Open the device, and obtain the USB device pipe for data transfer. + let pipe = usb.connectDevice(deviceList[0]); + let interface1 = deviceList[0].configs[0].interfaces[0]; + /* + Claim the corresponding interface from **deviceList**. + interface1 must be one present in the device configuration. + */ + usb.claimInterface(pipe, interface1, true); + ``` 4. Perform data transfer. - ```js - /* + ```js + /* 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. - */ - let inEndpoint = interface1.endpoints[2]; - let outEndpoint = interface1.endpoints[1]; - let dataUint8Array = new Uint8Array(1024); - usb.bulkTransfer(pipe, inEndpoint, dataUint8Array, 15000).then(dataLength => { - if (dataLength >= 0) { - console.info("usb readData result Length : " + dataLength); - } else { - console.info("usb readData failed : " + dataLength); - } - }).catch(error => { - console.info("usb readData error : " + JSON.stringify(error)); - }); - // Send data. Select the corresponding TX endpoint from deviceList for data transfer. (endpoint.direction == 0) - usb.bulkTransfer(pipe, outEndpoint, dataUint8Array, 15000).then(dataLength => { - if (dataLength >= 0) { - console.info("usb writeData result write length : " + dataLength); - } else { - console.info("writeData failed"); - } - }).catch(error => { - console.info("usb writeData error : " + JSON.stringify(error)); - }); - ``` - -5. Release the USB interface, and close the USB device. - - ```js - usb.releaseInterface(pipe, interface); - usb.closePipe(pipe); - ``` \ No newline at end of file + (endpoint.direction == 0x80); dataUint8Array indicates the data to read. The data type is Uint8Array. + */ + let inEndpoint = interface1.endpoints[2]; + let outEndpoint = interface1.endpoints[1]; + let dataUint8Array = new Uint8Array(1024); + usb.bulkTransfer(pipe, inEndpoint, dataUint8Array, 15000).then(dataLength => { + if (dataLength >= 0) { + console.info("usb readData result Length : " + dataLength); + } else { + console.info("usb readData failed : " + dataLength); + } + }).catch(error => { + console.info("usb readData error : " + JSON.stringify(error)); + }); + // Send data. Select the corresponding TX endpoint from deviceList for data transfer. (endpoint.direction == 0) + usb.bulkTransfer(pipe, outEndpoint, dataUint8Array, 15000).then(dataLength => { + if (dataLength >= 0) { + console.info("usb writeData result write length : " + dataLength); + } else { + console.info("writeData failed"); + } + }).catch(error => { + console.info("usb writeData error : " + JSON.stringify(error)); + }); + ``` + +5. Release the USB interface, and close the USB device. + + ```js + usb.releaseInterface(pipe, interface1); + usb.closePipe(pipe); + ``` \ No newline at end of file diff --git a/en/application-dev/internationalization/intl-guidelines.md b/en/application-dev/internationalization/intl-guidelines.md index fcac5325292b27f349f6c3dcadb627dca2dd0c03..44b69713783501cc21c0612fa2bb08390a53dcc0 100644 --- a/en/application-dev/internationalization/intl-guidelines.md +++ b/en/application-dev/internationalization/intl-guidelines.md @@ -111,7 +111,7 @@ The [i18n](../reference/apis/js-apis-i18n.md) module provides enhanced I18N capa let dateTimeFormat = new Intl.DateTimeFormat(); ``` - Alternatively, use your own locale and formatting parameters to create a **DateTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [DateTimeOptions](../reference/apis/js-apis-intl.md#datetimeoptions9). + Alternatively, use your own locale and formatting parameters to create a **DateTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [DateTimeOptions](../reference/apis/js-apis-intl.md#datetimeoptions6). ```js let options = {dateStyle: "full", timeStyle: "full"}; @@ -181,7 +181,7 @@ The [i18n](../reference/apis/js-apis-i18n.md) module provides enhanced I18N capa let numberFormat = new Intl.NumberFormat(); ``` - Alternatively, use your own locale and formatting parameters to create a **NumberFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [NumberOptions](../reference/apis/js-apis-intl.md#numberoptions9). + Alternatively, use your own locale and formatting parameters to create a **NumberFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [NumberOptions](../reference/apis/js-apis-intl.md#numberoptions6). ```js let options = {compactDisplay: "short", notation: "compact"}; @@ -240,7 +240,7 @@ Users in different regions have different requirements for string sorting. [Coll let collator = new Intl.Collator(); ``` - Alternatively, use your own locale and formatting parameters to create a **Collator** object. For a full list of parameters, see [CollatorOptions](../reference/apis/js-apis-intl.md#collatoroptions9). + Alternatively, use your own locale and formatting parameters to create a **Collator** object. For a full list of parameters, see [CollatorOptions](../reference/apis/js-apis-intl.md#collatoroptions8). The **sensitivity** parameter is used to specify the levels of differences that will be used for string comparison. The value **base** indicates that only characters are compared, but not the accent and capitalization. For example, 'a' != 'b', 'a' == '', 'a'=='A'. The value **accent** indicates that the accent is considered, but not the capitalization. For example, 'a' != 'b', 'a' == '', 'a'=='A'. The value **case** indicates that the capitalization is considered, but the accent. For example, 'a' != 'b', 'a' == '', 'a'=='A'. The value **variant** indicates that the accent and capitalization are considered. For example, 'a' != 'b', 'a' == '', 'a'=='A'. ```js @@ -301,7 +301,7 @@ According to grammars in certain languages, the singular or plural form of a nou let pluralRules = new Intl.PluralRules(); ``` - Alternatively, use your own locale and formatting parameters to create a **PluralRules** object. For a full list of parameters, see [PluralRulesOptions](../reference/apis/js-apis-intl.md#pluralrulesoptions9). + Alternatively, use your own locale and formatting parameters to create a **PluralRules** object. For a full list of parameters, see [PluralRulesOptions](../reference/apis/js-apis-intl.md#pluralrulesoptions8). ```js let pluralRules = new Intl.PluralRules("zh-CN", {localeMatcher: "best fit", type: "cardinal"}); @@ -349,7 +349,7 @@ According to grammars in certain languages, the singular or plural form of a nou let relativeTimeFormat = new Intl.RelativeTimeFormat(); ``` - Alternatively, use your own locale and formatting parameters to create a **RelativeTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md#relativetimeformatinputoptions9). + Alternatively, use your own locale and formatting parameters to create a **RelativeTimeFormat** object. Formatting parameters are optional. For a full list of formatting parameters, see [RelativeTimeFormatInputOptions](../reference/apis/js-apis-intl.md#relativetimeformatinputoptions8). ```js let relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"}); @@ -384,4 +384,4 @@ According to grammars in certain languages, the singular or plural form of a nou ```js let relativeTimeFormat = new Intl.RelativeTimeFormat("zh-CN", {numeric: "always", style: "long"}); let options = relativeTimeFormat.resolvedOptions(); // options = {"locale": "zh-CN", "style": "long", "numeric": "always", "numberingSystem": "latn"} - ``` + ``` \ No newline at end of file diff --git a/en/application-dev/notification/figures/en-us_image_0000001466462305.png b/en/application-dev/notification/figures/en-us_image_0000001466462305.png index 740f4b79a9ee234008cad6cf3616a8f213569476..7db8892ea08d7bc75f87c1f90cc7bc7281a7e07e 100644 Binary files a/en/application-dev/notification/figures/en-us_image_0000001466462305.png and b/en/application-dev/notification/figures/en-us_image_0000001466462305.png differ diff --git a/en/application-dev/notification/notification-enable.md b/en/application-dev/notification/notification-enable.md index 4b0ecd303d8f13b3f7ba4f43364ddd53ffadc1d7..0ab05bec0d4ec44eee8f2c5c43151c2da6da51d3 100644 --- a/en/application-dev/notification/notification-enable.md +++ b/en/application-dev/notification/notification-enable.md @@ -1,17 +1,17 @@ # Enabling Notification -To publish a notification, you must have notification enabled for your application. You can call the [requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationrequestenablenotification) API to display a dialog box prompting the user to enable notification for your application. Note that the dialog box is displayed only when the API is called for the first time. +To publish a notification, you must have notification enabled for your application. You can call the [requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationmanagerrequestenablenotification) API to display a dialog box prompting the user to enable notification for your application. Note that the dialog box is displayed only when the API is called for the first time. - **Figure 1** Dialog box prompting the user to enable notification +**Figure 1** Dialog box prompting the user to enable notification ![en-us_image_0000001416585590](figures/en-us_image_0000001416585590.png) - Touching **allow** enables notification for the application, and touching **ban** keeps notification disabled. -- The dialog box will not be displayed again when [requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationrequestenablenotification) is called later. The user can manually enable notification as follows. - +- The dialog box will not be displayed again when [requestEnableNotification()](../reference/apis/js-apis-notificationManager.md#notificationmanagerrequestenablenotification) is called later. The user can manually enable notification as follows. + | 1. Swipe down from the upper left corner of the device screen to access the notification panel. | 2. Touch the **Settings** icon in the upper right corner. On the notification screen, locate the target application.| 3. Toggle on **Allow notifications**. | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | | ![en-us_image_0000001417062434](figures/en-us_image_0000001417062434.png) | ![en-us_image_0000001466462297](figures/en-us_image_0000001466462297.png) | ![en-us_image_0000001466782025](figures/en-us_image_0000001466782025.png) | @@ -19,7 +19,7 @@ To publish a notification, you must have notification enabled for your applicati ## Available APIs -For details about the APIs, see [@ohos.notificationManager](../reference/apis/js-apis-notificationManager.md#notificationrequestenablenotification). +For details about the APIs, see [@ohos.notificationManager](../reference/apis/js-apis-notificationManager.md#notificationmanagerrequestenablenotification). **Table 1** Notification APIs diff --git a/en/application-dev/notification/notification-overview.md b/en/application-dev/notification/notification-overview.md index 6bef8be8fd446e62b3e3da04582b467c9ddc5961..f3dd4149d7b9c77be498f6d02abed67d9e070ab8 100644 --- a/en/application-dev/notification/notification-overview.md +++ b/en/application-dev/notification/notification-overview.md @@ -24,4 +24,5 @@ A notification is generated by the notification sender and sent to the notificat System applications also support notification-related configuration options, such as switches. The system configuration initiates a configuration request and sends the request to the notification subsystem for storage in the memory and database. +**Figure 1** Notification service process ![en-us_image_0000001466582017](figures/en-us_image_0000001466582017.png) diff --git a/en/application-dev/notification/notification-subscription.md b/en/application-dev/notification/notification-subscription.md index 95fe77de7feead97208082c12519523588cd6521..45e75f1f64606cfa89cae2cfae91b89a13faaa5c 100644 --- a/en/application-dev/notification/notification-subscription.md +++ b/en/application-dev/notification/notification-subscription.md @@ -16,19 +16,19 @@ The major APIs for notification subscription are described as follows. For detai | Name | Description| | -------- | -------- | | subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback<void>): void | Subscribes to notifications from a specific application.| -| subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void | Subscribes to notifications from all applications. | +| subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void | Subscribes to notifications from all applications. | **Table 2** Callbacks for notification subscription | Name | Description| | -------- | -------- | -| onConsume?:(data: SubscribeCallbackData) => void | Callback for receiving notifications. | -| onCancel?:(data: SubscribeCallbackData) => void | Callback for canceling notifications. | -| onUpdate?:(data: NotificationSortingMap) => void | Callback for notification sorting updates. | -| onConnect?:() => void; | Callback for subscription. | -| onDisconnect?:() => void; | Callback for unsubscription. | -| onDestroy?:() => void | Callback for disconnecting from the notification subsystem. | -| onDoNotDisturbDateChange?:(mode: notification.DoNotDisturbDate) => void | Callback for the Do Not Disturb (DNT) time changes.| +| onConsume?:(data: SubscribeCallbackData) => void | Callback for receiving notifications. | +| onCancel?:(data: SubscribeCallbackData) => void | Callback for canceling notifications. | +| onUpdate?:(data: NotificationSortingMap) => void | Callback for notification sorting updates. | +| onConnect?:() => void; | Callback for subscription. | +| onDisconnect?:() => void; | Callback for unsubscription. | +| onDestroy?:() => void | Callback for disconnecting from the notification subsystem. | +| onDoNotDisturbDateChange?:(mode: notification.DoNotDisturbDate) => void | Callback for the Do Not Disturb (DNT) time changes.| | onEnabledNotificationChanged?:(callbackData: EnabledNotificationCallbackData) => void | Callback for notification switch changes. | @@ -46,37 +46,38 @@ The major APIs for notification subscription are described as follows. For detai ```ts let subscriber = { - onConsume: function (data) { - let req = data.request; - console.info('[ANS] onConsume callback req.id: ' + req.id); - }, - onCancel: function (data) { - let req = data.request; - console.info('[ANS] onCancel callback req.id: : ' + req.id); - }, - onUpdate: function (data) { - console.info('[ANS] onUpdate in test'); - }, - onConnect: function () { - console.info('[ANS] onConnect in test'); - }, - onDisconnect: function () { - console.info('[ANS] onDisConnect in test'); - }, - onDestroy: function () { - console.info('[ANS] onDestroy in test'); - }, + onConsume: function (data) { + let req = data.request; + console.info(`onConsume callback. req.id: ${req.id}`); + }, + onCancel: function (data) { + let req = data.request; + console.info(`onCancel callback. req.id: ${req.id}`); + }, + onUpdate: function (data) { + let req = data.request; + console.info(`onUpdate callback. req.id: ${req.id}`); + }, + onConnect: function () { + console.info(`onConnect callback.}`); + }, + onDisconnect: function () { + console.info(`onDisconnect callback.}`); + }, + onDestroy: function () { + console.info(`onDestroy callback.}`); + }, }; ``` - + 4. Initiate notification subscription. ```ts notificationSubscribe.subscribe(subscriber, (err, data) => { // This API uses an asynchronous callback to return the result. if (err) { - console.error(`[ANS] subscribe failed, code is ${err.code}, message is ${err.message}`); + console.error(`Failed to subscribe notification. Code is ${err.code}, message is ${err.message}`); return; } - console.info(`[ANS] subscribeTest success : + ${data}`); + console.info(`Succeeded in subscribing to notification. Data: ${data}`); }); ``` diff --git a/en/application-dev/notification/notification-with-wantagent.md b/en/application-dev/notification/notification-with-wantagent.md index 47275ecabeed338cfb67cff44cb39c325498e0ff..638f53ef2f6f6fce1637468ba4c900496727f23d 100644 --- a/en/application-dev/notification/notification-with-wantagent.md +++ b/en/application-dev/notification/notification-with-wantagent.md @@ -4,7 +4,7 @@ A [WantAgent](../reference/apis/js-apis-app-ability-wantAgent.md) object encapsu Below you can see the process of adding a **WantAgent** object to a notification. The notification publisher requests a **WantAgent** object from the Ability Manager Service (AMS), and then sends a notification carrying the **WantAgent** object to the home screen. When the user touches the notification from the notification panel on the home screen, the **WantAgent** object is triggered. - **Figure 1** Publishing a notification with a WantAgent object +**Figure 1** Publishing a notification with a WantAgent object ![notification-with-wantagent](figures/notification-with-wantagent.png) @@ -15,11 +15,11 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ | Name| Description| | -------- | -------- | -|getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void | Creates a **WantAgent** object.| -|trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void | Triggers a **WantAgent** object.| -|cancel(agent: WantAgent, callback: AsyncCallback<void>): void | Cancels a **WantAgent** object.| -|getWant(agent: WantAgent, callback: AsyncCallback<Want>): void | Obtains a **WantAgent** object.| -|equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback<boolean>): void | Checks whether two **WantAgent** objects are equal.| +| getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void | Creates a **WantAgent** object.| +| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void | Triggers a **WantAgent** object.| +| cancel(agent: WantAgent, callback: AsyncCallback<void>): void | Cancels a **WantAgent** object.| +| getWant(agent: WantAgent, callback: AsyncCallback<Want>): void | Obtains a **WantAgent** object.| +| equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback<boolean>): void | Checks whether two **WantAgent** objects are equal.| ## How to Develop @@ -42,20 +42,20 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ // Set the action type through operationType of WantAgentInfo. let wantAgentInfo = { - wants: [ - { - deviceId: '', - bundleName: 'com.example.myapplication', - abilityName: 'EntryAbility', - action: '', - entities: [], - uri: '', - parameters: {} - } - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.CONSTANT_FLAG] + wants: [ + { + deviceId: '', + bundleName: 'com.example.myapplication', + abilityName: 'EntryAbility', + action: '', + entities: [], + uri: '', + parameters: {} + } + ], + operationType: wantAgent.OperationType.START_ABILITY, + requestCode: 0, + wantAgentFlags:[wantAgent.WantAgentFlags.CONSTANT_FLAG] }; ``` @@ -66,16 +66,16 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ // Set the action type through operationType of WantAgentInfo. let wantAgentInfo = { - wants: [ - { - action: 'event_name', // Set the action name. - parameters: {}, - } - ], - operationType: wantAgent.OperationType.SEND_COMMON_EVENT, - requestCode: 0, - wantAgentFlags: [wantAgent.WantAgentFlags.CONSTANT_FLAG], - } + wants: [ + { + action: 'event_name', // Set the action name. + parameters: {}, + } + ], + operationType: wantAgent.OperationType.SEND_COMMON_EVENT, + requestCode: 0, + wantAgentFlags: [wantAgent.WantAgentFlags.CONSTANT_FLAG], + }; ``` 4. Invoke the [getWantAgent()](../reference/apis/js-apis-app-ability-wantAgent.md#wantagentgetwantagent) API to create a **WantAgent** object. @@ -83,12 +83,12 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ ```typescript // Create a WantAgent object. wantAgent.getWantAgent(wantAgentInfo, (err, data) => { - if (err) { - console.error('[WantAgent]getWantAgent err=' + JSON.stringify(err)); - return; - } - console.info('[WantAgent]getWantAgent success'); - wantAgentObj = data; + if (err) { + console.error(`Failed to get want agent. Code is ${err.code}, message is ${err.message}`); + return; + } + console.info('Succeeded in geting want agent.'); + wantAgentObj = data; }); ``` @@ -97,25 +97,25 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/ ```typescript // Create a NotificationRequest object. let notificationRequest: notificationManager.NotificationRequest = { - content: { - contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'Test_Title', - text: 'Test_Text', - additionalText: 'Test_AdditionalText', - }, + content: { + contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, + normal: { + title: 'Test_Title', + text: 'Test_Text', + additionalText: 'Test_AdditionalText', }, - id: 1, - label: 'TEST', - wantAgent: wantAgentObj, + }, + id: 1, + label: 'TEST', + wantAgent: wantAgentObj, } notificationManager.publish(notificationRequest, (err) => { - if (err) { - console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`); - return; - } - console.info(`[ANS] publish success`); + if (err) { + console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`); + return; + } + console.info('Succeeded in publishing notification.'); }); ``` diff --git a/en/application-dev/notification/progress-bar-notification.md b/en/application-dev/notification/progress-bar-notification.md index db7cae812218c2f7b6c363d204baa04dfeeb639f..4f016fefcbb6912fa9a0b998c7b5feb672503eee 100644 --- a/en/application-dev/notification/progress-bar-notification.md +++ b/en/application-dev/notification/progress-bar-notification.md @@ -27,13 +27,14 @@ In the [NotificationTemplate](../reference/apis/js-apis-inner-notification-notif ```ts notificationManager.isSupportTemplate('downloadTemplate').then((data) => { console.info(`[ANS] isSupportTemplate success`); + console.info('Succeeded in supporting download template notification.'); let isSupportTpl: boolean = data; // The value true means that the template of the downloadTemplate type is supported, and false means the opposite. // ... }).catch((err) => { - console.error(`[ANS] isSupportTemplate failed, code is ${err.code}, message is ${err.message}`); + console.error(`Failed to support download template notification. Code is ${err.code}, message is ${err.message}`); }); ``` - + > **NOTE** > > Proceed with the step below only when the specified template is supported. @@ -61,9 +62,9 @@ In the [NotificationTemplate](../reference/apis/js-apis-inner-notification-notif // Publish the notification. notificationManager.publish(notificationRequest, (err) => { if (err) { - console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`); + console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`); return; } - console.info(`[ANS] publish success `); + console.info('Succeeded in publishing notification.'); }); ``` diff --git a/en/application-dev/notification/text-notification.md b/en/application-dev/notification/text-notification.md index 7901a78a4c547ca02caae191b551d27f6cae3e3a..fb1455e0dcdd791db6658935b48e90a6f14a3a14 100644 --- a/en/application-dev/notification/text-notification.md +++ b/en/application-dev/notification/text-notification.md @@ -3,8 +3,7 @@ You can publish basic notifications to send SMS messages, prompt messages, and advertisements. Available content types of basic notifications include normal text, long text, multi-line text, and picture-attached. - - **Table 1** Basic notification content types +**Table 1** Basic notification content types | Type| Description| | -------- | -------- | @@ -13,16 +12,16 @@ You can publish basic notifications to send SMS messages, prompt messages, and a | NOTIFICATION_CONTENT_MULTILINE | Multi-line text notification.| | NOTIFICATION_CONTENT_PICTURE | Picture-attached notification.| +Notifications are displayed in the notification panel, which is the only supported subscriber to notifications. Below you can see two examples of the basic notification. -Notifications are displayed in the notification panel, which is the only system subscriber to notifications. Below you can see two examples of the basic notification. +**Figure 1** Examples of the basic notification -**Figure 1** Examples of the basic notification ![en-us_image_0000001466462305](figures/en-us_image_0000001466462305.png) ## Available APIs -The following table describes the APIs for notification publishing. You specify the notification type by setting the [NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest) parameter in the APIs. +The following table describes the APIs for notification publishing. You specify the notification type by setting the [NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest) parameter in the APIs. | Name| Description| | -------- | -------- | @@ -48,21 +47,21 @@ The following table describes the APIs for notification publishing. You specify let notificationRequest: notificationManager.NotificationRequest = { id: 1, content: { - contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // Basic notification - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText', - } + contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, // Basic notification + normal: { + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText', + } } - } + }; notificationManager.publish(notificationRequest, (err) => { - if (err) { - console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`); - return; - } - console.info(`[ANS] publish success.`); + if (err) { + console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`); + return; + } + console.info('Succeeded in publishing notification.'); }); ``` @@ -74,25 +73,25 @@ The following table describes the APIs for notification publishing. You specify let notificationRequest: notificationManager.NotificationRequest = { id: 1, content: { - contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, // Long-text notification - longText: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText', - longText: 'test_longText', - briefText: 'test_briefText', - expandedTitle: 'test_expandedTitle', - } + contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, // Long-text notification + longText: { + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText', + longText: 'test_longText', + briefText: 'test_briefText', + expandedTitle: 'test_expandedTitle', + } } - } + }; // Publish the notification. notificationManager.publish(notificationRequest, (err) => { - if (err) { - console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`); - return; - } - console.info(`[ANS] publish success.`); + if (err) { + console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`); + return; + } + console.info('Succeeded in publishing notification.'); }); ``` @@ -104,24 +103,24 @@ The following table describes the APIs for notification publishing. You specify let notificationRequest: notificationManager.NotificationRequest = { id: 1, content: { - contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_MULTILINE, // Multi-line text notification - multiLine: { - title: 'test_title', - text: 'test_text', - briefText: 'test_briefText', - longTitle: 'test_longTitle', - lines: ['line_01', 'line_02', 'line_03', 'line_04'], - } + contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_MULTILINE, // Multi-line text notification + multiLine: { + title: 'test_title', + text: 'test_text', + briefText: 'test_briefText', + longTitle: 'test_longTitle', + lines: ['line_01', 'line_02', 'line_03', 'line_04'], + } } - } + }; // Publish the notification. notificationManager.publish(notificationRequest, (err) => { if (err) { - console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`); - return; + console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`); + return; } - console.info(`[ANS] publish success`); + console.info('Succeeded in publishing notification.'); }); ``` @@ -132,27 +131,27 @@ The following table describes the APIs for notification publishing. You specify ```ts let imagePixelMap: PixelMap = undefined; // Obtain the PixelMap information. let notificationRequest: notificationManager.NotificationRequest = { - id: 1, - content: { - contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_PICTURE, - picture: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText', - briefText: 'test_briefText', - expandedTitle: 'test_expandedTitle', - picture: imagePixelMap - } + id: 1, + content: { + contentType: notificationManager.ContentType.NOTIFICATION_CONTENT_PICTURE, + picture: { + title: 'test_title', + text: 'test_text', + additionalText: 'test_additionalText', + briefText: 'test_briefText', + expandedTitle: 'test_expandedTitle', + picture: imagePixelMap } - } + } + }; // Publish the notification. notificationManager.publish(notificationRequest, (err) => { - if (err) { - console.error(`[ANS] publish failed, code is ${err.code}, message is ${err.message}`); - return; - } - console.info(`[ANS] publish success.`); + if (err) { + console.error(`Failed to publish notification. Code is ${err.code}, message is ${err.message}`); + return; + } + console.info('Succeeded in publishing notification.'); }); ``` diff --git a/en/application-dev/quick-start/arkts-observed-and-objectlink.md b/en/application-dev/quick-start/arkts-observed-and-objectlink.md index a84802480d1fbd3eb4b6942d5b8f1a2f5f642aa1..1282545cc1d65a1acdc90da3ac5a2828cf611ca9 100644 --- a/en/application-dev/quick-start/arkts-observed-and-objectlink.md +++ b/en/application-dev/quick-start/arkts-observed-and-objectlink.md @@ -316,7 +316,7 @@ class StringArray extends Array { -Declare a class that extends from** Array**: **class StringArray extends Array\ {}** and create an instance of **StringArray**. The use of the **new** operator is required for the \@Observed class decorator to work properly. +Declare a class that extends from **Array**: **class StringArray extends Array\ {}** and create an instance of **StringArray**. The use of the **new** operator is required for the \@Observed class decorator to work properly. ```ts diff --git a/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md b/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md index 2b8f2293918bef081b6f6377a99d6fdb2e35a03e..90a06cc468f5dc383ec3cf15a9f2d8a894f63239 100644 --- a/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md +++ b/en/application-dev/quick-start/arkts-page-custom-components-lifecycle.md @@ -19,7 +19,7 @@ The following lifecycle callbacks are provided for the lifecycle of a page, that - [onBackPress](../reference/arkui-ts/ts-custom-component-lifecycle.md#onbackpress): Invoked when the user clicks the Back button. -The following lifecycle callbacks are provided for the lifecycle of a custom component, which is one decorated with \@Component: +The following lifecycle callbacks are provided for the lifecycle of a component, that is, the lifecycle of a custom component decorated with \@Component: - [aboutToAppear](../reference/arkui-ts/ts-custom-component-lifecycle.md#abouttoappear): Invoked when the custom component is about to appear. Specifically, it is invoked after a new instance of the custom component is created and before its **build** function is executed. @@ -134,7 +134,7 @@ struct MyComponent { Child() } // When this.showChild is false, the Child child component is deleted, and Child aboutToDisappear is invoked. - Button('create or delete Child').onClick(() => { + Button('delete Child').onClick(() => { this.showChild = false; }) // Because of the pushing from the current page to Page2, onPageHide is invoked. diff --git a/en/application-dev/quick-start/arkts-rendering-control-lazyforeach.md b/en/application-dev/quick-start/arkts-rendering-control-lazyforeach.md index 7086569f912a0c447228643958c38b3bd16e0045..95b6665c834a4bdf281b4712717e71f51659c112 100644 --- a/en/application-dev/quick-start/arkts-rendering-control-lazyforeach.md +++ b/en/application-dev/quick-start/arkts-rendering-control-lazyforeach.md @@ -75,15 +75,17 @@ interface DataChangeListener { } ``` -| Declaration | Parameter Type | Description | -| ---------------------------------------- | -------------------------------------- | ---------------------------------------- | -| onDataReloaded(): void | - | Invoked when all data is reloaded. | -| onDataAdded(index: number):void | number | Invoked when data is added to the position indicated by the specified index.
**index**: index of the position where data is added. | -| onDataMoved(from: number, to: number): void | from: number,
to: number | Invoked when data is moved.
**from**: original position of data; **to**: target position of data.
**NOTE**
The ID must remain unchanged before and after data movement. If the ID changes, APIs for deleting and adding data must be called.| -| onDataChanged(index: number): void | number | Invoked when data in the position indicated by the specified index is changed.
**index**: listener for data changes. | -| onDataAdd(index: number): void | number | Invoked when data is added to the position indicated by the specified index.
**index**: index of the position where data is added. | -| onDataMove(from: number, to: number): void | from: number,
to: number | Invoked when data is moved.
**from**: original position of data; **to**: target position of data.
**NOTE**
The ID must remain unchanged before and after data movement. If the ID changes, APIs for deleting and adding data must be called.| -| onDataChanged(index: number): void | number | Invoked when data in the position indicated by the specified index is changed.
**index**: index of the position where data is changed.| +| Declaration | Parameter Type | Description | +| ------------------------------------------------------------ | -------------------------------------- | ------------------------------------------------------------ | +| onDataReloaded(): void | - | Invoked when all data is reloaded. | +| onDataAdded(index: number):void(deprecated) | number | Invoked when data is added to the position indicated by the specified index.
This API is deprecated since API version 8. You are advised to use **onDataAdd** instead.
**index**: index of the position where data is added.| +| onDataMoved(from: number, to: number): void(deprecated) | from: number,
to: number | Invoked when data is moved.
This API is deprecated since API version 8. You are advised to use **onDataMove** instead.
**from**: original position of data; **to**: target position of data.
**NOTE**
The ID must remain unchanged before and after data movement. If the ID changes, APIs for deleting and adding data must be called.| +| onDataDeleted(index: number):void(deprecated) | number | Invoked when data is deleted from the position indicated by the specified index. LazyForEach will update the displayed content accordingly.
This API is deprecated since API version 8. You are advised to use **onDataDelete** instead.
**index**: index of the position where data is deleted.| +| onDataChanged(index: number): void(deprecated) | number | Invoked when data in the position indicated by the specified index is changed.
This API is deprecated since API version 8. You are advised to use **onDataChange** instead.
**index**: listener for data changes.| +| onDataAdd(index: number): void8+ | number | Invoked when data is added to the position indicated by the specified index.
**index**: index of the position where data is added.| +| onDataMove(from: number, to: number): void8+ | from: number,
to: number | Invoked when data is moved.
**from**: original position of data; **to**: target position of data.
**NOTE**
The ID must remain unchanged before and after data movement. If the ID changes, APIs for deleting and adding data must be called.| +| onDataDelete(index: number):void8+ | number | Invoked when data is deleted from the position indicated by the specified index. LazyForEach will update the displayed content accordingly.
**index**: index of the position where data is deleted.
**NOTE**
Before **onDataDelete** is called, ensure that the corresponding data in **dataSource** has been deleted. Otherwise, undefined behavior will occur during page rendering.| +| onDataChange(index: number): void8+ | number | Invoked when data in the position indicated by the specified index is changed.
**index**: index of the position where data is changed.| ## Restrictions diff --git a/en/application-dev/quick-start/atomicService-aging.md b/en/application-dev/quick-start/atomicService-aging.md index 6b393b5a9456e3cbf840dbf9cf5655c46d832658..75c4be084bc7e103f504924f936daea71b8fe5de 100644 --- a/en/application-dev/quick-start/atomicService-aging.md +++ b/en/application-dev/quick-start/atomicService-aging.md @@ -4,7 +4,7 @@ Space management for atomic services is necessary from two aspects. On the one h ## Managing Quota for Atomic Service Data Directories -Set a storage quota for the data sandbox directory of an atomic service. This quota can be obtained through the system parameter **persist.sys.bms.aging.policy.atomicservice.datasize.threshold**. The default value is 1024 MB. When the quota is used up, writing data will return an error message. +Set a storage quota for the data sandbox directory of an atomic service. This quota can be obtained through the system parameter **persist.sys.bms.aging.policy.atomicservice.datasize.threshold**. The default value is 50 MB. When the quota is used up, writing data will return an error message. You can run the [param get/set](../../device-dev/subsystems/subsys-boot-init-plugin.md) command to view and set system parameters. diff --git a/en/application-dev/quick-start/cross-app-hsp.md b/en/application-dev/quick-start/cross-app-hsp.md index db971e348908dbc6f6ca87f5d84d162b6bac0997..4d4115490d7060843fe008cda7281fcc2a003ada 100644 --- a/en/application-dev/quick-start/cross-app-hsp.md +++ b/en/application-dev/quick-start/cross-app-hsp.md @@ -17,34 +17,29 @@ An inter-application HSP works by combining the following parts: HSP: contains the actual implementation code, including the JS/TS code, C++ libraries, resources, and configuration files. It is either released to the application market or integrated into the system version. ### Integrating the HAR in an Inter-Application HSP -Define the interfaces to be exported in the **index.d.ets** file in the HAR, which is the entry to the declaration file exported by the inter-application HSP. The path of the **index.d.ets** file is as follows: +Define the interfaces to be exported in the **index.ets** file in the HAR, which is the entry to the declaration file exported by the inter-application HSP. The path to the **index.ets** file is as follows: ``` -src -├── main -| └── module.json5 -├── index.d.ets +liba +├── src +│ └── main +│ ├── ets +│ │ ├── pages +│ │ └── index.ets +│ ├── resources +│ └── module.json5 └── oh-package.json5 ``` -Below is an example of the **index.d.ets** file content: -```ts -@Component -export declare struct UIComponent { - build():void; -} - -export declare function hello(): string; - -export declare function foo1(): string; +Below is an example of the **index.ets** file content: -export declare function foo2(): string; - -export declare function nativeHello(): string; +```ts +// liba/src/main/ets/index.ets +export { hello, foo1, foo2, nativeMulti, UIComponent } from './ui/MyUIComponent' ``` -In the example, **UIComponent** is an ArkUI component, **hello()**, **foo1()**, and **foo2()** are TS methods, and **nativeHello()** is a native method. Specific implementation is as follows: +In the example, **UIComponent** is an ArkUI component, **hello()**, **foo1()**, and **foo2()** are TS methods, and **nativeMulti()** is a native method. Specific implementation is as follows: #### ArkUI Components The following is an implementation example of ArkUI components in the HSP: ```ts -// lib/src/main/ets/ui/MyUIComponent.ets +// liba/src/main/ets/ui/MyUIComponent.ets @Component export struct UIComponent { @State message: string = 'Hello World' @@ -63,6 +58,7 @@ export struct UIComponent { #### **TS Methods** The following is an implementation example of TS methods in the HSP: ```ts +// liba/src/main/ets/ui/MyUIComponent.ets export function hello(name: string): string { return "hello + " + name; } @@ -74,50 +70,22 @@ export function foo1() { export function foo2() { return "foo2"; } + ``` #### **Native Methods** -The following is an implementation example of native methods in the HSP: -```C++ -#include "napi/native_api.h" -#include -#include -#include - -const std::string libname = "liba"; -const std::string version = "v10001"; - -static napi_value Hello(napi_env env, napi_callback_info info) { - napi_value ret; - std::string msg = libname + ":native hello, " + version; - napi_create_string_utf8(env, msg.c_str(), msg.length(), &ret); - return ret; -} +The HSP can contain .so files compiled in C++. The HSP indirectly exports the native method in the .so file. In this example, the **multi** API in the **libnative.so** file is exported. -EXTERN_C_START -static napi_value Init(napi_env env, napi_value exports) { - napi_property_descriptor desc[] = { - {"nativeHello", nullptr, Hello, nullptr, nullptr, nullptr, napi_default, nullptr}}; - napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); - return exports; -} -EXTERN_C_END - -static napi_module demoModule = { - .nm_version = 1, - .nm_flags = 0, - .nm_filename = nullptr, - .nm_register_func = Init, - .nm_modname = "liba", - .nm_priv = ((void *)0), - .reserved = {0}, -}; - -extern "C" __attribute__((constructor)) void RegisterLibaModule(void) { - napi_module_register(&demoModule); +```ts +// liba/src/main/ets/ui/MyUIComponent.ets +import native from "libnative.so" + +export function nativeMulti(a: number, b: number) { + return native.multi(a, b); } ``` + ### Using the Capabilities Exported from the HAR -To start with, [configure dependency](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-development-npm-package-0000001222578434#section89674298391) on the HAR. The dependency information will then be generated in the **module.json5** file of the corresponding module, as shown in the following: +To start with, [configure dependency](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/creating_har_api9-0000001518082393-V3#section611662614153) on the HAR. The dependency information will then be generated in the **module.json5** file of the corresponding module, as shown in the following: ```json "dependencies": [ { @@ -180,7 +148,7 @@ struct Index { #### Referencing Native Methods in the HAR To reference the native methods exported from the HAR, use **import** as follows: ``` ts -import { nativeHello } from 'liba' +import { nativeMulti } from 'liba' @Component struct Index { @@ -190,7 +158,7 @@ struct Index { Button('Button') .onClick(()=>{ // Reference the native method in the HAR. - nativeHello(); + nativeMulti(); }) } .width('100%') @@ -207,11 +175,6 @@ Inter-application HSPs are not completely integrated into an application. They a ### Inter-Application HSP Debugging Mode You can debug an inter-application HSP after it is distributed to a device. If the aforementioned distribution methods are not applicable, you can distribute the HSP by running **bm** commands. The procedure is as follows: - -> **NOTE** -> -> Do not reverse steps 2 and 3. Otherwise, your application will fail to be installed due to a lack of the required inter-application HSP. For more information about the **bm** commands, see [Bundle Management](../../readme/bundle-management.md). - 1. Obtain the inter-application HSP installation package. 2. Run the following **bm** command to install the inter-application HSP. ``` @@ -222,3 +185,7 @@ bm install -s sharebundle.hsp bm install -p feature.hap ``` 4. Start your application and start debugging. + +> **NOTE** +> +> Do not reverse steps 2 and 3. Otherwise, your application will fail to be installed due to a lack of the required inter-application HSP. For more information about the **bm** commands, see [bm Commands](../../readme/bundle-management.md#bm-commands). \ No newline at end of file diff --git a/en/application-dev/quick-start/figures/ci_download.png b/en/application-dev/quick-start/figures/ci_download.png new file mode 100644 index 0000000000000000000000000000000000000000..da0d306e0f95a4fa114af51ca010d9109ae7e029 Binary files /dev/null and b/en/application-dev/quick-start/figures/ci_download.png differ diff --git a/en/application-dev/quick-start/figures/compiler.png b/en/application-dev/quick-start/figures/compiler.png new file mode 100644 index 0000000000000000000000000000000000000000..3854c378fd56761952b0f6443458e4ae663b3bf2 Binary files /dev/null and b/en/application-dev/quick-start/figures/compiler.png differ diff --git a/en/application-dev/quick-start/figures/sdk-structure.png b/en/application-dev/quick-start/figures/sdk-structure.png new file mode 100644 index 0000000000000000000000000000000000000000..18a9315151bc7b184a87c2f95b23238bbefc2b82 Binary files /dev/null and b/en/application-dev/quick-start/figures/sdk-structure.png differ diff --git a/en/application-dev/quick-start/har-package.md b/en/application-dev/quick-start/har-package.md index 63b5fcfd10437ac2140a17bcc1daf690e780c791..587af49e108ed1cfedbd9a190ea7858bc470073c 100644 --- a/en/application-dev/quick-start/har-package.md +++ b/en/application-dev/quick-start/har-package.md @@ -2,7 +2,7 @@ A Harmony Archive (HAR) is a static shared package that can contain code, C++ libraries, resources, and configuration files. It enables modules and projects to share code related to ArkUI components, resources, and more. Unlike a Harmony Ability Package (HAP), a HAR cannot be independently installed on a device. Instead, it can be referenced only as the dependency of an application module. ## Creating a HAR Module -You can kickstart your HAR module development with the module template of the **Library** type in DevEco Studio. By default, obfuscation is disabled for the HAR module. To enable this feature, set **artifactType** in the **build-profile.json5** file of the HAR module to **obfuscation** as follows: +You can [create a HAR module in DevEco Studio](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/creating_har_api9-0000001518082393-V3#section143510369612). To better protect your source code, enable obfuscation for the HAR module so that DevEco Studio compiles, obfuscates, and compresses code during HAR building. To enable obfuscation, open the **build-profile.json5** file of the HAR module and set **artifactType** to **obfuscation** as follows: ```json { @@ -12,15 +12,13 @@ You can kickstart your HAR module development with the module template of the ** } } ``` -The value options of **artifactType** are as follows, and the default value is **original**: +The value options of **artifactType** are as follows, with the default value being **original**: - **original**: Code is not obfuscated. - **obfuscation**: Code is obfuscated using Uglify. -When obfuscation is enabled, DevEco Studio compiles, obfuscates, and compresses code during HAR building, thereby protecting your code assets. - > **NOTE** > -> If **artifactType** is set to **obfuscation**, **apiType** must be set to **stageMode**, because obfuscation is available only in the stage model. +> Obfuscation is available only in the stage model. Therefore, if **artifactType** is set to **obfuscation**, **apiType** must be set to **stageMode**. ## Precautions for HAR Development - The HAR does not support the declaration of **abilities** and **extensionAbilities** in its configuration file. @@ -88,12 +86,12 @@ export { func2 } from './src/main/ts/test' ``` ### Resources Resources are packed into the HAR when it is being compiled and packaged. During compilation and building of a HAP, DevEco Studio collects resource files from the HAP module and its dependent modules. If the resource files of different modules have the same name, DevEco Studio overwrites the resource files based on the following priorities (in descending order): -- AppScope (supported only by the stage model of API version 9) +- AppScope (only for the stage model of API version 9) - Modules in the HAP file - If resource conflicts occur between dependent HAR modules, they are overwritten based on the dependency sequence. (The module that is higher in the dependency sequence list has higher priority.) ## Referencing ArkUI Components, APIs, and Resources in the HAR -To start with, [configure dependency](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-development-npm-package-0000001222578434#section89674298391) on the HAR. +To start with, [configure dependency](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/creating_har_api9-0000001518082393-V3#section611662614153) on the HAR. ### Reference ArkUI Components in the HAR @@ -170,3 +168,7 @@ struct Index { } } ``` + +## Releasing a HAR + +Follow the [instructions](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/creating_har_api9-0000001518082393-V3#section1213451811512) to release a HAR. diff --git a/en/application-dev/quick-start/howto-migrate-cmake-with-ohosndk.md b/en/application-dev/quick-start/howto-migrate-cmake-with-ohosndk.md new file mode 100644 index 0000000000000000000000000000000000000000..ae328b3e52b577be0fd9fcefd58b0e215e3d7ca4 --- /dev/null +++ b/en/application-dev/quick-start/howto-migrate-cmake-with-ohosndk.md @@ -0,0 +1,173 @@ +# Using Native APIs (NDK) of the OHOS SDK in a CMake Project + +## What Is Native API +For details, see [Native APIs](https://gitee.com/openharmony/docs/blob/master/en/application-dev/napi/Readme-EN.md). + +## Downloading the NDK + +You download the Native API Development Kit (NDK) by downloading the OHOS SDK, where the NDK is included. To download the OHOS SDK, use any of the following modes: + +- (Recommended) Acquire source code from mirrors for an officially released version. For details, see [release notes](https://gitee.com/openharmony/docs/tree/master/en/release-notes#/openharmony/docs/blob/master/en/release-notes/OpenHarmony-v3.2-release.md). +- Download the SDK from the SDK Manager in DevEco Studio. +- Download the SDK from the [daily build](http://ci.openharmony.cn/dailys/dailybuilds), by clicking the download link to the ohos-sdk component. + ![Download from Daily Build](figures/ci_download.png) + +## Decompressing the NDK + +Place the downloaded NDK in a folder you prefer and decompress it. Below shows the directory structure after decompression. +![SDK Directory Structure](figures/sdk-structure.png) + +Configure the Linux environment as follows: (Skip this step if the NDK is downloaded from DevEco Studio.) + +1. Add the CMake tool that comes with the NDK to the environment variables. + +``` + # Open the .bashrc file. + vim ~/.bashrc + # Append the custom CMake path to the file. Save the file and exit. + export PATH=~/ohos-sdk/ohos-sdk/linux/native/build-tools/cmake/bin:$PATH + # Run the source ~/.bashrc command to make the environment variables take effect. + source ~/.bashrc +``` + +2. Check the default CMake path. + +``` + # Run the which cmake command. + which cmake + # The result should be the same as the custom path previously appended to the file. + ~/ohos-sdk/ohos-sdk/linux/native/build-tools/cmake/bin/cmake +``` + + +## Using the NDK to Compile a Native Program + +You can use the NDK to quickly develop a native program, including native dynamic libraries, static libraries, and executable files. The ArkUI application framework can call the native dynamic libraries through the NAPI framework. The following exemplifies how to use the NDK to compile a C/C++ dynamic library in a C/C++ demo project. + + +### Folders in the NDK +#### build Folder: ohos.toolchain.cmake file +The **ohos.toolchain.cmake** file contains the attributes of the CMake compilation target. Its path must be specified in the **CMAKE_TOOLCHAIN_FILE** parameter so that it can be located during CMake compilation. For details about the mandatory parameters in the **ohos.toolchain.cmake** file, see [Key Parameters in ohos.toolchain.cmake](#key-parameters-in-ohostoolchaincmake). + + +#### build-tools folder: Build Tool Provided by the NDK +``` + # Run the following command to view the CMake version: + cmake -version + # Result + cmake version 3.16.5 + + CMake suite maintained and supported by Kitware (kitware.com/cmake). +``` +#### llvm Folder: Compiler Provided by the NDK +![Compiler](figures/compiler.png) + +### Demo Project for the NDK +#### Demo Project Directory + demo + ├── CMakeLists.txt + ├── include + └── sum.h + └── src + ├── CMakeLists.txt + ├── sum.cpp + └── hello.cpp + +#### CMakeLists.txt in the demo Directory +``` + # Specify the minimum CMake version. + CMAKE_MINIMUM_REQUIRED(VERSION 3.16) + + # Set the project name, which is HELLO in this example. + PROJECT(HELLO) + + # Add a subdirectory and build the subdirectory. + ADD_SUBDIRECTORY(src bin) +``` + +#### CMakeLists.txt in the src Directory +``` + SET(LIBHELLO_SRC hello.cpp) + + # Set compilation flags. + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0") + + # Set the link parameter. The value below is only for exemplary purposes. + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--emit-relocs --verbose") + + # Add a libsum dynamic library target. If the compilation is successful, a libsum.so file is generated. + ADD_LIBRARY(sum SHARED sum.cpp) + + # Add the executable target called Hello. If the compilation is successful, a Hello executable is generated. + ADD_EXECUTABLE(Hello ${LIBHELLO_SRC}) + + # Specify the path to the include directory of the Hello target. + TARGET_INCLUDE_DIRECTORIES(Hello PUBLIC ../include) + + # Specify the name of the library to be linked to the Hello target. + TARGET_LINK_LIBRARIES(Hello PUBLIC sum) +``` + +For details about CMake, see [CMake Tutorial](https://cmake.org/cmake/help/v3.16/guide/tutorial/). + +#### Source Code +**hello.cpp** source code: + +``` + #include + #include "sum.h" + + int main(int argc,const char **argv) + { + std::cout<< "hello world!" <** c ### Exporting Native Methods The HSP can contain .so files compiled in C++. The HSP indirectly exports the native method in the .so file. In this example, the **multi** method in the **libnative.so** file is exported. ```ts -// ibrary/src/main/ets/utils/nativeTest.ts +// library/src/main/ets/utils/nativeTest.ts import native from "libnative.so" export function nativeMulti(a: number, b: number) { @@ -103,15 +103,9 @@ export { nativeMulti } from './utils/nativeTest' ``` ## Using the In-Application HSP -To use APIs in the HSP, first configure the dependency on the HSP in the **oh-package.json5** file of the module that needs to call the APIs (called the invoking module). If the HSP and the invoking module are in the same project, the APIs can be referenced locally. The sample code is as follows: -```json -// entry/oh-package.json5 -"dependencies": { - "library": "file:../library" -} -``` -You can now call the external APIs of the HSP in the same way as calling the APIs in the HAR. -In this example, the external APIs are the following ones exported from **library**: +To use APIs in the HSP, first [configure the dependency](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/hsp-0000001521396322-V3#section6161154819195) on the HSP in the **oh-package.json5** file of the module that needs to call the APIs (called the invoking module). +You can then call the external APIs of the HSP in the same way as calling the APIs in the HAR. In this example, the external APIs are the following ones exported from **library**: + ```ts // library/src/main/ets/index.ets export { Log, add, minus } from './utils/test' diff --git a/en/application-dev/quick-start/module-configuration-file.md b/en/application-dev/quick-start/module-configuration-file.md index 2d830a4b8318afdf61f4d9d7531e71a3a6420858..ac141ad75d108f68d25007491a15062ae958563e 100644 --- a/en/application-dev/quick-start/module-configuration-file.md +++ b/en/application-dev/quick-start/module-configuration-file.md @@ -309,7 +309,7 @@ Set **icon**, **label**, and **skills** under **abilities** in the **module.json | [metadata](#metadata)| Metadata information of the UIAbility component.| Object array| Yes (initial value: left empty)| | exported | Whether the UIAbility component can be called by other applications.
- **true**: The UIAbility component can be called by other applications.
- **false**: The UIAbility component cannot be called by other applications.| Boolean| Yes (initial value: **false**)| | continuable | Whether the UIAbility component can be [migrated](../application-models/hop-cross-device-migration.md).
- **true**: The UIAbility component can be migrated.
- **false**: The UIAbility component cannot be migrated.| Boolean| Yes (initial value: **false**)| -| [skills](#skills) | Feature set of [wants](../application-models/want-overview.md) that can be received by the current UIAbility or ExtensionAbility component.
Configuring rule:
- For HAPs of the entry type, you can configure multiple **skills** attributes with the entry capability for an OpenHarmony application. (A **skills** attribute with the entry capability is the one that has **ohos.want.action.home** and **entity.system.home** configured.)
- For HAPs of the feature type, you can configure **skills** attributes with the entry capability for an OpenHarmony application, but not for an OpenHarmony service.| Object array| Yes (initial value: left empty)| +| [skills](#skills) | Feature set of [wants](../application-models/want-overview.md) that can be received by the current UIAbility or ExtensionAbility component.
Configuration rules:
- For HAPs of the entry type, you can configure multiple **skills** attributes with the entry capability for an OpenHarmony application. (A **skills** attribute with the entry capability is the one that has **ohos.want.action.home** and **entity.system.home** configured.)
- For HAPs of the feature type, you can configure **skills** attributes with the entry capability for an OpenHarmony application, but not for an OpenHarmony service.| Object array| Yes (initial value: left empty)| | backgroundModes | Continuous tasks of the UIAbility component.
Continuous tasks are classified into the following types:
- **dataTransfer**: service for downloading, backing up, sharing, or transferring data from the network or peer devices.
- **audioPlayback**: audio playback service.
- **audioRecording**: audio recording service.
- **location**: location and navigation services.
- **bluetoothInteraction**: Bluetooth scanning, connection, and transmission services (wearables).
- **multiDeviceConnection**: multi-device interconnection service.
- **wifiInteraction**: Wi-Fi scanning, connection, and transmission services (as used in the Multi-screen Collaboration and clone features)
- **voip**: voice/video call and VoIP services.
- **taskKeeping**: computing service.| String array| Yes (initial value: left empty)| | startWindowIcon | Index to the icon file of the UIAbility component startup page. Example: **$media:icon**.
The value is a string with a maximum of 255 bytes.| String| No| | startWindowBackground | Index to the background color resource file of the UIAbility component startup page. Example: **$color:red**.
The value is a string with a maximum of 255 bytes.| String| No| diff --git a/en/application-dev/quick-start/quickfix-principles.md b/en/application-dev/quick-start/quickfix-principles.md index 4c0a1f684cfc1ff71c5ad9a2594ae8823e178e82..0431534f0f46bb7bb0988c538d84628767ce8bfb 100644 --- a/en/application-dev/quick-start/quickfix-principles.md +++ b/en/application-dev/quick-start/quickfix-principles.md @@ -10,7 +10,7 @@ Quick fix is a technical means provided by the OpenHarmony system for developers * The bundle name and application version number configured in the quick fix package must be the same as those of the installed application. Otherwise, the deployment will fail. * Make sure the version of the quick fix package to deploy is later than that of the one previously deployed. Otherwise, the deployment will fail. * The signature information of the quick fix package must be the same as that of the application to be fixed. Otherwise, the deployment will fail. -* Installing an application update will delete quick fix package. +* Installing an application update will delete the quick fix package. ## Structure of the Quick Fix Package @@ -18,7 +18,7 @@ Quick fix is a technical means provided by the OpenHarmony system for developers
The preceding figure shows the structure of the quick fix package released by an OpenHarmony application. * As shown in the figure, the quick fix package comes in two formats: * .appqf (Application Quick Fix) -
There is a one-to-one mapping between the .appqf file and App Pack of an application. For details, see [Application Package Structure in Stage Model](application-package-structure-stage). +
There is a one-to-one mapping between the .appqf file and App Pack of an application. For details, see [Application Package Structure in Stage Model](application-package-structure-stage.md). * The .appqf file is used to release OpenHarmony applications to the application market and cannot be directly installed on devices. * An .appqf file consists of one or more .hqf (Harmony Ability Package Quick Fix) files, which are extracted from the .appqf file by the application market and then distributed to specific devices. * The .appqf file must contain the developer's signature information before being released to the application market. For details about how to sign the file, see [hapsigner Overview](../security/hapsigntool-overview.md). diff --git a/en/application-dev/quick-start/start-with-ets-fa.md b/en/application-dev/quick-start/start-with-ets-fa.md index 019490d354b8d7c6b6ff7771065aae1b7534b76c..36fe7adfb84fa9ea5a5e735a61d71ca44dbe6dab 100644 --- a/en/application-dev/quick-start/start-with-ets-fa.md +++ b/en/application-dev/quick-start/start-with-ets-fa.md @@ -10,7 +10,7 @@ ## Creating an ArkTS Project -1. If you are opening DevEco Studio for the first time, click **Create Project**. If a project is already open, choose **File** > **New** > **Create Project** from the menu bar. On the **Choose Your Ability Template** page, select **Application** (or **Atomic Service**, depending on your project), select **Empty Ability** as the template, and click Next. +1. If you are opening DevEco Studio for the first time, click **Create Project**. If a project is already open, choose **File** > **New** > **Create Project** from the menu bar. On the **Choose Your Ability Template** page, select **Application** (or **Atomic Service**, depending on your project), select **Empty Ability** as the template, and click **Next**. ![createProject](figures/createProject.png) diff --git a/en/application-dev/quick-start/start-with-ets-stage.md b/en/application-dev/quick-start/start-with-ets-stage.md index d18a01875cf2e52abd45b493f8223c596912276d..978ffd47a206abc5f5b3e047a8d7f3dcc0e599e9 100644 --- a/en/application-dev/quick-start/start-with-ets-stage.md +++ b/en/application-dev/quick-start/start-with-ets-stage.md @@ -10,7 +10,7 @@ ## Creating an ArkTS Project -1. If you are opening DevEco Studio for the first time, click **Create Project**. If a project is already open, choose **File** > **New** > **Create Project** from the menu bar. On the **Choose Your Ability Template** page, select **Application** (or **Atomic Service**, depending on your project), select **Empty Ability** as the template, and click Next. +1. If you are opening DevEco Studio for the first time, click **Create Project**. If a project is already open, choose **File** > **New** > **Create Project** from the menu bar. On the **Choose Your Ability Template** page, select **Application** (or **Atomic Service**, depending on your project), select **Empty Ability** as the template, and click **Next**. ![createProject](figures/createProject.png) diff --git a/en/application-dev/quick-start/start-with-js-fa.md b/en/application-dev/quick-start/start-with-js-fa.md index abb27d9fb942a406e22d98285626984bdc63d197..812be6247b4ed3aae55dd1f67b0ee5bb47f01065 100644 --- a/en/application-dev/quick-start/start-with-js-fa.md +++ b/en/application-dev/quick-start/start-with-js-fa.md @@ -8,7 +8,7 @@ ## Creating a JavaScript Project -1. If you are opening DevEco Studio for the first time, click **Create Project**. If a project is already open, choose **File** > **New** > **Create Project** from the menu bar. On the **Choose Your Ability Template** page, select **Application** (or **Atomic Service**, depending on your project), select **Empty Ability** as the template, and click Next. +1. If you are opening DevEco Studio for the first time, click **Create Project**. If a project is already open, choose **File** > **New** > **Create Project** from the menu bar. On the **Choose Your Ability Template** page, select **Application** (or **Atomic Service**, depending on your project), select **Empty Ability** as the template, and click **Next**. ![createProject](figures/createProject.png) diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md index 1a65db36edb6c0ecdbab3a46e1b6a412913eaca4..f9a6af9e1de4ac19c1623914fcd7e6a62c41a3fd 100644 --- a/en/application-dev/reference/apis/Readme-EN.md +++ b/en/application-dev/reference/apis/Readme-EN.md @@ -120,6 +120,7 @@ - [@ohos.events.emitter (Emitter)](js-apis-emitter.md) - [@ohos.notificationManager (NotificationManager) (Recommended)](js-apis-notificationManager.md) - [@ohos.notificationSubscribe (NotificationSubscribe) (Recommended)](js-apis-notificationSubscribe.md) + - [@ohos.application.StaticSubscriberExtensionContext (NotificationSubscribe) (Recommended)](js-apis-application-StaticSubscriberExtensionContext.md) - [System Common Events (To Be Deprecated Soon)](commonEvent-definitions.md) - [@ohos.commonEvent (Common Event) (To Be Deprecated Soon)](js-apis-commonEvent.md) - [@ohos.notification (Notification) (To Be Deprecated Soon)](js-apis-notification.md) @@ -137,6 +138,10 @@ - [NotificationFlags](js-apis-inner-notification-notificationFlags.md) - [NotificationRequest](js-apis-inner-notification-notificationRequest.md) - [NotificationSlot](js-apis-inner-notification-notificationSlot.md) + - [NotificationSorting](js-apis-inner-notification-notificationSorting.md) + - [NotificationSortingMap](js-apis-inner-notification-notificationSortingMap.md) + - [NotificationSubscribeInfo](js-apis-inner-notification-notificationSubscribeInfo.md) + - [NotificationSubscriber](js-apis-inner-notification-notificationSubscriber.md) - [NotificationTemplate](js-apis-inner-notification-notificationTemplate.md) - [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md) - Common Events @@ -320,7 +325,7 @@ - [@ohos.systemTimer (System Timer)](js-apis-system-timer.md) - [@ohos.wallpaper (Wallpaper)](js-apis-wallpaper.md) - [@ohos.web.webview (Webview)](js-apis-webview.md) - - [console (Log)](js-apis-logs.md) + - [Console](js-apis-logs.md) - [Timer](js-apis-timer.md) - application - [AccessibilityExtensionContext (Accessibility Extension Context)](js-apis-inner-application-accessibilityExtensionContext.md) @@ -330,6 +335,7 @@ - [@ohos.batteryStatistics (Battery Statistics)](js-apis-batteryStatistics.md) - [@ohos.brightness (Screen Brightness)](js-apis-brightness.md) - [@ohos.charger (Charging Type)](js-apis-charger.md) + - [@ohos.cooperate (Screen Hopping)](js-apis-devicestatus-cooperate.md) - [@ohos.deviceInfo (Device Information)](js-apis-device-info.md) - [@ohos.distributedHardware.deviceManager (Device Management)](js-apis-device-manager.md) - [@ohos.geoLocationManager (Geolocation Manager)](js-apis-geoLocationManager.md) @@ -366,6 +372,7 @@ - [@ohos.configPolicy (Configuration Policy)](js-apis-configPolicy.md) - [@ohos.enterprise.accountManager (Account Management)](js-apis-enterprise-accountManager.md) - [@ohos.enterprise.adminManager (Enterprise Device Management)](js-apis-enterprise-adminManager.md) + - [@ohos.enterprise.applicationManager (Application Management)](js-apis-enterprise-applicationManager.md) - [@ohos.enterprise.bundleManager (Bundle Management)](js-apis-enterprise-bundleManager.md) - [@ohos.enterprise.dateTimeManager (System Time Management)](js-apis-enterprise-dateTimeManager.md) - [@ohos.enterprise.deviceControl (Device Control Management)](js-apis-enterprise-deviceControl.md) diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md index c116f901789c4a0fd1898d28bb7e8fd69a1b38fc..db930ccbe8cc14f368b9e16d29b556074e981482 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle.md @@ -904,7 +904,7 @@ bundle.getAllApplicationInfo(bundleFlags, userId, (err, data) => { > This API is deprecated since API version 9. You are advised to use [bundleManager.getAllApplicationInfo](js-apis-bundleManager.md#bundlemanagergetallapplicationinfo) instead. -getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void; +getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback\\>): void; Obtains the information about all applications of the current user. This API uses an asynchronous callback to return the result. diff --git a/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md b/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md index 7ea0a7024970cffde1434f76ce911cce28dbcd2e..95d4b1e408a255be8f9830ecc0594640211a26e1 100644 --- a/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md +++ b/en/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md @@ -25,7 +25,7 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; onAddForm(want: Want): formBindingData.FormBindingData -Called to notify the widget provider that a **Form** instance (widget) has been created. +Called to notify the widget provider that a **Form** instance (widget) is being created. **System capability**: SystemCapability.Ability.Form @@ -49,7 +49,7 @@ import formBindingData from '@ohos.app.form.formBindingData'; export default class MyFormExtensionAbility extends FormExtensionAbility { onAddForm(want) { - console.log('FormExtensionAbility onAddForm, want: ${want.abilityName}'); + console.log(`FormExtensionAbility onAddForm, want: ${want.abilityName}`); let dataObj1 = { temperature: '11c', 'time': '11:00' @@ -64,7 +64,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onCastToNormalForm(formId: string): void -Called to notify the widget provider that a temporary widget has been converted to a normal one. +Called to notify the widget provider that a temporary widget is being converted to a normal one. **System capability**: SystemCapability.Ability.Form @@ -81,7 +81,7 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; export default class MyFormExtensionAbility extends FormExtensionAbility { onCastToNormalForm(formId) { - console.log('FormExtensionAbility onCastToNormalForm, formId: ${formId}'); + console.log(`FormExtensionAbility onCastToNormalForm, formId: ${formId}`); } }; ``` @@ -90,7 +90,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onUpdateForm(formId: string): void -Called to notify the widget provider that a widget has been updated. After obtaining the latest data, your application should call [updateForm](js-apis-app-form-formProvider.md#updateform) of **formProvider** to update the widget data. +Called to notify the widget provider that a widget is being updated. After obtaining the latest data, your application should call [updateForm](js-apis-app-form-formProvider.md#updateform) of **formProvider** to update the widget data. **System capability**: SystemCapability.Ability.Form @@ -109,15 +109,15 @@ import formProvider from '@ohos.app.form.formProvider'; export default class MyFormExtensionAbility extends FormExtensionAbility { onUpdateForm(formId) { - console.log('FormExtensionAbility onUpdateForm, formId: ${formId}'); + console.log(`FormExtensionAbility onUpdateForm, formId: ${formId}`); let obj2 = formBindingData.createFormBindingData({ temperature: '22c', time: '22:00' }); formProvider.updateForm(formId, obj2).then((data) => { - console.log('FormExtensionAbility context updateForm, data: ${data}'); + console.log(`FormExtensionAbility context updateForm, data: ${data}`); }).catch((error) => { - console.error('Operation updateForm failed. Cause: ${error}'); + console.error(`Operation updateForm failed. Cause: ${error}`); }); } }; @@ -127,7 +127,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onChangeFormVisibility(newStatus: { [key: string]: number }): void -Called to notify the widget provider of the change of visibility. +Called to notify the widget provider that the widget visibility status is being changed. **System capability**: SystemCapability.Ability.Form @@ -146,18 +146,18 @@ import formProvider from '@ohos.app.form.formProvider'; export default class MyFormExtensionAbility extends FormExtensionAbility { onChangeFormVisibility(newStatus) { - console.log('FormExtensionAbility onChangeFormVisibility, newStatus: ${newStatus}'); + console.log(`FormExtensionAbility onChangeFormVisibility, newStatus: ${newStatus}`); let obj2 = formBindingData.createFormBindingData({ temperature: '22c', time: '22:00' }); for (let key in newStatus) { - console.log('FormExtensionAbility onChangeFormVisibility, key: ${key}, value= ${newStatus[key]}'); + console.log(`FormExtensionAbility onChangeFormVisibility, key: ${key}, value= ${newStatus[key]}`); formProvider.updateForm(key, obj2).then((data) => { - console.log('FormExtensionAbility context updateForm, data: ${data}'); + console.log(`FormExtensionAbility context updateForm, data: ${data}`); }).catch((error) => { - console.error('Operation updateForm failed. Cause: ${error}'); + console.error(`Operation updateForm failed. Cause: ${error}`); }); } } @@ -168,7 +168,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onFormEvent(formId: string, message: string): void -Called to instruct the widget provider to receive and process the widget event. +Called to instruct the widget provider to process the widget event. **System capability**: SystemCapability.Ability.Form @@ -186,7 +186,7 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; export default class MyFormExtensionAbility extends FormExtensionAbility { onFormEvent(formId, message) { - console.log('FormExtensionAbility onFormEvent, formId: ${formId}, message: ${message}'); + console.log(`FormExtensionAbility onFormEvent, formId: ${formId}, message: ${message}`); } }; ``` @@ -195,7 +195,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onRemoveForm(formId: string): void -Called to notify the widget provider that a **Form** instance (widget) has been destroyed. +Called to notify the widget provider that a **Form** instance (widget) is being destroyed. **System capability**: SystemCapability.Ability.Form @@ -212,7 +212,7 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; export default class MyFormExtensionAbility extends FormExtensionAbility { onRemoveForm(formId) { - console.log('FormExtensionAbility onRemoveForm, formId: ${formId}'); + console.log(`FormExtensionAbility onRemoveForm, formId: ${formId}`); } }; ``` @@ -221,7 +221,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onConfigurationUpdate(newConfig: Configuration): void; -Called when the configuration of the environment where the ability is running is updated. +Called when the configuration of the environment where the FormExtensionAbility is running is updated. **System capability**: SystemCapability.Ability.Form @@ -238,7 +238,7 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; export default class MyFormExtensionAbility extends FormExtensionAbility { onConfigurationUpdate(config) { - console.log('onConfigurationUpdate, config: ${JSON.stringify(config)}'); + console.log(`onConfigurationUpdate, config: ${JSON.stringify(config)}`); } }; ``` @@ -247,7 +247,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onAcquireFormState?(want: Want): formInfo.FormState; -Called when the widget provider receives the status query result of a widget. By default, the initial state is returned. +Called to notify the widget provider that the widget host is requesting the widget state. By default, the initial state is returned. **System capability**: SystemCapability.Ability.Form @@ -265,7 +265,7 @@ import formInfo from '@ohos.app.form.formInfo'; export default class MyFormExtensionAbility extends FormExtensionAbility { onAcquireFormState(want) { - console.log('FormExtensionAbility onAcquireFormState, want: ${want}'); + console.log(`FormExtensionAbility onAcquireFormState, want: ${want}`); return formInfo.FormState.UNKNOWN; } }; @@ -275,7 +275,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { onShareForm?(formId: string): { [key: string]: Object } -Called by the widget provider to receive shared widget data. +Called to notify the widget provider that the widget host is sharing the widget data. **System API**: This is a system API. @@ -300,7 +300,46 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; export default class MyFormExtensionAbility extends FormExtensionAbility { onShareForm(formId) { - console.log('FormExtensionAbility onShareForm, formId: ${formId}'); + console.log(`FormExtensionAbility onShareForm, formId: ${formId}`); + let wantParams = { + 'temperature': '20', + 'time': '2022-8-8 09:59', + }; + return wantParams; + } +}; +``` + +## onAcquireFormData10+ + +onAcquireFormData?(formId: string): { [key: string]: Object } + +Called to notify the widget provider that the widget host is requesting the custom data. + +**System API**: This is a system API. + +**System capability**: SystemCapability.Ability.Form + +**Parameters** + +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| formId | string | Yes | Widget ID.| + +**Return value** + +| Type | Description | +| ------------------------------------------------------------ | ----------------------------------------------------------- | +| {[key: string]: any} | Custom data of the widget, in the form of key-value pairs.| + +**Example** + +```ts +import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; + +export default class MyFormExtensionAbility extends FormExtensionAbility { + onAcquireFormData(formId) { + console.log('FormExtensionAbility onAcquireFormData, formId: ${formId}'); let wantParams = { 'temperature': '20', 'time': '2022-8-8 09:59', diff --git a/en/application-dev/reference/apis/js-apis-app-form-formHost.md b/en/application-dev/reference/apis/js-apis-app-form-formHost.md index 0afda1db43c8830ffbf9eeb63cceae0c07a62f2c..d81c78c439f21e0ce60ff3df6e33c3d949ee980a 100644 --- a/en/application-dev/reference/apis/js-apis-app-form-formHost.md +++ b/en/application-dev/reference/apis/js-apis-app-form-formHost.md @@ -2222,7 +2222,7 @@ try { ## getRunningFormInfosByFilter10+ -function getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter): Promise<Array<formInfo.RunningFormInfo>> +getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter): Promise<Array<formInfo.RunningFormInfo>> Obtains the information about widget hosts based on the widget provider information. This API uses a promise to return the result. @@ -2273,7 +2273,7 @@ try { ## getRunningFormInfosByFilter10+ -function getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter, callback: AsyncCallback<Array<formInfo.FormInfo>>): void +getRunningFormInfosByFilter(formProviderFilter: formInfo.FormProviderFilter, callback: AsyncCallback<Array<formInfo.FormInfo>>): void Obtains the information about widget hosts based on the widget provider information. This API uses an asynchronous callback to return the result. @@ -2321,7 +2321,7 @@ try { ## getRunningFormInfoById10+ -function getRunningFormInfoById(formId: string): Promise<Array<formInfo.RunningFormInfo>> +getRunningFormInfoById(formId: string): Promise<Array<formInfo.RunningFormInfo>> Obtains the information about widget hosts based on the widget ID. This API uses a promise to return the result. @@ -2366,7 +2366,7 @@ try { ## getRunningFormInfoById10+ -function getRunningFormInfoById(formId: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void +getRunningFormInfoById(formId: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void Obtains the information about widget hosts based on the widget ID. This API uses an asynchronous callback to return the result. diff --git a/en/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md b/en/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md new file mode 100644 index 0000000000000000000000000000000000000000..f1c7c82e6af9bdeacc971596d47b217c72f1ddc9 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-application-StaticSubscriberExtensionContext.md @@ -0,0 +1,161 @@ +# @ohos.application.StaticSubscriberExtensionContext (StaticSubscriberExtensionContext) + +The **StaticSubscriberExtensionContext** module, inherited from **ExtensionContext**, provides context for StaticSubscriberExtensionAbilities. + +You can use the APIs of this module to start StaticSubscriberExtensionAbilities. + +> **NOTE** +> +> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> The APIs of this module can be used only in the stage model. + +## Usage + +Before using the **StaticSubscriberExtensionContext** module, you must first obtain a **StaticSubscriberExtensionAbility** instance. + +```ts +import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriberExtensionAbility' + +export default class MyStaticSubscriberExtensionAbility extends StaticSubscriberExtensionAbility { + context = this.context; +}; +``` + +## StaticSubscriberExtensionContext.startAbility + +startAbility(want: Want, callback: AsyncCallback<void>): void; + +Starts an ability that belongs to the same application as this StaticSubscriberExtensionAbility. This API uses an asynchronous callback to return the result. + +Observe the following when using this API: + - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. + - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Core + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ----------------------------------- | ---- | -------------------------- | +| want | [Want](js-apis-application-want.md) | Yes | Want information about the target ability. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Error codes** + +For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| 16000001 | The specified ability does not exist. | +| 16000002 | Incorrect ability type. | +| 16000004 | Can not start invisible component. | +| 16000005 | The specified process does not have the permission. | +| 16000006 | Cross-user operations are not allowed. | +| 16000008 | The crowdtesting application expires. | +| 16000009 | An ability cannot be started or stopped in Wukong mode. | +| 16000011 | The context does not exist. | +| 16000050 | Internal error. | +| 16000053 | The ability is not on the top of the UI. | +| 16000055 | Installation-free timed out. | +| 16200001 | The caller has been released. | +| 16300003 | The target application is not self application. | + +**Example** + + ```ts + let want = { + bundleName: "com.example.myapp", + abilityName: "MyAbility" + }; + + try { + this.context.startAbility(want, (error) => { + if (error) { + // Process service logic errors. + console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) + + ' error.message: ' + JSON.stringify(error.message)); + return; + } + // Carry out normal service processing. + console.log('startAbility succeed'); + }); + } catch (paramError) { + // Process input parameter errors. + console.log('startAbility failed, error.code: ' + JSON.stringify(paramError.code) + + ' error.message: ' + JSON.stringify(paramError.message)); + } + ``` + +## StaticSubscriberExtensionContext.startAbility + +startAbility(want: Want): Promise<void>; + +Starts an ability that belongs to the same application as this StaticSubscriberExtensionAbility. This API uses a promise to return the result. + +Observe the following when using this API: + - If an application running in the background needs to call this API to start an ability, it must have the **ohos.permission.START_ABILITIES_FROM_BACKGROUND** permission. + - If **visible** of the target ability is **false** in cross-application scenarios, the caller must have the **ohos.permission.START_INVISIBLE_ABILITY** permission. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Core + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | ----------------------------------- | ---- | ----------------------- | +| want | [Want](js-apis-application-want.md) | Yes | Want information about the target ability.| + +**Return value** + +| Type | Description | +| ------------------- | ------------------------- | +| Promise<void> | Promise used to return the result.| + +**Error codes** + +For details about the error codes, see [Ability Error Codes](../errorcodes/errorcode-ability.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| 16000001 | The specified ability does not exist. | +| 16000002 | Incorrect ability type. | +| 16000004 | Can not start invisible component. | +| 16000005 | The specified process does not have the permission. | +| 16000006 | Cross-user operations are not allowed. | +| 16000008 | The crowdtesting application expires. | +| 16000009 | An ability cannot be started or stopped in Wukong mode. | +| 16000011 | The context does not exist. | +| 16000050 | Internal error. | +| 16000053 | The ability is not on the top of the UI. | +| 16000055 | Installation-free timed out. | +| 16200001 | The caller has been released. | +| 16300003 | The target application is not self application. | + +**Example** + + ```ts + let want = { + bundleName: "com.example.myapp", + abilityName: "MyAbility" + }; + + try { + this.context.startAbility(want) + .then(() => { + // Carry out normal service processing. + console.log('startAbility succeed'); + }) + .catch((error) => { + // Process service logic errors. + console.log('startAbility failed, error.code: ' + JSON.stringify(error.code) + + ' error.message: ' + JSON.stringify(error.message)); + }); + } catch (paramError) { + // Process input parameter errors. + console.log('startAbility failed, error.code: ' + JSON.stringify(paramError.code) + + ' error.message: ' + JSON.stringify(paramError.message)); + } + ``` diff --git a/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md b/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md index 096433a60c44904bbe9b2f25d09e9384e192c7fb..c28c4372ba1cf10ad9c67669913de1b4ac06ae17 100644 --- a/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md +++ b/en/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md @@ -13,6 +13,14 @@ The **StaticSubscriberExtensionAbility** module provides Extension abilities for import StaticSubscriberExtensionAbility from '@ohos.application.StaticSubscriberExtensionAbility'; ``` +## Attributes + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +| Name | Type | Readable| Writable| Description | +| ------- | ------------------------------------------------------------ | ---- | ---- | -------- | +| context | [StaticSubscriberExtensionContext](js-apis-application-StaticSubscriberExtensionContext.md) | Yes | No | Context.| + ## StaticSubscriberExtensionAbility.onReceiveEvent onReceiveEvent(event: CommonEventData): void; @@ -30,7 +38,6 @@ Callback of the common event of a static subscriber. | event | [CommonEventData](js-apis-commonEventManager.md#commoneventdata) | Yes| Common event of a static subscriber.| **Example** - ```ts class MyStaticSubscriberExtensionAbility extends StaticSubscriberExtensionAbility { onReceiveEvent(event) { diff --git a/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md b/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md index 340a54ba1b1e5950cdced1971050c42590208f74..f8bbe2212f0b6b9ae41183bfce2ae7c03a726d99 100644 --- a/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md +++ b/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md @@ -1,6 +1,6 @@ # @ohos.arkui.componentSnapshot (Component Snapshot) -The **componentSnapshot** module provides APIs for obtaining component snapshots, including snapshots of components that have been loaded and snapshots of components that have not been loaded yet. +The **componentSnapshot** module provides APIs for obtaining component snapshots, including snapshots of components that have been loaded and snapshots of components that have not been loaded yet. Note that a component snapshot does not contain content drawn outside of the area of the owning component or the parent component. > **NOTE** > @@ -8,6 +8,7 @@ The **componentSnapshot** module provides APIs for obtaining component snapshots > > You can preview how this component looks on a real device. The preview is not yet available in the DevEco Studio Previewer. + ## Modules to Import ```js @@ -20,14 +21,18 @@ get(id: string, callback: AsyncCallback): void Obtains the snapshot of a component that has been loaded. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> The snapshot captures content rendered in the last frame. If this API is called when the component triggers an update, the re-rendered content will not be included in the obtained snapshot. + **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ----------------------------------- | ---- | ------------------------------------------------------------------------------ | -| id | string | Yes | [ID](../arkui-ts/ts-universal-attributes-component-id.md) of the target component.| -| callback | AsyncCallback<image.PixelMap> | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ----------------------------------- | ---- | ---------------------------------------- | +| id | string | Yes | [ID](../arkui-ts/ts-universal-attributes-component-id.md) of the target component.| +| callback | AsyncCallback<image.PixelMap> | Yes | Callback used to return the result. | **Example** @@ -45,8 +50,8 @@ struct SnapshotExample { Image(this.pixmap) .width(300).height(300) // ...Component - // ...Components - // ...Components + // ...Component + // ...Component Button("click to generate UI snapshot") .onClick(() => { componentSnapshot.get("root", (error: Error, pixmap: image.PixelMap) => { @@ -71,25 +76,29 @@ get(id: string): Promise Obtains the snapshot of a component that has been loaded. This API uses a promise to return the result. +> **NOTE** +> +> The snapshot captures content rendered in the last frame. If this API is called when the component triggers an update, the re-rendered content will not be included in the obtained snapshot. + **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| ------- | ------------------------------------------------------- | ---- | -------------------- | -| id | string | Yes | [ID](../arkui-ts/ts-universal-attributes-component-id.md) of the target component.| +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ---------------------------------------- | +| id | string | Yes | [ID](../arkui-ts/ts-universal-attributes-component-id.md) of the target component.| **Return value** -| Type | Description | -| ----------------------------- | -------------- | +| Type | Description | +| ----------------------------- | -------- | | Promise<image.PixelMap> | Promise used to return the result.| **Error codes** -| ID| Error Message | -| -------- | ------------------- | -| 100001 | if id is not valid. | +| ID | Error Message | +| ------ | ------------------- | +| 100001 | if id is not valid. | **Example** @@ -134,14 +143,21 @@ createFromBuilder(builder: CustomBuilder, callback: AsyncCallback **NOTE** +> +> To account for the time spent in awaiting component building and rendering, the callback of offscreen snapshots has a delay of less than 500 ms. +> +> If a component is on a time-consuming task, for example, an **\** or **\** component that is loading online images, its loading may be still in progress when this API is called. In this case, the output snapshot does not represent the component in the way it looks when the loading is successfully completed. + + **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------------------------------------- | ---- | -------------------- | -| builder | [CustomBuilder](../arkui-ts/ts-types.md#custombuilder8) | Yes | Builder of the custom component.| -| callback | AsyncCallback<image.PixelMap> | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ---------- | +| builder | [CustomBuilder](../arkui-ts/ts-types.md#custombuilder8) | Yes | Builder of the custom component.| +| callback | AsyncCallback<image.PixelMap> | Yes | Callback used to return the result.| **Example** @@ -194,25 +210,31 @@ createFromBuilder(builder: CustomBuilder): Promise Renders a custom component in the application background and outputs its snapshot. This API uses a promise to return the result. +> **NOTE** +> +> To account for the time spent in awaiting component building and rendering, the callback of offscreen snapshots has a delay of less than 500 ms. +> +> If a component is on a time-consuming task, for example, an **\** or **\** component that is loading online images, its loading may be still in progress when this API is called. In this case, the output snapshot does not represent the component in the way it looks when the loading is successfully completed. + **System capability**: SystemCapability.ArkUI.ArkUI.Full **Parameters** -| Name | Type | Mandatory| Description | -| ------- | ------------------------------------------------------- | ---- | -------------------- | -| builder | [CustomBuilder](../arkui-ts/ts-types.md#custombuilder8) | Yes | Builder of the custom component.| +| Name | Type | Mandatory | Description | +| ------- | ---------------------------------------- | ---- | ---------- | +| builder | [CustomBuilder](../arkui-ts/ts-types.md#custombuilder8) | Yes | Builder of the custom component.| **Return value** -| Type | Description | -| ----------------------------- | -------------- | +| Type | Description | +| ----------------------------- | -------- | | Promise<image.PixelMap> | Promise used to return the result.| **Error codes** -| ID| Error Message | -| -------- | ----------------------------------------- | -| 100001 | if builder is not a valid build function. | +| ID | Error Message | +| ------ | ---------------------------------------- | +| 100001 | if builder is not a valid build function. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-audio.md b/en/application-dev/reference/apis/js-apis-audio.md index 83c2d59e857f73cf3b6573cbc2b96f8200c14e18..4301f1019a2b6665a3ee039550146bee70e97be0 100644 --- a/en/application-dev/reference/apis/js-apis-audio.md +++ b/en/application-dev/reference/apis/js-apis-audio.md @@ -3553,6 +3553,7 @@ let inputAudioDeviceDescriptor = [{ networkId : audio.LOCAL_NETWORK_ID, interruptGroupId : 1, volumeGroupId : 1, + displayName : "", }]; async function selectInputDevice(){ @@ -3602,6 +3603,7 @@ let inputAudioDeviceDescriptor = [{ networkId : audio.LOCAL_NETWORK_ID, interruptGroupId : 1, volumeGroupId : 1, + displayName : "", }]; async function getRoutingManager(){ @@ -3756,6 +3758,7 @@ let outputAudioDeviceDescriptor = [{ networkId : audio.LOCAL_NETWORK_ID, interruptGroupId : 1, volumeGroupId : 1, + displayName : "", }]; async function selectOutputDevice(){ @@ -3805,6 +3808,7 @@ let outputAudioDeviceDescriptor = [{ networkId : audio.LOCAL_NETWORK_ID, interruptGroupId : 1, volumeGroupId : 1, + displayName : "", }]; async function selectOutputDevice(){ @@ -3856,6 +3860,7 @@ let outputAudioDeviceDescriptor = [{ networkId : audio.LOCAL_NETWORK_ID, interruptGroupId : 1, volumeGroupId : 1, + displayName : "", }]; async function selectOutputDeviceByFilter(){ @@ -3914,6 +3919,7 @@ let outputAudioDeviceDescriptor = [{ networkId : audio.LOCAL_NETWORK_ID, interruptGroupId : 1, volumeGroupId : 1, + displayName : "", }]; async function selectOutputDeviceByFilter(){ @@ -4082,17 +4088,18 @@ Describes the audio renderer change event. **System capability**: SystemCapability.Multimedia.Audio.Renderer -| Name | Type | Readable | Writable | Description | -| ----------------- | ------------------------------------------------- | -------- | -------- | ---------------------------------------------------------- | -| streamId | number | Yes | No | Unique ID of an audio stream. | -| clientUid | number | Yes | No | UID of the audio renderer client.
This is a system API. | -| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | No | Audio renderer information. | -| rendererState | [AudioState](#audiostate) | Yes | No | Audio state.
This is a system API. | -| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description. | +| Name | Type | Readable| Writable| Description | +| -------------------| ----------------------------------------- | ---- | ---- | ---------------------------- | +| streamId | number | Yes | No | Unique ID of an audio stream. | +| clientUid | number | Yes | No | UID of the audio renderer client.
This is a system API.| +| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | No | Audio renderer information. | +| rendererState | [AudioState](#audiostate) | Yes | No | Audio state.
This is a system API.| +| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description.| **Example** ```js + import audio from '@ohos.multimedia.audio'; const audioManager = audio.getAudioManager(); @@ -4140,13 +4147,13 @@ Describes the audio capturer change event. **System capability**: SystemCapability.Multimedia.Audio.Capturer -| Name | Type | Readable | Writable | Description | -| ----------------- | ------------------------------------------------- | -------- | -------- | ---------------------------------------------------------- | -| streamId | number | Yes | No | Unique ID of an audio stream. | -| clientUid | number | Yes | No | UID of the audio capturer client.
This is a system API. | -| capturerInfo | [AudioCapturerInfo](#audiocapturerinfo8) | Yes | No | Audio capturer information. | -| capturerState | [AudioState](#audiostate) | Yes | No | Audio state.
This is a system API. | -| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description. | +| Name | Type | Readable| Writable| Description | +| -------------------| ----------------------------------------- | ---- | ---- | ---------------------------- | +| streamId | number | Yes | No | Unique ID of an audio stream. | +| clientUid | number | Yes | No | UID of the audio capturer client.
This is a system API.| +| capturerInfo | [AudioCapturerInfo](#audiocapturerinfo8) | Yes | No | Audio capturer information. | +| capturerState | [AudioState](#audiostate) | Yes | No | Audio state.
This is a system API.| +| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description.| **Example** @@ -4194,19 +4201,20 @@ Describes an audio device. **System capability**: SystemCapability.Multimedia.Audio.Device -| Name | Type | Readable | Writable | Description | -| ----------------------------- | ------------------------- | -------- | -------- | ------------------------------------------------------------ | -| deviceRole | [DeviceRole](#devicerole) | Yes | No | Device role. | -| deviceType | [DeviceType](#devicetype) | Yes | No | Device type. | -| id9+ | number | Yes | No | Device ID, which is unique. | -| name9+ | string | Yes | No | Device name. | -| address9+ | string | Yes | No | Device address. | -| sampleRates9+ | Array<number> | Yes | No | Supported sampling rates. | -| channelCounts9+ | Array<number> | Yes | No | Number of channels supported. | -| channelMasks9+ | Array<number> | Yes | No | Supported channel masks. | -| networkId9+ | string | Yes | No | ID of the device network.
This is a system API. | -| interruptGroupId9+ | number | Yes | No | ID of the interruption group to which the device belongs.
This is a system API. | -| volumeGroupId9+ | number | Yes | No | ID of the volume group to which the device belongs.
This is a system API. | +| Name | Type | Readable| Writable| Description | +| ----------------------------- | -------------------------- | ---- | ---- | ---------- | +| deviceRole | [DeviceRole](#devicerole) | Yes | No | Device role.| +| deviceType | [DeviceType](#devicetype) | Yes | No | Device type.| +| id9+ | number | Yes | No | Device ID, which is unique. | +| name9+ | string | Yes | No | Device name.| +| address9+ | string | Yes | No | Device address.| +| sampleRates9+ | Array<number> | Yes | No | Supported sampling rates.| +| channelCounts9+ | Array<number> | Yes | No | Number of channels supported.| +| channelMasks9+ | Array<number> | Yes | No | Supported channel masks.| +| displayName10+ | string | Yes | No | Display name of the device.| +| networkId9+ | string | Yes | No | ID of the device network.
This is a system API.| +| interruptGroupId9+ | number | Yes | No | ID of the interruption group to which the device belongs.
This is a system API.| +| volumeGroupId9+ | number | Yes | No | ID of the volume group to which the device belongs.
This is a system API.| **Example** @@ -4238,11 +4246,11 @@ Implements filter criteria. Before calling **selectOutputDeviceByFilter**, you m **System API**: This is a system API. -| Name | Type | Mandatory | Description | -| ------------ | ---------------------------------------- | --------- | ------------------------------------------------------------ | -| uid | number | No | Application ID.
**System capability**: SystemCapability.Multimedia.Audio.Core | -| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | No | Audio renderer information.
**System capability**: SystemCapability.Multimedia.Audio.Renderer | -| rendererId | number | No | Unique ID of an audio stream.
**System capability**: SystemCapability.Multimedia.Audio.Renderer | +| Name | Type | Mandatory| Description | +| -------------| ---------------------------------------- | ---- | -------------- | +| uid | number | No | Application ID.
**System capability**: SystemCapability.Multimedia.Audio.Core| +| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | No | Audio renderer information.
**System capability**: SystemCapability.Multimedia.Audio.Renderer| +| rendererId | number | No | Unique ID of an audio stream.
**System capability**: SystemCapability.Multimedia.Audio.Renderer| **Example** @@ -4264,9 +4272,9 @@ Provides APIs for audio rendering. Before calling any API in **AudioRenderer**, **System capability**: SystemCapability.Multimedia.Audio.Renderer -| Name | Type | Readable | Writable | Description | -| ------------------ | -------------------------- | -------- | -------- | --------------------- | -| state8+ | [AudioState](#audiostate8) | Yes | No | Audio renderer state. | +| Name | Type | Readable| Writable| Description | +| ----- | -------------------------- | ---- | ---- | ------------------ | +| state8+ | [AudioState](#audiostate8) | Yes | No | Audio renderer state.| **Example** @@ -4284,9 +4292,9 @@ Obtains the renderer information of this **AudioRenderer** instance. This API us **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------------------------------------------- | :-------- | :------------------------------------------------ | -| callback | AsyncCallback<[AudioRendererInfo](#audiorendererinfo8)\> | Yes | Callback used to return the renderer information. | +| Name | Type | Mandatory| Description | +| :------- | :------------------------------------------------------- | :--- | :--------------------- | +| callback | AsyncCallback<[AudioRendererInfo](#audiorendererinfo8)\> | Yes | Callback used to return the renderer information.| **Example** @@ -4309,9 +4317,9 @@ Obtains the renderer information of this **AudioRenderer** instance. This API us **Return value** -| Type | Description | -| -------------------------------------------------- | ------------------------------------------------ | -| Promise<[AudioRendererInfo](#audiorendererinfo8)\> | Promise used to return the renderer information. | +| Type | Description | +| -------------------------------------------------- | ------------------------------- | +| Promise<[AudioRendererInfo](#audiorendererinfo8)\> | Promise used to return the renderer information.| **Example** @@ -4336,9 +4344,9 @@ Obtains the stream information of this **AudioRenderer** instance. This API uses **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :--------------------------------------------------- | :-------- | :---------------------------------------------- | -| callback | AsyncCallback<[AudioStreamInfo](#audiostreaminfo8)\> | Yes | Callback used to return the stream information. | +| Name | Type | Mandatory| Description | +| :------- | :--------------------------------------------------- | :--- | :------------------- | +| callback | AsyncCallback<[AudioStreamInfo](#audiostreaminfo8)\> | Yes | Callback used to return the stream information.| **Example** @@ -4362,9 +4370,9 @@ Obtains the stream information of this **AudioRenderer** instance. This API uses **Return value** -| Type | Description | -| :--------------------------------------------- | :--------------------------------------------- | -| Promise<[AudioStreamInfo](#audiostreaminfo8)\> | Promise used to return the stream information. | +| Type | Description | +| :--------------------------------------------- | :--------------------- | +| Promise<[AudioStreamInfo](#audiostreaminfo8)\> | Promise used to return the stream information.| **Example** @@ -4378,7 +4386,6 @@ audioRenderer.getStreamInfo().then((streamInfo) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### getAudioStreamId9+ @@ -4391,9 +4398,9 @@ Obtains the stream ID of this **AudioRenderer** instance. This API uses an async **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :--------------------- | :-------- | :------------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the stream ID. | +| Name | Type | Mandatory| Description | +| :------- | :--------------------------------------------------- | :--- | :------------------- | +| callback | AsyncCallback | Yes | Callback used to return the stream ID.| **Example** @@ -4401,7 +4408,6 @@ Obtains the stream ID of this **AudioRenderer** instance. This API uses an async audioRenderer.getAudioStreamId((err, streamid) => { console.info(`Renderer GetStreamId: ${streamid}`); }); - ``` ### getAudioStreamId9+ @@ -4414,9 +4420,9 @@ Obtains the stream ID of this **AudioRenderer** instance. This API uses a promis **Return value** -| Type | Description | -| :--------------- | :------------------------------------ | -| Promise | Promise used to return the stream ID. | +| Type | Description | +| :--------------------------------------------- | :--------------------- | +| Promise | Promise used to return the stream ID.| **Example** @@ -4426,7 +4432,6 @@ audioRenderer.getAudioStreamId().then((streamid) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### start8+ @@ -4439,9 +4444,9 @@ Starts the renderer. This API uses an asynchronous callback to return the result **Parameters** -| Name | Type | Mandatory | Description | -| -------- | -------------------- | --------- | ----------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ---------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -4453,7 +4458,6 @@ audioRenderer.start((err) => { console.info('Renderer start success.'); } }); - ``` ### start8+ @@ -4466,9 +4470,9 @@ Starts the renderer. This API uses a promise to return the result. **Return value** -| Type | Description | -| -------------- | ---------------------------------- | -| Promise\ | Promise used to return the result. | +| Type | Description | +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| **Example** @@ -4478,7 +4482,6 @@ audioRenderer.start().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### pause8+ @@ -4491,9 +4494,9 @@ Pauses rendering. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| -------- | -------------------- | --------- | ----------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ---------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -4505,7 +4508,6 @@ audioRenderer.pause((err) => { console.info('Renderer paused.'); } }); - ``` ### pause8+ @@ -4518,9 +4520,9 @@ Pauses rendering. This API uses a promise to return the result. **Return value** -| Type | Description | -| -------------- | ---------------------------------- | -| Promise\ | Promise used to return the result. | +| Type | Description | +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| **Example** @@ -4530,7 +4532,6 @@ audioRenderer.pause().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### drain8+ @@ -4543,9 +4544,9 @@ Drains the playback buffer. This API uses an asynchronous callback to return the **Parameters** -| Name | Type | Mandatory | Description | -| -------- | -------------------- | --------- | ----------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ---------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -4557,7 +4558,6 @@ audioRenderer.drain((err) => { console.info('Renderer drained.'); } }); - ``` ### drain8+ @@ -4570,9 +4570,9 @@ Drains the playback buffer. This API uses a promise to return the result. **Return value** -| Type | Description | -| -------------- | ---------------------------------- | -| Promise\ | Promise used to return the result. | +| Type | Description | +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| **Example** @@ -4582,7 +4582,6 @@ audioRenderer.drain().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### stop8+ @@ -4595,9 +4594,9 @@ Stops rendering. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| -------- | -------------------- | --------- | ----------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ---------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -4609,7 +4608,6 @@ audioRenderer.stop((err) => { console.info('Renderer stopped.'); } }); - ``` ### stop8+ @@ -4622,9 +4620,9 @@ Stops rendering. This API uses a promise to return the result. **Return value** -| Type | Description | -| -------------- | ---------------------------------- | -| Promise\ | Promise used to return the result. | +| Type | Description | +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| **Example** @@ -4634,7 +4632,6 @@ audioRenderer.stop().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### release8+ @@ -4647,9 +4644,9 @@ Releases the renderer. This API uses an asynchronous callback to return the resu **Parameters** -| Name | Type | Mandatory | Description | -| -------- | -------------------- | --------- | ----------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ---------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -4661,7 +4658,6 @@ audioRenderer.release((err) => { console.info('Renderer released.'); } }); - ``` ### release8+ @@ -4674,9 +4670,9 @@ Releases the renderer. This API uses a promise to return the result. **Return value** -| Type | Description | -| -------------- | ---------------------------------- | -| Promise\ | Promise used to return the result. | +| Type | Description | +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| **Example** @@ -4686,7 +4682,6 @@ audioRenderer.release().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### write8+ @@ -4699,10 +4694,10 @@ Writes the buffer. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ---------------------- | --------- | ------------------------------------------------------------ | -| buffer | ArrayBuffer | Yes | Buffer to be written. | -| callback | AsyncCallback\ | Yes | Callback used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned. | +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | --------------------------------------------------- | +| buffer | ArrayBuffer | Yes | Buffer to be written. | +| callback | AsyncCallback\ | Yes | Callback used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned.| **Example** @@ -4742,7 +4737,6 @@ for (let i = 0;i < len; i++) { }) } - ``` ### write8+ @@ -4755,9 +4749,9 @@ Writes the buffer. This API uses a promise to return the result. **Return value** -| Type | Description | +| Type | Description | | ---------------- | ------------------------------------------------------------ | -| Promise\ | Promise used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned. | +| Promise\ | Promise used to return the result. If the operation is successful, the number of bytes written is returned; otherwise, an error code is returned.| **Example** @@ -4792,7 +4786,6 @@ for (let i = 0;i < len; i++) { console.error(`audioRenderer.write err: ${err}`); } } - ``` ### getAudioTime8+ @@ -4805,9 +4798,9 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970). **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ---------------------- | --------- | -------------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the timestamp. | +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | ---------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the timestamp.| **Example** @@ -4815,7 +4808,6 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970). audioRenderer.getAudioTime((err, timestamp) => { console.info(`Current timestamp: ${timestamp}`); }); - ``` ### getAudioTime8+ @@ -4828,9 +4820,9 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970). **Return value** -| Type | Description | -| ---------------- | ------------------------------------- | -| Promise\ | Promise used to return the timestamp. | +| Type | Description | +| ---------------- | ----------------------- | +| Promise\ | Promise used to return the timestamp.| **Example** @@ -4840,7 +4832,6 @@ audioRenderer.getAudioTime().then((timestamp) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### getBufferSize8+ @@ -4853,9 +4844,9 @@ Obtains a reasonable minimum buffer size in bytes for rendering. This API uses a **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ---------------------- | --------- | ---------------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return the buffer size. | +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | -------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the buffer size.| **Example** @@ -4865,7 +4856,6 @@ let bufferSize = audioRenderer.getBufferSize(async(err, bufferSize) => { console.error('getBufferSize error'); } }); - ``` ### getBufferSize8+ @@ -4878,9 +4868,9 @@ Obtains a reasonable minimum buffer size in bytes for rendering. This API uses a **Return value** -| Type | Description | -| ---------------- | --------------------------------------- | -| Promise\ | Promise used to return the buffer size. | +| Type | Description | +| ---------------- | --------------------------- | +| Promise\ | Promise used to return the buffer size.| **Example** @@ -4892,7 +4882,6 @@ audioRenderer.getBufferSize().then((data) => { }).catch((err) => { console.error(`AudioFrameworkRenderLog: getBufferSize: ERROR: ${err}`); }); - ``` ### setRenderRate8+ @@ -4905,10 +4894,10 @@ Sets the render rate. This API uses an asynchronous callback to return the resul **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ---------------------------------------- | --------- | ----------------------------------- | -| rate | [AudioRendererRate](#audiorendererrate8) | Yes | Audio render rate. | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | ---------------------------------------- | ---- | ------------------------ | +| rate | [AudioRendererRate](#audiorendererrate8) | Yes | Audio render rate. | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -4920,7 +4909,6 @@ audioRenderer.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL, (err) => console.info('Callback invoked to indicate a successful render rate setting.'); } }); - ``` ### setRenderRate8+ @@ -4933,15 +4921,15 @@ Sets the render rate. This API uses a promise to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| ---- | ---------------------------------------- | --------- | ------------------ | -| rate | [AudioRendererRate](#audiorendererrate8) | Yes | Audio render rate. | +| Name| Type | Mandatory| Description | +| ------ | ---------------------------------------- | ---- | ------------ | +| rate | [AudioRendererRate](#audiorendererrate8) | Yes | Audio render rate.| **Return value** -| Type | Description | -| -------------- | ---------------------------------- | -| Promise\ | Promise used to return the result. | +| Type | Description | +| -------------- | ------------------------- | +| Promise\ | Promise used to return the result.| **Example** @@ -4951,7 +4939,6 @@ audioRenderer.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL).then(() }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### getRenderRate8+ @@ -4964,9 +4951,9 @@ Obtains the current render rate. This API uses an asynchronous callback to retur **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ------------------------------------------------------- | --------- | ---------------------------------------------- | -| callback | AsyncCallback<[AudioRendererRate](#audiorendererrate8)> | Yes | Callback used to return the audio render rate. | +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------------------- | ---- | ------------------ | +| callback | AsyncCallback<[AudioRendererRate](#audiorendererrate8)> | Yes | Callback used to return the audio render rate.| **Example** @@ -4974,7 +4961,6 @@ Obtains the current render rate. This API uses an asynchronous callback to retur audioRenderer.getRenderRate((err, renderrate) => { console.info(`getRenderRate: ${renderrate}`); }); - ``` ### getRenderRate8+ @@ -4987,9 +4973,9 @@ Obtains the current render rate. This API uses a promise to return the result. **Return value** -| Type | Description | -| ------------------------------------------------- | --------------------------------------------- | -| Promise<[AudioRendererRate](#audiorendererrate8)> | Promise used to return the audio render rate. | +| Type | Description | +| ------------------------------------------------- | ------------------------- | +| Promise<[AudioRendererRate](#audiorendererrate8)> | Promise used to return the audio render rate.| **Example** @@ -4999,9 +4985,7 @@ audioRenderer.getRenderRate().then((renderRate) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` - ### setInterruptMode9+ setInterruptMode(mode: InterruptMode): Promise<void> @@ -5012,15 +4996,15 @@ Sets the audio interruption mode for the application. This API uses a promise to **Parameters** -| Name | Type | Mandatory | Description | -| ---- | -------------------------------- | --------- | ------------------------ | -| mode | [InterruptMode](#interruptmode9) | Yes | Audio interruption mode. | +| Name | Type | Mandatory | Description | +| ---------- | ---------------------------------- | ------ | ---------- | +| mode | [InterruptMode](#interruptmode9) | Yes | Audio interruption mode. | **Return value** -| Type | Description | -| ------------------- | ------------------------------------------------------------ | -| Promise<void> | Promise used to return the result. If the operation is successful, **undefined** is returned. Otherwise, **error** is returned. | +| Type | Description | +| ------------------- | ----------------------------- | +| Promise<void> | Promise used to return the result. If the operation is successful, **undefined** is returned. Otherwise, **error** is returned.| **Example** @@ -5031,9 +5015,7 @@ audioRenderer.setInterruptMode(mode).then(data=>{ }).catch((err) => { console.error(`setInterruptMode Fail: ${err}`); }); - ``` - ### setInterruptMode9+ setInterruptMode(mode: InterruptMode, callback: AsyncCallback\): void @@ -5044,10 +5026,10 @@ Sets the audio interruption mode for the application. This API uses an asynchron **Parameters** -| Name | Type | Mandatory | Description | -| -------- | -------------------------------- | --------- | ----------------------------------- | -| mode | [InterruptMode](#interruptmode9) | Yes | Audio interruption mode. | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| ------- | ----------------------------------- | ------ | -------------- | +|mode | [InterruptMode](#interruptmode9) | Yes | Audio interruption mode.| +|callback | AsyncCallback\ | Yes |Callback used to return the result.| **Example** @@ -5059,7 +5041,6 @@ audioRenderer.setInterruptMode(mode, (err, data)=>{ } console.info('setInterruptMode Success!'); }); - ``` ### setVolume9+ @@ -5072,15 +5053,15 @@ Sets the volume for the application. This API uses a promise to return the resul **Parameters** -| Name | Type | Mandatory | Description | -| ------ | ------ | --------- | ------------------------------------------------------------ | -| volume | number | Yes | Volume to set, which can be within the range from 0.0 to 1.0. | +| Name | Type | Mandatory | Description | +| ---------- | ------- | ------ | ------------------- | +| volume | number | Yes | Volume to set, which can be within the range from 0.0 to 1.0.| **Return value** -| Type | Description | -| ------------------- | ------------------------------------------------------------ | -| Promise<void> | Promise used to return the result. If the operation is successful, **undefined** is returned. Otherwise, **error** is returned. | +| Type | Description | +| ------------------- | ----------------------------- | +| Promise<void> | Promise used to return the result. If the operation is successful, **undefined** is returned. Otherwise, **error** is returned.| **Example** @@ -5090,9 +5071,7 @@ audioRenderer.setVolume(0.5).then(data=>{ }).catch((err) => { console.error(`setVolume Fail: ${err}`); }); - ``` - ### setVolume9+ setVolume(volume: number, callback: AsyncCallback\): void @@ -5103,10 +5082,10 @@ Sets the volume for the application. This API uses an asynchronous callback to r **Parameters** -| Name | Type | Mandatory | Description | -| -------- | -------------------- | --------- | ------------------------------------------------------------ | -| volume | number | Yes | Volume to set, which can be within the range from 0.0 to 1.0. | -| callback | AsyncCallback\ | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| ------- | -----------| ------ | ------------------- | +|volume | number | Yes | Volume to set, which can be within the range from 0.0 to 1.0.| +|callback | AsyncCallback\ | Yes |Callback used to return the result.| **Example** @@ -5117,7 +5096,6 @@ audioRenderer.setVolume(0.5, (err, data)=>{ } console.info('setVolume Success!'); }); - ``` ### on('audioInterrupt')9+ @@ -5132,18 +5110,18 @@ Same as [on('interrupt')](#oninterrupt), this API is used to listen for focus ch **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ---------------------------------------------- | --------- | ------------------------------------------------------------ | -| type | string | Yes | Event type. The value **'audioInterrupt'** means the audio interruption event, which is triggered when audio rendering is interrupted. | -| callback | Callback\<[InterruptEvent](#interruptevent9)\> | Yes | Callback used to return the audio interruption event. | +| Name | Type | Mandatory| Description | +| -------- | -------------------------------------------- | ---- | ------------------------------------------------------------ | +| type | string | Yes | Event type. The value **'audioInterrupt'** means the audio interruption event, which is triggered when audio rendering is interrupted.| +| callback | Callback\<[InterruptEvent](#interruptevent9)\> | Yes | Callback used to return the audio interruption event. | **Error codes** For details about the error codes, see [Audio Error Codes](../errorcodes/errorcode-audio.md). -| ID | Error Message | -| ------- | ------------------------------ | -| 6800101 | if input parameter value error | +| ID| Error Message| +| ------- | --------------------------------------------| +| 6800101 | if input parameter value error | **Example** @@ -5215,7 +5193,6 @@ async function onAudioInterrupt(){ } }); } - ``` ### on('markReach')8+ @@ -5228,11 +5205,11 @@ Subscribes to mark reached events. When the number of frames rendered reaches th **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :---------------- | :-------- | :----------------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'markReach'**. | -| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | -| callback | Callback\ | Yes | Callback invoked when the event is triggered. | +| Name | Type | Mandatory| Description | +| :------- | :----------------------- | :--- | :---------------------------------------- | +| type | string | Yes | Event type. The value is fixed at **'markReach'**.| +| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | +| callback | Callback\ | Yes | Callback invoked when the event is triggered. | **Example** @@ -5242,7 +5219,6 @@ audioRenderer.on('markReach', 1000, (position) => { console.info('ON Triggered successfully'); } }); - ``` @@ -5256,15 +5232,14 @@ Unsubscribes from mark reached events. **Parameters** -| Name | Type | Mandatory | Description | -| :--- | :----- | :-------- | :------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'markReach'**. | +| Name| Type | Mandatory| Description | +| :----- | :----- | :--- | :------------------------------------------------ | +| type | string | Yes | Event type. The value is fixed at **'markReach'**.| **Example** ```js audioRenderer.off('markReach'); - ``` ### on('periodReach') 8+ @@ -5277,11 +5252,11 @@ Subscribes to period reached events. When the number of frames rendered reaches **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :---------------- | :-------- | :----------------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'periodReach'**. | -| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | -| callback | Callback\ | Yes | Callback invoked when the event is triggered. | +| Name | Type | Mandatory| Description | +| :------- | :----------------------- | :--- | :------------------------------------------ | +| type | string | Yes | Event type. The value is fixed at **'periodReach'**.| +| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | +| callback | Callback\ | Yes | Callback invoked when the event is triggered. | **Example** @@ -5291,7 +5266,6 @@ audioRenderer.on('periodReach', 1000, (position) => { console.info('ON Triggered successfully'); } }); - ``` ### off('periodReach') 8+ @@ -5304,15 +5278,14 @@ Unsubscribes from period reached events. **Parameters** -| Name | Type | Mandatory | Description | -| :--- | :----- | :-------- | :--------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'periodReach'**. | +| Name| Type | Mandatory| Description | +| :----- | :----- | :--- | :-------------------------------------------------- | +| type | string | Yes | Event type. The value is fixed at **'periodReach'**.| **Example** ```js audioRenderer.off('periodReach') - ``` ### on('stateChange')8+ @@ -5325,10 +5298,10 @@ Subscribes to state change events. **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------------------------ | :-------- | :----------------------------------------------------------- | -| type | string | Yes | Event type. The value **stateChange** means the state change event. | -| callback | Callback\<[AudioState](#audiostate8)> | Yes | Callback used to return the state change. | +| Name | Type | Mandatory| Description | +| :------- | :------------------------- | :--- | :------------------------------------------ | +| type | string | Yes | Event type. The value **stateChange** means the state change event.| +| callback | Callback\<[AudioState](#audiostate8)> | Yes | Callback used to return the state change. | **Example** @@ -5341,7 +5314,6 @@ audioRenderer.on('stateChange', (state) => { console.info('audio renderer state is: STATE_RUNNING'); } }); - ``` ## AudioCapturer8+ @@ -5352,15 +5324,14 @@ Provides APIs for audio capture. Before calling any API in **AudioCapturer**, yo **System capability**: SystemCapability.Multimedia.Audio.Capturer -| Name | Type | Readable | Writable | Description | -| :----------------- | :------------------------- | :------- | :------- | :-------------------- | -| state8+ | [AudioState](#audiostate8) | Yes | No | Audio capturer state. | +| Name | Type | Readable| Writable| Description | +| :---- | :------------------------- | :--- | :--- | :--------------- | +| state8+ | [AudioState](#audiostate8) | Yes| No | Audio capturer state.| **Example** ```js let state = audioCapturer.state; - ``` ### getCapturerInfo8+ @@ -5373,9 +5344,9 @@ Obtains the capturer information of this **AudioCapturer** instance. This API us **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :-------------------------------- | :-------- | :------------------------------------------------ | -| callback | AsyncCallback | Yes | Callback used to return the capturer information. | +| Name | Type | Mandatory| Description | +| :------- | :-------------------------------- | :--- | :----------------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the capturer information.| **Example** @@ -5389,7 +5360,6 @@ audioCapturer.getCapturerInfo((err, capturerInfo) => { console.info(`Capturer flags: ${capturerInfo.capturerFlags}`); } }); - ``` @@ -5403,9 +5373,9 @@ Obtains the capturer information of this **AudioCapturer** instance. This API us **Return value** -| Type | Description | -| :------------------------------------------------ | :----------------------------------------------- | -| Promise<[AudioCapturerInfo](#audiocapturerinfo)\> | Promise used to return the capturer information. | +| Type | Description | +| :------------------------------------------------ | :---------------------------------- | +| Promise<[AudioCapturerInfo](#audiocapturerinfo)\> | Promise used to return the capturer information.| **Example** @@ -5422,7 +5392,6 @@ audioCapturer.getCapturerInfo().then((audioParamsGet) => { }).catch((err) => { console.error(`AudioFrameworkRecLog: CapturerInfo :ERROR: ${err}`); }); - ``` ### getStreamInfo8+ @@ -5435,9 +5404,9 @@ Obtains the stream information of this **AudioCapturer** instance. This API uses **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :--------------------------------------------------- | :-------- | :---------------------------------------------- | -| callback | AsyncCallback<[AudioStreamInfo](#audiostreaminfo8)\> | Yes | Callback used to return the stream information. | +| Name | Type | Mandatory| Description | +| :------- | :--------------------------------------------------- | :--- | :------------------------------- | +| callback | AsyncCallback<[AudioStreamInfo](#audiostreaminfo8)\> | Yes | Callback used to return the stream information.| **Example** @@ -5453,7 +5422,6 @@ audioCapturer.getStreamInfo((err, streamInfo) => { console.info(`Capturer encoding type: ${streamInfo.encodingType}`); } }); - ``` ### getStreamInfo8+ @@ -5466,9 +5434,9 @@ Obtains the stream information of this **AudioCapturer** instance. This API uses **Return value** -| Type | Description | -| :--------------------------------------------- | :--------------------------------------------- | -| Promise<[AudioStreamInfo](#audiostreaminfo8)\> | Promise used to return the stream information. | +| Type | Description | +| :--------------------------------------------- | :------------------------------ | +| Promise<[AudioStreamInfo](#audiostreaminfo8)\> | Promise used to return the stream information.| **Example** @@ -5482,7 +5450,6 @@ audioCapturer.getStreamInfo().then((audioParamsGet) => { }).catch((err) => { console.error(`getStreamInfo :ERROR: ${err}`); }); - ``` ### getAudioStreamId9+ @@ -5495,9 +5462,9 @@ Obtains the stream ID of this **AudioCapturer** instance. This API uses an async **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :--------------------- | :-------- | :------------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the stream ID. | +| Name | Type | Mandatory| Description | +| :------- | :--------------------------------------------------- | :--- | :------------------- | +| callback | AsyncCallback | Yes | Callback used to return the stream ID.| **Example** @@ -5505,7 +5472,6 @@ Obtains the stream ID of this **AudioCapturer** instance. This API uses an async audioCapturer.getAudioStreamId((err, streamid) => { console.info(`audioCapturer GetStreamId: ${streamid}`); }); - ``` ### getAudioStreamId9+ @@ -5518,9 +5484,9 @@ Obtains the stream ID of this **AudioCapturer** instance. This API uses a promis **Return value** -| Type | Description | -| :--------------- | :------------------------------------ | -| Promise | Promise used to return the stream ID. | +| Type | Description | +| :----------------| :--------------------- | +| Promise | Promise used to return the stream ID.| **Example** @@ -5530,7 +5496,6 @@ audioCapturer.getAudioStreamId().then((streamid) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); - ``` ### start8+ @@ -5543,9 +5508,9 @@ Starts capturing. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------- | :-------- | :---------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| :------- | :------------------- | :--- | :----------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the result.| **Example** @@ -5557,7 +5522,6 @@ audioCapturer.start((err) => { console.info('Capturer start success.'); } }); - ``` @@ -5571,9 +5535,9 @@ Starts capturing. This API uses a promise to return the result. **Return value** -| Type | Description | -| :------------- | :--------------------------------- | -| Promise | Promise used to return the result. | +| Type | Description | +| :------------- | :---------------------------- | +| Promise | Promise used to return the result.| **Example** @@ -5589,7 +5553,6 @@ audioCapturer.start().then(() => { }).catch((err) => { console.info(`AudioFrameworkRecLog: Capturer start :ERROR : ${err}`); }); - ``` ### stop8+ @@ -5602,9 +5565,9 @@ Stops capturing. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------- | :-------- | :---------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| :------- | :------------------- | :--- | :----------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the result.| **Example** @@ -5616,7 +5579,6 @@ audioCapturer.stop((err) => { console.info('Capturer stopped.'); } }); - ``` @@ -5630,9 +5592,9 @@ Stops capturing. This API uses a promise to return the result. **Return value** -| Type | Description | -| :------------- | :--------------------------------- | -| Promise | Promise used to return the result. | +| Type | Description | +| :------------- | :---------------------------- | +| Promise | Promise used to return the result.| **Example** @@ -5646,7 +5608,6 @@ audioCapturer.stop().then(() => { }).catch((err) => { console.info(`AudioFrameworkRecLog: Capturer stop: ERROR: ${err}`); }); - ``` ### release8+ @@ -5659,9 +5620,9 @@ Releases this **AudioCapturer** instance. This API uses an asynchronous callback **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------- | :-------- | :---------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| :------- | :------------------- | :--- | :---------------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the result.| **Example** @@ -5673,7 +5634,6 @@ audioCapturer.release((err) => { console.info('capturer released.'); } }); - ``` @@ -5687,9 +5647,9 @@ Releases this **AudioCapturer** instance. This API uses a promise to return the **Return value** -| Type | Description | -| :------------- | :--------------------------------- | -| Promise | Promise used to return the result. | +| Type | Description | +| :------------- | :---------------------------- | +| Promise | Promise used to return the result.| **Example** @@ -5703,7 +5663,6 @@ audioCapturer.release().then(() => { }).catch((err) => { console.info(`AudioFrameworkRecLog: Capturer stop: ERROR: ${err}`); }); - ``` ### read8+ @@ -5716,11 +5675,11 @@ Reads the buffer. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| :------------- | :-------------------------- | :-------- | :----------------------------------- | -| size | number | Yes | Number of bytes to read. | -| isBlockingRead | boolean | Yes | Whether to block the read operation. | -| callback | AsyncCallback | Yes | Callback used to return the buffer. | +| Name | Type | Mandatory| Description | +| :------------- | :-------------------------- | :--- | :------------------------------- | +| size | number | Yes | Number of bytes to read. | +| isBlockingRead | boolean | Yes | Whether to block the read operation. | +| callback | AsyncCallback | Yes | Callback used to return the buffer.| **Example** @@ -5737,7 +5696,6 @@ audioCapturer.read(bufferSize, true, async(err, buffer) => { console.info('Success in reading the buffer data'); } }); - ``` ### read8+ @@ -5750,16 +5708,16 @@ Reads the buffer. This API uses a promise to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| :------------- | :------ | :-------- | :----------------------------------- | -| size | number | Yes | Number of bytes to read. | -| isBlockingRead | boolean | Yes | Whether to block the read operation. | +| Name | Type | Mandatory| Description | +| :------------- | :------ | :--- | :--------------- | +| size | number | Yes | Number of bytes to read. | +| isBlockingRead | boolean | Yes | Whether to block the read operation.| **Return value** -| Type | Description | -| :-------------------- | :----------------------------------------------------------- | -| Promise | Promise used to return the result. If the operation is successful, the buffer data read is returned; otherwise, an error code is returned. | +| Type | Description | +| :-------------------- | :----------------------------------------------------- | +| Promise | Promise used to return the result. If the operation is successful, the buffer data read is returned; otherwise, an error code is returned.| **Example** @@ -5777,7 +5735,6 @@ audioCapturer.read(bufferSize, true).then((buffer) => { }).catch((err) => { console.info(`ERROR : ${err}`); }); - ``` ### getAudioTime8+ @@ -5790,9 +5747,9 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970). **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :--------------------- | :-------- | :---------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| :------- | :--------------------- | :--- | :----------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the result.| **Example** @@ -5800,7 +5757,6 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970). audioCapturer.getAudioTime((err, timestamp) => { console.info(`Current timestamp: ${timestamp}`); }); - ``` ### getAudioTime8+ @@ -5813,9 +5769,9 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970). **Return value** -| Type | Description | -| :--------------- | :------------------------------------ | -| Promise | Promise used to return the timestamp. | +| Type | Description | +| :--------------- | :---------------------------- | +| Promise | Promise used to return the timestamp.| **Example** @@ -5825,7 +5781,6 @@ audioCapturer.getAudioTime().then((audioTime) => { }).catch((err) => { console.info(`AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${err}`); }); - ``` ### getBufferSize8+ @@ -5838,9 +5793,9 @@ Obtains a reasonable minimum buffer size in bytes for capturing. This API uses a **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :--------------------- | :-------- | :--------------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the buffer size. | +| Name | Type | Mandatory| Description | +| :------- | :--------------------- | :--- | :----------------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the buffer size.| **Example** @@ -5855,7 +5810,6 @@ audioCapturer.getBufferSize((err, bufferSize) => { }); } }); - ``` ### getBufferSize8+ @@ -5868,9 +5822,9 @@ Obtains a reasonable minimum buffer size in bytes for capturing. This API uses a **Return value** -| Type | Description | -| :--------------- | :-------------------------------------- | -| Promise | Promise used to return the buffer size. | +| Type | Description | +| :--------------- | :---------------------------------- | +| Promise | Promise used to return the buffer size.| **Example** @@ -5882,14 +5836,13 @@ audioCapturer.getBufferSize().then((data) => { }).catch((err) => { console.info(`AudioFrameworkRecLog: getBufferSize :ERROR : ${err}`); }); - ``` ### on('audioInterrupt')10+ on(type: 'audioInterrupt', callback: Callback\): void -Subscribes to audio interruption events. This API uses a callback to get interrupt events. +Subscribes to audio interruption events. This API uses a callback to obtain interrupt events. Same as [on('interrupt')](#oninterrupt), this API is used to listen for focus changes. The **AudioCapturer** instance proactively gains the focus when the **start** event occurs and releases the focus when the **pause** or **stop** event occurs. Therefore, you do not need to request to gain or release the focus. @@ -5897,18 +5850,18 @@ Same as [on('interrupt')](#oninterrupt), this API is used to listen for focus ch **Parameters** -| Name | Type | Mandatory | Description | -| -------- | ---------------------------------------------- | --------- | ------------------------------------------------------------ | -| type | string | Yes | Event type. The value **'audioInterrupt'** means the audio interruption event, which is triggered when audio capturing is interrupted. | -| callback | Callback\<[InterruptEvent](#interruptevent9)\> | Yes | Callback used to return the audio interruption event. | +| Name | Type | Mandatory| Description | +| -------- | -------------------------------------------- | ---- | ------------------------------------------------------------ | +| type | string | Yes | Event type. The value **'audioInterrupt'** means the audio interruption event, which is triggered when audio capturing is interrupted.| +| callback | Callback\<[InterruptEvent](#interruptevent9)\> | Yes | Callback used to return the audio interruption event. | **Error codes** For details about the error codes, see [Audio Error Codes](../errorcodes/errorcode-audio.md). -| ID | Error Message | -| ------- | ------------------------------ | -| 6800101 | if input parameter value error | +| ID| Error Message| +| ------- | --------------------------------------------| +| 6800101 | if input parameter value error | **Example** @@ -5959,7 +5912,6 @@ async function onAudioInterrupt(){ } }); } - ``` @@ -5973,11 +5925,11 @@ Subscribes to mark reached events. When the number of frames captured reaches th **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :---------------- | :-------- | :----------------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'markReach'**. | -| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | -| callback | Callback\ | Yes | Callback invoked when the event is triggered. | +| Name | Type | Mandatory| Description | +| :------- | :---------------------- | :--- | :----------------------------------------- | +| type | string | Yes | Event type. The value is fixed at **'markReach'**. | +| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | +| callback | Callback\ | Yes | Callback invoked when the event is triggered.| **Example** @@ -5987,7 +5939,6 @@ audioCapturer.on('markReach', 1000, (position) => { console.info('ON Triggered successfully'); } }); - ``` ### off('markReach')8+ @@ -6000,15 +5951,14 @@ Unsubscribes from mark reached events. **Parameters** -| Name | Type | Mandatory | Description | -| :--- | :----- | :-------- | :------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'markReach'**. | +| Name| Type | Mandatory| Description | +| :----- | :----- | :--- | :-------------------------------------------- | +| type | string | Yes | Event type. The value is fixed at **'markReach'**.| **Example** ```js audioCapturer.off('markReach'); - ``` ### on('periodReach')8+ @@ -6021,11 +5971,11 @@ Subscribes to period reached events. When the number of frames captured reaches **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :---------------- | :-------- | :----------------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'periodReach'**. | -| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | -| callback | Callback\ | Yes | Callback invoked when the event is triggered. | +| Name | Type | Mandatory| Description | +| :------- | :----------------------- | :--- | :------------------------------------------ | +| type | string | Yes | Event type. The value is fixed at **'periodReach'**.| +| frame | number | Yes | Number of frames to trigger the event. The value must be greater than **0**. | +| callback | Callback\ | Yes | Callback invoked when the event is triggered. | **Example** @@ -6035,7 +5985,6 @@ audioCapturer.on('periodReach', 1000, (position) => { console.info('ON Triggered successfully'); } }); - ``` ### off('periodReach')8+ @@ -6048,15 +5997,14 @@ Unsubscribes from period reached events. **Parameters** -| Name | Type | Mandatory | Description | -| :--- | :----- | :-------- | :--------------------------------------------------- | -| type | string | Yes | Event type. The value is fixed at **'periodReach'**. | +| Name| Type | Mandatory| Description | +| :----- | :----- | :--- | :---------------------------------------------- | +| type | string | Yes | Event type. The value is fixed at **'periodReach'**.| **Example** ```js audioCapturer.off('periodReach') - ``` ### on('stateChange')8+ @@ -6069,10 +6017,10 @@ Subscribes to state change events. **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------------------------ | :-------- | :----------------------------------------------------------- | -| type | string | Yes | Event type. The value **stateChange** means the state change event. | -| callback | Callback\<[AudioState](#audiostate8)> | Yes | Callback used to return the state change. | +| Name | Type | Mandatory| Description | +| :------- | :------------------------- | :--- | :------------------------------------------ | +| type | string | Yes | Event type. The value **stateChange** means the state change event.| +| callback | Callback\<[AudioState](#audiostate8)> | Yes | Callback used to return the state change. | **Example** @@ -6085,7 +6033,6 @@ audioCapturer.on('stateChange', (state) => { console.info('audio capturer state is: STATE_RUNNING'); } }); - ``` ## ToneType9+ @@ -6096,35 +6043,35 @@ Enumerates the tone types of the player. **System capability**: SystemCapability.Multimedia.Audio.Tone -| Name | Value | Description | -| :----------------------------------------------- | :---- | :-------------------------------------------- | -| TONE_TYPE_DIAL_0 | 0 | DTMF tone of key 0. | -| TONE_TYPE_DIAL_1 | 1 | DTMF tone of key 1. | -| TONE_TYPE_DIAL_2 | 2 | DTMF tone of key 2. | -| TONE_TYPE_DIAL_3 | 3 | DTMF tone of key 3. | -| TONE_TYPE_DIAL_4 | 4 | DTMF tone of key 4. | -| TONE_TYPE_DIAL_5 | 5 | DTMF tone of key 5. | -| TONE_TYPE_DIAL_6 | 6 | DTMF tone of key 6. | -| TONE_TYPE_DIAL_7 | 7 | DTMF tone of key 7. | -| TONE_TYPE_DIAL_8 | 8 | DTMF tone of key 8. | -| TONE_TYPE_DIAL_9 | 9 | DTMF tone of key 9. | -| TONE_TYPE_DIAL_S | 10 | DTMF tone of the star key (*). | -| TONE_TYPE_DIAL_P | 11 | DTMF tone of the pound key (#). | -| TONE_TYPE_DIAL_A | 12 | DTMF tone of key A. | -| TONE_TYPE_DIAL_B | 13 | DTMF tone of key B. | -| TONE_TYPE_DIAL_C | 14 | DTMF tone of key C. | -| TONE_TYPE_DIAL_D | 15 | DTMF tone of key D. | -| TONE_TYPE_COMMON_SUPERVISORY_DIAL | 100 | Supervisory tone - dial tone. | -| TONE_TYPE_COMMON_SUPERVISORY_BUSY | 101 | Supervisory tone - busy. | -| TONE_TYPE_COMMON_SUPERVISORY_CONGESTION | 102 | Supervisory tone - congestion. | -| TONE_TYPE_COMMON_SUPERVISORY_RADIO_ACK | 103 | Supervisory tone - radio path acknowledgment. | -| TONE_TYPE_COMMON_SUPERVISORY_RADIO_NOT_AVAILABLE | 104 | Supervisory tone - radio path not available. | -| TONE_TYPE_COMMON_SUPERVISORY_CALL_WAITING | 106 | Supervisory tone - call waiting tone. | -| TONE_TYPE_COMMON_SUPERVISORY_RINGTONE | 107 | Supervisory tone - ringing tone. | -| TONE_TYPE_COMMON_PROPRIETARY_BEEP | 200 | Proprietary tone - beep tone. | -| TONE_TYPE_COMMON_PROPRIETARY_ACK | 201 | Proprietary tone - ACK. | -| TONE_TYPE_COMMON_PROPRIETARY_PROMPT | 203 | Proprietary tone - PROMPT. | -| TONE_TYPE_COMMON_PROPRIETARY_DOUBLE_BEEP | 204 | Proprietary tone - double beep tone. | +| Name | Value | Description | +| :------------------------------------------------ | :----- | :----------------------------| +| TONE_TYPE_DIAL_0 | 0 | DTMF tone of key 0. | +| TONE_TYPE_DIAL_1 | 1 | DTMF tone of key 1. | +| TONE_TYPE_DIAL_2 | 2 | DTMF tone of key 2. | +| TONE_TYPE_DIAL_3 | 3 | DTMF tone of key 3. | +| TONE_TYPE_DIAL_4 | 4 | DTMF tone of key 4. | +| TONE_TYPE_DIAL_5 | 5 | DTMF tone of key 5. | +| TONE_TYPE_DIAL_6 | 6 | DTMF tone of key 6. | +| TONE_TYPE_DIAL_7 | 7 | DTMF tone of key 7. | +| TONE_TYPE_DIAL_8 | 8 | DTMF tone of key 8. | +| TONE_TYPE_DIAL_9 | 9 | DTMF tone of key 9. | +| TONE_TYPE_DIAL_S | 10 | DTMF tone of the star key (*). | +| TONE_TYPE_DIAL_P | 11 | DTMF tone of the pound key (#). | +| TONE_TYPE_DIAL_A | 12 | DTMF tone of key A. | +| TONE_TYPE_DIAL_B | 13 | DTMF tone of key B. | +| TONE_TYPE_DIAL_C | 14 | DTMF tone of key C. | +| TONE_TYPE_DIAL_D | 15 | DTMF tone of key D. | +| TONE_TYPE_COMMON_SUPERVISORY_DIAL | 100 | Supervisory tone - dial tone. | +| TONE_TYPE_COMMON_SUPERVISORY_BUSY | 101 | Supervisory tone - busy. | +| TONE_TYPE_COMMON_SUPERVISORY_CONGESTION | 102 | Supervisory tone - congestion. | +| TONE_TYPE_COMMON_SUPERVISORY_RADIO_ACK | 103 | Supervisory tone - radio path acknowledgment. | +| TONE_TYPE_COMMON_SUPERVISORY_RADIO_NOT_AVAILABLE | 104 | Supervisory tone - radio path not available. | +| TONE_TYPE_COMMON_SUPERVISORY_CALL_WAITING | 106 | Supervisory tone - call waiting tone. | +| TONE_TYPE_COMMON_SUPERVISORY_RINGTONE | 107 | Supervisory tone - ringing tone. | +| TONE_TYPE_COMMON_PROPRIETARY_BEEP | 200 | Proprietary tone - beep tone. | +| TONE_TYPE_COMMON_PROPRIETARY_ACK | 201 | Proprietary tone - ACK. | +| TONE_TYPE_COMMON_PROPRIETARY_PROMPT | 203 | Proprietary tone - PROMPT. | +| TONE_TYPE_COMMON_PROPRIETARY_DOUBLE_BEEP | 204 | Proprietary tone - double beep tone. | ## TonePlayer9+ @@ -6144,10 +6091,10 @@ Loads the DTMF tone configuration. This API uses an asynchronous callback to ret **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :--------------------- | :-------- | :---------------------------------- | -| type | [ToneType](#tonetype9) | Yes | Tone type. | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory | Description | +| :--------------| :-------------------------- | :-----| :------------------------------ | +| type | [ToneType](#tonetype9) | Yes | Tone type. | +| callback | AsyncCallback | Yes | Callback used to return the result.| **Example** @@ -6160,7 +6107,6 @@ tonePlayer.load(audio.ToneType.TONE_TYPE_DIAL_5, (err) => { console.info('callback call load success'); } }); - ``` ### load9+ @@ -6175,15 +6121,15 @@ Loads the DTMF tone configuration. This API uses a promise to return the result. **Parameters** -| Name | Type | Mandatory | Description | -| :--- | :--------------------- | :-------- | ----------- | -| type | [ToneType](#tonetype9) | Yes | Tone type. | +| Name | Type | Mandatory | Description | +| :------------- | :--------------------- | :--- | ---------------- | +| type | [ToneType](#tonetype9) | Yes | Tone type. | **Return value** -| Type | Description | -| :------------- | :--------------------------------- | -| Promise | Promise used to return the result. | +| Type | Description | +| :--------------| :-------------------------- | +| Promise | Promise used to return the result.| **Example** @@ -6193,7 +6139,6 @@ tonePlayer.load(audio.ToneType.TONE_TYPE_DIAL_1).then(() => { }).catch(() => { console.error('promise call load fail'); }); - ``` ### start9+ @@ -6208,9 +6153,9 @@ Starts DTMF tone playing. This API uses an asynchronous callback to return the r **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------- | :-------- | :---------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| :------- | :------------------- | :--- | :----------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the result.| **Example** @@ -6223,7 +6168,6 @@ tonePlayer.start((err) => { console.info('callback call start success'); } }); - ``` ### start9+ @@ -6238,9 +6182,9 @@ Starts DTMF tone playing. This API uses a promise to return the result. **Return value** -| Type | Description | -| :------------- | :--------------------------------- | -| Promise | Promise used to return the result. | +| Type | Description | +| :------------- | :---------------------------- | +| Promise | Promise used to return the result.| **Example** @@ -6250,7 +6194,6 @@ tonePlayer.start().then(() => { }).catch(() => { console.error('promise call start fail'); }); - ``` ### stop9+ @@ -6265,9 +6208,9 @@ Stops the tone that is being played. This API uses an asynchronous callback to r **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------- | :-------- | :---------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| :------- | :------------------- | :--- | :----------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the result.| **Example** @@ -6280,7 +6223,6 @@ tonePlayer.stop((err) => { console.error('callback call stop success '); } }); - ``` ### stop9+ @@ -6295,9 +6237,9 @@ Stops the tone that is being played. This API uses a promise to return the resul **Return value** -| Type | Description | -| :------------- | :--------------------------------- | -| Promise | Promise used to return the result. | +| Type | Description | +| :------------- | :---------------------------- | +| Promise | Promise used to return the result.| **Example** @@ -6307,7 +6249,6 @@ tonePlayer.stop().then(() => { }).catch(() => { console.error('promise call stop fail'); }); - ``` ### release9+ @@ -6322,9 +6263,9 @@ Releases the resources associated with the **TonePlayer** instance. This API use **Parameters** -| Name | Type | Mandatory | Description | -| :------- | :------------------- | :-------- | :---------------------------------- | -| callback | AsyncCallback | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| :------- | :------------------- | :--- | :---------------------------- | +| callback | AsyncCallback | Yes | Callback used to return the result. | **Example** @@ -6337,7 +6278,6 @@ tonePlayer.release((err) => { console.info('callback call release success '); } }); - ``` ### release9+ @@ -6352,9 +6292,9 @@ Releases the resources associated with the **TonePlayer** instance. This API use **Return value** -| Type | Description | -| :------------- | :--------------------------------- | -| Promise | Promise used to return the result. | +| Type | Description | +| :------------- | :---------------------------- | +| Promise | Promise used to return the result.| **Example** @@ -6364,7 +6304,6 @@ tonePlayer.release().then(() => { }).catch(() => { console.error('promise call release fail'); }); - ``` ## ActiveDeviceType(deprecated) @@ -6377,10 +6316,10 @@ Enumerates the active device types. **System capability**: SystemCapability.Multimedia.Audio.Device -| Name | Value | Description | -| ------------- | ----- | ------------------------------------------------------------ | -| SPEAKER | 2 | Speaker. | -| BLUETOOTH_SCO | 7 | Bluetooth device using Synchronous Connection Oriented (SCO) links. | +| Name | Value | Description | +| ------------- | ------ | ---------------------------------------------------- | +| SPEAKER | 2 | Speaker. | +| BLUETOOTH_SCO | 7 | Bluetooth device using Synchronous Connection Oriented (SCO) links.| ## InterruptActionType(deprecated) @@ -6392,10 +6331,10 @@ Enumerates the returned event types for audio interruption events. **System capability**: SystemCapability.Multimedia.Audio.Renderer -| Name | Value | Description | -| -------------- | ----- | ------------------------- | -| TYPE_ACTIVATED | 0 | Focus gain event. | -| TYPE_INTERRUPT | 1 | Audio interruption event. | +| Name | Value | Description | +| -------------- | ------ | ------------------ | +| TYPE_ACTIVATED | 0 | Focus gain event.| +| TYPE_INTERRUPT | 1 | Audio interruption event.| ## AudioInterrupt(deprecated) @@ -6407,11 +6346,11 @@ Describes input parameters of audio interruption events. **System capability**: SystemCapability.Multimedia.Audio.Renderer -| Name | Type | Mandatory | Description | -| --------------- | --------------------------- | --------- | ------------------------------------------------------------ | -| streamUsage | [StreamUsage](#streamusage) | Yes | Audio stream usage. | -| contentType | [ContentType](#contenttype) | Yes | Audio content type. | -| pauseWhenDucked | boolean | Yes | Whether audio playback can be paused during audio interruption. The value **true** means that audio playback can be paused during audio interruption, and **false** means the opposite. | +| Name | Type | Mandatory| Description | +| --------------- | --------------------------- | ----| ------------------------------------------------------------ | +| streamUsage | [StreamUsage](#streamusage) | Yes | Audio stream usage. | +| contentType | [ContentType](#contenttype) | Yes | Audio content type. | +| pauseWhenDucked | boolean | Yes | Whether audio playback can be paused during audio interruption. The value **true** means that audio playback can be paused during audio interruption, and **false** means the opposite.| ## InterruptAction(deprecated) @@ -6423,9 +6362,9 @@ Describes the callback invoked for audio interruption or focus gain events. **System capability**: SystemCapability.Multimedia.Audio.Renderer -| Name | Type | Mandatory | Description | -| ---------- | ----------------------------------------------------- | --------- | ------------------------------------------------------------ | -| actionType | [InterruptActionType](#interruptactiontypedeprecated) | Yes | Returned event type. The value **TYPE_ACTIVATED** means the focus gain event, and **TYPE_INTERRUPT** means the audio interruption event. | -| type | [InterruptType](#interrupttype) | No | Type of the audio interruption event. | -| hint | [InterruptHint](#interrupthint) | No | Hint provided along with the audio interruption event. | -| activated | boolean | No | Whether the focus is gained or released. The value **true** means that the focus is gained or released, and **false** means that the focus fails to be gained or released. | \ No newline at end of file +| Name | Type | Mandatory| Description | +| ---------- | ------------------------------------------- | ---- | ------------------------------------------------------------ | +| actionType | [InterruptActionType](#interruptactiontypedeprecated) | Yes | Returned event type. The value **TYPE_ACTIVATED** means the focus gain event, and **TYPE_INTERRUPT** means the audio interruption event.| +| type | [InterruptType](#interrupttype) | No | Type of the audio interruption event. | +| hint | [InterruptHint](#interrupthint) | No | Hint provided along with the audio interruption event. | +| activated | boolean | No | Whether the focus is gained or released. The value **true** means that the focus is gained or released, and **false** means that the focus fails to be gained or released.| diff --git a/en/application-dev/reference/apis/js-apis-buffer.md b/en/application-dev/reference/apis/js-apis-buffer.md index 5a014e7cfe5618c7e31741b43d32ce743d86a0b2..737c9f1dbf05e30e2f84e185b89e804642b0c39f 100644 --- a/en/application-dev/reference/apis/js-apis-buffer.md +++ b/en/application-dev/reference/apis/js-apis-buffer.md @@ -726,7 +726,7 @@ Checks whether this **Buffer** instance contains the specified value. | -------- | -------- | -------- | -------- | | value | string \| number \| Buffer \| Uint8Array | Yes| Value to match.| | byteOffset | number | No| Number of bytes to skip before starting to check data. If the offset is a negative number, data is checked from the end of the **Buffer** instance. The default value is **0**.| -| encoding | [BufferEncoding](#bufferencoding) | No| Encoding format used if **value** is a string. The default value is **utf-8**.| +| encoding | [BufferEncoding](#bufferencoding) | No| Encoding format (valid only when **value** is a string). The default value is **utf-8**.| **Return value** @@ -758,7 +758,7 @@ Obtains the index of the first occurrence of the specified value in this **Buffe | -------- | -------- | -------- | -------- | | value | string \| number \| Buffer \| Uint8Array | Yes| Value to match.| | byteOffset | number | No| Number of bytes to skip before starting to check data. If the offset is a negative number, data is checked from the end of the **Buffer** instance. The default value is **0**.| -| encoding | [BufferEncoding](#bufferencoding) | No| Encoding format used if **value** is a string. The default value is **utf-8**.| +| encoding | [BufferEncoding](#bufferencoding) | No| Encoding format (valid only when **value** is a string). The default value is **utf-8**.| **Return value** @@ -815,7 +815,7 @@ Obtains the index of the last occurrence of the specified value in this **Buffer | -------- | -------- | -------- | -------- | | value | string \| number \| Buffer \| Uint8Array | Yes| Value to match.| | byteOffset | number | No| Number of bytes to skip before starting to check data. If the offset is a negative number, data is checked from the end of the **Buffer** instance. The default value is **0**.| -| encoding | [BufferEncoding](#bufferencoding) | No| Encoding format used if **value** is a string. The default value is **utf-8**.| +| encoding | [BufferEncoding](#bufferencoding) | No| Encoding format (valid only when **value** is a string). The default value is **utf-8**.| **Return value** @@ -838,7 +838,7 @@ console.log(buf.lastIndexOf('buffer').toString()); // Print: 17 readBigInt64BE(offset?: number): bigint -Reads a signed, big-endian 64-bit big integer from this **Buffer** instance at the specified offset. +Reads a 64-bit, big-endian, signed big integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -872,14 +872,14 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, console.log(buf.readBigInt64BE(0).toString()); let buf1 = buffer.allocUninitializedFromPool(8); -let result = buf1.writeBigInt64BE(0x0102030405060708n, 0); +let result = buf1.writeBigInt64BE(BigInt(0x0102030405060708), 0); ``` ### readBigInt64LE readBigInt64LE(offset?: number): bigint -Reads a signed, little-endian 64-bit big integer from this **Buffer** instance at the specified offset. +Reads a 64-bit, little-endian, signed big integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -913,14 +913,14 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, console.log(buf.readBigInt64LE(0).toString()); let buf1 = buffer.allocUninitializedFromPool(8); -let result = buf1.writeBigInt64BE(0x0102030405060708n, 0); +let result = buf1.writeBigInt64BE(BigInt(0x0102030405060708), 0); ``` ### readBigUInt64BE readBigUInt64BE(offset?: number): bigint -Reads an unsigned, big-endian 64-bit big integer from this **Buffer** instance at the specified offset. +Reads a 64-bit, big-endian, unsigned big integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -954,14 +954,14 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, console.log(buf.readBigUInt64BE(0).toString()); let buf1 = buffer.allocUninitializedFromPool(8); -let result = buf1.writeBigUInt64BE(0xdecafafecacefaden, 0); +let result = buf1.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0); ``` ### readBigUInt64LE readBigUInt64LE(offset?: number): bigint -Reads an unsigned, little-endian 64-bit big integer from this **Buffer** instance at the specified offset. +Reads a 64-bit, little-endian, unsigned big integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -995,14 +995,14 @@ let buf = buffer.from([0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, console.log(buf.readBigUInt64LE(0).toString()); let buf1 = buffer.allocUninitializedFromPool(8); -let result = buf1.writeBigUInt64BE(0xdecafafecacefaden, 0); +let result = buf1.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0); ``` ### readDoubleBE readDoubleBE(offset?: number): number -Reads a 64-bit, big-endian floating-point number from this **Buffer** instance at the specified offset. +Reads a 64-bit, big-endian, double-precision floating-point number from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1042,7 +1042,7 @@ let result = buf1.writeDoubleBE(123.456, 0); readDoubleLE(offset?: number): number -Reads a 64-bit, little-endian floating-point number from this **Buffer** instance at the specified offset. +Reads a 64-bit, little-endian, double-precision floating-point number from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1082,7 +1082,7 @@ let result = buf1.writeDoubleLE(123.456, 0); readFloatBE(offset?: number): number -Reads a 32-bit, big-endian floating-point number from this **Buffer** instance at the specified offset. +Reads a 32-bit, big-endian, single-precision floating-point number from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1122,7 +1122,7 @@ let result = buf1.writeFloatBE(0xcabcbcbc, 0); readFloatLE(offset?: number): number -Reads a 32-bit, little-endian floating-point number from this **Buffer** instance at the specified offset. +Reads a 32-bit, little-endian, single-precision floating-point number from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1162,7 +1162,7 @@ let result = buf1.writeFloatLE(0xcabcbcbc, 0); readInt8(offset?: number): number -Reads a signed 8-bit integer from this **Buffer** instance at the specified offset. +Reads a 8-bit signed integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1203,7 +1203,7 @@ let result = buf1.writeInt8(0x12); readInt16BE(offset?: number): number -Reads a signed, big-endian 16-bit integer from this **Buffer** instance at the specified offset. +Reads a 16-bit, big-endian, signed integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1243,7 +1243,7 @@ let result = buf1.writeInt16BE(0x1234, 0); readInt16LE(offset?: number): number -Reads a signed, little-endian 16-bit integer from this **Buffer** instance at the specified offset. +Reads a 16-bit, little-endian, signed integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1283,7 +1283,7 @@ let result = buf1.writeInt16BE(0x1234, 0); readInt32BE(offset?: number): number -Reads a signed, big-endian 32-bit integer from this **Buffer** instance at the specified offset. +Reads a 32-bit, big-endian, signed integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1323,7 +1323,7 @@ let result = buf1.writeInt32BE(0x12345678, 0); readInt32LE(offset?: number): number -Reads a signed, little-endian 32-bit integer from this **Buffer** instance at the specified offset. +Reads a 32-bit, little-endian, signed integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1449,7 +1449,7 @@ let result = buf1.writeIntLE(0x123456789011, 0, 6); readUInt8(offset?: number): number -Reads an unsigned 8-bit integer from this **Buffer** instance at the specified offset. +Reads a 8-bit unsigned integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1491,7 +1491,7 @@ let result = buf1.writeUInt8(0x42); readUInt16BE(offset?: number): number -Reads an unsigned, big-endian 16-bit integer from this **Buffer** instance at the specified offset. +Reads a 16-bit, big-endian, unsigned integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1533,7 +1533,7 @@ let result = buf1.writeUInt16BE(0x1234, 0); readUInt16LE(offset?: number): number -Reads an unsigned, little-endian 16-bit integer from this **Buffer** instance at the specified offset. +Reads a 16-bit, little-endian, unsigned integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1575,7 +1575,7 @@ let result = buf1.writeUInt16LE(0x1234, 0); readUInt32BE(offset?: number): number -Reads an unsigned, big-endian 32-bit integer from this **Buffer** instance at the specified offset. +Reads a 32-bit, big-endian, unsigned integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -1616,7 +1616,7 @@ let result = buf1.writeUInt32BE(0x12345678, 0); readUInt32LE(offset?: number): number -Reads an unsigned, little-endian 32-bit integer from this **Buffer** instance at the specified offset. +Reads a 32-bit, little-endian, unsigned integer from this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2013,7 +2013,7 @@ let length = buffer1.write('abcd', 8); writeBigInt64BE(value: bigint, offset?: number): number -Writes a signed, big-endian 64-bit Big integer to this **Buffer** instance at the specified offset. +Writes a 64-bit, big-endian, signed big integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2045,14 +2045,14 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco import buffer from '@ohos.buffer'; let buf = buffer.allocUninitializedFromPool(8); -let result = buf.writeBigInt64BE(0x0102030405060708n, 0); +let result = buf.writeBigInt64BE(BigInt(0x0102030405060708), 0); ``` ### writeBigInt64LE writeBigInt64LE(value: bigint, offset?: number): number -Writes a signed, little-endian 64-bit Big integer to this **Buffer** instance at the specified offset. +Writes a 64-bit, little-endian, signed big integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2084,14 +2084,14 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco import buffer from '@ohos.buffer'; let buf = buffer.allocUninitializedFromPool(8); -let result = buf.writeBigInt64LE(0x0102030405060708n, 0); +let result = buf.writeBigInt64LE(BigInt(0x0102030405060708), 0); ``` ### writeBigUInt64BE writeBigUInt64BE(value: bigint, offset?: number): number -Writes an unsigned, big-endian 64-bit Big integer to this **Buffer** instance at the specified offset. +Writes a 64-bit, big-endian, unsigned big integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2123,14 +2123,14 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco import buffer from '@ohos.buffer'; let buf = buffer.allocUninitializedFromPool(8); -let result = buf.writeBigUInt64BE(0xdecafafecacefaden, 0); +let result = buf.writeBigUInt64BE(BigInt(0xdecafafecacefade), 0); ``` ### writeBigUInt64LE writeBigUInt64LE(value: bigint, offset?: number): number -Writes an unsigned, little-endian 64-bit Big integer to this **Buffer** instance at the specified offset. +Writes a 64-bit, little-endian, unsigned big integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2162,14 +2162,14 @@ For details about the error codes, see [Utils Error Codes](../errorcodes/errorco import buffer from '@ohos.buffer'; let buf = buffer.allocUninitializedFromPool(8); -let result = buf.writeBigUInt64LE(0xdecafafecacefaden, 0); +let result = buf.writeBigUInt64LE(BigInt(0xdecafafecacefade), 0); ``` ### writeDoubleBE writeDoubleBE(value: number, offset?: number): number -Writes a big-endian double-precision floating-point number to this **Buffer** instance at the specified offset. +Writes a 64-bit, big-endian, double-precision floating-point number to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2208,7 +2208,7 @@ let result = buf.writeDoubleBE(123.456, 0); writeDoubleLE(value: number, offset?: number): number -Writes a little-endian double-precision floating-point number to this **Buffer** instance at the specified offset. +Writes a 64-bit, little-endian, double-precision floating-point number to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2247,7 +2247,7 @@ let result = buf.writeDoubleLE(123.456, 0); writeFloatBE(value: number, offset?: number): number -Writes a big-endian single-precision floating-point number to this **Buffer** instance at the specified offset. +Writes a 32-bit, big-endian, single-precision floating-point number to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2287,7 +2287,7 @@ let result = buf.writeFloatBE(0xcafebabe, 0); writeFloatLE(value: number, offset?: number): number -Writes a little-endian single-precision floating-point number to this **Buffer** instance at the specified offset. +Writes a 32-bit, little-endian, single-precision floating-point number to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2326,7 +2326,7 @@ let result = buf.writeFloatLE(0xcafebabe, 0); writeInt8(value: number, offset?: number): number -Writes a signed 8-bit integer to this **Buffer** instance at the specified offset. +Writes a 8-bit signed integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2367,7 +2367,7 @@ let result1 = buf.writeInt8(-2, 1); writeInt16BE(value: number, offset?: number): number -Writes a signed, big-endian 16-bit integer to this **Buffer** instance at the specified offset. +Writes a 16-bit, big-endian, signed integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2407,7 +2407,7 @@ let result = buf.writeInt16BE(0x0102, 0); writeInt16LE(value: number, offset?: number): number -Writes a signed, little-endian 16-bit integer to this **Buffer** instance at the specified offset. +Writes a 16-bit, little-endian, signed integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2446,7 +2446,7 @@ let result = buf.writeInt16LE(0x0304, 0); writeInt32BE(value: number, offset?: number): number -Writes a signed, big-endian 32-bit integer to this **Buffer** instance at the specified offset. +Writes a 32-bit, big-endian, signed integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2486,7 +2486,7 @@ let result = buf.writeInt32BE(0x01020304, 0); writeInt32LE(value: number, offset?: number): number -Writes a signed, little-endian 32-bit integer to this **Buffer** instance at the specified offset. +Writes a 32-bit, little-endian, signed integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2606,7 +2606,7 @@ let result = buf.writeIntLE(0x1234567890ab, 0, 6); writeUInt8(value: number, offset?: number): number -Writes an unsigned 8-bit integer to this **Buffer** instance at the specified offset. +Writes a 8-bit unsigned integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2648,7 +2648,7 @@ let result3 = buf.writeUInt8(0x42, 3); writeUInt16BE(value: number, offset?: number): number -Writes an unsigned, big-endian 16-bit integer to this **Buffer** instance at the specified offset. +Writes a 16-bit, big-endian, unsigned integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2688,7 +2688,7 @@ let result1 = buf.writeUInt16BE(0xbeef, 2); writeUInt16LE(value: number, offset?: number): number -Writes an unsigned, little-endian 16-bit integer to this **Buffer** instance at the specified offset. +Writes a 16-bit, little-endian, unsigned integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2728,7 +2728,7 @@ let result1 = buf.writeUInt16LE(0xbeef, 2); writeUInt32BE(value: number, offset?: number): number -Writes an unsigned, big-endian 32-bit integer to this **Buffer** instance at the specified offset. +Writes a 32-bit, big-endian, unsigned integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang @@ -2767,7 +2767,7 @@ let result = buf.writeUInt32BE(0xfeedface, 0); writeUInt32LE(value: number, offset?: number): number -Writes an unsigned, little-endian 32-bit integer to this **Buffer** instance at the specified offset. +Writes a 32-bit, little-endian, unsigned integer to this **Buffer** instance at the specified offset. **System capability**: SystemCapability.Utils.Lang diff --git a/en/application-dev/reference/apis/js-apis-bundleManager.md b/en/application-dev/reference/apis/js-apis-bundleManager.md index 7962d8ae77ab77dc1bba0d72b4418d3da2f867a2..a4d1dab714b0b5f632b020d0b57d6c788b48d8b7 100644 --- a/en/application-dev/reference/apis/js-apis-bundleManager.md +++ b/en/application-dev/reference/apis/js-apis-bundleManager.md @@ -113,6 +113,7 @@ Enumerates the types of Extension abilities. | THUMBNAIL | 13 | ThumbnailExtensionAbility: provides thumbnails for files. This ability is reserved.| | PREVIEW | 14 | PreviewExtensionAbility: provides APIs for file preview so that other applications can be embedded and displayed in the current application. This ability is reserved.| | PRINT10+ | 15 | PrintExtensionAbility: provides APIs for printing images. Printing documents is not supported yet.| +| PUSH10+ | 17 | **PushExtensionAbility**: provides APIs for pushing scenario-specific messages. This ability is reserved.| | DRIVER10+ | 18 | DriverExtensionAbility: provides APIs for the peripheral driver. This type of ability is not supported yet.| | UNSPECIFIED | 255 | No type is specified. It is used together with **queryExtensionAbilityInfo** to query all types of Extension abilities.| diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md index 106aa2ecdcea58b97966a46e1f4ea38bcb2432eb..b8d4e4b54a0d34826962b8d3d66b5e7f1b30be13 100644 --- a/en/application-dev/reference/apis/js-apis-camera.md +++ b/en/application-dev/reference/apis/js-apis-camera.md @@ -550,7 +550,7 @@ Listens for camera status changes. This API uses an asynchronous callback to ret **Example** ```js -cameraManager.on('cameraStatus', (cameraStatusInfo) => { +cameraManager.on('cameraStatus', (err, cameraStatusInfo) => { console.log(`camera : ${cameraStatusInfo.camera.cameraId}`); console.log(`status: ${cameraStatusInfo.status}`); }) @@ -1679,7 +1679,7 @@ The coordinate system is based on the horizontal device direction with the devic | Name | Type | Mandatory| Description | | ------------- | -------------------------------| ---- | ------------------- | -| exposurePoint | [Point](#point) | Yes | Exposure point. | +| exposurePoint | [Point](#point) | Yes | Metering point. The value range of x and y must be within [0,1]. If a value less than 0 is passed, the value **0** is used. If a value greater than **1** is passed, the value **1** is used. | **Return value** @@ -1754,7 +1754,7 @@ Before the setting, you are advised to use **[getExposureBiasRange](#getexposure | Name | Type | Mandatory| Description | | -------- | -------------------------------| ---- | ------------------- | -| exposureBias | number | Yes | Exposure bias to set, which must be within the range obtained by running **getExposureBiasRange** interface. If the API call fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned.| +| exposureBias | number | Yes | EV. The supported EV range can be obtained by calling **getExposureBiasRange**. If calling the API fails, an error code defined in [CameraErrorCode](#cameraerrorcode) will be returned. If the value passed is not within the supported range, the nearest critical point is used.| **Error codes** @@ -1936,7 +1936,7 @@ The coordinate system is based on the horizontal device direction with the devic | Name | Type | Mandatory| Description | | -------- | ----------------------- | ---- | ------------------- | -| Point1 | [Point](#point) | Yes | Focal point. | +| Point1 | [Point](#point) | Yes | Focal point. The value range of x and y must be within [0,1]. If a value less than 0 is passed, the value **0** is used. If a value greater than **1** is passed, the value **1** is used. | **Return value** @@ -2075,7 +2075,7 @@ Sets a zoom ratio, with a maximum precision of two decimal places. | Name | Type | Mandatory| Description | | --------- | -------------------- | ---- | ------------------- | -| zoomRatio | number | Yes | Zoom ratio. You can use **getZoomRatioRange** to obtain the supported values.| +| zoomRatio | number | Yes | Zoom ratio. The supported zoom ratio range can be obtained by calling **getZoomRatioRange**. If the value passed is not within the supported range, the nearest critical point is used.| **Return value** @@ -2735,7 +2735,7 @@ Captures a photo with the specified shooting parameters. This API uses a promise | Name | Type | Mandatory| Description | | ------- | ------------------------------------------- | ---- | -------- | -| setting | [PhotoCaptureSetting](#photocapturesetting) | No | Shooting settings.| +| setting | [PhotoCaptureSetting](#photocapturesetting) | No | Shooting parameters. The input of **undefined** is processed as if no parameters were passed.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-commonEvent.md b/en/application-dev/reference/apis/js-apis-commonEvent.md index 1496c18abf062e412dcc36368d046992b7f95c69..5a4af7f39f321fc486a4e359b567666dc359135a 100644 --- a/en/application-dev/reference/apis/js-apis-commonEvent.md +++ b/en/application-dev/reference/apis/js-apis-commonEvent.md @@ -3,6 +3,7 @@ The **CommonEvent** module provides common event capabilities, including the capabilities to publish, subscribe to, and unsubscribe from common events, as well obtaining and setting the common event result code and result data. > **NOTE** +> > - The APIs provided by this module are no longer maintained since API version 9. You are advised to use [@ohos.commonEventManager](js-apis-commonEventManager.md). > > - 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. @@ -19,14 +20,16 @@ A system common event is an event that is published by a system service or syste For details about the definitions of all system common events, see [System Common Events](./commonEvent-definitions.md). -## CommonEvent.publish +## CommonEvent.publish(deprecated) -```ts -publish(event: string, callback: AsyncCallback): void -``` +publish(event: string, callback: AsyncCallback\): void Publishes a common event. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [commonEventManager.publish](js-apis-commonEventManager.md#commoneventmanagerpublish) instead. + **System capability**: SystemCapability.Notification.CommonEvent **Parameters** @@ -52,14 +55,16 @@ function publishCB(err) { CommonEvent.publish("event", publishCB); ``` -## CommonEvent.publish +## CommonEvent.publish(deprecated) -```ts -publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void -``` +publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\): void Publishes a common event with given attributes. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [commonEventManager.publish](js-apis-commonEventManager.md#commoneventmanagerpublish-1) instead. + **System capability**: SystemCapability.Notification.CommonEvent **Parameters** @@ -68,7 +73,7 @@ Publishes a common event with given attributes. This API uses an asynchronous ca | -------- | ---------------------- | ---- | ---------------------- | | event | string | Yes | Name of the common event to publish. | | options | [CommonEventPublishData](./js-apis-inner-commonEvent-commonEventPublishData.md) | Yes | Attributes of the common event to publish.| -| callback | syncCallback\ | Yes | Callback used to return the result. | +| callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -94,14 +99,16 @@ function publishCB(err) { CommonEvent.publish("event", options, publishCB); ``` -## CommonEvent.publishAsUser8+ +## CommonEvent.publishAsUser(deprecated) -```ts -publishAsUser(event: string, userId: number, callback: AsyncCallback): void -``` +publishAsUser(event: string, userId: number, callback: AsyncCallback\): void Publishes a common event to a specific user. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [commonEventManager.publishAsUser](js-apis-commonEventManager.md#commoneventmanagerpublishasuser) instead. + **System capability**: SystemCapability.Notification.CommonEvent **System API**: This is a system API and cannot be called by third-party applications. @@ -133,14 +140,16 @@ let userId = 100; CommonEvent.publishAsUser("event", userId, publishCB); ``` -## CommonEvent.publishAsUser8+ +## CommonEvent.publishAsUser(deprecated) -```ts -publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback): void -``` +publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback\): void Publishes a common event with given attributes to a specific user. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [commonEventManager.publishAsUser](js-apis-commonEventManager.md#commoneventmanagerpublishasuser-1) instead. + **System capability**: SystemCapability.Notification.CommonEvent **System API**: This is a system API and cannot be called by third-party applications. @@ -180,14 +189,16 @@ let userId = 100; CommonEvent.publishAsUser("event", userId, options, publishCB); ``` -## CommonEvent.createSubscriber +## CommonEvent.createSubscriber(deprecated) -```ts -createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void -``` +createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback\): void Creates a subscriber. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [commonEventManager.createSubscriber](js-apis-commonEventManager.md#commoneventmanagercreatesubscriber) instead. + **System capability**: SystemCapability.Notification.CommonEvent **Parameters** @@ -222,14 +233,16 @@ function createCB(err, commonEventSubscriber) { CommonEvent.createSubscriber(subscribeInfo, createCB); ``` -## CommonEvent.createSubscriber +## CommonEvent.createSubscriber(deprecated) -```ts -createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise -``` +createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise\ Creates a subscriber. This API uses a promise to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [commonEventManager.createSubscriber](js-apis-commonEventManager.md#commoneventmanagercreatesubscriber-1) instead. + **System capability**: SystemCapability.Notification.CommonEvent **Parameters** @@ -262,14 +275,16 @@ CommonEvent.createSubscriber(subscribeInfo).then((commonEventSubscriber) => { }); ``` -## CommonEvent.subscribe +## CommonEvent.subscribe(deprecated) -```ts -subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void -``` +subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback\): void Subscribes to common events. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [commonEventManager.subscribe](js-apis-commonEventManager.md#commoneventmanagersubscribe) instead. + **System capability**: SystemCapability.Notification.CommonEvent **Parameters** @@ -314,14 +329,16 @@ function createCB(err, commonEventSubscriber) { CommonEvent.createSubscriber(subscribeInfo, createCB); ``` -## CommonEvent.unsubscribe +## CommonEvent.unsubscribe(deprecated) -```ts -unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback): void -``` +unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback\): void Unsubscribes from common events. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [commonEventManager.subscribe](js-apis-commonEventManager.md#commoneventmanagerunsubscribe) instead. + **System capability**: SystemCapability.Notification.CommonEvent **Parameters** diff --git a/en/application-dev/reference/apis/js-apis-commonEventManager.md b/en/application-dev/reference/apis/js-apis-commonEventManager.md index 292df5cbe51d1b257f37fc42d99b17f7d08ad813..61d22613c35ceb0556ab66748f635c3e92c7b412 100644 --- a/en/application-dev/reference/apis/js-apis-commonEventManager.md +++ b/en/application-dev/reference/apis/js-apis-commonEventManager.md @@ -39,7 +39,6 @@ Publishes a common event and executes an asynchronous callback after the event i | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1500004 | not System services. | | 1500007 | error sending message to Common Event Service. | | 1500008 | Common Event Service does not complete initialization. | @@ -87,7 +86,6 @@ Publishes a common event with given attributes. This API uses an asynchronous ca | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1500004 | not System services. | | 1500007 | error sending message to Common Event Service. | | 1500008 | Common Event Service does not complete initialization. | @@ -144,8 +142,6 @@ Publishes a common event to a specific user. This API uses an asynchronous callb | ID| Error Message | | -------- | ----------------------------------- | -| 202 | not system app. | -| 401 | The parameter check failed. | | 1500004 | not System services. | | 1500007 | error sending message to Common Event Service. | | 1500008 | Common Event Service does not complete initialization. | @@ -199,9 +195,7 @@ Publishes a common event with given attributes to a specific user. This API uses | ID| Error Message | | -------- | ----------------------------------- | -| 202 | not system app. | -| 401 | The parameter check failed. | -| 1500004 | not System services. | +| 1500004 | not System services or System app. | | 1500007 | error sending message to Common Event Service. | | 1500008 | Common Event Service does not complete initialization. | | 1500009 | error obtaining system parameters. | @@ -251,17 +245,8 @@ Creates a subscriber. This API uses an asynchronous callback to return the resul | subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | Yes | Subscriber information. | | callback | AsyncCallback\<[CommonEventSubscriber](./js-apis-inner-commonEvent-commonEventSubscriber.md)> | Yes | Callback used to return the result.| -**Error codes** - - For details about the error codes, see [Event Error Codes](../errorcodes/errorcode-CommonEventService.md). - -| ID| Error Message | -| -------- | ----------------------------------- | -| 401 | The parameter check failed. | - **Example** - ```ts let subscriber; // Used to save the created subscriber object for subsequent subscription and unsubscription. @@ -307,14 +292,6 @@ Creates a subscriber. This API uses a promise to return the result. | --------------------------------------------------------- | ---------------- | | Promise\<[CommonEventSubscriber](./js-apis-inner-commonEvent-commonEventSubscriber.md)> | Promise used to return the subscriber object.| -**Error codes** - - For details about the error codes, see [Event Error Codes](../errorcodes/errorcode-CommonEventService.md). - -| ID| Error Message | -| -------- | ----------------------------------- | -| 401 | The parameter check failed. | - **Example** ```ts @@ -356,7 +333,6 @@ Subscribes to common events. This API uses an asynchronous callback to return th | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 801 | capability not supported. | | 1500007 | error sending message to Common Event Service. | | 1500008 | Common Event Service does not complete initialization. | @@ -426,7 +402,6 @@ Unsubscribes from common events. This API uses an asynchronous callback to retur | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 801 | capability not supported. | | 1500007 | error sending message to Common Event Service. | | 1500008 | Common Event Service does not complete initialization. | @@ -495,6 +470,8 @@ Removes a sticky common event. This API uses an asynchronous callback to return **Required permissions**: ohos.permission.COMMONEVENT_STICKY +**System API**: This is a system API and cannot be called by third-party applications. + **Parameters** | Name | Type | Mandatory| Description | @@ -508,12 +485,9 @@ Removes a sticky common event. This API uses an asynchronous callback to return | ID| Error Message | | -------- | ----------------------------------- | -| 201 | The application dose not have permission to call the interface. | -| 202 | not system app. | -| 401 | The parameter check failed. | | 1500004 | not system service. | -| 1500007 | The message send error. | -| 1500008 | The CEMS error. | +| 1500007 | error sending message to Common Event Service. | +| 1500008 | Common Event Service does not complete initialization. | **Example** @@ -525,7 +499,6 @@ CommonEventManager.removeStickyCommonEvent("sticky_event", (err) => { return; } console.info(`Remove sticky event AsyncCallback success`); - } }); ``` @@ -539,6 +512,8 @@ Removes a sticky common event. This API uses a promise to return the result. **Required permissions**: ohos.permission.COMMONEVENT_STICKY +**System API**: This is a system API and cannot be called by third-party applications. + **Parameters** | Name| Type | Mandatory| Description | @@ -557,20 +532,102 @@ Removes a sticky common event. This API uses a promise to return the result. | ID| Error Message | | -------- | ----------------------------------- | -| 201 | The application dose not have permission to call the interface. | -| 202 | not system app. | -| 401 | The parameter check failed. | | 1500004 | not system service. | -| 1500007 | The message send error. | -| 1500008 | The CEMS error. | +| 1500007 | error sending message to Common Event Service. | +| 1500008 | Common Event Service does not complete initialization. | **Example** ```ts -commonEventManager.removeStickyCommonEvent("sticky_event").then(() => { +CommonEventManager.removeStickyCommonEvent("sticky_event").then(() => { console.info(`Remove sticky event AsyncCallback success`); }).catch ((err) => { console.info(`Remove sticky event AsyncCallback failed, errCode: ${err.code}, errMes: ${err.message}`); }); ``` + +## CommonEventManager.setStaticSubscriberState10+ + +setStaticSubscriberState(enable: boolean, callback: AsyncCallback\): void; + +Enables or disables static subscription for the current application. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Notification.CommonEvent + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | -------------------------- | +| enable | boolean | Yes | Whether static subscription is enabled.
**true**: enabled.
**false**: disabled.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| + +**Error codes** + + For details about the error codes, see [Event Error Codes](../errorcodes/errorcode-CommonEventService.md). + +| ID| Error Message | +| -------- | ----------------------------------- | +| 1500007 | error sending message to Common Event Service. | +| 1500008 | Common Event Service does not complete initialization. | + +**Example** + + +```ts +CommonEventManager.setStaticSubscriberState(true, (err) => { + if (!err) { + console.info(`Set static subscriber state callback failed, err is null.`); + return; + } + if (err.code) { + console.info(`Set static subscriber state callback failed, errCode: ${err.code}, errMes: ${err.message}`); + return; + } + console.info(`Set static subscriber state callback success`); +}); +``` + +## CommonEventManager.setStaticSubscriberState10+ + +setStaticSubscriberState(enable: boolean): Promise\; + +Enables or disables static subscription for the current application. This API uses a promise to return the result. + +**System capability**: SystemCapability.Notification.CommonEvent + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | -------------------------- | +| enable | boolean | Yes | Whether static subscription is enabled.
**true**: enabled.
**false**: disabled.| + +**Return value** + +| Type | Description | +| -------------- | ---------------------------- | +| Promise\ | Promise used to return the result.| + +**Error codes** + + For details about the error codes, see [Event Error Codes](../errorcodes/errorcode-CommonEventService.md). + +| ID| Error Message | +| -------- | ----------------------------------- | +| 1500007 | error sending message to Common Event Service. | +| 1500008 | Common Event Service does not complete initialization. | + +**Example** + + +```ts +CommonEventManager.setStaticSubscriberState(false).then(() => { + console.info(`Set static subscriber state promise success`); +}).catch ((err) => { + console.info(`Set static subscriber state promise failed, errCode: ${err.code}, errMes: ${err.message}`); +}); +``` diff --git a/en/application-dev/reference/apis/js-apis-convertxml.md b/en/application-dev/reference/apis/js-apis-convertxml.md index 4c66c928fb7ee6c5482d39db7b39acaa6793691e..8aad8fdf810b9f3246672b8c3d2e21df7733d94e 100644 --- a/en/application-dev/reference/apis/js-apis-convertxml.md +++ b/en/application-dev/reference/apis/js-apis-convertxml.md @@ -28,7 +28,7 @@ Converts an XML text into a JavaScript object. | Name | Type | Mandatory| Description | | ------- | --------------------------------- | ---- | --------------- | | xml | string | Yes | XML text to convert.| -| options | [ConvertOptions](#convertoptions) | No | Options for conversion. | +| options | [ConvertOptions](#convertoptions) | No | Options for conversion. The default value is a **ConvertOptions** object, which consists of the default values of the attributes in the object. | **Return value** @@ -89,7 +89,7 @@ Converts an XML text into a JavaScript object. | Name | Type | Mandatory| Description | | ------- | --------------------------------- | ---- | --------------- | | xml | string | Yes | XML text to convert.| -| options | [ConvertOptions](#convertoptions) | No | Options for conversion. | +| options | [ConvertOptions](#convertoptions) | No | Options for conversion. The default value is a **ConvertOptions** object, which consists of the default values of the attributes in the object. | **Return value** diff --git a/en/application-dev/reference/apis/js-apis-enterprise-applicationManager.md b/en/application-dev/reference/apis/js-apis-enterprise-applicationManager.md new file mode 100644 index 0000000000000000000000000000000000000000..0f9d2852f88f7e6b729326e62fc3886422d63eb2 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-enterprise-applicationManager.md @@ -0,0 +1,434 @@ +# @ohos.enterprise.applicationManager (Application Management) + +The **applicationManager** module provides application management capabilities, including adding applications to or removing applications from an application blocklist, and obtaining the application blocklist. The application blocklist contains the applications that are forbidden to run. Only the enterprise device administrator applications can call the APIs provided by this module. + +> **NOTE** +> +> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> - The APIs of this module can be called only after a [device administrator application](js-apis-enterprise-adminManager.md#adminmanagerenableadmin) is enabled. + +## Modules to Import + +```js +import applicationManager from '@ohos.enterprise.applicationManager'; +``` + +## applicationManager.addDisallowedRunningBundles + +addDisallowedRunningBundles(admin: Want, appIds: Array\, callback: AsyncCallback<void>): void; + +Adds applications to the application blocklist using the specified device administrator application. This API uses an asynchronous callback to return the result. The applications added to the blocklist cannot run under the administrator user. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| appIds | Array<string> | Yes | IDs of the applications to add. | +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +applicationManager.addDisallowedRunningBundles(wantTemp, appIds, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## applicationManager.addDisallowedRunningBundles + +addDisallowedRunningBundles(admin: Want, appIds: Array\, userId: number, callback: AsyncCallback<void>): void; + +Adds applications to the application list for a user using the specified device administrator application. This API uses an asynchronous callback to return the result. The applications added to the blocklist cannot run under the user specified by **userId**. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| appIds | Array<string> | Yes | IDs of the applications to add. | +| userId | number | Yes | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +applicationManager.addDisallowedRunningBundles(wantTemp, appIds, 100, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## applicationManager.addDisallowedRunningBundles + +addDisallowedRunningBundles(admin: Want, appIds: Array\, userId?: number): Promise<void>; + +Adds applications to the application blocklist using the specified device administrator application. This API uses a promise to return the result. If **userId** is passed in when this API is called, the added applications cannot run under the specified user. If **userId** is not passed in, the added applications cannot run under the current user. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| appIds | Array<string> | Yes | IDs of the applications to add. | +| userId | number | No | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| + +**Return value** + +| Type | Description | +| --------------------- | ------------------------- | +| Promise<void> | Promise that returns no value. An error object is thrown when the applications fail to be added. | + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +applicationManager.addDisallowedRunningBundles(wantTemp, appIds, 100).then(() => { + console.log("success"); +}).catch(error => { + console.log("error code:" + error.code + " error message:" + error.message); +}); +``` + +## applicationManager.removeDisallowedRunningBundles + +removeDisallowedRunningBundles(admin: Want, appIds: Array\, callback: AsyncCallback<void>): void; + +Removes applications from the application blocklist using the specified device administrator application. This API uses an asynchronous callback to return the result. If an application blocklist exists, the applications in the blocklist cannot run under the current user. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| appIds | Array<string> | Yes | IDs of the applications to remove. | +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +applicationManager.removeDisallowedRunningBundles(wantTemp, appIds, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## applicationManager.removeDisallowedRunningBundles + +removeDisallowedRunningBundles(admin: Want, appIds: Array\, userId: number, callback: AsyncCallback<void>): void; + +Removes applications from the application blocklist of a user using the specified device administrator application. This API uses an asynchronous callback to return the result. If an application blocklist exists, the applications in the blocklist cannot run under the user specified by **userId**. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| appIds | Array<string> | Yes | IDs of the applications to remove. | +| userId | number | Yes | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.| + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +applicationManager.removeDisallowedRunningBundles(wantTemp, appIds, 100, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## applicationManager.removeDisallowedRunningBundles + +removeDisallowedRunningBundles(admin: Want, appIds: Array\, userId?: number): Promise<void>; + +Removes applications from the application blocklist using the specified device administrator application. This API uses a promise to return the result. If **userId** is passed in when this API is called to remove applications from the blocklist, the applications in the blocklist cannot run under the specified user. If **userId** is not passed in, the applications in the blocklist cannot run under the current user. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| appIds | Array<string> | Yes | IDs of the applications to remove. | +| userId | number | No | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| + +**Return value** + +| Type | Description | +| --------------------- | ------------------------- | +| Promise<void> | Promise that returns no value. An error object is thrown when the applications fail to be removed. | + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +applicationManager.removeDisallowedRunningBundles(wantTemp, appIds, 100).then(() => { + console.log("success"); +}).catch(error => { + console.log("error code:" + error.code + " error message:" + error.message); +}); +``` + +## applicationManager.getDisallowedRunningBundles + +getDisallowedRunningBundles(admin: Want, callback: AsyncCallback<Array<string>>): void; + +Obtains the application blocklist of the administrator user using the specified device administrator application. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; + +applicationManager.getDisallowedRunningBundles(wantTemp, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## applicationManager.getDisallowedRunningBundles + +getDisallowedRunningBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void; + +Obtains the application blocklist of a user using the specified device administrator application. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | +| userId | number | Yes | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| +| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object. | + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; + +applicationManager.getDisallowedRunningBundles(wantTemp, 100, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## applicationManager.getDisallowedRunningBundles + +getDisallowedRunningBundles(admin: Want, userId?: number): Promise<Array<string>>; + +Obtains the application blocklist using the specified device administrator application. This API uses a promise to return the result. If **userId** is passed in when this API is called, the device administrator application obtains the application blocklist of the specified user. If **userId** is not passed in, the device administrator application obtains the application blocklist of the current user. + +**Required permissions**: ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY + +**System capability**: SystemCapability.Customization.EnterpriseDeviceManager + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application.| +| userId | number | No | User ID. The default value is the user ID of the caller. The user ID must be greater than or equal to **0**.| + +**Return value** + +| Type | Description | +| --------------------- | ------------------------- | +| Promise<Array<string>> | Promise used to return the application blocklist of the administrator user.| + +**Error codes** + +For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). + +| ID| Error Message | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**Example** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +applicationManager.getDisallowedRunningBundles(wantTemp, 100).then(() => { + console.log("success"); +}).catch(error => { + console.log("error code:" + error.code + " error message:" + error.message); +}); +``` diff --git a/en/application-dev/reference/apis/js-apis-image.md b/en/application-dev/reference/apis/js-apis-image.md index 9c6037df7f907354d71a6eacb211855b579945a5..34337fa9198edeeeab9d437bc084538777834d31 100644 --- a/en/application-dev/reference/apis/js-apis-image.md +++ b/en/application-dev/reference/apis/js-apis-image.md @@ -879,6 +879,53 @@ async function Demo() { } ``` +### getColorSpace10+ + +getColorSpace(): colorSpaceManager.ColorSpaceManager + +Obtains the color space of this image + +**System capability**: SystemCapability.Multimedia.Image.Core + +**Return value** + +| Type | Description | +| ----------------------------------- | ---------------- | +| [colorSpaceManager.ColorSpaceManager](js-apis-colorSpaceManager.md#colorspacemanager) | Color space obtained.| + +**Example** + +```js +import colorSpaceManager from '@ohos.graphics.colorSpaceManager'; +async function Demo() { + let csm = pixelmap.getColorSpace(); +} +``` + +### setColorSpace10+ + +setColorSpace(colorSpace: colorSpaceManager.ColorSpaceManager): void + +Sets the color space for this image. + +**System capability**: SystemCapability.Multimedia.Image.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| ---------- | ----------------------------------- | ---- | --------------- | +| colorSpace | [colorSpaceManager.ColorSpaceManager](js-apis-colorSpaceManager.md#colorspacemanager) | Yes | Color space to set.| + +**Example** + +```js +import colorSpaceManager from '@ohos.graphics.colorSpaceManager'; +async function Demo() { + var csm = colorSpaceManager.create(colorSpaceName); + pixelmap.setColorSpace(csm); +} +``` + ### release7+ release():Promise\ @@ -937,7 +984,7 @@ Creates an **ImageSource** instance based on the URI. | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------------------------- | -| uri | string | Yes | Image path. Currently, only the application sandbox path is supported.
Currently, the following formats are supported: JPG, PNG, GIF, BMP, Webp, and RAW.| +| uri | string | Yes | Image path. Currently, only the application sandbox path is supported.
Currently, the following formats are supported: .jpg, .png, .gif, .bmp, .webp, and raw. For details, see [SVG Tags10+](#svg-tags). | **Return value** @@ -975,7 +1022,7 @@ Creates an **ImageSource** instance based on the URI. | Name | Type | Mandatory| Description | | ------- | ------------------------------- | ---- | ----------------------------------- | -| uri | string | Yes | Image path. Currently, only the application sandbox path is supported.
Currently, the following formats are supported: JPG, PNG, GIF, BMP, Webp, and RAW.| +| uri | string | Yes | Image path. Currently, only the application sandbox path is supported.
Currently, the following formats are supported: .jpg, .png, .gif, .bmp, .webp, and raw. For details, see [SVG Tags10+](#svg-tags). | | options | [SourceOptions](#sourceoptions9) | Yes | Image properties, including the image index and default property value.| **Return value** @@ -1553,10 +1600,10 @@ let decodeOpts = { editable: true, desiredSize: { width: 198, height: 202 }, rotate: 0, - desiredPixelFormat: RGBA_8888, + desiredPixelFormat: 3, index: 0, }; -let pixelmaplist = await imageSourceApi.createPixelMapList(decodeOpts); +let pixelmaplist = imageSourceApi.createPixelMapList(decodeOpts); ``` ### createPixelMapList10+ @@ -1604,7 +1651,7 @@ let decodeOpts = { editable: true, desiredSize: { width: 198, height: 202 }, rotate: 0, - desiredPixelFormat: RGBA_8888, + desiredPixelFormat: 3, index: 0, }; imageSourceApi.createPixelMap(decodeOpts, pixelmaplist => { @@ -1651,12 +1698,12 @@ Obtains an array of delay times. This API uses a promise to return the result. **Example** ```js -let delayTimes = await imageSourceApi.getDelayTime(); +let delayTimes = imageSourceApi.getDelayTime(); ``` ### getFrameCount10+ -getFrameCount(callback: AsyncCallback): void; +getFrameCount(callback: AsyncCallback\): void; Obtains the number of frames. This API uses an asynchronous callback to return the result. @@ -1693,7 +1740,7 @@ Obtains the number of frames. This API uses a promise to return the result. **Example** ```js -let frameCount = await imageSourceApi.getFrameCount(); +let frameCount = imageSourceApi.getFrameCount(); ``` ### release @@ -2787,7 +2834,50 @@ Describes the color components of an image. | pixelStride | number | Yes | No | Pixel stride. | | byteBuffer | ArrayBuffer | Yes | No | Component buffer.| -## ResponseCode +## Supplementary Information +### SVG Tags + +The SVG tags are supported since API verison 10. The used version is (SVG) 1.1. Currently, the following tags are supported: +- a +- circla +- clipPath +- defs +- ellipse +- feBlend +- feColorMatrix +- feComposite +- feDiffuseLighting +- feDisplacementMap +- feDistantLight +- feFlood +- feGaussianBlur +- feImage +- feMorphology +- feOffset +- fePointLight +- feSpecularLighting +- feSpotLight +- feTurbulence +- filter +- g +- image +- line +- linearGradient +- mask +- path +- pattern +- polygon +- polyline +- radialGradient +- rect +- stop +- svg +- text +- textPath +- tspan +- use + +### ResponseCode Enumerates the response codes returned upon build errors. diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md index a73c80d7c5fa09e19f901b3c947f445eb61989e1..a8afc035794c4e35fbdf9d68a715fe2bb67e7b36 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventData.md @@ -1,5 +1,10 @@ # CommonEventData +> **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. + + **System capability**: SystemCapability.Notification.CommonEvent | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md index 94963860fe1b57a6abfd6fff6fdba38816a63294..332fd934c7ee9799d4356acc45996d3632b4f9d2 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventPublishData.md @@ -1,5 +1,9 @@ # CommonEventPublishData +> **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. + **System capability**: SystemCapability.Notification.CommonEvent | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md index 2b9db9ec46f479d5d0607c33f07601b1ef721446..c5de47b81e6b928a7d26909a54aa9ba798078417 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscribeInfo.md @@ -1,5 +1,9 @@ # CommonEventSubscribeInfo +> **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. + **System capability**: SystemCapability.Notification.CommonEvent | Name | Type | Readable| Writable| Description | diff --git a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md index 18eeac506b75dc96b27b56b9369070215ff8892a..02112d5b265e73139c9cd662246a819bc16c0b1f 100644 --- a/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md +++ b/en/application-dev/reference/apis/js-apis-inner-commonEvent-commonEventSubscriber.md @@ -1,11 +1,40 @@ # CommonEventSubscriber -## getCode +> **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. + +## Usage + +Before using the **CommonEventSubscriber** module, you must obtain a **subscriber** object by calling **CommonEvent.createSubscriber**. ```ts -getCode(callback: AsyncCallback): void +import CommonEvent from '@ohos.commonEvent'; +let subscriber; // Used to save the created subscriber object for subsequent subscription and unsubscription. + +// Subscriber information. +let subscribeInfo = { + events: ["event"] +}; + +// Callback for subscriber creation. +function createCB(err, commonEventSubscriber) { + if (err.code) { + console.error(`createSubscriber failed, code is ${err.code}`); + } else { + console.info("createSubscriber"); + subscriber = commonEventSubscriber; + } +} + +// Create a subscriber. +CommonEvent.createSubscriber(subscribeInfo, createCB); ``` +## getCode + +getCode(callback: AsyncCallback\): void + Obtains the code of this common event. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Notification.CommonEvent @@ -19,8 +48,6 @@ Obtains the code of this common event. This API uses an asynchronous callback to **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for result code obtaining of an ordered common event. function getCodeCB(err, code) { if (err.code) { @@ -34,9 +61,7 @@ subscriber.getCode(getCodeCB); ## getCode -```ts -getCode(): Promise -``` +getCode(): Promise\ Obtains the code of this common event. This API uses a promise to return the result. @@ -51,8 +76,6 @@ Obtains the code of this common event. This API uses a promise to return the res **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.getCode().then((code) => { console.info("getCode " + JSON.stringify(code)); }).catch((err) => { @@ -62,9 +85,7 @@ subscriber.getCode().then((code) => { ## setCode -```ts -setCode(code: number, callback: AsyncCallback): void -``` +setCode(code: number, callback: AsyncCallback\): void Sets the code for this common event. This API uses an asynchronous callback to return the result. @@ -80,8 +101,6 @@ Sets the code for this common event. This API uses an asynchronous callback to r **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for result code setting of an ordered common event. function setCodeCB(err) { if (err.code) { @@ -95,9 +114,7 @@ subscriber.setCode(1, setCodeCB); ## setCode -```ts -setCode(code: number): Promise -``` +setCode(code: number): Promise\ Sets the code for this common event. This API uses a promise to return the result. @@ -118,8 +135,6 @@ Sets the code for this common event. This API uses a promise to return the resul **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.setCode(1).then(() => { console.info("setCode"); }).catch((err) => { @@ -129,9 +144,7 @@ subscriber.setCode(1).then(() => { ## getData -```ts -getData(callback: AsyncCallback): void -``` +getData(callback: AsyncCallback\): void Obtains the data of this common event. This API uses an asynchronous callback to return the result. @@ -146,8 +159,6 @@ Obtains the data of this common event. This API uses an asynchronous callback to **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for result data obtaining of an ordered common event. function getDataCB(err, data) { if (err.code) { @@ -161,9 +172,7 @@ subscriber.getData(getDataCB); ## getData -```ts -getData(): Promise -``` +getData(): Promise\ Obtains the data of this common event. This API uses a promise to return the result. @@ -178,8 +187,6 @@ Obtains the data of this common event. This API uses a promise to return the res **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.getData().then((data) => { console.info("getData " + JSON.stringify(data)); }).catch((err) => { @@ -205,8 +212,6 @@ Sets the data for this common event. This API uses an asynchronous callback to r **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for result data setting of an ordered common event function setDataCB(err) { if (err.code) { @@ -220,9 +225,7 @@ subscriber.setData("publish_data_changed", setDataCB); ## setData -```ts -setData(data: string): Promise -``` +setData(data: string): Promise\ Sets the data for this common event. This API uses a promise to return the result. @@ -243,8 +246,6 @@ Sets the data for this common event. This API uses a promise to return the resul **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.setData("publish_data_changed").then(() => { console.info("setData"); }).catch((err) => { @@ -254,9 +255,7 @@ subscriber.setData("publish_data_changed").then(() => { ## setCodeAndData -```ts -setCodeAndData(code: number, data: string, callback:AsyncCallback): void -``` +setCodeAndData(code: number, data: string, callback:AsyncCallback\): void Sets the code and data for this common event. This API uses an asynchronous callback to return the result. @@ -273,8 +272,6 @@ Sets the code and data for this common event. This API uses an asynchronous call **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for code and data setting of an ordered common event. function setCodeDataCB(err) { if (err.code) { @@ -288,9 +285,7 @@ subscriber.setCodeAndData(1, "publish_data_changed", setCodeDataCB); ## setCodeAndData -```ts -setCodeAndData(code: number, data: string): Promise -``` +setCodeAndData(code: number, data: string): Promise\ Sets the code and data for this common event. This API uses a promise to return the result. @@ -312,8 +307,6 @@ Sets the code and data for this common event. This API uses a promise to return **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.setCodeAndData(1, "publish_data_changed").then(() => { console.info("setCodeAndData"); }).catch((err) => { @@ -323,9 +316,7 @@ subscriber.setCodeAndData(1, "publish_data_changed").then(() => { ## isOrderedCommonEvent -```ts -isOrderedCommonEvent(callback: AsyncCallback): void -``` +isOrderedCommonEvent(callback: AsyncCallback\): void Checks whether this common event is an ordered one. This API uses an asynchronous callback to return the result. @@ -340,8 +331,6 @@ Checks whether this common event is an ordered one. This API uses an asynchronou **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for checking whether the current common event is an ordered one. function isOrderedCB(err, isOrdered) { if (err.code) { @@ -355,9 +344,7 @@ subscriber.isOrderedCommonEvent(isOrderedCB); ## isOrderedCommonEvent -```ts -isOrderedCommonEvent(): Promise -``` +isOrderedCommonEvent(): Promise\ Checks whether this common event is an ordered one. This API uses a promise to return the result. @@ -372,8 +359,6 @@ Checks whether this common event is an ordered one. This API uses a promise to r **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.isOrderedCommonEvent().then((isOrdered) => { console.info("isOrdered " + JSON.stringify(isOrdered)); }).catch((err) => { @@ -383,9 +368,7 @@ subscriber.isOrderedCommonEvent().then((isOrdered) => { ## isStickyCommonEvent -```ts -isStickyCommonEvent(callback: AsyncCallback): void -``` +isStickyCommonEvent(callback: AsyncCallback\): void Checks whether this common event is a sticky one. This API uses an asynchronous callback to return the result. @@ -400,8 +383,6 @@ Checks whether this common event is a sticky one. This API uses an asynchronous **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for checking whether the current common event is a sticky one. function isStickyCB(err, isSticky) { if (err.code) { @@ -415,9 +396,7 @@ subscriber.isStickyCommonEvent(isStickyCB); ## isStickyCommonEvent -```ts -isStickyCommonEvent(): Promise -``` +isStickyCommonEvent(): Promise\ Checks whether this common event is a sticky one. This API uses a promise to return the result. @@ -432,8 +411,6 @@ Checks whether this common event is a sticky one. This API uses a promise to ret **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.isStickyCommonEvent().then((isSticky) => { console.info("isSticky " + JSON.stringify(isSticky)); }).catch((err) => { @@ -443,9 +420,7 @@ subscriber.isStickyCommonEvent().then((isSticky) => { ## abortCommonEvent -```ts -abortCommonEvent(callback: AsyncCallback): void -``` +abortCommonEvent(callback: AsyncCallback\): void Aborts this common event. After the abort, the common event is not sent to the next subscriber. This API takes effect only for ordered common events. It uses an asynchronous callback to return the result. @@ -460,8 +435,6 @@ Aborts this common event. After the abort, the common event is not sent to the n **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for common event aborting. function abortCB(err) { if (err.code) { @@ -475,9 +448,7 @@ subscriber.abortCommonEvent(abortCB); ## abortCommonEvent -```ts -abortCommonEvent(): Promise -``` +abortCommonEvent(): Promise\ Aborts this common event. After the abort, the common event is not sent to the next subscriber. This API takes effect only for ordered common events. It uses a promise to return the result. @@ -492,8 +463,6 @@ Aborts this common event. After the abort, the common event is not sent to the n **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.abortCommonEvent().then(() => { console.info("abortCommonEvent"); }).catch((err) => { @@ -503,9 +472,7 @@ subscriber.abortCommonEvent().then(() => { ## clearAbortCommonEvent -```ts -clearAbortCommonEvent(callback: AsyncCallback): void -``` +clearAbortCommonEvent(callback: AsyncCallback\): void Clears the aborted state of this common event. This API takes effect only for ordered common events. It uses an asynchronous callback to return the result. @@ -520,8 +487,6 @@ Clears the aborted state of this common event. This API takes effect only for or **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for clearing the aborted state of the current common event. function clearAbortCB(err) { if (err.code) { @@ -535,9 +500,7 @@ subscriber.clearAbortCommonEvent(clearAbortCB); ## clearAbortCommonEvent -```ts -clearAbortCommonEvent(): Promise -``` +clearAbortCommonEvent(): Promise\ Clears the aborted state of this common event. This API takes effect only for ordered common events. It uses a promise to return the result. @@ -552,8 +515,6 @@ Clears the aborted state of this common event. This API takes effect only for or **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.clearAbortCommonEvent().then(() => { console.info("clearAbortCommonEvent"); }).catch((err) => { @@ -563,9 +524,7 @@ subscriber.clearAbortCommonEvent().then(() => { ## getAbortCommonEvent -```ts -getAbortCommonEvent(callback: AsyncCallback): void -``` +getAbortCommonEvent(callback: AsyncCallback\): void Checks whether this common event is in the aborted state. This API takes effect only for ordered common events. It uses an asynchronous callback to return the result. @@ -580,8 +539,6 @@ Checks whether this common event is in the aborted state. This API takes effect **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for checking whether the current common event is in the aborted state. function getAbortCB(err, abortEvent) { if (err.code) { @@ -595,9 +552,7 @@ subscriber.getAbortCommonEvent(getAbortCB); ## getAbortCommonEvent -```ts -getAbortCommonEvent(): Promise -``` +getAbortCommonEvent(): Promise\ Checks whether this common event is in the aborted state. This API takes effect only for ordered common events. It uses a promise to return the result. @@ -612,8 +567,6 @@ Checks whether this common event is in the aborted state. This API takes effect **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.getAbortCommonEvent().then((abortEvent) => { console.info("abortCommonEvent " + JSON.stringify(abortEvent)); }).catch((err) => { @@ -623,9 +576,7 @@ subscriber.getAbortCommonEvent().then((abortEvent) => { ## getSubscribeInfo -```ts -getSubscribeInfo(callback: AsyncCallback): void -``` +getSubscribeInfo(callback: AsyncCallback\): void Obtains the subscriber information. This API uses an asynchronous callback to return the result. @@ -640,8 +591,6 @@ Obtains the subscriber information. This API uses an asynchronous callback to re **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for subscriber information obtaining. function getCB(err, subscribeInfo) { if (err.code) { @@ -655,9 +604,7 @@ subscriber.getSubscribeInfo(getCB); ## getSubscribeInfo -```ts -getSubscribeInfo(): Promise -``` +getSubscribeInfo(): Promise\ Obtains the subscriber information. This API uses a promise to return the result. @@ -672,8 +619,6 @@ Obtains the subscriber information. This API uses a promise to return the result **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.getSubscribeInfo().then((subscribeInfo) => { console.info("subscribeInfo " + JSON.stringify(subscribeInfo)); }).catch((err) => { @@ -683,9 +628,7 @@ subscriber.getSubscribeInfo().then((subscribeInfo) => { ## finishCommonEvent9+ -```ts -finishCommonEvent(callback: AsyncCallback): void -``` +finishCommonEvent(callback: AsyncCallback\): void Finishes this common event. This API takes effect only for ordered common events. It uses an asynchronous callback to return the result. @@ -700,14 +643,13 @@ Finishes this common event. This API takes effect only for ordered common events **Example** ```ts -let subscriber; // Subscriber object successfully created. - // Callback for ordered common event finishing. function finishCB(err) { if (err.code) { console.error(`finishCommonEvent failed, code is ${err.code}, message is ${err.message}`); -} else { + } else { console.info("FinishCommonEvent"); + } } subscriber.finishCommonEvent(finishCB); @@ -715,9 +657,7 @@ subscriber.finishCommonEvent(finishCB); ## finishCommonEvent9+ -```ts -finishCommonEvent(): Promise -``` +finishCommonEvent(): Promise\ Finishes this common event. This API takes effect only for ordered common events. It uses a promise to return the result. @@ -732,8 +672,6 @@ Finishes this common event. This API takes effect only for ordered common events **Example** ```ts -let subscriber; // Subscriber object successfully created. - subscriber.finishCommonEvent().then(() => { console.info("FinishCommonEvent"); }).catch((err) => { diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md index 88e58e4bea766398e24ae1870c061e0dc385953a..ee7f0e37c7d85cdfdde76ae9b852bb05964af358 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationActionButton.md @@ -8,9 +8,9 @@ The **NotificationActionButton** module describes the button displayed in the no **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | --------- | ----------------------------------------------- | --- | ---- | ------------------------- | -| title | string | Yes | Yes | Button title. | -| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** of the button.| -| extras | { [key: string]: any } | Yes | Yes | Extra information of the button. | -| userInput8+ | [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md) | Yes | Yes | User input object. | +| title | string | No | Yes | Button title. | +| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | No | Yes | **WantAgent** of the button.| +| extras | { [key: string]: any } | No | No | Extra information of the button. | +| userInput8+ | [NotificationUserInput](js-apis-inner-notification-notificationUserInput.md) | No | No | User input object. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md index dcd2a4ce8de27431ea343b27bb933d829fcad74c..48f8c4cc28912aab4b3cc0446c951fe539b6ba4e 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationCommonDef.md @@ -10,7 +10,7 @@ Provides the bundle information of an application. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Mandatory| Description | -| ------ | ------ |---- | ------ | -| bundle | string | Yes| Bundle information of the application.| -| uid | number | No| User ID.| +| Name | Type | Read-only| Mandatory| Description | +| ------ | ------ | ---- | ---- | ------ | +| bundle | string | No | Yes| Bundle information of the application.| +| uid | number | No | No| User ID.| diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md index 7c2b3a78da9b2c22c7ae9967552655f6e70a6c8c..9f5de8d911f2533c0dd789fd3bce1eeaf1adeef6 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationContent.md @@ -8,13 +8,13 @@ The **NotificationContent** module describes the notification content. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | ----------- | ------------------------------------------------------------ | ---- | --- | ------------------ | -| contentType | [ContentType](./js-apis-notificationManager.md#contenttype) | Yes | Yes | Notification content type. | -| normal | [NotificationBasicContent](#notificationbasiccontent) | Yes | Yes | Normal text. | -| longText | [NotificationLongTextContent](#notificationlongtextcontent) | Yes | Yes | Long text.| -| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | Yes | Yes | Multi-line text. | -| picture | [NotificationPictureContent](#notificationpicturecontent) | Yes | Yes | Picture-attached. | +| contentType | [ContentType](./js-apis-notificationManager.md#contenttype) | No | Yes | Notification content type. | +| normal | [NotificationBasicContent](#notificationbasiccontent) | No | No | Normal text. | +| longText | [NotificationLongTextContent](#notificationlongtextcontent) | No | No | Long text.| +| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | No | No | Multi-line text. | +| picture | [NotificationPictureContent](#notificationpicturecontent) | No | No | Picture-attached. | ## NotificationBasicContent @@ -22,11 +22,11 @@ Describes the normal text notification. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | -------------- | ------ | ---- | ---- | ---------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| +| title | string | No | Yes | Notification title. | +| text | string | No | Yes | Notification content. | +| additionalText | string | No | No | Additional information of the notification.| ## NotificationLongTextContent @@ -35,14 +35,14 @@ Describes the long text notification. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | -------------- | ------ | ---- | --- | -------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| -| longText | string | Yes | Yes | Long text of the notification. | -| briefText | string | Yes | Yes | Brief text of the notification.| -| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. | +| title | string | No | Yes | Notification title. | +| text | string | No | Yes | Notification content. | +| additionalText | string | No | No | Additional information of the notification.| +| longText | string | No | Yes | Long text of the notification. | +| briefText | string | No | Yes | Brief text of the notification. | +| expandedTitle | string | No | Yes | Title of the notification in the expanded state. | ## NotificationMultiLineContent @@ -53,12 +53,12 @@ Describes the multi-line text notification. | Name | Type | Readable| Writable| Description | | -------------- | --------------- | --- | --- | -------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| -| briefText | string | Yes | Yes | Brief text of the notification.| -| longTitle | string | Yes | Yes | Title of the notification in the expanded state. | -| lines | Array\ | Yes | Yes | Multi-line text of the notification. | +| title | string | No | Yes | Notification title. | +| text | string | No | Yes | Notification content. | +| additionalText | string | No | No | Additional information of the notification.| +| briefText | string | No | Yes | Brief text of the notification.| +| longTitle | string | No | Yes | Title of the notification in the expanded state. | +| lines | Array\ | No | Yes | Multi-line text of the notification. | ## NotificationPictureContent @@ -69,9 +69,9 @@ Describes the picture-attached notification. | Name | Type | Readable| Writable| Description | | -------------- | -------------- | ---- | --- | -------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| -| briefText | string | Yes | Yes | Brief text of the notification.| -| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. | -| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Picture attached to the notification. | +| title | string | No | Yes | Notification title. | +| text | string | No | Yes | Notification content. | +| additionalText | string | No | No | Additional information of the notification.| +| briefText | string | No | Yes | Brief text of the notification.| +| expandedTitle | string | No | Yes | Title of the notification in the expanded state. | +| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | No | Yes | Picture attached to the notification. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md index f7e1a995b51bcc193e2cd21115eb8e934233eec5..e0b84a9fbac8e59070b598960bdb447c9cc24dbe 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationFlags.md @@ -8,7 +8,7 @@ The **NotificationFlags** module implements a **NotificationFlags** instance. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | ---------------- | ---------------------- | ---- | ---- | --------------------------------- | | soundEnabled | [NotificationFlagStatus](#notificationflagstatus) | Yes | No | Whether to enable the sound alert for the notification. | | vibrationEnabled | [NotificationFlagStatus](#notificationflagstatus) | Yes | No | Whether to enable vibration for the notification. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md index 205a6c04bdf7fff97c80e44b882fb487712e2c01..ac3646f424f7701e2fa85c671a76ba90c511d212 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationRequest.md @@ -8,45 +8,45 @@ The **NotificationRequest** module describes the notification request. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | --------------------- | --------------------------------------------- | ---- | --- | -------------------------- | -| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | Yes | Yes | Notification content. | -| id | number | Yes | Yes | Notification ID. | -| slotType | [SlotType](js-apis-notificationManager.md#slottype) | Yes | Yes | Notification slot type. | -| isOngoing | boolean | Yes | Yes | Whether the notification is an ongoing notification. | -| isUnremovable | boolean | Yes | Yes | Whether the notification can be removed. | -| deliveryTime | number | Yes | Yes | Time when the notification is sent. | -| tapDismissed | boolean | Yes | Yes | Whether the notification is automatically cleared. | -| autoDeletedTime | number | Yes | Yes | Time when the notification is automatically cleared. | -| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** instance to which the notification will be redirected after being clicked.| -| extraInfo | {[key: string]: any} | Yes | Yes | Extended parameters. | -| color | number | Yes | Yes | Background color of the notification. Not supported currently.| -| colorEnabled | boolean | Yes | Yes | Whether the notification background color can be enabled. Not supported currently.| -| isAlertOnce | boolean | Yes | Yes | Whether the notification triggers an alert only once.| -| isStopwatch | boolean | Yes | Yes | Whether to display the stopwatch. | -| isCountDown | boolean | Yes | Yes | Whether to display the countdown time. | -| isFloatingIcon | boolean | Yes | Yes | Whether the notification is displayed as a floating icon in the status bar. | -| label | string | Yes | Yes | Notification label. | -| badgeIconStyle | number | Yes | Yes | Notification badge type. | -| showDeliveryTime | boolean | Yes | Yes | Whether to display the time when the notification is delivered. | -| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | Yes | Yes | Buttons in the notification. Up to three buttons are allowed. | -| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Small notification icon. This field is optional, and the icon size cannot exceed 30 KB.| -| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Large notification icon. This field is optional, and the icon size cannot exceed 30 KB.| +| content | [NotificationContent](js-apis-inner-notification-notificationContent.md#notificationcontent) | No | Yes | Notification content. | +| id | number | No | No | Notification ID. | +| slotType | [SlotType](js-apis-notificationManager.md#slottype) | Yes | No | Notification slot type. | +| isOngoing | boolean | No | No | Whether the notification is an ongoing notification. | +| isUnremovable | boolean | No | No | Whether the notification can be removed. | +| deliveryTime | number | No | No | Time when the notification is sent. | +| tapDismissed | boolean | No | No | Whether the notification is automatically cleared. | +| autoDeletedTime | number | No | No | Time when the notification is automatically cleared. | +| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | No | No | **WantAgent** instance to which the notification will be redirected after being clicked.| +| extraInfo | {[key: string]: any} | No | No | Extended parameters. | +| color | number | No | No | Background color of the notification. Not supported currently.| +| colorEnabled | boolean | No | No | Whether the notification background color can be enabled. Not supported currently.| +| isAlertOnce | boolean | No | No | Whether the notification triggers an alert only once.| +| isStopwatch | boolean | No | No | Whether to display the stopwatch. | +| isCountDown | boolean | No | No | Whether to display the countdown time. | +| isFloatingIcon | boolean | No | No | Whether the notification is displayed as a floating icon in the status bar. | +| label | string | No | No | Notification label. | +| badgeIconStyle | number | No | No | Notification badge type. Not supported currently. | +| showDeliveryTime | boolean | No | No | Whether to display the time when the notification is delivered. | +| actionButtons | Array\<[NotificationActionButton](js-apis-inner-notification-notificationActionButton.md)\> | No | No | Buttons in the notification. Up to three buttons are allowed. | +| smallIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | No | No | Small notification icon. This field is optional, and the icon size cannot exceed 30 KB.| +| largeIcon | [image.PixelMap](js-apis-image.md#pixelmap7) | No | No | Large notification icon. This field is optional, and the icon size cannot exceed 30 KB.| | creatorBundleName | string | Yes | No | Name of the bundle that creates the notification. | | creatorUid8+ | number | Yes | No | UID used for creating the notification. | | creatorPid | number | Yes | No | PID used for creating the notification. | -| creatorUserId| number | Yes | No | ID of the user who creates the notification. | +| creatorUserId | number | Yes | No | ID of the user who creates the notification. | | hashCode | string | Yes | No | Unique ID of the notification. | -| classification | string | Yes | Yes | Notification category.
**System API**: This is a system API and cannot be called by third-party applications. | -| groupName8+ | string | Yes | Yes | Notification group name. | -| template8+ | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | Yes | Yes | Notification template. | +| classification | string | No | No | Notification category.
**System API**: This is a system API and cannot be called by third-party applications. | +| groupName8+ | string | No | No | Notification group name. | +| template8+ | [NotificationTemplate](./js-apis-inner-notification-notificationTemplate.md) | No | No | Notification template. | | isRemoveAllowed8+ | boolean | Yes | No | Whether the notification can be removed.
**System API**: This is a system API and cannot be called by third-party applications. | | source8+ | number | Yes | No | Notification source.
**System API**: This is a system API and cannot be called by third-party applications. | -| distributedOption8+ | [DistributedOptions](#distributedoptions) | Yes | Yes | Distributed notification options. | +| distributedOption8+ | [DistributedOptions](#distributedoptions) | No | No | Distributed notification options. | | deviceId8+ | string | Yes | No | Device ID of the notification source.
**System API**: This is a system API and cannot be called by third-party applications. | -| notificationFlags8+ | [NotificationFlags](js-apis-inner-notification-notificationflags#notificationFlags) | Yes | No | Notification flags. | -| removalWantAgent9+ | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** instance to which the notification will be redirected when it is removed. | -| badgeNumber9+ | number | Yes | Yes | Number of notifications displayed on the application icon. | +| notificationFlags8+ | [NotificationFlags](js-apis-inner-notification-notificationFlags.md#notificationflags) | Yes | No | Notification flags. | +| removalWantAgent9+ | [WantAgent](js-apis-app-ability-wantAgent.md) | No | No | **WantAgent** instance to which the notification will be redirected when it is removed. | +| badgeNumber9+ | number | No | No | Number of notifications displayed on the application icon. | ## DistributedOptions @@ -55,9 +55,9 @@ Describes distributed notification options. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | ---------------------- | -------------- | ---- | ---- | ---------------------------------- | -| isDistributed8+ | boolean | Yes | Yes | Whether the notification is a distributed notification. | -| supportDisplayDevices8+ | Array\ | Yes | Yes | List of the devices to which the notification can be synchronized. | -| supportOperateDevices8+ | Array\ | Yes | Yes | List of the devices on which the notification can be opened. | +| isDistributed8+ | boolean | No | No | Whether the notification is a distributed notification. | +| supportDisplayDevices8+ | Array\ | No | No | List of the devices to which the notification can be synchronized. | +| supportOperateDevices8+ | Array\ | No | No | List of the devices on which the notification can be opened. | | remindType8+ | number | Yes | No | Notification reminder type.
**System API**: This is a system API and cannot be called by third-party applications. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md index 8bf9e286d59504be03ff8454d59ce60c31a9a597..9757ef2c007501439c509adc691e8f57aa3b354c 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSlot.md @@ -8,17 +8,17 @@ The **NotificationSlot** module describes the notification slot. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | -------------------- | --------------------- | ---- | --- | ------------------------------------------ | -| type | [SlotType](js-apis-notificationManager.md#slottype) | Yes | Yes | Notification slot type. | -| level | number | Yes | Yes | Notification level. If this parameter is not set, the default value that corresponds to the notification slot type is used.| -| desc | string | Yes | Yes | Notification slot description. | -| badgeFlag | boolean | Yes | Yes | Whether to display the badge. | -| bypassDnd | boolean | Yes | Yes | Whether to bypass DND mode in the system. | -| lockscreenVisibility | number | Yes | Yes | Mode for displaying the notification on the lock screen. | -| vibrationEnabled | boolean | Yes | Yes | Whether to enable vibration for the notification. | -| sound | string | Yes | Yes | Notification alert tone. | -| lightEnabled | boolean | Yes | Yes | Whether the indicator blinks for the notification. | -| lightColor | number | Yes | Yes | Indicator color of the notification. | -| vibrationValues | Array\ | Yes | Yes | Vibration mode of the notification. | +| type | [SlotType](js-apis-notificationManager.md#slottype) | No | Yes | Notification slot type. | +| level | number | No | No | Notification level. If this parameter is not set, the default value that corresponds to the notification slot type is used.| +| desc | string | No | No | Notification slot description. | +| badgeFlag | boolean | No | No | Whether to display the badge. | +| bypassDnd | boolean | No | No | Whether to bypass DND mode in the system. | +| lockscreenVisibility | number | No | No | Mode for displaying the notification on the lock screen. | +| vibrationEnabled | boolean | No | No | Whether to enable vibration for the notification. | +| sound | string | No | No | Notification alert tone. | +| lightEnabled | boolean | No | No | Whether the indicator blinks for the notification. | +| lightColor | number | No | No | Indicator color of the notification. | +| vibrationValues | Array\ | No | No | Vibration mode of the notification. | | enabled9+ | boolean | Yes | No | Whether the notification slot is enabled. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md new file mode 100644 index 0000000000000000000000000000000000000000..8062a16f3ac0305025130bcd73f91bd41ba6abdf --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSorting.md @@ -0,0 +1,17 @@ +# NotificationSorting + +Provides sorting information of active notifications. + +> **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. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +| Name | Type | Read-only| Mandatory| Description | +| -------------------- | --------------------- | ---- | --- | ------------------------------------------ | +| slot | [NotificationSlot](js-apis-inner-notification-notificationSlot.md) | Yes | Yes | Notification slot type. | +| level | number | Yes | Yes | Notification level. If this parameter is not set, the default value is used based on the notification slot type.| +| desc | string | Yes | Yes | Description of the notification slot. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md new file mode 100644 index 0000000000000000000000000000000000000000..0e75e98d2ce00b55aefc7d640f6590332782b451 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSortingMap.md @@ -0,0 +1,17 @@ +# NotificationSortingMap + +Provides sorting information of active notifications in all subscribed notifications. + +> **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. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +| Name | Type | Read-only| Mandatory| Description | +| -------------------- | --------------------- | ---- | --- | ------------------------------------------ | +| sortings | { [key: string]: [NotificationSorting](js-apis-inner-notification-notificationSorting.md) } | Yes | Yes | Array of notification sorting information.| +| sortedHashCode | Array\ | Yes | Yes | Hash codes for notification sorting.| + diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..8bd477d99c99ba3cc5f494b12fb83c993b0ca682 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md @@ -0,0 +1,16 @@ +# NotificationSubscribeInfo + +Provides the information about the publisher for notification subscription. + +> **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. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +| Name | Type | Read-only| Mandatory| Description | +| -------------------- | --------------------- | ---- | --- | ------------------------------------------ | +| bundleNames | Array\ | No | No | Bundle names of the applications whose notifications are to be subscribed to. | +| userId | number | No | No | User ID. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md new file mode 100644 index 0000000000000000000000000000000000000000..cd23687ebc1da6055172deede38ab03b62e68c0c --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationSubscriber.md @@ -0,0 +1,402 @@ +# NotificationSubscriber + +Provides callbacks for receiving or removing notifications and serves as the input parameter of [subscribe](js-apis-notificationSubscribe.md). + +> **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. + +## Modules to Import + +```js +import notificationSubscribe from '@ohos.notificationSubscribe'; +``` + +**System API**: This is a system API and cannot be called by third-party applications. + +### onConsume + +onConsume?: (data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void + +Called when a new notification is received. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type| Mandatory| Description| +| ------------ | ------------------------ | ---- | -------------------------- | +| data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | Yes| Information about the notification received.| + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onConsumeCallback(data) { + console.info('===> onConsume in test'); + let req = data.request; + console.info('===> onConsume callback req.id:' + req.id); +}; + +let subscriber = { + onConsume: onConsumeCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + +### onCancel + +onCancel?:(data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void + +Called when a notification is canceled. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type| Mandatory| Description| +| ------------ | ------------------------ | ---- | -------------------------- | +| data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | Yes| Information about the notification to cancel.| + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onCancelCallback(data) { + console.info('===> onCancel in test'); + let req = data.request; + console.info('===> onCancel callback req.id:' + req.id); +} + +let subscriber = { + onCancel: onCancelCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + +### onUpdate + +onUpdate?:(data: [NotificationSortingMap](js-apis-notification.md#notificationsortingmap)) => void + +Called when notification sorting is updated. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type| Mandatory| Description| +| ------------ | ------------------------ | ---- | -------------------------- | +| data | [NotificationSortingMap](js-apis-notification.md#notificationsortingmap) | Yes| Latest notification sorting list.| + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onUpdateCallback(map) { + console.info('===> onUpdateCallback map:' + JSON.stringify(map)); +} + +let subscriber = { + onUpdate: onUpdateCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + +### onConnect + +onConnect?:() => void + +Called when the subscription is complete. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onConnectCallback() { + console.info('===> onConnect in test'); +} + +let subscriber = { + onConnect: onConnectCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + +### onDisconnect + +onDisconnect?:() => void + +Called when unsubscription is complete. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; +function unsubscribeCallback(err) { + if (err.code) { + console.error(`unsubscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("unsubscribeCallback"); + } +}; + +function onConnectCallback() { + console.info('===> onConnect in test'); +} +function onDisconnectCallback() { + console.info('===> onDisconnect in test'); +} + +let subscriber = { + onConnect: onConnectCallback, + onDisconnect: onDisconnectCallback +}; + +// The onConnect callback is invoked when subscription to the notification is complete. +notificationSubscribe.subscribe(subscriber, subscribeCallback); +// The onDisconnect callback is invoked when unsubscription to the notification is complete. +notificationSubscribe.unsubscribe(subscriber, unsubscribeCallback); +``` + +### onDestroy + +onDestroy?:() => void + +Called when the service is disconnected. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onDestroyCallback() { + console.info('===> onDestroy in test'); +} + +let subscriber = { + onDestroy: onDestroyCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + +### onDoNotDisturbDateChange8+ + +onDoNotDisturbDateChange?:(mode: notification.[DoNotDisturbDate](js-apis-notificationManager.md#donotdisturbdate)) => void + +Called when the DND time settings are changed. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type| Mandatory| Description| +| ------------ | ------------------------ | ---- | -------------------------- | +| mode | notification.[DoNotDisturbDate](js-apis-notificationManager.md#DoNotDisturbDate) | Yes| DND time setting updates.| + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onDoNotDisturbDateChangeCallback(mode) { + console.info('===> onDoNotDisturbDateChange:' + mode); +} + +let subscriber = { + onDoNotDisturbDateChange: onDoNotDisturbDateChangeCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + + +### onEnabledNotificationChanged8+ + +onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata8)) => void + +Listens for the notification enabled status changes. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name| Type| Mandatory| Description| +| ------------ | ------------------------ | ---- | -------------------------- | +| callback | AsyncCallback\<[EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata8)\> | Yes| Callback used to return the result.| + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onEnabledNotificationChangedCallback(callbackData) { + console.info("bundle: ", callbackData.bundle); + console.info("uid: ", callbackData.uid); + console.info("enable: ", callbackData.enable); +}; + +let subscriber = { + onEnabledNotificationChanged: onEnabledNotificationChangedCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + +### onBadgeChanged10+ + + onBadgeChanged?:(data: [BadgeNumberCallbackData](#badgenumbercallbackdata10)) => void + +Listens for the change of the notification badge number. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------------------------ | ---- | -------------------------- | +| callback | AsyncCallback\<[BadgeNumberCallbackData](#badgenumbercallbackdata10)\> | Yes | Callback used to return the result.| + +**Example** + +```javascript +function subscribeCallback(err) { + if (err) { + console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("subscribeCallback"); + } +}; + +function onBadgeChangedCallback(data) { + console.info("bundle: ", data.bundle); + console.info("uid: ", data.uid); + console.info("badgeNumber: ", data.badgeNumber); +}; + +let subscriber = { + onBadgeChanged: onBadgeChangedCallback +}; + +notificationSubscribe.subscribe(subscriber, subscribeCallback); +``` + +## SubscribeCallbackData + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +| Name | Type | Read-only| Mandatory| Description | +| --------------- | ------------------------------------------------- | ---- | --- | -------- | +| request | [NotificationRequest](js-apis-inner-notification-notificationRequest#notificationrequest) | Yes | Yes | Notification content.| +| sortingMap | [NotificationSortingMap](js-apis-inner-notification-notificationSortingMap.md) | Yes | No | Notification sorting information.| +| reason | number | Yes | No | Reason for deletion.| +| sound | string | Yes | No | Sound used for notification.| +| vibrationValues | Array\ | Yes | No | Vibration used for notification.| + + +## EnabledNotificationCallbackData8+ + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +| Name | Type | Read-only| Mandatory| Description | +| ------ | ------- | ---- | --- | ---------------- | +| bundle | string | Yes | Yes | Bundle name of the application. | +| uid | number | Yes | Yes | UID of the application. | +| enable | boolean | Yes | Yes | Notification enabled status of the application.| + + +## BadgeNumberCallbackData10+ + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +| Name | Type | Read-only| Mandatory| Description | +| ----------- | ------ | ---- | ---- | ------------ | +| bundle | string | Yes | Yes | Bundle name of the application.| +| uid | number | Yes | Yes | UID of the application. | +| badgeNumber | number | Yes | Yes | Number of notifications displayed on the application icon. | diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md index 557fad664de00eb37567cb2d055c0c0ec2f8d484..3f9825e1d8cf63848d70e2282498e0d85f37cab0 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationTemplate.md @@ -8,7 +8,7 @@ The **NotificationTemplate** module describes the notification template. **System capability**: SystemCapability.Notification.Notification -| Name| Type | Readable| Writable| Description | +| Name| Type | Read-only| Mandatory| Description | | ---- | ---------------------- | ---- | ---- | ---------- | -| name | string | Yes | Yes | Template name.| -| data | {[key:string]: Object} | Yes | Yes | Template data.| +| name | string | No | Yes | Template name.| +| data | {[key:string]: Object} | No | Yes | Template data.| diff --git a/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md b/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md index 76e673c886d4208354b680501c6ddbb0000e6438..bfda17b7872a816c4eb05a3af9fc5c10098f0a90 100644 --- a/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md +++ b/en/application-dev/reference/apis/js-apis-inner-notification-notificationUserInput.md @@ -8,6 +8,6 @@ The **NotificationUserInput** module provides the notification user input. **System capability**: SystemCapability.Notification.Notification -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | -------- | ------ | --- | ---- | ----------------------------- | -| inputKey | string | Yes | Yes | Key to identify the user input.| +| inputKey | string | No | Yes | Key to identify the user input.| diff --git a/en/application-dev/reference/apis/js-apis-logs.md b/en/application-dev/reference/apis/js-apis-logs.md index bda44776ef9cf1674796260c5eba54e07b22d599..fa73f169b26bec6240b6205c2970af08f5def1f8 100644 --- a/en/application-dev/reference/apis/js-apis-logs.md +++ b/en/application-dev/reference/apis/js-apis-logs.md @@ -1,4 +1,4 @@ -# console +# Console The **console** module provides a simple debugging console, which is similar to the JavaScript console provided by the browser. diff --git a/en/application-dev/reference/apis/js-apis-net-ethernet.md b/en/application-dev/reference/apis/js-apis-net-ethernet.md index ec15531de49c13ab4b2c85b0da9eacf37400d195..eca9a04d0e42791e19a3620f6582f3d7284dc6d4 100644 --- a/en/application-dev/reference/apis/js-apis-net-ethernet.md +++ b/en/application-dev/reference/apis/js-apis-net-ethernet.md @@ -55,8 +55,7 @@ ethernet.setIfaceConfig("eth0", { route: "192.168.xx.xxx", gateway: "192.168.xx.xxx", netMask: "255.255.255.0", - dnsServers: "1.1.1.1", - domain: "2.2.2.2" + dnsServers: "1.1.1.1" }, (error) => { if (error) { console.log("setIfaceConfig callback error = " + JSON.stringify(error)); @@ -115,8 +114,7 @@ ethernet.setIfaceConfig("eth0", { route: "192.168.xx.xxx", gateway: "192.168.xx.xxx", netMask: "255.255.255.0", - dnsServers: "1.1.1.1", - domain: "2.2.2.2" + dnsServers: "1.1.1.1" }).then(() => { console.log("setIfaceConfig promise ok "); }).catch(error => { @@ -168,7 +166,6 @@ ethernet.getIfaceConfig("eth0", (error, value) => { console.log("getIfaceConfig callback gateway = " + JSON.stringify(value.gateway)); console.log("getIfaceConfig callback netMask = " + JSON.stringify(value.netMask)); console.log("getIfaceConfig callback dnsServers = " + JSON.stringify(value.dnsServers)); - console.log("getIfaceConfig callback domain = " + JSON.stringify(value.domain)); } }); ``` @@ -219,7 +216,6 @@ ethernet.getIfaceConfig("eth0").then((data) => { console.log("getIfaceConfig promise gateway = " + JSON.stringify(data.gateway)); console.log("getIfaceConfig promise netMask = " + JSON.stringify(data.netMask)); console.log("getIfaceConfig promise dnsServers = " + JSON.stringify(data.dnsServers)); - console.log("getIfaceConfig promise domain = " + JSON.stringify(data.domain)); }).catch(error => { console.log("getIfaceConfig promise error = " + JSON.stringify(error)); }); diff --git a/en/application-dev/reference/apis/js-apis-notification.md b/en/application-dev/reference/apis/js-apis-notification.md index b0ad704b1848025f7b049f9c0cda6d12f2175554..646f07fc4d30ec6ad4585eacd840a99954b34973 100644 --- a/en/application-dev/reference/apis/js-apis-notification.md +++ b/en/application-dev/reference/apis/js-apis-notification.md @@ -566,7 +566,7 @@ Notification.getSlot(slotType).then((data) => { ## Notification.getSlots -getSlots(callback: AsyncCallback>): void +getSlots(callback: AsyncCallback\>): void Obtains all notification slots. This API uses an asynchronous callback to return the result. @@ -576,7 +576,7 @@ Obtains all notification slots. This API uses an asynchronous callback to return | Name | Type | Mandatory| Description | | -------- | --------------------------------- | ---- | -------------------- | -| callback | AsyncCallback\\> | Yes | Callback used to return the result.| +| callback | AsyncCallback\> | Yes | Callback used to return the result.| **Example** @@ -726,7 +726,7 @@ Subscribes to a notification with the subscription information specified. This A | Name | Type | Mandatory| Description | | ---------- | ------------------------- | ---- | ---------------- | -| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | +| subscriber | [NotificationSubscriber](js-apis-inner-notification-notificationSubscriber.md#notificationsubscriber) | Yes | Notification subscriber. | | info | [NotificationSubscribeInfo](#notificationsubscribeinfo) | Yes | Notification subscription information.| | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -769,7 +769,7 @@ Subscribes to notifications of all applications under this user. This API uses a | Name | Type | Mandatory| Description | | ---------- | ---------------------- | ---- | ---------------- | -| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | +| subscriber | [NotificationSubscriber](js-apis-inner-notification-notificationSubscriber.md#notificationsubscriber) | Yes | Notification subscriber. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -807,7 +807,7 @@ Subscribes to a notification with the subscription information specified. This A | Name | Type | Mandatory| Description | | ---------- | ------------------------- | ---- | ------------ | -| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| +| subscriber | [NotificationSubscriber](js-apis-inner-notification-notificationSubscriber.md#notificationsubscriber) | Yes | Notification subscriber.| | info | [NotificationSubscribeInfo](#notificationsubscribeinfo) | No | Notification subscription information. | **Example** @@ -840,7 +840,7 @@ Unsubscribes from a notification. This API uses an asynchronous callback to retu | Name | Type | Mandatory| Description | | ---------- | ---------------------- | ---- | -------------------- | -| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber. | +| subscriber | [NotificationSubscriber](js-apis-inner-notification-notificationSubscriber.md#notificationsubscriber) | Yes | Notification subscriber. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -878,7 +878,7 @@ Unsubscribes from a notification. This API uses a promise to return the result. | Name | Type | Mandatory| Description | | ---------- | ---------------------- | ---- | ------------ | -| subscriber | [NotificationSubscriber](#notificationsubscriber) | Yes | Notification subscriber.| +| subscriber | [NotificationSubscriber](js-apis-inner-notification-notificationSubscriber.md#notificationsubscriber) | Yes | Notification subscriber.| **Example** @@ -910,7 +910,7 @@ Sets whether to enable notification for a specified application. This API uses a | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | -------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | enable | boolean | Yes | Whether to enable notification. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -946,7 +946,7 @@ Sets whether to enable notification for a specified application. This API uses a | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| | enable | boolean | Yes | Whether to enable notification. | **Example** @@ -976,7 +976,7 @@ Checks whether notification is enabled for a specified application. This API use | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ------------------------ | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1011,7 +1011,7 @@ Checks whether notification is enabled for a specified application. This API use | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| **Return value** @@ -1078,7 +1078,7 @@ Checks whether notification is enabled for this application. This API uses a pro | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| **Return value** @@ -1110,7 +1110,7 @@ Sets whether to enable the notification badge for a specified application. This | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | -------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | enable | boolean | Yes | Whether to enable notification. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -1146,7 +1146,7 @@ Sets whether to enable the notification badge for a specified application. This | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| | enable | boolean | Yes | Whether to enable notification. | **Example** @@ -1176,7 +1176,7 @@ Checks whether the notification badge is enabled for a specified application. Th | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ------------------------ | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1211,7 +1211,7 @@ Checks whether the notification badge is enabled for a specified application. Th | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| **Return value** @@ -1246,7 +1246,7 @@ Sets the notification slot for a specified application. This API uses an asynchr | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | -------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | slot | [NotificationSlot](#notificationslot) | Yes | Notification slot. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -1285,7 +1285,7 @@ Sets the notification slot for a specified application. This API uses a promise | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| | slot | [NotificationSlot](#notificationslot) | Yes | Notification slot.| **Example** @@ -1304,7 +1304,7 @@ Notification.setSlotByBundle(bundle, notificationSlot).then(() => { ## Notification.getSlotsByBundle -getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback>): void +getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback\>): void Obtains the notification slots of a specified application. This API uses an asynchronous callback to return the result. @@ -1318,8 +1318,8 @@ Obtains the notification slots of a specified application. This API uses an asyn | Name | Type | Mandatory| Description | | -------- | ---------------------------------------- | ---- | -------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | -| callback | AsyncCallback> | Yes | Callback used to return the result.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | +| callback | AsyncCallback\> | Yes | Callback used to return the result.| **Example** @@ -1339,7 +1339,7 @@ Notification.getSlotsByBundle(bundle, getSlotsByBundleCallback); ## Notification.getSlotsByBundle -getSlotsByBundle(bundle: BundleOption): Promise> +getSlotsByBundle(bundle: BundleOption): Promise\> Obtains the notification slots of a specified application. This API uses a promise to return the result. @@ -1353,13 +1353,13 @@ Obtains the notification slots of a specified application. This API uses a promi | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| **Return value** | Type | Description | | ----------------------------------------------------------- | ------------------------------------------------------------ | -| Promise> | Promise used to return the result.| +| Promise\> | Promise used to return the result.| **Example** @@ -1388,7 +1388,7 @@ Obtains the number of notification slots of a specified application. This API us | Name | Type | Mandatory| Description | | -------- | ------------------------- | ---- | ---------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1423,7 +1423,7 @@ Obtains the number of notification slots of a specified application. This API us | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| **Return value** @@ -1458,9 +1458,9 @@ Removes a notification for a specified bundle. This API uses an asynchronous cal | Name | Type | Mandatory| Description | | --------------- | ----------------------------------| ---- | -------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | -| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | -| reason | [RemoveReason](#removereason9) | Yes | Indicates the reason for deleting a notification. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | +| notificationKey | [NotificationKey](#notificationkeydeprecated) | Yes | Notification key. | +| reason | [RemoveReason](#removereason9-deprecated) | Yes | Indicates the reason for deleting a notification. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1500,9 +1500,9 @@ Removes a notification for a specified bundle. This API uses a promise to return | Name | Type | Mandatory| Description | | --------------- | --------------- | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application.| -| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | -| reason | [RemoveReason](#removereason9) | Yes | Reason for deleting the notification. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application.| +| notificationKey | [NotificationKey](#notificationkeydeprecated) | Yes | Notification key. | +| reason | [RemoveReason](#removereason9-deprecated) | Yes | Reason for deleting the notification. | **Example** @@ -1536,8 +1536,8 @@ Removes a notification for a specified bundle. This API uses an asynchronous cal | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | -------------------- | -| hashCode | string | Yes | Unique notification ID. It is the **hashCode** in the [NotificationRequest](#notificationrequest) object of [SubscribeCallbackData](#subscribecallbackdata) of the [onConsume](#onconsume) callback.| -| reason | [RemoveReason](#removereason9) | Yes | Indicates the reason for deleting a notification. | +| hashCode | string | Yes | Unique notification ID. It is the **hashCode** in the [NotificationRequest](#notificationrequest) object of [SubscribeCallbackData](#subscribecallbackdata) of the [onConsume](js-apis-inner-notification-notificationSubscriber.md#onconsume) callback. | +| reason | [RemoveReason](#removereason9-deprecated) | Yes | Indicates the reason for deleting a notification. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1573,7 +1573,7 @@ Removes a notification for a specified bundle. This API uses a promise to return | Name | Type | Mandatory| Description | | -------- | ---------- | ---- | ---------- | | hashCode | string | Yes | Unique notification ID.| -| reason | [RemoveReason](#removereason9) | Yes | Reason for deleting the notification. | +| reason | [RemoveReason](#removereason9-deprecated) | Yes | Reason for deleting the notification. | **Example** @@ -1601,7 +1601,7 @@ Removes all notifications for a specified application. This API uses an asynchro | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ---------------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1668,7 +1668,7 @@ Removes all notifications for a specified application. This API uses a promise t | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](#bundleoption) | No | Bundle information of the application.| +| bundle | [BundleOption](#bundleoptiondeprecated) | No | Bundle information of the application.| **Example** @@ -1743,7 +1743,7 @@ Notification.removeAll(userId).then(() => { ## Notification.getAllActiveNotifications -getAllActiveNotifications(callback: AsyncCallback>): void +getAllActiveNotifications(callback: AsyncCallback\>): void Obtains all active notifications. This API uses an asynchronous callback to return the result. @@ -1757,7 +1757,7 @@ Obtains all active notifications. This API uses an asynchronous callback to retu | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------------------ | ---- | -------------------- | -| callback | AsyncCallback> | Yes | Callback used to return the result.| +| callback | AsyncCallback\> | Yes | Callback used to return the result.| **Example** @@ -1775,7 +1775,7 @@ Notification.getAllActiveNotifications(getAllActiveNotificationsCallback); ## Notification.getAllActiveNotifications -getAllActiveNotifications(): Promise\\> +getAllActiveNotifications(): Promise\> Obtains all active notifications. This API uses a promise to return the result. @@ -1789,7 +1789,7 @@ Obtains all active notifications. This API uses a promise to return the result. | Type | Description | | ----------------------------------------------------------- | ------------------------------------------------------------ | -| Promise\\> | Promise used to return the result.| +| Promise\> | Promise used to return the result.| **Example** @@ -1969,7 +1969,7 @@ Removes notifications under a notification group of a specified application. Thi | Name | Type | Mandatory| Description | | --------- | --------------------- | ---- | ---------------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | groupName | string | Yes | Name of the notification group. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -2006,7 +2006,7 @@ Removes notifications under a notification group of a specified application. Thi | Name | Type | Mandatory| Description | | --------- | ------------ | ---- | -------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | groupName | string | Yes | Name of the notification group.| **Example** @@ -2035,7 +2035,7 @@ Sets the DND time. This API uses an asynchronous callback to return the result. | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ---------------------- | -| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set. | +| date | [DoNotDisturbDate](#donotdisturbdate8-deprecated) | Yes | DND time to set. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -2074,7 +2074,7 @@ Sets the DND time. This API uses a promise to return the result. | Name| Type | Mandatory| Description | | ---- | ---------------- | ---- | -------------- | -| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set.| +| date | [DoNotDisturbDate](#donotdisturbdate8-deprecated) | Yes | DND time to set.| **Example** @@ -2106,7 +2106,7 @@ Sets the DND time for a specified user. This API uses an asynchronous callback t | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ---------------------- | -| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set. | +| date | [DoNotDisturbDate](#donotdisturbdate8-deprecated) | Yes | DND time to set. | | userId | number | Yes | ID of the user for whom you want to set the DND time.| | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -2147,7 +2147,7 @@ Sets the DND time for a specified user. This API uses a promise to return the re | Name | Type | Mandatory| Description | | ------ | ---------------- | ---- | -------------- | -| date | [DoNotDisturbDate](#donotdisturbdate8) | Yes | DND time to set.| +| date | [DoNotDisturbDate](#donotdisturbdate8-deprecated) | Yes | DND time to set.| | userId | number | Yes | ID of the user for whom you want to set the DND time.| **Example** @@ -2183,7 +2183,7 @@ Obtains the DND time. This API uses an asynchronous callback to return the resul | Name | Type | Mandatory| Description | | -------- | --------------------------------- | ---- | ---------------------- | -| callback | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8)\> | Yes | Callback used to return the result.| +| callback | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8-deprecated)\> | Yes | Callback used to return the result.| **Example** @@ -2215,7 +2215,7 @@ Obtains the DND time. This API uses a promise to return the result. | Type | Description | | ------------------------------------------------- | ----------------------------------------- | -| Promise\<[DoNotDisturbDate](#donotdisturbdate8)\> | Promise used to return the result.| +| Promise\<[DoNotDisturbDate](#donotdisturbdate8-deprecated)\> | Promise used to return the result.| **Example** @@ -2242,7 +2242,7 @@ Obtains the DND time of a specified user. This API uses an asynchronous callback | Name | Type | Mandatory| Description | | -------- | --------------------------------- | ---- | ---------------------- | -| callback | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8)\> | Yes | Callback used to return the result.| +| callback | AsyncCallback\<[DoNotDisturbDate](#donotdisturbdate8-deprecated)\> | Yes | Callback used to return the result.| | userId | number | Yes | User ID.| **Example** @@ -2283,7 +2283,7 @@ Obtains the DND time of a specified user. This API uses a promise to return the | Type | Description | | ------------------------------------------------- | ----------------------------------------- | -| Promise\<[DoNotDisturbDate](#donotdisturbdate8)\> | Promise used to return the result.| +| Promise\<[DoNotDisturbDate](#donotdisturbdate8-deprecated)\> | Promise used to return the result.| **Example** @@ -2589,7 +2589,7 @@ Sets whether a specified application supports distributed notifications. This AP | Name | Type | Mandatory| Description | | -------- | ------------------------ | ---- | -------------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Bundle information of the application. | | enable | boolean | Yes | Whether the device supports distributed notifications. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -2629,7 +2629,7 @@ Sets whether a specified application supports distributed notifications. This AP | Name | Type | Mandatory| Description | | -------- | ------------------------ | ---- | -------------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Application bundle. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Application bundle. | | enable | boolean | Yes | Whether the device supports distributed notifications. | **Example** @@ -2661,7 +2661,7 @@ Obtains whether an application supports distributed notifications based on the b | Name | Type | Mandatory| Description | | -------- | ------------------------ | ---- | -------------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Application bundle. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Application bundle. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -2698,7 +2698,7 @@ Checks whether a specified application supports distributed notifications. This | Name | Type | Mandatory| Description | | -------- | ------------------------ | ---- | -------------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Application bundle. | +| bundle | [BundleOption](#bundleoptiondeprecated) | Yes | Application bundle. | **Return value** @@ -2735,7 +2735,7 @@ Obtains the notification reminder type. This API uses an asynchronous callback t | Name | Type | Mandatory| Description | | -------- | --------------------------------- | ---- | -------------------------- | -| callback | AsyncCallback\<[DeviceRemindType](#deviceremindtype8)\> | Yes | Callback used to return the result.| +| callback | AsyncCallback\<[DeviceRemindType](#deviceremindtype8-deprecated)\> | Yes | Callback used to return the result.| **Example** @@ -2767,7 +2767,7 @@ Obtains the notification reminder type. This API uses a promise to return the re | Type | Description | | ------------------ | --------------- | -| Promise\<[DeviceRemindType](#deviceremindtype8)\> | Promise used to return the result.| +| Promise\<[DeviceRemindType](#deviceremindtype8-deprecated)\> | Promise used to return the result.| **Example** @@ -2777,1033 +2777,255 @@ Notification.getDeviceRemindType().then((data) => { }); ``` - -## Notification.publishAsBundle9+ - -publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number, callback: AsyncCallback\): void - -Publishes an agent-powered notification. This API uses an asynchronous callback to return the result. +## SubscribeCallbackData **System capability**: SystemCapability.Notification.Notification -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER - **System API**: This is a system API and cannot be called by third-party applications. -**Parameters** +| Name | Type | Readable| Writable| Description | +| --------------- | ------------------------------------------------- | ---- | --- | -------- | +| request | [NotificationRequest](#notificationrequest) | Yes | No | Notification content.| +| sortingMap | [NotificationSortingMap](#notificationsortingmap) | Yes | No | Notification sorting information.| +| reason | number | Yes | No | Reason for deletion.| +| sound | string | Yes | No | Sound used for notification.| +| vibrationValues | Array\ | Yes | No | Vibration used for notification.| -| Name | Type | Mandatory| Description | -| -------------------- | ------------------------------------------- | ---- | ---------------------------------------- | -| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| -| representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent. | -| userId | number | Yes | User ID. | -| callback | AsyncCallback | Yes | Callback used to return the result. | -**Example** +## EnabledNotificationCallbackData8+ -```js -// publishAsBundle callback -function callback(err) { - if (err.code) { - console.info("publishAsBundle failed " + JSON.stringify(err)); - } else { - console.info("publishAsBundle success"); - } -} -// Bundle name of the application whose notification function is taken over by the reminder agent -let representativeBundle = "com.example.demo"; -// User ID -let userId = 100; -// NotificationRequest object -let request = { - id: 1, - content: { - contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - } -}; +**System capability**: SystemCapability.Notification.Notification -Notification.publishAsBundle(request, representativeBundle, userId, callback); -``` +**System API**: This is a system API and cannot be called by third-party applications. -## Notification.publishAsBundle9+ +| Name | Type | Readable| Writable| Description | +| ------ | ------- | ---- | --- | ---------------- | +| bundle | string | Yes | No | Bundle name of the application. | +| uid | number | Yes | No | UID of the application. | +| enable | boolean | Yes | No | Notification enabled status of the application.| -publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise\ -Publishes a notification through the reminder agent. This API uses a promise to return the result. +## DoNotDisturbDate8+ deprecated **System capability**: SystemCapability.Notification.Notification -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER +> **NOTE** +> +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [notificationManager.DoNotDisturbDate](js-apis-notificationManager.md#donotdisturbdate) instead. **System API**: This is a system API and cannot be called by third-party applications. -**Parameters** - +| Name | Type | Readable| Writable| Description | +| ----- | -------------------------------------- | ---- | ---- | ---------------------- | +| type | [DoNotDisturbType](#donotdisturbtype8-deprecated) | Yes | Yes | DND time type.| +| begin | Date | Yes | Yes | DND start time.| +| end | Date | Yes | Yes | DND end time.| -| Name | Type | Mandatory| Description | -| -------------------- | ------------------------------------------- | ---- | --------------------------------------------- | -| request | [NotificationRequest](#notificationrequest) | Yes | Content and related configuration of the notification to publish.| -| representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent. | -| userId | number | Yes | User ID. | +## DoNotDisturbType8+ deprecated -**Example** +**System capability**: SystemCapability.Notification.Notification -```js -// Bundle name of the application whose notification function is taken over by the reminder agent -let representativeBundle = "com.example.demo"; -// User ID -let userId = 100; -// NotificationRequest object -let request = { - id: 1, - content: { - contentType: Notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - } -}; +> **NOTE** +> +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [notificationManager.DoNotDisturbType](js-apis-notificationManager.md#donotdisturbtype) instead. -Notification.publishAsBundle(request, representativeBundle, userId).then(() => { - console.info("publishAsBundle success"); -}); -``` +**System API**: This is a system API and cannot be called by third-party applications. -## Notification.cancelAsBundle9+ +| Name | Value | Description | +| ------------ | ---------------- | ------------------------------------------ | +| TYPE_NONE | 0 | Non-DND. | +| TYPE_ONCE | 1 | One-shot DND at the specified time segment (only considering the hour and minute).| +| TYPE_DAILY | 2 | Daily DND at the specified time segment (only considering the hour and minute).| +| TYPE_CLEARLY | 3 | DND at the specified time segment (considering the year, month, day, hour, and minute). | -cancelAsBundle(id: number, representativeBundle: string, userId: number, callback: AsyncCallback\): void -Cancels a notification published by the reminder agent. This API uses an asynchronous callback to return the result. +## ContentType **System capability**: SystemCapability.Notification.Notification -**System API**: This is a system API and cannot be called by third-party applications. - -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER +| Name | Value | Description | +| --------------------------------- | ----------- | ------------------ | +| NOTIFICATION_CONTENT_BASIC_TEXT | NOTIFICATION_CONTENT_BASIC_TEXT | Normal text notification. | +| NOTIFICATION_CONTENT_LONG_TEXT | NOTIFICATION_CONTENT_LONG_TEXT | Long text notification. | +| NOTIFICATION_CONTENT_PICTURE | NOTIFICATION_CONTENT_PICTURE | Picture-attached notification. | +| NOTIFICATION_CONTENT_CONVERSATION | NOTIFICATION_CONTENT_CONVERSATION | Conversation notification. | +| NOTIFICATION_CONTENT_MULTILINE | NOTIFICATION_CONTENT_MULTILINE | Multi-line text notification.| -**System API**: This is a system API and cannot be called by third-party applications. +## SlotLevel -**Parameters** +**System capability**: SystemCapability.Notification.Notification -| Name | Type | Mandatory| Description | -| -------------------- | ------------- | ---- | ------------------------ | -| id | number | Yes | Notification ID. | -| representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent. | -| userId | number | Yes | User ID. | -| callback | AsyncCallback | Yes | Callback used to return the result.| +| Name | Value | Description | +| --------------------------------- | ----------- | ------------------ | +| LEVEL_NONE | 0 | The notification function is disabled. | +| LEVEL_MIN | 1 | The notification function is enabled, but the notification icon is not displayed in the status bar, with no banner or alert tone.| +| LEVEL_LOW | 2 | The notification function is enabled, and the notification icon is displayed in the status bar, with no banner or alert tone.| +| LEVEL_DEFAULT | 3 | The notification feature is enabled, and the notification icon is displayed in the status bar, with an alert tone but no banner.| +| LEVEL_HIGH | 4 | The notification feature is enabled, and the notification icon is displayed in the status bar, with an alert tone and banner.| -**Example** -```js -// cancelAsBundle -function cancelAsBundleCallback(err) { - if (err.code) { - console.info("cancelAsBundle failed " + JSON.stringify(err)); - } else { - console.info("cancelAsBundle success"); - } -} -// Bundle name of the application whose notification function is taken over by the reminder agent -let representativeBundle = "com.example.demo"; -// User ID -let userId = 100; +## BundleOptiondeprecated -Notification.cancelAsBundle(0, representativeBundle, userId, cancelAsBundleCallback); -``` +**System capability**: SystemCapability.Notification.Notification -## Notification.cancelAsBundle9+ +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [notificationManager.BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) instead. -cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise\ +| Name | Type | Read-only| Mandatory| Description | +| ------ | ------ |---- | --- | ------ | +| bundle | string | No | Yes | Bundle information of the application.| +| uid | number | No | No | User ID.| -Cancels a notification published by the reminder agent. This API uses a promise to return the result. +## NotificationKeydeprecated **System capability**: SystemCapability.Notification.Notification -**System API**: This is a system API and cannot be called by third-party applications. - -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER - -**System API**: This is a system API and cannot be called by third-party applications. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [notificationManager.NotificationKey](js-apis-notificationSubscribe.md#notificationkey) instead. -**Parameters** +| Name | Type | Readable| Writable| Description | +| ----- | ------ | ---- | --- | -------- | +| id | number | Yes | Yes | Notification ID. | +| label | string | Yes | Yes | Notification label.| -| Name | Type | Mandatory| Description | -| -------------------- | ------ | ---- | ------------------ | -| id | number | Yes | Notification ID. | -| representativeBundle | string | Yes | Bundle name of the application whose notification function is taken over by the reminder agent.| -| userId | number | Yes | User ID.| -**Example** +## SlotType -```js -// Bundle name of the application whose notification function is taken over by the reminder agent -let representativeBundle = "com.example.demo"; -// User ID -let userId = 100; +**System capability**: SystemCapability.Notification.Notification -Notification.cancelAsBundle(0, representativeBundle, userId).then(() => { - console.info("cancelAsBundle success"); -}); -``` +| Name | Value | Description | +| -------------------- | -------- | ---------- | +| UNKNOWN_TYPE | 0 | Unknown type.| +| SOCIAL_COMMUNICATION | 1 | Notification slot for social communication.| +| SERVICE_INFORMATION | 2 | Notification slot for service information.| +| CONTENT_INFORMATION | 3 | Notification slot for content consultation.| +| OTHER_TYPES | 0xFFFF | Notification slot for other purposes.| -## Notification.enableNotificationSlot 9+ -enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean, callback: AsyncCallback\): void +## NotificationActionButton -Sets the enabled status of a notification slot type for a specified application. This API uses an asynchronous callback to return the result. +Describes the button displayed in the notification. **System capability**: SystemCapability.Notification.Notification -**System API**: This is a system API and cannot be called by third-party applications. - -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER +| Name | Type | Readable| Writable| Description | +| --------- | ----------------------------------------------- | --- | ---- | ------------------------- | +| title | string | Yes | Yes | Button title. | +| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** of the button.| +| extras | { [key: string]: any } | Yes | Yes | Extra information of the button. | +| userInput8+ | [NotificationUserInput](#notificationuserinput8) | Yes | Yes | User input object. | -**Parameters** -| Name | Type | Mandatory| Description | -| -------- | ----------------------------- | ---- | ---------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | -| type | [SlotType](#slottype) | Yes | Notification slot type. | -| enable | boolean | Yes | Whether to enable notification. | -| callback | AsyncCallback\ | Yes | Callback used to return the result.| +## NotificationBasicContent -**Example** +Describes the normal text notification. -```js -// enableNotificationSlot -function enableSlotCallback(err) { - if (err.code) { - console.info("enableNotificationSlot failed " + JSON.stringify(err)); - } else { - console.info("enableNotificationSlot success"); - } -}; +**System capability**: SystemCapability.Notification.Notification -Notification.enableNotificationSlot( - { bundle: "ohos.samples.notification", }, - Notification.SlotType.SOCIAL_COMMUNICATION, - true, - enableSlotCallback); -``` +| Name | Type | Readable| Writable| Description | +| -------------- | ------ | ---- | ---- | ---------------------------------- | +| title | string | Yes | Yes | Notification title. | +| text | string | Yes | Yes | Notification content. | +| additionalText | string | Yes | Yes | Additional information of the notification.| -## Notification.enableNotificationSlot 9+ -enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean): Promise\ +## NotificationLongTextContent -Sets the enabled status of a notification slot type for a specified application. This API uses a promise to return the result. +Describes the long text notification. **System capability**: SystemCapability.Notification.Notification -**System API**: This is a system API and cannot be called by third-party applications. +| Name | Type | Readable| Writable| Description | +| -------------- | ------ | ---- | --- | -------------------------------- | +| title | string | Yes | Yes | Notification title. | +| text | string | Yes | Yes | Notification content. | +| additionalText | string | Yes | Yes | Additional information of the notification.| +| longText | string | Yes | Yes | Long text of the notification. | +| briefText | string | Yes | Yes | Brief text of the notification.| +| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. | -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER -**Parameters** +## NotificationMultiLineContent -| Name| Type | Mandatory| Description | -| ------ | ----------------------------- | ---- | -------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | -| type | [SlotType](#slottype) | Yes | Notification slot type.| -| enable | boolean | Yes | Whether to enable notification. | +Describes the multi-line text notification. -**Example** +**System capability**: SystemCapability.Notification.Notification -```js -// enableNotificationSlot -Notification.enableNotificationSlot({ bundle: "ohos.samples.notification", }, - Notification.SlotType.SOCIAL_COMMUNICATION,true).then(() => { - console.info("enableNotificationSlot success"); -}); -``` +| Name | Type | Readable| Writable| Description | +| -------------- | --------------- | --- | --- | -------------------------------- | +| title | string | Yes | Yes | Notification title. | +| text | string | Yes | Yes | Notification content. | +| additionalText | string | Yes | Yes | Additional information of the notification.| +| briefText | string | Yes | Yes | Brief text of the notification.| +| longTitle | string | Yes | Yes | Title of the notification in the expanded state. | +| lines | Array\ | Yes | Yes | Multi-line text of the notification. | -## Notification.isNotificationSlotEnabled 9+ -isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback\): void +## NotificationPictureContent -Checks whether a specified notification slot type is enabled for a specified application. This API uses an asynchronous callback to return the result. +Describes the picture-attached notification. **System capability**: SystemCapability.Notification.Notification -**System API**: This is a system API and cannot be called by third-party applications. - -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER +| Name | Type | Readable| Writable| Description | +| -------------- | -------------- | ---- | --- | -------------------------------- | +| title | string | Yes | Yes | Notification title. | +| text | string | Yes | Yes | Notification content. | +| additionalText | string | Yes | Yes | Additional information of the notification.| +| briefText | string | Yes | Yes | Brief text of the notification.| +| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. | +| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Picture attached to the notification. | -**Parameters** -| Name | Type | Mandatory| Description | -| -------- | ----------------------------- | ---- | ---------------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | -| type | [SlotType](#slottype) | Yes | Notification slot type. | -| callback | AsyncCallback\ | Yes | Callback used to return the result.| +## NotificationContent -**Example** +Describes the notification content. -```js -// isNotificationSlotEnabled -function getEnableSlotCallback(err, data) { - if (err.code) { - console.info("isNotificationSlotEnabled failed " + JSON.stringify(err)); - } else { - console.info("isNotificationSlotEnabled success"); - } -}; +**System capability**: SystemCapability.Notification.Notification -Notification.isNotificationSlotEnabled( - { bundle: "ohos.samples.notification", }, - Notification.SlotType.SOCIAL_COMMUNICATION, - getEnableSlotCallback); -``` +| Name | Type | Readable| Writable| Description | +| ----------- | ------------------------------------------------------------ | ---- | --- | ------------------ | +| contentType | [ContentType](#contenttype) | Yes | Yes | Notification content type. | +| normal | [NotificationBasicContent](#notificationbasiccontent) | Yes | Yes | Normal text. | +| longText | [NotificationLongTextContent](#notificationlongtextcontent) | Yes | Yes | Long text.| +| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | Yes | Yes | Multi-line text. | +| picture | [NotificationPictureContent](#notificationpicturecontent) | Yes | Yes | Picture-attached. | -## Notification.isNotificationSlotEnabled 9+ -isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise\ +## NotificationFlagStatus8+ -Checks whether a specified notification slot type is enabled for a specified application. This API uses a promise to return the result. +Describes the notification flag status. **System capability**: SystemCapability.Notification.Notification **System API**: This is a system API and cannot be called by third-party applications. -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER - -**Parameters** - -| Name| Type | Mandatory| Description | -| ------ | ----------------------------- | ---- | -------------- | -| bundle | [BundleOption](#bundleoption) | Yes | Bundle information of the application. | -| type | [SlotType](#slottype) | Yes | Notification slot type.| - -**Return value** - -| Type | Description | -| ------------------ | ------------------------------- | -| Promise\ | Promise used to return the result.| - -**Example** - -```js -// isNotificationSlotEnabled -Notification.isNotificationSlotEnabled({ bundle: "ohos.samples.notification", }, - Notification.SlotType.SOCIAL_COMMUNICATION).then((data) => { - console.info("isNotificationSlotEnabled success, data: " + JSON.stringify(data)); -}); -``` - +| Name | Value | Description | +| -------------- | --- | --------------------------------- | +| TYPE_NONE | 0 | The default flag is used. | +| TYPE_OPEN | 1 | The notification flag is enabled. | +| TYPE_CLOSE | 2 | The notification flag is disabled. | -## Notification.setSyncNotificationEnabledWithoutApp9+ -setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean, callback: AsyncCallback\): void +## NotificationFlags8+ -Sets whether to enable the notification sync feature for devices where the application is not installed. This API uses an asynchronous callback to return the result. +Enumerates notification flags. **System capability**: SystemCapability.Notification.Notification -**System API**: This is a system API and cannot be called by third-party applications. +| Name | Type | Readable| Writable| Description | +| ---------------- | ---------------------- | ---- | ---- | --------------------------------- | +| soundEnabled | [NotificationFlagStatus](#notificationflagstatus8) | Yes | No | Whether to enable the sound alert for the notification. | +| vibrationEnabled | [NotificationFlagStatus](#notificationflagstatus8) | Yes | No | Whether to enable vibration for the notification. | -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER -**Parameters** +## NotificationRequest -| Name| Type | Mandatory| Description | -| ------ | ----------------------------- | ---- | -------------- | -| userId | number | Yes | User ID. | -| enable | boolean | Yes | Whether the feature is enabled. | -| callback | AsyncCallback\ | Yes | Callback used to return the result.| +Describes the notification request. -**Example** - -```js -let userId = 100; -let enable = true; - -function callback(err) { - if (err.code) { - console.info("setSyncNotificationEnabledWithoutApp failed " + JSON.stringify(err)); - } else { - console.info("setSyncNotificationEnabledWithoutApp success"); - } -} - -Notification.setSyncNotificationEnabledWithoutApp(userId, enable, callback); -``` - - -## Notification.setSyncNotificationEnabledWithoutApp9+ - -setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean): Promise\ - -Sets whether to enable the notification sync feature for devices where the application is not installed. This API uses a promise to return the result. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER - -**Parameters** - -| Name| Type | Mandatory| Description | -| ------ | ----------------------------- | ---- | -------------- | -| userId | number | Yes | User ID. | -| enable | boolean | Yes | Whether the feature is enabled. | - -**Return value** - -| Type | Description | -| ----------------------------------------------------------- | ------------------------------------------------------------ | -| Promise\ | Promise used to return the result.| - -**Example** - -```js -let userId = 100; -let enable = true; - -Notification.setSyncNotificationEnabledWithoutApp(userId, enable).then(() => { - console.info('setSyncNotificationEnabledWithoutApp success'); -}).catch((err) => { - console.info('setSyncNotificationEnabledWithoutApp, err:' + JSON.stringify(err)); -}); -``` - - -## Notification.getSyncNotificationEnabledWithoutApp9+ - -getSyncNotificationEnabledWithoutApp(userId: number, callback: AsyncCallback\): void - -Obtains whether the notification sync feature is enabled for devices where the application is not installed. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER - -**Parameters** - -| Name| Type | Mandatory| Description | -| ------ | ----------------------------- | ---- | -------------- | -| userId | number | Yes | User ID. | -| callback | AsyncCallback\ | Yes | Callback used to return the result.| - -**Example** - -```js -let userId = 100; - -function getSyncNotificationEnabledWithoutAppCallback(err, data) { - if (err) { - console.info('getSyncNotificationEnabledWithoutAppCallback, err:' + err); - } else { - console.info('getSyncNotificationEnabledWithoutAppCallback, data:' + data); - } -} - -Notification.getSyncNotificationEnabledWithoutApp(userId, getSyncNotificationEnabledWithoutAppCallback); -``` - - -## Notification.getSyncNotificationEnabledWithoutApp9+ - -getSyncNotificationEnabledWithoutApp(userId: number): Promise\ - -Obtains whether the notification sync feature is enabled for devices where the application is not installed. This API uses a promise to return the result. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER - -**Parameters** - -| Name| Type | Mandatory| Description | -| ------ | ----------------------------- | ---- | -------------- | -| userId | number | Yes | User ID. | - -**Return value** - -| Type | Description | -| ------------------ | ------------------------------------------------------------ | -| Promise\ | Promise used to return the result.| - -**Example** - -```js -let userId = 100; -Notification.getSyncNotificationEnabledWithoutApp(userId).then((data) => { - console.info('getSyncNotificationEnabledWithoutApp, data:' + data); -}).catch((err) => { - console.info('getSyncNotificationEnabledWithoutApp, err:' + err); -}); -``` - -## NotificationSubscriber - -Provides callbacks for receiving or removing notifications and serves as the input parameter of [subscribe](#notificationsubscribe). - -**System API**: This is a system API and cannot be called by third-party applications. - -### onConsume - -onConsume?: (data: [SubscribeCallbackData](#subscribecallbackdata)) => void - -Callback for receiving notifications. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| data | [SubscribeCallbackData](#subscribecallbackdata) | Yes| Information about the notification received.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; - -function onConsumeCallback(data) { - let req = data.request; - console.info('===> onConsume callback req.id:' + req.id); -}; - -let subscriber = { - onConsume: onConsumeCallback -}; - -Notification.subscribe(subscriber, subscribeCallback); -``` - -### onCancel - -onCancel?:(data: [SubscribeCallbackData](#subscribecallbackdata)) => void - -Callback for canceling notifications. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| data | [SubscribeCallbackData](#subscribecallbackdata) | Yes| Information about the notification to cancel.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; - -function onCancelCallback(data) { - let req = data.request; - console.info('===> onCancel callback req.id:' + req.id); -} - -let subscriber = { - onCancel: onCancelCallback -}; - -Notification.subscribe(subscriber, subscribeCallback); -``` - -### onUpdate - -onUpdate?:(data: [NotificationSortingMap](#notificationsortingmap)) => void - -Callback for notification sorting updates. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| data | [NotificationSortingMap](#notificationsortingmap) | Yes| Latest notification sorting list.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; - -function onUpdateCallback(map) { - console.info('===> onUpdateCallback map:' + JSON.stringify(map)); -} - -let subscriber = { - onUpdate: onUpdateCallback -}; - -Notification.subscribe(subscriber, subscribeCallback); -``` - -### onConnect - -onConnect?:() => void - -Callback for subscription. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Example** - -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; - -function onConnectCallback() { - console.info('===> onConnect in test'); -} - -let subscriber = { - onConnect: onConnectCallback -}; - -Notification.subscribe(subscriber, subscribeCallback); -``` - -### onDisconnect - -onDisconnect?:() => void - -Callback for unsubscription. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Example** - -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; -function unsubscribeCallback(err) { - if (err.code) { - console.info("unsubscribe failed " + JSON.stringify(err)); - } else { - console.info("unsubscribeCallback"); - } -}; - -function onConnectCallback() { - console.info('===> onConnect in test'); -} -function onDisconnectCallback() { - console.info('===> onDisconnect in test'); -} - -let subscriber = { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback -}; - -// The onConnect callback is invoked when subscription to the notification is complete. -Notification.subscribe(subscriber, subscribeCallback); -// The onDisconnect callback is invoked when unsubscription to the notification is complete. -Notification.unsubscribe(subscriber, unsubscribeCallback); -``` - -### onDestroy - -onDestroy?:() => void - -Callback for service disconnection. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Example** - -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; - -function onDestroyCallback() { - console.info('===> onDestroy in test'); -} - -let subscriber = { - onDestroy: onDestroyCallback -}; - -Notification.subscribe(subscriber, subscribeCallback); -``` - -### onDoNotDisturbDateChange8+ - -onDoNotDisturbDateChange?:(mode: notification.[DoNotDisturbDate](#donotdisturbdate8)) => void - -Callback for DND time setting updates. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| mode | notification.[DoNotDisturbDate](#donotdisturbdate8) | Yes| DND time setting updates.| - -**Example** -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; - -function onDoNotDisturbDateChangeCallback(mode) { - console.info('===> onDoNotDisturbDateChange:' + mode); -} - -let subscriber = { - onDoNotDisturbDateChange: onDoNotDisturbDateChangeCallback -}; -Notification.subscribe(subscriber, subscribeCallback); - -let doNotDisturbDate = { - type: Notification.DoNotDisturbType.TYPE_ONCE, - begin: new Date(), - end: new Date(2021, 11, 15, 18, 0) -} -// Set the onDoNotDisturbDateChange callback for DND time setting updates. -Notification.setDoNotDisturbDate(doNotDisturbDate).then(() => { - console.info("setDoNotDisturbDate sucess"); -}); -``` - - -### onEnabledNotificationChanged8+ - -onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](#enablednotificationcallbackdata8)) => void - -Listens for the notification enabled status changes. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| callback | AsyncCallback\<[EnabledNotificationCallbackData](#enablednotificationcallbackdata8)\> | Yes| Callback used to return the result.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err.code) { - console.info("subscribe failed " + JSON.stringify(err)); - } else { - console.info("subscribeCallback"); - } -}; - -function onEnabledNotificationChangedCallback(callbackData) { - console.info("bundle: " + callbackData.bundle); - console.info("uid: " + callbackData.uid); - console.info("enable: " + callbackData.enable); -}; - -let subscriber = { - onEnabledNotificationChanged: onEnabledNotificationChangedCallback -}; -Notification.subscribe(subscriber, subscribeCallback); - -let bundle = { - bundle: "bundleName1", -} -// Set the onEnabledNotificationChanged callback that is triggered when the notification enabled status changes. -Notification.enableNotification(bundle, false).then(() => { - console.info("enableNotification sucess"); -}); -``` - -## SubscribeCallbackData - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -| Name | Type | Readable| Writable| Description | -| --------------- | ------------------------------------------------- | ---- | --- | -------- | -| request | [NotificationRequest](#notificationrequest) | Yes | No | Notification content.| -| sortingMap | [NotificationSortingMap](#notificationsortingmap) | Yes | No | Notification sorting information.| -| reason | number | Yes | No | Reason for deletion.| -| sound | string | Yes | No | Sound used for notification.| -| vibrationValues | Array\ | Yes | No | Vibration used for notification.| - - -## EnabledNotificationCallbackData8+ - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -| Name | Type | Readable| Writable| Description | -| ------ | ------- | ---- | --- | ---------------- | -| bundle | string | Yes | No | Bundle name of the application. | -| uid | number | Yes | No | UID of the application. | -| enable | boolean | Yes | No | Notification enabled status of the application.| - - -## DoNotDisturbDate8+ - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -| Name | Type | Readable| Writable| Description | -| ----- | -------------------------------------- | ---- | ---- | ---------------------- | -| type | [DoNotDisturbType](#donotdisturbtype8) | Yes | Yes | DND time type.| -| begin | Date | Yes | Yes | DND start time.| -| end | Date | Yes | Yes | DND end time.| - -## DoNotDisturbType8+ - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -| Name | Value | Description | -| ------------ | ---------------- | ------------------------------------------ | -| TYPE_NONE | 0 | Non-DND. | -| TYPE_ONCE | 1 | One-shot DND at the specified time segment (only considering the hour and minute).| -| TYPE_DAILY | 2 | Daily DND at the specified time segment (only considering the hour and minute).| -| TYPE_CLEARLY | 3 | DND at the specified time segment (considering the year, month, day, hour, and minute). | - - -## ContentType - -**System capability**: SystemCapability.Notification.Notification - -| Name | Value | Description | -| --------------------------------- | ----------- | ------------------ | -| NOTIFICATION_CONTENT_BASIC_TEXT | NOTIFICATION_CONTENT_BASIC_TEXT | Normal text notification. | -| NOTIFICATION_CONTENT_LONG_TEXT | NOTIFICATION_CONTENT_LONG_TEXT | Long text notification. | -| NOTIFICATION_CONTENT_PICTURE | NOTIFICATION_CONTENT_PICTURE | Picture-attached notification. | -| NOTIFICATION_CONTENT_CONVERSATION | NOTIFICATION_CONTENT_CONVERSATION | Conversation notification. | -| NOTIFICATION_CONTENT_MULTILINE | NOTIFICATION_CONTENT_MULTILINE | Multi-line text notification.| - -## SlotLevel - -**System capability**: SystemCapability.Notification.Notification - -| Name | Value | Description | -| --------------------------------- | ----------- | ------------------ | -| LEVEL_NONE | 0 | The notification function is disabled. | -| LEVEL_MIN | 1 | The notification function is enabled, but the notification icon is not displayed in the status bar, with no banner or alert tone.| -| LEVEL_LOW | 2 | The notification function is enabled, and the notification icon is displayed in the status bar, with no banner or alert tone.| -| LEVEL_DEFAULT | 3 | The notification feature is enabled, and the notification icon is displayed in the status bar, with an alert tone but no banner.| -| LEVEL_HIGH | 4 | The notification feature is enabled, and the notification icon is displayed in the status bar, with an alert tone and banner.| - - -## BundleOption - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| ------ | ------ |---- | --- | ------ | -| bundle | string | Yes | Yes | Bundle information of the application.| -| uid | number | Yes | Yes | User ID.| - -## NotificationKey - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| ----- | ------ | ---- | --- | -------- | -| id | number | Yes | Yes | Notification ID. | -| label | string | Yes | Yes | Notification label.| - - -## SlotType - -**System capability**: SystemCapability.Notification.Notification - -| Name | Value | Description | -| -------------------- | -------- | ---------- | -| UNKNOWN_TYPE | 0 | Unknown type.| -| SOCIAL_COMMUNICATION | 1 | Notification slot for social communication.| -| SERVICE_INFORMATION | 2 | Notification slot for service information.| -| CONTENT_INFORMATION | 3 | Notification slot for content consultation.| -| OTHER_TYPES | 0xFFFF | Notification slot for other purposes.| - - -## NotificationActionButton - -Describes the button displayed in the notification. - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| --------- | ----------------------------------------------- | --- | ---- | ------------------------- | -| title | string | Yes | Yes | Button title. | -| wantAgent | [WantAgent](js-apis-app-ability-wantAgent.md) | Yes | Yes | **WantAgent** of the button.| -| extras | { [key: string]: any } | Yes | Yes | Extra information of the button. | -| userInput8+ | [NotificationUserInput](#notificationuserinput8) | Yes | Yes | User input object. | - - -## NotificationBasicContent - -Describes the normal text notification. - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| -------------- | ------ | ---- | ---- | ---------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| - - -## NotificationLongTextContent - -Describes the long text notification. - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| -------------- | ------ | ---- | --- | -------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| -| longText | string | Yes | Yes | Long text of the notification. | -| briefText | string | Yes | Yes | Brief text of the notification.| -| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. | - - -## NotificationMultiLineContent - -Describes the multi-line text notification. - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| -------------- | --------------- | --- | --- | -------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| -| briefText | string | Yes | Yes | Brief text of the notification.| -| longTitle | string | Yes | Yes | Title of the notification in the expanded state. | -| lines | Array\ | Yes | Yes | Multi-line text of the notification. | - - -## NotificationPictureContent - -Describes the picture-attached notification. - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| -------------- | -------------- | ---- | --- | -------------------------------- | -| title | string | Yes | Yes | Notification title. | -| text | string | Yes | Yes | Notification content. | -| additionalText | string | Yes | Yes | Additional information of the notification.| -| briefText | string | Yes | Yes | Brief text of the notification.| -| expandedTitle | string | Yes | Yes | Title of the notification in the expanded state. | -| picture | [image.PixelMap](js-apis-image.md#pixelmap7) | Yes | Yes | Picture attached to the notification. | - - -## NotificationContent - -Describes the notification content. - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| ----------- | ------------------------------------------------------------ | ---- | --- | ------------------ | -| contentType | [ContentType](#contenttype) | Yes | Yes | Notification content type. | -| normal | [NotificationBasicContent](#notificationbasiccontent) | Yes | Yes | Normal text. | -| longText | [NotificationLongTextContent](#notificationlongtextcontent) | Yes | Yes | Long text.| -| multiLine | [NotificationMultiLineContent](#notificationmultilinecontent) | Yes | Yes | Multi-line text. | -| picture | [NotificationPictureContent](#notificationpicturecontent) | Yes | Yes | Picture-attached. | - - -## NotificationFlagStatus8+ - -Describes the notification flag status. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -| Name | Value | Description | -| -------------- | --- | --------------------------------- | -| TYPE_NONE | 0 | The default flag is used. | -| TYPE_OPEN | 1 | The notification flag is enabled. | -| TYPE_CLOSE | 2 | The notification flag is disabled. | - - -## NotificationFlags8+ - -Enumerates notification flags. - -**System capability**: SystemCapability.Notification.Notification - -| Name | Type | Readable| Writable| Description | -| ---------------- | ---------------------- | ---- | ---- | --------------------------------- | -| soundEnabled | [NotificationFlagStatus](#notificationflagstatus8) | Yes | No | Whether to enable the sound alert for the notification. | -| vibrationEnabled | [NotificationFlagStatus](#notificationflagstatus8) | Yes | No | Whether to enable vibration for the notification. | - - -## NotificationRequest - -Describes the notification request. - -**System capability**: SystemCapability.Notification.Notification +**System capability**: SystemCapability.Notification.Notification | Name | Type | Readable| Writable| Description | | --------------------- | --------------------------------------------- | ---- | --- | -------------------------- | @@ -3947,12 +3169,16 @@ Provides the notification user input. | inputKey | string | Yes | Yes | Key to identify the user input.| -## DeviceRemindType8+ +## DeviceRemindType8+ deprecated **System capability**: SystemCapability.Notification.Notification **System API**: This is a system API and cannot be called by third-party applications. +> **NOTE** +> +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [notificationManager.DeviceRemindType](js-apis-notificationManager.md#deviceremindtype) instead. + | Name | Value | Description | | -------------------- | --- | --------------------------------- | | IDLE_DONOT_REMIND | 0 | The device is not in use. No notification is required. | @@ -3961,25 +3187,33 @@ Provides the notification user input. | ACTIVE_REMIND | 3 | The device is in use. | -## SourceType8+ +## SourceType8+ deprecated **System capability**: SystemCapability.Notification.Notification **System API**: This is a system API and cannot be called by third-party applications. +> **NOTE** +> +> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [notificationManager.SourceType](js-apis-notificationManager.md#sourcetype) instead. + | Name | Value | Description | | -------------------- | --- | -------------------- | | TYPE_NORMAL | 0 | Normal notification. | | TYPE_CONTINUOUS | 1 | Continuous notification. | | TYPE_TIMER | 2 | Timed notification. | -## RemoveReason9+ +## RemoveReason9+ deprecated **System capability**: SystemCapability.Notification.Notification **System API**: This is a system API and cannot be called by third-party applications. +> **NOTE** +> +> This API is supported since API version 9 and deprecated since API version 9. You are advised to use [notificationManager.RemoveReason](js-apis-notificationSubscribe.md#removereason) instead. + | Name | Value | Description | | -------------------- | --- | -------------------- | -| CLICK_REASON_REMOVE | 1 | The notification is removed after a click on it. | -| CANCEL_REASON_REMOVE | 2 | The notification is removed by the user. | +| CLICK_REASON_REMOVE9+ | 1 | The notification is removed after a click on it. | +| CANCEL_REASON_REMOVE9+ | 2 | The notification is removed by the user. | diff --git a/en/application-dev/reference/apis/js-apis-notificationManager.md b/en/application-dev/reference/apis/js-apis-notificationManager.md index 3142a3daec90c4ac772e6a6f1e9d36572b9ee828..024b58e38329ce83b1f119d383ff697ad5df1a84 100644 --- a/en/application-dev/reference/apis/js-apis-notificationManager.md +++ b/en/application-dev/reference/apis/js-apis-notificationManager.md @@ -33,7 +33,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -88,8 +87,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------------- | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -145,8 +142,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------------- | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -209,8 +204,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------------- | -| 201 | Permission denied. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -265,7 +258,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -306,7 +298,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -341,7 +332,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -375,7 +365,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -414,7 +403,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -452,9 +440,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -502,9 +487,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -543,7 +525,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -583,7 +564,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -622,9 +602,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -676,9 +653,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -721,7 +695,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -767,7 +740,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -783,7 +755,7 @@ notificationManager.getSlot(slotType).then((data) => { ## notificationManager.getSlots -getSlots(callback: AsyncCallback>): void +getSlots(callback: AsyncCallback\>): void Obtains all notification slots of this application. This API uses an asynchronous callback to return the result. @@ -801,7 +773,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -822,7 +793,7 @@ notificationManager.getSlots(getSlotsCallback); ## notificationManager.getSlots -getSlots(): Promise\> +getSlots(): Promise\> Obtains all notification slots of this application. This API uses a promise to return the result. @@ -840,7 +811,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -874,7 +844,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -914,7 +883,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -948,7 +916,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -980,7 +947,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1019,9 +985,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1068,9 +1031,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1104,7 +1064,7 @@ Checks whether notification is enabled for a specified application. This API use | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ------------------------ | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. | -| callback | AsyncCallback\ | Yes | Callback used to return the result.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Error codes** @@ -1112,9 +1072,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1166,9 +1123,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1201,7 +1155,7 @@ Checks whether notification is enabled for this application. This API uses an as | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ------------------------ | -| callback | AsyncCallback\ | Yes | Callback used to return the result.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| **Error codes** @@ -1209,9 +1163,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1242,11 +1193,93 @@ Checks whether notification is enabled for the current application. This API use **System API**: This is a system API and cannot be called by third-party applications. +**Return value** + +| Type | Description | +| ----------------------------------------------------------- | ------------------------------------------------------------ | +| Promise\ | Promise used to return the result.| + +**Error codes** + +For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md). + +| ID| Error Message | +| -------- | ---------------------------------------- | +| 1600001 | Internal error. | +| 1600002 | Marshalling or unmarshalling error. | +| 1600003 | Failed to connect service. | + +**Example** + +```ts +notificationManager.isNotificationEnabled().then((data) => { + console.info("isNotificationEnabled success, data: " + JSON.stringify(data)); +}); +``` + +## notificationManager.isNotificationEnabled + +isNotificationEnabled(userId: number, callback: AsyncCallback\): void + +Checks whether notification is enabled for a specified user. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Notification.Notification + +**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER + +**System API**: This is a system API and cannot be called by third-party applications. + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | --------------------- | ---- | ------------------------ | +| userId | number | Yes | User ID.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.| + +**Error codes** + +For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md). + +| ID| Error Message | +| -------- | ----------------------------------- | +| 1600001 | Internal error. | +| 1600002 | Marshalling or unmarshalling error. | +| 1600003 | Failed to connect service. | +| 1600008 | The user is not exist. | + +**Example** + +```ts +function isNotificationEnabledCallback(err, data) { + if (err) { + console.error(`isNotificationEnabled failed, code is ${err.code}, message is ${err.message}`); + } else { + console.info("isNotificationEnabled success"); + } +} + +let userId = 1; + +notificationManager.isNotificationEnabled(userId, isNotificationEnabledCallback); +``` + +## notificationManager.isNotificationEnabled + +isNotificationEnabled(userId: number): Promise\ + +Checks whether notification is enabled for a specified user. This API uses a promise to return the result. + +**System capability**: SystemCapability.Notification.Notification + +**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER + +**System API**: This is a system API and cannot be called by third-party applications. + **Parameters** | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application.| +| userId | number | Yes | User ID.| **Return value** @@ -1260,18 +1293,17 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | -| 17700001 | The specified bundle name was not found. | +| 1600008 | The user is not exist.. | **Example** ```ts -notificationManager.isNotificationEnabled().then((data) => { +let userId = 1; + +notificationManager.isNotificationEnabled(userId).then((data) => { console.info("isNotificationEnabled success, data: " + JSON.stringify(data)); }); ``` @@ -1302,9 +1334,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1351,9 +1380,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1395,9 +1421,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1449,9 +1472,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1486,7 +1506,6 @@ Sets the notification badge number. This API uses a promise to return the result | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1522,7 +1541,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1569,9 +1587,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1621,9 +1636,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1645,7 +1657,7 @@ notificationManager.setSlotByBundle(bundle, notificationSlot).then(() => { ## notificationManager.getSlotsByBundle -getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback>): void +getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback\>): void Obtains the notification slots of a specified application. This API uses an asynchronous callback to return the result. @@ -1660,7 +1672,7 @@ Obtains the notification slots of a specified application. This API uses an asyn | Name | Type | Mandatory| Description | | -------- | ---------------------------------------- | ---- | -------------------- | | bundle | [BundleOption](./js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle of the application. | -| callback | AsyncCallback> | Yes | Callback used to return the result.| +| callback | AsyncCallback\> | Yes | Callback used to return the result.| **Error codes** @@ -1668,9 +1680,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1694,7 +1703,7 @@ notificationManager.getSlotsByBundle(bundle, getSlotsByBundleCallback); ## notificationManager.getSlotsByBundle -getSlotsByBundle(bundle: BundleOption): Promise> +getSlotsByBundle(bundle: BundleOption): Promise\> Obtains the notification slots of a specified application. This API uses a promise to return the result. @@ -1714,7 +1723,7 @@ Obtains the notification slots of a specified application. This API uses a promi | Type | Description | | ----------------------------------------------------------- | ------------------------------------------------------------ | -| Promise> | Promise used to return the result.| +| Promise\> | Promise used to return the result.| **Error codes** @@ -1722,9 +1731,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1766,9 +1772,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1820,9 +1823,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1842,7 +1842,7 @@ notificationManager.getSlotNumByBundle(bundle).then((data) => { ## notificationManager.getAllActiveNotifications -getAllActiveNotifications(callback: AsyncCallback>): void +getAllActiveNotifications(callback: AsyncCallback\>): void Obtains all active notifications. This API uses an asynchronous callback to return the result. @@ -1856,15 +1856,12 @@ Obtains all active notifications. This API uses an asynchronous callback to retu | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------------------ | ---- | -------------------- | -| callback | AsyncCallback> | Yes | Callback used to return the result.| +| callback | AsyncCallback\> | Yes | Callback used to return the result.| **Error codes** | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1907,9 +1904,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1942,7 +1936,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1981,7 +1974,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -1996,7 +1988,7 @@ notificationManager.getActiveNotificationCount().then((data) => { ## notificationManager.getActiveNotifications -getActiveNotifications(callback: AsyncCallback>): void +getActiveNotifications(callback: AsyncCallback\>): void Obtains active notifications of this application. This API uses an asynchronous callback to return the result. @@ -2006,7 +1998,7 @@ Obtains active notifications of this application. This API uses an asynchronous | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------------------ | ---- | ------------------------------ | -| callback | AsyncCallback> | Yes | Callback used to return the result.| +| callback | AsyncCallback\> | Yes | Callback used to return the result.| **Error codes** @@ -2014,7 +2006,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2053,7 +2044,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2087,7 +2077,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2128,7 +2117,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2168,9 +2156,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2218,9 +2203,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2261,9 +2243,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2313,9 +2292,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2361,9 +2337,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2417,9 +2390,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2467,9 +2437,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2513,9 +2480,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2555,9 +2519,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2610,9 +2571,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2652,9 +2610,6 @@ Checks whether DND mode is supported. This API uses an asynchronous callback to | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2697,9 +2652,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2733,11 +2685,9 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | -| 1600011 | Read template config failed. | **Example** @@ -2780,11 +2730,9 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | -| 1600011 | Read template config failed. | **Example** @@ -2816,7 +2764,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2849,7 +2796,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2889,9 +2835,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2937,9 +2880,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -2976,7 +2916,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3018,7 +2957,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3060,9 +2998,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3116,9 +3051,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3164,9 +3096,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3221,9 +3150,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3267,9 +3193,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3312,9 +3235,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3355,9 +3275,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3425,9 +3342,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3491,9 +3405,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3547,9 +3458,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3596,9 +3504,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3649,9 +3554,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3695,9 +3597,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3752,9 +3651,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3797,9 +3693,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3854,9 +3747,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3901,9 +3791,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3956,9 +3843,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -3975,6 +3859,87 @@ notificationManager.getSyncNotificationEnabledWithoutApp(userId).then((data) => }); ``` +## notificationManager.on10+ + +on(type: 'checkNotification', callback: (checkInfo: NotificationCheckInfo) => NotificationCheckResult): void; + +Subscribes to notification events. The notification service sends the notification information in the callback to the verification program. The verification program returns the verification result to determine whether to publish the notification, for example, controlling the publish frequency of marketing notifications. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | ----------------------------- | ---- | -------------- | +| type | string | Yes | Event type. The value is fixed to **'checkNotification'**.| +| callback | (checkInfo: [NotificationCheckInfo](#notificationcheckinfo10)) => [NotificationCheckResult](#notificationcheckresult10) | Yes | Pointer to the notification verification function.| + +**Error codes** + +For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md). + +| ID| Error Message | +| -------- | ----------------------------------- | +| 1600001 | Internal error. | + +**Example** + +```ts +try{ + notificationManager.on("checkNotification", OnCheckNotification); +} catch (error){ + console.info(`notificationManager.on error: ${JSON.stringify(error)}`); +} +function OnCheckNotification(info : notificationManager.NotificationCheckInfo) { + console.info(`====>OnCheckNotification info: ${JSON.stringify(info)}`); + if(info.notificationId == 1){ + return { code: 1, message: "testMsg1"} + } else { + return { code: 0, message: "testMsg0"} + } +} +``` + +## notificationManager.off10+ + +off(type: 'checkNotification', callback?: (checkInfo: NotificationCheckInfo) => NotificationCheckResult): void; + +Unsubscribes from notification events. + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER + +**Parameters** + +| Name| Type | Mandatory| Description | +| ------ | ----------------------------- | ---- | -------------- | +| type | string | Yes | Event type. The value is fixed to **'checkNotification'**.| +| callback | (checkInfo: [NotificationCheckInfo](#notificationcheckinfo10)) => [NotificationCheckResult](#notificationcheckresult10) | No | Pointer to the notification verification function.| + +**Error codes** + +For details about the error codes, see [Notification Error Codes](../errorcodes/errorcode-notification.md). + +| ID| Error Message | +| -------- | ----------------------------------- | +| 1600001 | Internal error. | + +**Example** + +```ts +try{ + notificationManager.off("checkNotification"); +} catch (error){ + console.info(`notificationManager.off error: ${JSON.stringify(error)}`); +} +``` ## DoNotDisturbDate @@ -3982,11 +3947,11 @@ notificationManager.getSyncNotificationEnabledWithoutApp(userId).then((data) => **System API**: This is a system API and cannot be called by third-party applications. -| Name | Type | Readable| Writable| Description | +| Name | Type | Read-only| Mandatory| Description | | ----- | ------------------------------------- | ---- | ---- | ---------------------- | -| type | [DoNotDisturbType](#donotdisturbtype) | Yes | Yes | DND time type.| -| begin | Date | Yes | Yes | DND start time.| -| end | Date | Yes | Yes | DND end time.| +| type | [DoNotDisturbType](#donotdisturbtype) | No | Yes | DND time type.| +| begin | Date | No | Yes | DND start time.| +| end | Date | No | Yes | DND end time.| ## DoNotDisturbType @@ -4067,3 +4032,30 @@ notificationManager.getSyncNotificationEnabledWithoutApp(userId).then((data) => | TYPE_NORMAL | 0 | Normal notification. | | TYPE_CONTINUOUS | 1 | Continuous notification. | | TYPE_TIMER | 2 | Timed notification. | + +## NotificationCheckInfo10+ + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER + +| Name | Type | Read-only| Mandatory| Description | +| ----- | ------------------------------------- | ---- | ---- | ---------------------- | +| bundleName | string | No | Yes | Bundle name.| +| notificationId | number | No | Yes | Notification ID. | +| contentType | [ContentType](#contenttype) | No | Yes | Notification type. | + +## NotificationCheckResult10+ + +**System capability**: SystemCapability.Notification.Notification + +**System API**: This is a system API and cannot be called by third-party applications. + +**Required permissions**: ohos.permission.NOTIFICATION_CONTROLLER, ohos.permission.NOTIFICATION_AGENT_CONTROLLER + +| Name | Type | Read-only| Mandatory| Description | +| ----- | ------------------------------------- | ---- | ---- | ---------------------- | +| code | number | No | Yes | Result code.
**0**: display.
**1**: no display.| +| message | string | No | Yes | Result. | diff --git a/en/application-dev/reference/apis/js-apis-notificationSubscribe.md b/en/application-dev/reference/apis/js-apis-notificationSubscribe.md index fa441c00c57cb994824aeb3cf061e623f5256089..0746cb7cb1defd1691cbab96898dbb6ad47996a3 100644 --- a/en/application-dev/reference/apis/js-apis-notificationSubscribe.md +++ b/en/application-dev/reference/apis/js-apis-notificationSubscribe.md @@ -12,8 +12,6 @@ The **notificationSubscribe** module provides APIs for notification subscription import notificationSubscribe from '@ohos.notificationSubscribe'; ``` - - ## NotificationSubscribe.subscribe subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback\): void @@ -40,9 +38,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -96,9 +91,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -150,9 +142,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -199,9 +188,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -249,9 +235,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -287,7 +270,7 @@ Removes a notification for a specified application. This API uses an asynchronou | Name | Type | Mandatory| Description | | --------------- | ----------------------------------| ---- | -------------------- | | bundle | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. | -| notificationKey | [NotificationKey](js-apis-notification.md#notificationkey) | Yes | Notification key. | +| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | | reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -297,9 +280,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -346,7 +326,7 @@ Removes a notification for a specified application. This API uses a promise to r | Name | Type | Mandatory| Description | | --------------- | --------------- | ---- | ---------- | | bundle | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application.| -| notificationKey | [NotificationKey]((js-apis-notification.md#notificationkey)) | Yes | Notification key. | +| notificationKey | [NotificationKey](#notificationkey) | Yes | Notification key. | | reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. | **Error codes** @@ -355,9 +335,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -374,7 +351,7 @@ let notificationKey = { id: 0, label: "label", }; -let reason = NotificationSubscribe.RemoveReason.CLICK_REASON_REMOVE; +let reason = notificationSubscribe.RemoveReason.CLICK_REASON_REMOVE; notificationSubscribe.remove(bundle, notificationKey, reason).then(() => { console.info("remove success"); }); @@ -396,7 +373,7 @@ Removes a specified notification. This API uses an asynchronous callback to retu | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | -------------------- | -| hashCode | string | Yes | Unique notification ID. It is the value of **hashCode** in the [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) object of [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) in the [onConsume](#onconsume) callback.| +| hashCode | string | Yes | Unique notification ID. It is the **hashCode** in the [NotificationRequest](js-apis-inner-notification-notificationRequest.md#notificationrequest) object of [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) of the [onConsume](js-apis-inner-notification-notificationSubscriber.md#onConsume) callback.| | reason | [RemoveReason](#removereason) | Yes | Reason for removing the notification. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| @@ -406,9 +383,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -426,7 +400,7 @@ function removeCallback(err) { console.info("remove success"); } } -let reason = NotificationSubscribe.RemoveReason.CANCEL_REASON_REMOVE; +let reason = notificationSubscribe.RemoveReason.CANCEL_REASON_REMOVE; notificationSubscribe.remove(hashCode, reason, removeCallback); ``` @@ -455,9 +429,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -489,7 +460,7 @@ Removes all notifications for a specified application. This API uses an asynchro | Name | Type | Mandatory| Description | | -------- | --------------------- | ---- | ---------------------------- | -| bundle | [BundleOption]((js-apis-inner-notification-notificationCommonDef.md#bundleoption)) | Yes | Bundle information of the application. | +| bundle | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | Yes | Bundle information of the application. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Error codes** @@ -498,9 +469,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -519,7 +487,7 @@ function removeAllCallback(err) { let bundle = { bundle: "bundleName1", }; -NotificationSubscribe.removeAll(bundle, removeAllCallback); +notificationSubscribe.removeAll(bundle, removeAllCallback); ``` ## NotificationSubscribe.removeAll @@ -546,9 +514,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -583,7 +548,7 @@ Removes all notifications for a specified application. This API uses a promise t | Name | Type | Mandatory| Description | | ------ | ------------ | ---- | ---------- | -| bundle | [BundleOption]((js-apis-inner-notification-notificationCommonDef.md#bundleoption)) | No | Bundle information of the application.| +| bundle | [BundleOption](js-apis-inner-notification-notificationCommonDef.md#bundleoption) | No | Bundle information of the application.| **Error codes** @@ -591,9 +556,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ---------------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -633,9 +595,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -657,7 +616,7 @@ let userId = 1; notificationSubscribe.removeAll(userId, removeAllCallback); ``` -## Notification.removeAll +## NotificationSubscribe.removeAll removeAll(userId: number): Promise\ @@ -681,9 +640,6 @@ For details about the error codes, see [Notification Error Codes](../errorcodes/ | ID| Error Message | | -------- | ----------------------------------- | -| 201 | Permission denied. | -| 202 | Not system application to call the interface. | -| 401 | The parameter check failed. | | 1600001 | Internal error. | | 1600002 | Marshalling or unmarshalling error. | | 1600003 | Failed to connect service. | @@ -705,359 +661,14 @@ let userId = 1; notificationSubscribe.removeAll(userId, removeAllCallback); ``` -## NotificationSubscriber - -Provides callbacks for receiving or removing notifications and serves as the input parameter of [subscribe](#notificationsubscribesubscribe). - -**System API**: This is a system API and cannot be called by third-party applications. - -### onConsume - -onConsume?: (data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void - -Called when a notification is received. +## NotificationKey **System capability**: SystemCapability.Notification.Notification -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | Yes| Information about the notification received.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onConsumeCallback(data) { - console.info('===> onConsume in test'); - let req = data.request; - console.info('===> onConsume callback req.id:' + req.id); -}; - -let subscriber = { - onConsume: onConsumeCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - -### onCancel - -onCancel?:(data: [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata)) => void - -Called when a notification is canceled. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| data | [SubscribeCallbackData](js-apis-notification.md#subscribecallbackdata) | Yes| Information about the notification to cancel.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onCancelCallback(data) { - console.info('===> onCancel in test'); - let req = data.request; - console.info('===> onCancel callback req.id:' + req.id); -} - -let subscriber = { - onCancel: onCancelCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - -### onUpdate - -onUpdate?:(data: [NotificationSortingMap](js-apis-notification.md#notificationsortingmap)) => void - -Called when the notification sorting list is updated. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| data | [NotificationSortingMap](js-apis-notification.md#notificationsortingmap)) | Yes| Latest notification sorting list.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onUpdateCallback(map) { - console.info('===> onUpdateCallback map:' + JSON.stringify(map)); -} - -let subscriber = { - onUpdate: onUpdateCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - -### onConnect - -onConnect?:() => void - -Called when subscription is complete. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onConnectCallback() { - console.info('===> onConnect in test'); -} - -let subscriber = { - onConnect: onConnectCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - -### onDisconnect - -onDisconnect?:() => void - -Called when unsubscription is complete. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; -function unsubscribeCallback(err) { - if (err.code) { - console.error(`unsubscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("unsubscribeCallback"); - } -}; - -function onConnectCallback() { - console.info('===> onConnect in test'); -} -function onDisconnectCallback() { - console.info('===> onDisconnect in test'); -} - -let subscriber = { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback -}; - -// The onConnect callback is invoked when subscription to the notification is complete. -notificationSubscribe.subscribe(subscriber, subscribeCallback); -// The onDisconnect callback is invoked when unsubscription to the notification is complete. -notificationSubscribe.unsubscribe(subscriber, unsubscribeCallback); -``` - -### onDestroy - -onDestroy?:() => void - -Callback for service disconnection. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onDestroyCallback() { - console.info('===> onDestroy in test'); -} - -let subscriber = { - onDestroy: onDestroyCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - -### onDoNotDisturbDateChange - -onDoNotDisturbDateChange?:(mode: notification.[DoNotDisturbDate](js-apis-notificationManager.md#donotdisturbdate)) => void - -Called when the DND time setting is updated. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| mode | notification.[DoNotDisturbDate](js-apis-notificationManager.md#DoNotDisturbDate) | Yes| DND time setting updates.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onDoNotDisturbDateChangeCallback(mode) { - console.info('===> onDoNotDisturbDateChange:' + mode); -} - -let subscriber = { - onDoNotDisturbDateChange: onDoNotDisturbDateChangeCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - - -### onEnabledNotificationChanged - -onEnabledNotificationChanged?:(callbackData: [EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata8)) => void - -Listens for the notification enabled status changes. This API uses an asynchronous callback to return the result. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name| Type| Mandatory| Description| -| ------------ | ------------------------ | ---- | -------------------------- | -| callback | AsyncCallback\<[EnabledNotificationCallbackData](js-apis-notification.md#enablednotificationcallbackdata8)\> | Yes| Callback used to return the result.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onEnabledNotificationChangedCallback(callbackData) { - console.info("bundle: ", callbackData.bundle); - console.info("uid: ", callbackData.uid); - console.info("enable: ", callbackData.enable); -}; - -let subscriber = { - onEnabledNotificationChanged: onEnabledNotificationChangedCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - -### onBadgeChanged10+ - - onBadgeChanged?:(data: [BadgeNumberCallbackData](#badgenumbercallbackdata10)) => void - -Listens for the change of the notification badge number. - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -**Parameters** - -| Name | Type | Mandatory| Description | -| -------- | ------------------------------------------------------------ | ---- | -------------------------- | -| callback | AsyncCallback\<[BadgeNumberCallbackData](#badgenumbercallbackdata10)\> | Yes | Callback used to return the result.| - -**Example** - -```javascript -function subscribeCallback(err) { - if (err) { - console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`); - } else { - console.info("subscribeCallback"); - } -}; - -function onBadgeChangedCallback(data) { - console.info("bundle: ", data.bundle); - console.info("uid: ", data.uid); - console.info("badgeNumber: ", data.badgeNumber); -}; - -let subscriber = { - onBadgeChanged: onBadgeChangedCallback -}; - -notificationSubscribe.subscribe(subscriber, subscribeCallback); -``` - +| Name | Type | Read-only| Mandatory| Description | +| ----- | ------ | ---- | --- | -------- | +| id | number | No | Yes | Notification ID. | +| label | string | No | No | Notification label.| ## RemoveReason @@ -1069,15 +680,3 @@ notificationSubscribe.subscribe(subscriber, subscribeCallback); | -------------------- | --- | -------------------- | | CLICK_REASON_REMOVE | 1 | The notification is removed after a click on it. | | CANCEL_REASON_REMOVE | 2 | The notification is removed by the user. | - -## BadgeNumberCallbackData10+ - -**System capability**: SystemCapability.Notification.Notification - -**System API**: This is a system API and cannot be called by third-party applications. - -| Name | Type | Readable| Writable| Description | -| ----------- | ------ | ---- | ---- | ------------ | -| bundle | string | Yes | No | Bundle name of the application.| -| uid | number | Yes | No | UID of the application. | -| badgeNumber | number | Yes | No | Notification badge number. | diff --git a/en/application-dev/reference/apis/js-apis-pointer.md b/en/application-dev/reference/apis/js-apis-pointer.md index 49ed81e115de6345453c93441b68cda2a132021b..61bac1ec1ef7b02115705e7e5e34b600faedca60 100644 --- a/en/application-dev/reference/apis/js-apis-pointer.md +++ b/en/application-dev/reference/apis/js-apis-pointer.md @@ -258,6 +258,386 @@ try { } ``` +## pointer.setHoverScrollState10+ + +setHoverScrollState(state: boolean, callback: AsyncCallback<void>): void + +Sets the status of the mouse hover scroll switch. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ------------------------------------- | +| state | boolean | Yes | Status of the mouse hover scroll switch. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + +```js +try { + pointer.setHoverScrollState(true, (error) => { + if (error) { + console.log(`Set the mouse hover scroll failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + return; + } + console.log(`Set the mouse hover scroll success`); + }); +} catch (error) { + console.log(`Set the mouse hover scroll failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setHoverScrollState10+ + +setHoverScrollState(state: boolean): Promise<void> + +Sets the status of the mouse hover scroll switch. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------------------------------- | +| state | boolean | Yes | Status of the mouse hover scroll switch.| + +**Return value** + +| Name | Description | +| ------------------- | ---------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + +```js +try { + pointer.setHoverScrollState(true).then(() => { + console.log(`Set the mouse hover scroll success`); + }); +} catch (error) { + console.log(`Set the mouse hover scroll failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getHoverScrollState10+ + +getHoverScrollState(callback: AsyncCallback<boolean>): void + +Obtains the status of the mouse hover scroll switch. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | -------------- | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.| + +**Example** + +```js +try { + pointer.getHoverScrollState((error, state) => { + console.log(`Get the mouse hover scroll success, state: ${JSON.stringify(state)}`); + }); +} catch (error) { + console.log(`Get the mouse hover scroll failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getHoverScrollState10+ + +getHoverScrollState(): Promise<boolean> + +Obtains the status of the mouse hover scroll switch. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Return value** + +| Name | Description | +| --------------------- | ------------------- | +| Promise<boolean> | Promise used to return the result.| + +**Example** + +```js +try { + pointer.getHoverScrollState().then((state) => { + console.log(`Get the mouse hover scroll success, state: ${JSON.stringify(state)}`); + }); +} catch (error) { + console.log(`Get the mouse hover scroll failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setMousePrimaryButton10+ + +setMousePrimaryButton(primary: PrimaryButton, callback: AsyncCallback<void>): void + +Sets the primary button of the mouse. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ------------------------------------- | +| primary | [PrimaryButton](#primarybutton10) | Yes | ID of the primary mouse button. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + +```js +try { + pointer.setMousePrimaryButton(pointer.PrimaryButton.RIGHT, (error) => { + if (error) { + console.log(`Set mouse primary button failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + return; + } + console.log(`Set mouse primary button success`); + }); +} catch (error) { + console.log(`Set mouse primary button failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setMousePrimaryButton10+ + +setMousePrimaryButton(primary: PrimaryButton): Promise<void> + +Sets the primary button of the mouse. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------------------------------- | +| primary | [PrimaryButton](#primarybutton10) | Yes | ID of the primary mouse button.| + +**Return value** + +| Name | Description | +| ------------------- | ---------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + +```js +try { + pointer.setMousePrimaryButton(pointer.PrimaryButton.RIGHT).then(() => { + console.log(`Set mouse primary button success`); + }); +} catch (error) { + console.log(`Set mouse primary button failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getMousePrimaryButton10+ + +getMousePrimaryButton(callback: AsyncCallback<PrimaryButton>): void + +Obtains the primary button of the mouse. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | -------------- | +| callback | AsyncCallback<[PrimaryButton](#primarybutton10)> | Yes | Callback used to return the result.| + +**Example** + +```js +try { + pointer.getMousePrimaryButton((error, primary) => { + console.log(`Get mouse primary button success, primary: ${JSON.stringify(primary)}`); + }); +} catch (error) { + console.log(`Get mouse primary button failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getMousePrimaryButton10+ + +getMousePrimaryButton(): Promise<PrimaryButton> + +Obtains the primary button of the mouse. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Return value** + +| Name | Description | +| --------------------- | ------------------- | +| Promise<[PrimaryButton](#primarybutton10)> | Promise used to return the result.| + +**Example** + +```js +try { + pointer.getMousePrimaryButton().then((primary) => { + console.log(`Get mouse primary button success, primary: ${JSON.stringify(primary)}`); + }); +} catch (error) { + console.log(`Get mouse primary button failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## PrimaryButton10+ + +Type of the primary mouse button. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +| Name | Value | Description | +| -------------------------------- | ---- | ------ | +| LEFT | 0 | Left mouse button. | +| RIGHT | 1 | Right mouse button. | + +## pointer.setMouseScrollRows10+ + +setMouseScrollRows(rows: number, callback: AsyncCallback<void>): void + +Sets the number of mouse scroll rows. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ------------------------------------- | +| rows | number | Yes | Number of mouse scroll rows. The value ranges from 1 to 100. The default value is **3**. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| + +**Example** + +```js +try { + pointer.setMouseScrollRows(1, (error) => { + if (error) { + console.log(`setMouseScrollRows failed, error: ${JSON.stringify(error, [`code`, `message`])}`); + return; + } + console.log(`setMouseScrollRows success`); + }); +} catch (error) { + console.log(`setMouseScrollRows failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.setMouseScrollRows10+ + +setMouseScrollRows(rows: number): Promise<void> + +Sets the number of mouse scroll rows. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------------------------------- | +| rows | number | Yes | Number of mouse scroll rows. The value ranges from 1 to 100. The default value is **3**.| + +**Return value** + +| Name | Description | +| ------------------- | ---------------- | +| Promise<void> | Promise used to return the result.| + +**Example** + +```js +try { + pointer.setMouseScrollRows(20).then(() => { + console.log(`setMouseScrollRows success`); + }); +} catch (error) { + console.log(`setMouseScrollRows failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getMouseScrollRows10+ + +getMouseScrollRows(callback: AsyncCallback<number>): void + +Obtains the number of mouse scroll rows. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | -------------- | +| callback | AsyncCallback<number> | Yes | Callback used to return the result.| + +**Example** + +```js +try { + pointer.getMouseScrollRows((error, rows) => { + console.log(`getMouseScrollRows success, rows: ${JSON.stringify(rows)}`); + }); +} catch (error) { + console.log(`getMouseScrollRows failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + +## pointer.getMouseScrollRows10+ + +getMouseScrollRows(): Promise<number> + +Obtains the mouse movement speed. This API uses a promise to return the result. + +**System capability**: SystemCapability.MultimodalInput.Input.Pointer + +**System API**: This is a system API. + +**Return value** + +| Name | Description | +| --------------------- | ------------------- | +| Promise<number> | Promise used to return the result.| + +**Example** + +```js +try { + pointer.getMouseScrollRows().then((rows) => { + console.log(`getMouseScrollRows success, rows: ${JSON.stringify(rows)}`); + }); +} catch (error) { + console.log(`getMouseScrollRows failed, error: ${JSON.stringify(error, [`code`, `message`])}`); +} +``` + ## pointer.getPointerStyle9+ getPointerStyle(windowId: number, callback: AsyncCallback<PointerStyle>): void diff --git a/en/application-dev/reference/apis/js-apis-reminderAgent.md b/en/application-dev/reference/apis/js-apis-reminderAgent.md index 3f9387defec0e68dc6414fdb4b21c5bca9cb1490..dc0a33ab0c33f9978b1985e5962067c2f2097cc2 100644 --- a/en/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/en/application-dev/reference/apis/js-apis-reminderAgent.md @@ -1,4 +1,4 @@ -# @ohos.reminderAgent (Reminder Agent) +# @ohos.reminderAgent (reminderAgent) The **reminderAgent** module provides APIs for publishing scheduled reminders through the reminder agent. @@ -18,14 +18,18 @@ import reminderAgent from'@ohos.reminderAgent'; ``` -## reminderAgent.publishReminder +## reminderAgent.publishReminder(deprecated) ```ts -publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void +publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\): void ``` Publishes a reminder through the reminder agent. This API uses an asynchronous callback to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8). +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder). + **Required permissions**: ohos.permission.PUBLISH_AGENT_REMINDER **System capability**: SystemCapability.Notification.ReminderAgent @@ -50,14 +54,18 @@ Publishes a reminder through the reminder agent. This API uses an asynchronous c ``` -## reminderAgent.publishReminder +## reminderAgent.publishReminder(deprecated) ```ts -publishReminder(reminderReq: ReminderRequest): Promise +publishReminder(reminderReq: ReminderRequest): Promise\ ``` Publishes a reminder through the reminder agent. This API uses a promise to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8). +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder-1). + **Required permissions**: ohos.permission.PUBLISH_AGENT_REMINDER **System capability**: SystemCapability.Notification.ReminderAgent @@ -85,14 +93,18 @@ Publishes a reminder through the reminder agent. This API uses a promise to retu ``` -## reminderAgent.cancelReminder +## reminderAgent.cancelReminder(deprecated) ```ts -cancelReminder(reminderId: number, callback: AsyncCallback): void +cancelReminder(reminderId: number, callback: AsyncCallback\): void ``` Cancels the reminder with the specified ID. This API uses an asynchronous callback to return the cancellation result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** @@ -100,7 +112,7 @@ Cancels the reminder with the specified ID. This API uses an asynchronous callba | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | reminderId | number | Yes| ID of the reminder to cancel. The value is obtained by calling [publishReminder](#reminderagentpublishreminder).| -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Example** @@ -111,14 +123,18 @@ reminderAgent.cancelReminder(1, (err, data) => { ``` -## reminderAgent.cancelReminder +## reminderAgent.cancelReminder(deprecated) ```ts -cancelReminder(reminderId: number): Promise +cancelReminder(reminderId: number): Promise\ ``` Cancels the reminder with the specified ID. This API uses a promise to return the cancellation result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder-1). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** @@ -141,21 +157,25 @@ reminderAgent.cancelReminder(1).then(() => { }); ``` -## reminderAgent.getValidReminders +## reminderAgent.getValidReminders(deprecated) ```ts -getValidReminders(callback: AsyncCallback>): void +getValidReminders(callback: AsyncCallback\>): void ``` Obtains all valid (not yet expired) reminders set by the current application. This API uses an asynchronous callback to return the reminders. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\\> | Yes| Asynchronous callback used to return an array of all valid reminders set by the current application.| +| callback | AsyncCallback\\> | Yes| Callback used to return an array of all valid reminders set by the current application.| **Example** @@ -187,14 +207,18 @@ reminderAgent.getValidReminders((err, reminders) => { ``` -## reminderAgent.getValidReminders +## reminderAgent.getValidReminders(deprecated) ```ts -getValidReminders(): Promise> +getValidReminders(): Promise\> ``` Obtains all valid (not yet expired) reminders set by the current application. This API uses a promise to return the reminders. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders-1). + **System capability**: SystemCapability.Notification.ReminderAgent **Return value** @@ -233,21 +257,25 @@ reminderAgent.getValidReminders().then((reminders) => { ``` -## reminderAgent.cancelAllReminders +## reminderAgent.cancelAllReminders(deprecated) ```ts -cancelAllReminders(callback: AsyncCallback): void +cancelAllReminders(callback: AsyncCallback\): void ``` Cancels all reminders set by the current application. This API uses an asynchronous callback to return the cancellation result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Example** @@ -258,14 +286,18 @@ reminderAgent.cancelAllReminders((err, data) =>{ ``` -## reminderAgent.cancelAllReminders +## reminderAgent.cancelAllReminders(deprecated) ```ts -cancelAllReminders(): Promise +cancelAllReminders(): Promise\ ``` Cancels all reminders set by the current application. This API uses a promise to return the cancellation result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders-1). + **System capability**: SystemCapability.Notification.ReminderAgent **Return value** @@ -282,14 +314,18 @@ reminderAgent.cancelAllReminders().then(() => { }) ``` -## reminderAgent.addNotificationSlot +## reminderAgent.addNotificationSlot(deprecated) ```ts -addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void +addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback\): void ``` Adds a notification slot. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** @@ -297,7 +333,7 @@ Adds a notification slot. This API uses an asynchronous callback to return the r | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| Notification slot, whose type can be set.| -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Example** @@ -313,14 +349,18 @@ reminderAgent.addNotificationSlot(mySlot, (err, data) => { ``` -## reminderAgent.addNotificationSlot +## reminderAgent.addNotificationSlot(deprecated) ```ts -addNotificationSlot(slot: NotificationSlot): Promise +addNotificationSlot(slot: NotificationSlot): Promise\ ``` Adds a notification slot. This API uses a promise to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot-1). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** @@ -349,7 +389,7 @@ reminderAgent.addNotificationSlot(mySlot).then(() => { ``` -## reminderAgent.removeNotificationSlot +## reminderAgent.removeNotificationSlot(deprecated) ```ts removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void @@ -357,6 +397,10 @@ removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback< Removes a notification slot of a specified type. This API uses an asynchronous callback to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** @@ -364,7 +408,7 @@ Removes a notification slot of a specified type. This API uses an asynchronous c | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | slotType | [notification.SlotType](js-apis-notification.md#slottype) | Yes| Type of the reminder notification slot to remove.| -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Example** @@ -377,7 +421,7 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, ``` -## reminderAgent.removeNotificationSlot +## reminderAgent.removeNotificationSlot(deprecated) ```ts removeNotificationSlot(slotType: notification.SlotType): Promise @@ -385,6 +429,10 @@ removeNotificationSlot(slotType: notification.SlotType): Promise Removes a notification slot of a specified type. This API uses a promise to return the result. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot-1). + **System capability**: SystemCapability.Notification.ReminderAgent **Parameters** @@ -410,10 +458,14 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). ``` -## ActionButtonType +## ActionButtonType(deprecated) Enumerates button types. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ActionButtonType](js-apis-reminderAgentManager.md#ActionButtonType). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Value| Description| @@ -422,10 +474,14 @@ Enumerates button types. | ACTION_BUTTON_TYPE_SNOOZE | 1 | Button for snoozing the reminder.| -## ReminderType +## ReminderType(deprecated) Enumerates reminder types. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderType](js-apis-reminderAgentManager.md#ReminderType). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Value| Description| @@ -435,10 +491,14 @@ Enumerates reminder types. | REMINDER_TYPE_ALARM | 2 | Alarm reminder.| -## ActionButton +## ActionButton(deprecated) Defines a button displayed in the reminder notification. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ActionButton](js-apis-reminderAgentManager.md#ActionButton). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| @@ -447,10 +507,14 @@ Defines a button displayed in the reminder notification. | type | [ActionButtonType](#actionbuttontype) | Yes| Button type.| -## WantAgent +## WantAgent(deprecated) Sets the package and ability that are redirected to when the reminder notification is clicked. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.WantAgent](js-apis-reminderAgentManager.md#WantAgent). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| @@ -459,10 +523,14 @@ Sets the package and ability that are redirected to when the reminder notificati | abilityName | string | Yes| Name of the ability that is redirected to when the reminder notification is clicked.| -## MaxScreenWantAgent +## MaxScreenWantAgent(deprecated) Provides the information about the target package and ability to start automatically when the reminder is displayed in full-screen mode. This API is reserved. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.MaxScreenWantAgent](js-apis-reminderAgentManager.md#MaxScreenWantAgent). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| @@ -471,10 +539,14 @@ Provides the information about the target package and ability to start automatic | abilityName | string | Yes| Name of the ability that is automatically started when the reminder arrives and the device is not in use.| -## ReminderRequest +## ReminderRequest(deprecated) Defines the reminder to publish. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequest](js-apis-reminderAgentManager.md#ReminderRequest). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| @@ -494,12 +566,16 @@ Defines the reminder to publish. | slotType | [notification.SlotType](js-apis-notification.md#slottype) | No| Type of the slot used by the reminder.| -## ReminderRequestCalendar +## ReminderRequestCalendar(deprecated) ReminderRequestCalendar extends ReminderRequest Defines a reminder for a calendar event. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequestCalendar](js-apis-reminderAgentManager.md#ReminderRequestCalendar). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| @@ -509,12 +585,16 @@ Defines a reminder for a calendar event. | repeatDays | Array\ | No| Date on which the reminder repeats.| -## ReminderRequestAlarm +## ReminderRequestAlarm(deprecated) ReminderRequestAlarm extends ReminderRequest Defines a reminder for an alarm. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequestAlarm](js-apis-reminderAgentManager.md#ReminderRequestAlarm). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| @@ -524,12 +604,16 @@ Defines a reminder for an alarm. | daysOfWeek | Array\ | No| Days of a week when the reminder repeats. The value ranges from 1 to 7, corresponding to the data from Monday to Sunday.| -## ReminderRequestTimer +## ReminderRequestTimer(deprecated) ReminderRequestTimer extends ReminderRequest Defines a reminder for a scheduled timer. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.ReminderRequestTimer](js-apis-reminderAgentManager.md#ReminderRequestTimer). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| @@ -537,10 +621,14 @@ Defines a reminder for a scheduled timer. | triggerTimeInSeconds | number | Yes| Number of seconds in the countdown timer.| -## LocalDateTime +## LocalDateTime(deprecated) Sets the time information for a calendar reminder. +> **NOTE** +> +> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [reminderAgentManager.LocalDateTime](js-apis-reminderAgentManager.md#LocalDateTime). + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| diff --git a/en/application-dev/reference/apis/js-apis-reminderAgentManager.md b/en/application-dev/reference/apis/js-apis-reminderAgentManager.md index 4380dd084573117be6f2ea5db284969884cad0a3..7ec9eeb2c2070acee07603811e0bbd6417590555 100644 --- a/en/application-dev/reference/apis/js-apis-reminderAgentManager.md +++ b/en/application-dev/reference/apis/js-apis-reminderAgentManager.md @@ -18,9 +18,7 @@ import reminderAgentManager from'@ohos.reminderAgentManager'; ## reminderAgentManager.publishReminder -```ts -publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void -``` +publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\): void Publishes a reminder through the reminder agent. This API uses an asynchronous callback to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8). @@ -33,7 +31,7 @@ Publishes a reminder through the reminder agent. This API uses an asynchronous c | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | reminderReq | [ReminderRequest](#reminderrequest) | Yes| Reminder to be published.| - | callback | AsyncCallback\ | Yes| Callback used to return the published reminder's ID.| + | callback | AsyncCallback\ | Yes| Callback used to return the published reminder's ID.| **Error codes** @@ -67,9 +65,7 @@ try { ## reminderAgentManager.publishReminder -```ts -publishReminder(reminderReq: ReminderRequest): Promise -``` +publishReminder(reminderReq: ReminderRequest): Promise\ Publishes a reminder through the reminder agent. This API uses a promise to return the result. It can be called only when notification is enabled for the application through [Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8). @@ -85,7 +81,7 @@ Publishes a reminder through the reminder agent. This API uses a promise to retu **Return value** | Type| Description| | -------- | -------- | - | Promise\ | Promise used to return the published reminder's ID.| + | Promise\ | Promise used to return the published reminder's ID.| **Error codes** @@ -117,9 +113,7 @@ try { ## reminderAgentManager.cancelReminder -```ts -cancelReminder(reminderId: number, callback: AsyncCallback): void -``` +cancelReminder(reminderId: number, callback: AsyncCallback\): void Cancels the reminder with the specified ID. This API uses an asynchronous callback to return the cancellation result. @@ -130,7 +124,7 @@ Cancels the reminder with the specified ID. This API uses an asynchronous callba | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | reminderId | number | Yes| ID of the reminder to cancel.| -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Error codes** @@ -160,9 +154,7 @@ try { ## reminderAgentManager.cancelReminder -```ts -cancelReminder(reminderId: number): Promise -``` +cancelReminder(reminderId: number): Promise\ Cancels the reminder with the specified ID. This API uses a promise to return the cancellation result. @@ -178,7 +170,7 @@ Cancels the reminder with the specified ID. This API uses a promise to return th | Type| Description| | -------- | -------- | -| Promise\ | Promise used to return the result.| +| PPromise\ | Promise used to return the result.| **Error codes** @@ -205,10 +197,8 @@ try { ## reminderAgentManager.getValidReminders -```ts -getValidReminders(callback: AsyncCallback>): void +getValidReminders(callback: AsyncCallback>): void -``` Obtains all valid (not yet expired) reminders set by the current application. This API uses an asynchronous callback to return the reminders. @@ -218,7 +208,7 @@ Obtains all valid (not yet expired) reminders set by the current application. Th | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\\> | Yes| Asynchronous callback used to return an array of all valid reminders set by the current application.| +| callback | AsyncCallback\> | Yes| Asynchronous callback used to return an array of all valid reminders set by the current application.| **Error codes** @@ -267,9 +257,7 @@ try { ## reminderAgentManager.getValidReminders -```ts -getValidReminders(): Promise> -``` +getValidReminders(): Promise\> Obtains all valid (not yet expired) reminders set by the current application. This API uses a promise to return the reminders. @@ -279,7 +267,7 @@ Obtains all valid (not yet expired) reminders set by the current application. Th | Type| Description| | -------- | -------- | -| Promise\\> | Promise used to return an array of all valid reminders set by the current application.| +| Promise\> | Promise used to return an array of all valid reminders set by the current application.| **Error codes** @@ -327,9 +315,7 @@ try { ## reminderAgentManager.cancelAllReminders -```ts -cancelAllReminders(callback: AsyncCallback): void -``` +cancelAllReminders(callback: AsyncCallback\): void Cancels all reminders set by the current application. This API uses an asynchronous callback to return the cancellation result. @@ -339,7 +325,7 @@ Cancels all reminders set by the current application. This API uses an asynchron | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Error codes** @@ -368,9 +354,7 @@ try { ## reminderAgentManager.cancelAllReminders -```ts -cancelAllReminders(): Promise -``` +cancelAllReminders(): Promise\ Cancels all reminders set by the current application. This API uses a promise to return the cancellation result. @@ -380,7 +364,7 @@ Cancels all reminders set by the current application. This API uses a promise to | Type| Description| | -------- | -------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise used to return the result.| **Error codes** @@ -407,9 +391,7 @@ try { ## reminderAgentManager.addNotificationSlot -```ts -addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void -``` +addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback\): void Adds a notification slot. This API uses an asynchronous callback to return the result. @@ -420,7 +402,7 @@ Adds a notification slot. This API uses an asynchronous callback to return the r | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | slot | [NotificationSlot](js-apis-notification.md#notificationslot) | Yes| Notification slot, whose type can be set.| -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Example** @@ -446,9 +428,7 @@ try { ## reminderAgentManager.addNotificationSlot -```ts -addNotificationSlot(slot: NotificationSlot): Promise -``` +addNotificationSlot(slot: NotificationSlot): Promise\ Adds a notification slot. This API uses a promise to return the result. @@ -464,7 +444,7 @@ Adds a notification slot. This API uses a promise to return the result. | Type| Description| | -------- | -------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise used to return the result.| **Example** @@ -488,9 +468,7 @@ try { ## reminderAgentManager.removeNotificationSlot -```ts -removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void -``` +removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback\): void Removes a notification slot of a specified type. This API uses an asynchronous callback to return the result. @@ -501,7 +479,7 @@ Removes a notification slot of a specified type. This API uses an asynchronous c | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | slotType | [notification.SlotType](js-apis-notification.md#slottype) | Yes| Type of the notification slot to remove.| -| callback | AsyncCallback\ | Yes| Asynchronous callback used to return the result.| +| callback | AsyncCallback\ | Yes| Callback used to return the result.| **Example** @@ -524,9 +502,7 @@ try { ## reminderAgentManager.removeNotificationSlot -```ts -removeNotificationSlot(slotType: notification.SlotType): Promise -``` +removeNotificationSlot(slotType: notification.SlotType): Promise\ Removes a notification slot of a specified type. This API uses a promise to return the result. @@ -542,7 +518,7 @@ Removes a notification slot of a specified type. This API uses a promise to retu | Type| Description| | -------- | -------- | -| Promise\ | Promise used to return the result.| +| Promise\ | Promise used to return the result.| **Example** @@ -570,7 +546,7 @@ Enumerates button types. | -------- | -------- | -------- | | ACTION_BUTTON_TYPE_CLOSE | 0 | Button for closing the reminder.| | ACTION_BUTTON_TYPE_SNOOZE | 1 | Button for snoozing the reminder.| -| ACTION_BUTTON_TYPE_CUSTOM10+ | 2 | Custom button. (This is a system API.)| +| ACTION_BUTTON_TYPE_CUSTOM10+ | 2 | Custom button.
**System API**: This is a system API and cannot be called by third-party applications.| ## ReminderType @@ -590,13 +566,14 @@ Enumerates reminder types. Defines a button displayed for the reminder in the notification panel. + **System capability**: SystemCapability.Notification.ReminderAgent | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | title | string | Yes| Text on the button.| | type | [ActionButtonType](#actionbuttontype) | Yes| Button type.| -| wantAgent10+ | [WantAgent](#wantagent) | No| Ability information that is displayed after the button is clicked. (This is a system API.)| +| wantAgent10+ | [WantAgent](#wantagent) | No| Ability information that is displayed after the button is clicked.
**System API**: This is a system API and cannot be called by third-party applications.| ## WantAgent @@ -605,10 +582,12 @@ Defines the information about the redirected-to ability. **System capability**: SystemCapability.Notification.ReminderAgent + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | pkgName | string | Yes| Name of the target package.| | abilityName | string | Yes| Name of the target ability.| +| uri10+ | string | No| URI of the target ability.
**System API**: This is a system API and cannot be called by third-party applications.| ## MaxScreenWantAgent @@ -632,7 +611,7 @@ Defines the reminder to publish. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | reminderType | [ReminderType](#remindertype) | Yes| Type of the reminder.| -| actionButton | [ActionButton](#actionbutton) | No| Button displayed for the reminder in the notification panel. For common applications, a maximum of two buttons are supported. For system applications, a maximum of two buttons are supported in API version 9, and a maximum of three buttons are supported in API version 10 and later versions. | +| actionButton10+ | [ActionButton](#actionbutton) | No| Button displayed for the reminder in the notification panel. For common applications, a maximum of two buttons are supported. For system applications, a maximum of two buttons are supported in API version 9, and a maximum of three buttons are supported in API version 10 and later versions. | | wantAgent | [WantAgent](#wantagent) | No| Information about the ability that is redirected to when the reminder is clicked.| | maxScreenWantAgent | [MaxScreenWantAgent](#maxscreenwantagent) | No| Information about the ability that is automatically started when the reminder arrives. If the device is in use, a notification will be displayed.| | ringDuration | number | No| Ringing duration, in seconds. The default value is **1**.| @@ -659,8 +638,8 @@ Defines a reminder for a calendar event. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | dateTime | [LocalDateTime](#localdatetime) | Yes| Reminder time.| -| repeatMonths | Array\ | No| Month in which the reminder repeats.| -| repeatDays | Array\ | No| Date on which the reminder repeats.| +| repeatMonths | Array\ | No| Month in which the reminder repeats.| +| repeatDays | Array\ | No| Date on which the reminder repeats.| ## ReminderRequestAlarm @@ -675,7 +654,7 @@ Defines a reminder for an alarm. | -------- | -------- | -------- | -------- | | hour | number | Yes| Hour portion of the reminder time.| | minute | number | Yes| Minute portion of the reminder time.| -| daysOfWeek | Array\ | No| Days of a week when the reminder repeats. The value ranges from 1 to 7, corresponding to the data from Monday to Sunday.| +| daysOfWeek | Array\ | No| Days of a week when the reminder repeats. The value ranges from 1 to 7, corresponding to the data from Monday to Sunday.| ## ReminderRequestTimer diff --git a/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md b/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md index ab02ed0f2c5bf6bf553f6a36f6a94442db2bb378..9118b8b56684cc021cbd83511a905e28d5ddaead 100644 --- a/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md +++ b/en/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md @@ -39,7 +39,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | -| 9700004 | Checking workInfo failed. | +| 9700004 | Check workInfo failed. | | 9700005 | StartWork failed. | @@ -80,7 +80,7 @@ Instructs the **WorkSchedulerService** to stop the specified task. | Name | Type | Mandatory | Description | | ---------- | --------------------- | ---- | ---------- | | work | [WorkInfo](#workinfo) | Yes | Task to stop. | -| needCancel | boolean | Yes | Whether to cancel the task.| +| needCancel | boolean | No | Whether to cancel the task. The default value is **false**.| **Error codes** @@ -91,7 +91,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | -| 9700004 | Checking workInfo failed. | +| 9700004 | Check workInfo failed. | **Example** @@ -118,7 +118,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes } ``` -## workScheduler.getWorkStatus:callback +## workScheduler.getWorkStatus getWorkStatus(workId: number, callback : AsyncCallback\): void Obtains the latest task status. This API uses an asynchronous callback to return the result. @@ -141,7 +141,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | -| 9700004 | Checking workInfo failed. | +| 9700004 | Check workInfo failed. | **Example** @@ -161,7 +161,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes } ``` -## workScheduler.getWorkStatus:promise +## workScheduler.getWorkStatus getWorkStatus(workId: number): Promise\ Obtains the latest task status. This API uses a promise to return the result. @@ -189,7 +189,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | -| 9700004 | Checking workInfo failed. | +| 9700004 | Check workInfo failed. | **Example** @@ -207,7 +207,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes } ``` -## workScheduler.obtainAllWorks:callback +## workScheduler.obtainAllWorks obtainAllWorks(callback : AsyncCallback\): Array\ Obtains all tasks associated with this application. This API uses an asynchronous callback to return the result. @@ -252,8 +252,8 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes } ``` -## workScheduler.obtainAllWorks:promise -obtainAllWorks(): Promise> +## workScheduler.obtainAllWorks +obtainAllWorks(): Promise\> Obtains all tasks associated with this application. This API uses a promise to return the result. @@ -317,7 +317,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes } ``` -## workScheduler.isLastWorkTimeOut:callback +## workScheduler.isLastWorkTimeOut isLastWorkTimeOut(workId: number, callback : AsyncCallback\): boolean Checks whether the last execution of the specified task timed out. This API uses an asynchronous callback to return the result. @@ -346,7 +346,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | -| 9700004 | Checking workInfo failed. | +| 9700004 | Check workInfo failed. | **Example** @@ -364,7 +364,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes } ``` -## workScheduler.isLastWorkTimeOut:promise +## workScheduler.isLastWorkTimeOut isLastWorkTimeOut(workId: number): Promise\ Checks whether the last execution of the specified task timed out. This API uses a promise to return the result. @@ -392,7 +392,7 @@ For details about the error codes, see [workScheduler Error Codes](../errorcodes | 9700001 | Memory operation failed. | | 9700002 | Parcel operation failed. | | 9700003 | System service operation failed. | -| 9700004 | Checking workInfo failed. | +| 9700004 | Check workInfo failed. | **Example** @@ -432,7 +432,7 @@ Provides detailed information about the task. For details about the constraints | isPersisted | boolean | No | Whether to enable persistent storage for the task. | | isDeepIdle | boolean | No | Whether the device needs to enter the idle state. | | idleWaitTime | number | No | Time to wait in the idle state. | -| parameters | {[key: string]: number | string | boolean} | No | Carried parameters. | +| parameters | {[key: string]: number \| string \| boolean} | No | Carried parameters. | ## NetworkType Enumerates the network types that can trigger the task. diff --git a/en/application-dev/reference/apis/js-apis-stationary.md b/en/application-dev/reference/apis/js-apis-stationary.md index e05d0be7fb9f7e3a8329f28c1fc54c1d2a45ca63..7f732445123bce8a0fafde50b26a36548be0eb8e 100644 --- a/en/application-dev/reference/apis/js-apis-stationary.md +++ b/en/application-dev/reference/apis/js-apis-stationary.md @@ -123,7 +123,7 @@ Unsubscribes from the device status. | -------------------- | -------------------------------------------------- | ---- | ---------------------------- | | activity | [ActivityType](#activitytype) | Yes | Device status type. | | event | [ActivityEvent](#activityevent) | Yes | Event type. | -| callback | Callback<[ActivityResponse](#activityresponse)\> | No | Callback used to receive reported data, if the callback parameter is not passed, all callbacks subscribed to this type under this process will be removed. | +| callback | Callback<[ActivityResponse](#activityresponse)\> | No | Callback used to receive reported data. If this parameter is not passed, all callbacks associated with the specified event in the process will be unregistered. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-system-fetch.md b/en/application-dev/reference/apis/js-apis-system-fetch.md index 96bc642f5214e48b09df204a314bd694677a77f4..316e9ca1b3a083d9fdb277b6d910019d229cbce7 100644 --- a/en/application-dev/reference/apis/js-apis-system-fetch.md +++ b/en/application-dev/reference/apis/js-apis-system-fetch.md @@ -16,47 +16,15 @@ import fetch from '@system.fetch'; ## fetch.fetch3+ -fetch(options:{ - /** - * Resource URL. - * @since 3 - */ - url: string; - /** - * Request parameter, which can be of the string type or a JSON object. - * @since 3 - */ - data?: string | object; - /** - * Request header, which accommodates all attributes of the request. - * @since 3 - */ - header?: Object; - /** - * Request methods available: OPTIONS, GET, HEAD, POST, PUT, DELETE and TRACE. The default value is GET. - * @since 3 - */ - method?: string; - /** - * The return type can be text, or JSON. By default, the return type is determined based on Content-Type in the header returned by the server. - * @since 3 - */ - responseType?: string; - /** - * Called when the network data is obtained successfully. - * @since 3 - */ - success?: (data: FetchResponse) => void; - /** - * Called when the network data fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; +fetch(options:{
+  url: string;
+  data?: string | object;
+  header?: Object;
+  method?: string;
+  responseType?: string;
+  success?: (data: FetchResponse) => void;
+  fail?: (data: any, code: number) => void;
+  complete?: () => void;
} ): void Obtains data through a network. diff --git a/en/application-dev/reference/apis/js-apis-system-network.md b/en/application-dev/reference/apis/js-apis-system-network.md index 232c2be8d60b3b893fbebc1119b7d9e807d80ddf..e0cc9a177547c86910db7b3ba4c8ac5e8eb97e75 100644 --- a/en/application-dev/reference/apis/js-apis-system-network.md +++ b/en/application-dev/reference/apis/js-apis-system-network.md @@ -1,8 +1,6 @@ # @system.network (Network State) > **NOTE** -> - The APIs of this module are no longer maintained since API version 7. You are advised to use [`@ohos.telephony.observer`](js-apis-observer.md). -> > - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -23,23 +21,11 @@ ohos.permission.GET_NETWORK_INFO ## network.getType3+ -getType(options?: { - /** - * Called when the network type is obtained. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - /** - * Called when the network type fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void +getType(options?: {
+  success?: (data: NetworkResponse) => void;
+  fail?: (data: any, code: number) => void;
+  complete?: () => void;
+}): void Obtains the network type. @@ -79,17 +65,9 @@ export default { ## network.subscribe3+ -subscribe(options?:{ - /** - * Called when the network connection state changes. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; +subscribe(options?:{
+  success?: (data: NetworkResponse) => void;
+  fail?: (data: any, code: number) => void;
}): void Listens to the network connection state. If this method is called multiple times, the last call takes effect. diff --git a/en/application-dev/reference/apis/js-apis-system-parameter.md b/en/application-dev/reference/apis/js-apis-system-parameter.md index 0dc490855181cedbe2199810dd45a28384c75c71..fceb893eb40373ad0f4cff2faa34c10018ccb3b8 100644 --- a/en/application-dev/reference/apis/js-apis-system-parameter.md +++ b/en/application-dev/reference/apis/js-apis-system-parameter.md @@ -30,7 +30,7 @@ Obtains the value of the system parameter with the specified key. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| **Return value** @@ -124,7 +124,7 @@ Obtains the value of the system parameter with the specified key. This API uses | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md b/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md index 8b4be482d1e6b6b1bae52827c0104387ed16601d..12f2d8448418cac174e471bee660900ceee0b8de 100644 --- a/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md +++ b/en/application-dev/reference/apis/js-apis-system-parameterEnhance.md @@ -29,7 +29,7 @@ Obtains the value of the system parameter with the specified key. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| **Return value** @@ -123,7 +123,7 @@ Obtains the value of the system parameter with the specified key. This API uses | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system parameter.| -| def | string | No| Default value.| +| def | string | No| Default value of the system parameter.
It works only when the system parameter does not exist.
The value can be **undefined** (in which case an empty string will be returned) or any custom value.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-url.md b/en/application-dev/reference/apis/js-apis-url.md index 24f66154decc36532fdc49d4bb3273ccf8a81ba1..a6a89a8d4a94d83723d0a03853c1d4567cc7e3f2 100755 --- a/en/application-dev/reference/apis/js-apis-url.md +++ b/en/application-dev/reference/apis/js-apis-url.md @@ -23,7 +23,7 @@ A constructor used to create a **URLParams** instance. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| init | string[][] \| Record<string, string> \| string \| URLSearchParams | No| Input parameter objects, which include the following:
- **string[][]**: two-dimensional string array
- **Record<string, string>**: list of objects
- **string**: string
- **URLSearchParams**: object| +| init | string[][] \| Record<string, string> \| string \| URLSearchParams | No| Input parameter objects, which include the following:
- **string[][]**: two-dimensional string array
- **Record<string, string>**: list of objects
- **string**: string
- **URLSearchParams**: object
The default value is **null**.| **Example** @@ -150,7 +150,7 @@ Traverses the key-value pairs in the **URLSearchParams** instance by using a cal | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the key-value pairs in the **URLSearchParams** instance.| -| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this object.| **Table 1** callbackFn parameter description @@ -404,7 +404,7 @@ Creates a URL. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | url | string | Yes| Input object.| -| base | string \| URL | No| Input parameter, which can be any of the following:
- **string**: string
- **URL**: string or object| +| base | string \| URL | No| Input parameter, which can be any of the following:
- **string**: string
- **URL**: string or object
The default value is an empty string or an empty object.| **Example** @@ -444,7 +444,7 @@ Parses a URL. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | url | string | Yes| Input object.| -| base | string \| URL | No| Input parameter, which can be any of the following:
- **string**: string
- **URL**: string or object| +| base | string \| URL | No| Input parameter, which can be any of the following:
- **string**: string
- **URL**: string or object
The default value is an empty string or an empty object.| **Error codes** @@ -522,7 +522,7 @@ A constructor used to create a **URLSearchParams** instance. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| init | string[][] \| Record<string, string> \| string \| URLSearchParams | No| Input parameter objects, which include the following:
- **string[][]**: two-dimensional string array
- **Record<string, string>**: list of objects
- **string**: string
- **URLSearchParams**: object| +| init | string[][] \| Record<string, string> \| string \| URLSearchParams | No| Input parameter objects, which include the following:
- **string[][]**: two-dimensional string array
- **Record<string, string>**: list of objects
- **string**: string
- **URLSearchParams**: object
The default value is **null**.| **Example** @@ -665,7 +665,7 @@ Traverses the key-value pairs in the **URLSearchParams** instance by using a cal | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callbackFn | function | Yes| Callback invoked to traverse the key-value pairs in the **URLSearchParams** instance.| -| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked.| +| thisArg | Object | No| Value of **this** to use when **callbackFn** is invoked. The default value is this object.| **Table 1** callbackFn parameter description diff --git a/en/application-dev/reference/apis/js-apis-util.md b/en/application-dev/reference/apis/js-apis-util.md index 1a60dc51ae1404aee3947f799c166180ac13dde2..6600939a007d9ac3abd1ad964f3270445cec3a7e 100755 --- a/en/application-dev/reference/apis/js-apis-util.md +++ b/en/application-dev/reference/apis/js-apis-util.md @@ -547,7 +547,7 @@ A constructor used to create a **TextEncoder** object. | Name| Type| Mandatory| Description| | ----- | ---- | ---- | ---- | -| encoding | string | No| Encoding format.| +| encoding | string | No| Encoding format. The default format is **'utf-8'**.| **Example** @@ -567,7 +567,7 @@ Encodes the input content. | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------ | -| input | string | No | String to encode.| +| input | string | No | String to encode. The default value is an empty string.| **Return value** @@ -665,7 +665,7 @@ Encodes the input content. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| input | string | No| String to encode.| +| input | string | No| String to encode. The default value is an empty string.| **Return value** @@ -1646,18 +1646,18 @@ Create a class to implement the **compareTo** method. The **Temperature** class ```js class Temperature{ - constructor(value){ - // If TS is used for development, add the following code: - // private readonly _temp: Temperature; + // If ArkTS is used for development, add the following code: + // private readonly _temp: Temperature; + constructor(value) { this._temp = value; } - compareTo(value){ + compareTo(value) { return this._temp >= value.getTemp(); } - getTemp(){ + getTemp() { return this._temp; } - toString(){ + toString() { return this._temp.toString(); } } diff --git a/en/application-dev/reference/apis/js-apis-wallpaper.md b/en/application-dev/reference/apis/js-apis-wallpaper.md index 0563c2741b5b71a86cabfb61fee8370bf45e8871..4e869d9d32db75389926d06212fe085f3781955b 100644 --- a/en/application-dev/reference/apis/js-apis-wallpaper.md +++ b/en/application-dev/reference/apis/js-apis-wallpaper.md @@ -13,6 +13,21 @@ The **wallpaper** module is a system service module in OpenHarmony that provides ```js import wallpaper from '@ohos.wallpaper'; ``` +## WallpaperResourceType10+ + +Enumerates the types of wallpaper resources. + +**System capability**: SystemCapability.MiscServices.Wallpaper + +**System API**: This is a system API. + +| Name| Value|Description| +| -------- | -------- |-------- | +| DEFAULT | 0 |Default type (image resource).| +| PICTURE | 1 |Image resource.| +| VIDEO | 2 |Video resource.| +| PACKAGE | 3 |Package resource.| + ## WallpaperType7+ @@ -44,6 +59,158 @@ Defines the RGBA color space for the wallpaper. | alpha | number | Yes| Yes| Alpha value. The value ranges from 0 to 255.| +## wallpaper.setVideo10+ + +setVideo(source: string, wallpaperType: WallpaperType, callback: AsyncCallback<void>): void + +Sets a video resource as the home screen wallpaper or lock screen wallpaper. This API uses an asynchronous callback to return the result. + +**Required permissions**: ohos.permission.SET_WALLPAPER + +**System capability**: SystemCapability.MiscServices.Wallpaper + +**System API**: This is a system API. + +**Parameters** + +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| source | string | Yes| URI of an MP4 file.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result. If the wallpaper is set, **err** is **undefined**. Otherwise, **err** is an error object.| + +**Example** + +```js +let wallpaperPath = "/data/storage/el2/base/haps/entry/files/test.mp4"; +try { + wallpaper.setVideo(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => { + if (error) { + console.error(`failed to setVideo because: ${JSON.stringify(error)}`); + return; + } + console.log(`success to setVideo.`); + }); +} catch (error) { + console.error(`failed to setVideo because: ${JSON.stringify(error)}`); +} + +``` + +## wallpaper.setVideo10+ + +setVideo(source: string, wallpaperType: WallpaperType): Promise<void> + +Sets a video resource as the home screen wallpaper or lock screen wallpaper. This API uses a promise to return the result. + +**Required permissions**: ohos.permission.SET_WALLPAPER + +**System capability**: SystemCapability.MiscServices.Wallpaper + +**System API**: This is a system API. + +**Parameters** + +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| source | string | Yes| URI of an MP4 file.| +| wallpaperType | [WallpaperType](#wallpapertype7) | Yes| Wallpaper type.| + +**Return value** + +| Type| Description| +| -------- | -------- | +| Promise<void> | Promise that returns no value.| + +**Example** + +```js +let wallpaperPath = "/data/storage/el2/base/haps/entry/files/test.mp4"; +try { + wallpaper.setVideo(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => { + console.log(`success to setVideo.`); + }).catch((error) => { + console.error(`failed to setVideo because: ${JSON.stringify(error)}`); + }); +} catch (error) { + console.error(`failed to setVideo because: ${JSON.stringify(error)}`); +} +``` + +## wallpaper.on('wallpaperChange')10+ + +on(type: 'wallpaperChange', callback: (wallpaperType: WallpaperType, resourceType: WallpaperResourceType) => void): void + +Subscribes to wallpaper change events. + +**System capability**: SystemCapability.MiscServices.Wallpaper + +**System API**: This is a system API. + +**Parameters** + +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| type | string | Yes| Event type. The value is fixed at **'wallpaperChange'**.| +| callback | function | Yes| Callback used to return the wallpaper type and wallpaper resource type.
- wallpaperType
Wallpaper type.
- resourceType
Wallpaper resource type.| + +**Example** + +```js +try { + let listener = (wallpaperType, resourceType) => { + console.log(`wallpaper color changed.`); + }; + wallpaper.on('wallpaperChange', listener); +} catch (error) { + console.error(`failed to on because: ${JSON.stringify(error)}`); +} +``` + +## wallpaper.off('wallpaperChange')10+ + +off(type: 'wallpaperChange', callback?: (wallpaperType: WallpaperType, resourceType: WallpaperResourceType) => void): void + +Unsubscribes from wallpaper change events. + +**System capability**: SystemCapability.MiscServices.Wallpaper + +**System API**: This is a system API. + +**Parameters** + +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| type | string | Yes| Event type. The value is fixed at **'wallpaperChange'**.| +| callback | function | No| Callback used for unsubscription. If this parameter is not set, this API unsubscribes from all callbacks of the specified event type.
- wallpaperType
Wallpaper type.
- resourceType
Wallpaper resource type.| + +**Example** + +```js +let listener = (wallpaperType, resourceType) => { + console.log(`wallpaper color changed.`); +}; +try { + wallpaper.on('wallpaperChange', listener); +} catch (error) { + console.error(`failed to on because: ${JSON.stringify(error)}`); +} + +try { + // Unsubscribe from the listener. + wallpaper.off('wallpaperChange', listener); +} catch (error) { + console.error(`failed to off because: ${JSON.stringify(error)}`); +} + +try { + // Unsubscribe from all callbacks of the 'wallpaperChange' event type. + wallpaper.off('wallpaperChange'); +} catch (error) { + console.error(`failed to off because: ${JSON.stringify(error)}`); +} +``` + ## wallpaper.getColorsSync9+ getColorsSync(wallpaperType: WallpaperType): Array<RgbaColor> @@ -210,7 +377,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses an a ```js // The source type is string. -let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; +let wallpaperPath = "/data/storage/el2/base/haps/entry/files/js.jpeg"; wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => { if (error) { console.error(`failed to setImage because: ${JSON.stringify(error)}`); @@ -270,7 +437,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses a pr ```js // The source type is string. -let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; +let wallpaperPath = "/data/storage/el2/base/haps/entry/files/js.jpeg"; wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => { console.log(`success to setImage.`); }).catch((error) => { @@ -898,7 +1065,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses an a ```js // The source type is string. -let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; +let wallpaperPath = "/data/storage/el2/base/haps/entry/files/js.jpeg"; wallpaper.setWallpaper(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => { if (error) { console.error(`failed to setWallpaper because: ${JSON.stringify(error)}`); @@ -960,7 +1127,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses a pr ```js // The source type is string. -let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; +let wallpaperPath = "/data/storage/el2/base/haps/entry/files/js.jpeg"; wallpaper.setWallpaper(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => { console.log(`success to setWallpaper.`); }).catch((error) => { diff --git a/en/application-dev/reference/apis/js-apis-xml.md b/en/application-dev/reference/apis/js-apis-xml.md index 5259aede120c7b89b0ade477f8fb1bb27490cc1a..f8e8f0fff5917b56be67e1f3ab0b21ac949e7ee3 100644 --- a/en/application-dev/reference/apis/js-apis-xml.md +++ b/en/application-dev/reference/apis/js-apis-xml.md @@ -27,13 +27,13 @@ A constructor used to create an **XmlSerializer** instance. | Name | Type | Mandatory| Description | | -------- | --------------------------------- | ---- | ------------------------------------------------ | | buffer | ArrayBuffer \| DataView | Yes | **ArrayBuffer** or **DataView** for storing the XML information to write.| -| encoding | string | No | Encoding format. | +| encoding | string | No | Encoding format. The default value is **'utf-8'** (the only format currently supported). | **Example** ```js let arrayBuffer = new ArrayBuffer(2048); -let thatSer = new xml.XmlSerializer(arrayBuffer,"utf-8"); +let thatSer = new xml.XmlSerializer(arrayBuffer, "utf-8"); thatSer.setDeclaration(); let result = ''; let view = new Uint8Array(arrayBuffer); @@ -363,11 +363,11 @@ console.log(view1) //'' ## XmlPullParser -### XmlPullParser +### constructor constructor(buffer: ArrayBuffer | DataView, encoding?: string) -Creates and returns an **XmlPullParser** object. The **XmlPullParser** object passes two parameters. The first parameter is the memory of the **ArrayBuffer** or **DataView** type, and the second parameter is the file format (UTF-8 by default). +Creates and returns an **XmlPullParser** object. **System capability**: SystemCapability.Utils.Lang @@ -375,8 +375,8 @@ Creates and returns an **XmlPullParser** object. The **XmlPullParser** object pa | Name | Type | Mandatory| Description | | -------- | --------------------------------- | ---- | ------------------------------------------ | -| buffer | ArrayBuffer \| DataView | Yes | **ArrayBuffer** or **DataView** that contains XML text information.| -| encoding | string | No | Encoding format. Only UTF-8 is supported. | +| buffer | ArrayBuffer \| DataView | Yes | XML text information to be parsed.| +| encoding | string | No | Encoding format. The default value is **'utf-8'** (the only format currently supported). | **Example** @@ -401,13 +401,9 @@ let strXml = ' ' + ' ' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let i = 0; i < strLen; ++i) { - bufView[i] = strXml.charCodeAt(i); -} -let that = new xml.XmlPullParser(arrayBuffer, 'UTF-8'); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer, 'UTF-8'); let str1 = ''; function func1(name, value){ str1 += name+':'+value; @@ -443,13 +439,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -481,9 +473,9 @@ Defines the XML parsing options. | ------------------------------ | ------------------------------------------------------------ | ---- | --------------------------------------- | | supportDoctype | boolean | No | Whether to ignore **Doctype**. The default value is **false**.| | ignoreNameSpace | boolean | No | Whether to ignore **Namespace**. The default value is **false**. | -| tagValueCallbackFunction | (name: string, value: string) => boolean | No | Callback used to return **tagValue**. | -| attributeValueCallbackFunction | (name: string, value: string) => boolean | No | Callback used to return **attributeValue**. | -| tokenValueCallbackFunction | (eventType: [EventType](#eventtype), value: [ParseInfo](#parseinfo)) => boolean | No | Callback used to return **tokenValue**. | +| tagValueCallbackFunction | (name: string, value: string) => boolean | No | Callback used to return **tagValue**. The default value is **null**. | +| attributeValueCallbackFunction | (name: string, value: string) => boolean | No | Callback used to return **attributeValue**. The default value is **null**. | +| tokenValueCallbackFunction | (eventType: [EventType](#eventtype), value: [ParseInfo](#parseinfo)) => boolean | No | Callback used to return **tokenValue**. The default value is **null**. | ## ParseInfo @@ -514,13 +506,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -561,13 +549,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -611,13 +595,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -658,13 +638,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -704,13 +680,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -750,13 +722,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -797,13 +765,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -843,13 +807,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -889,13 +849,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; @@ -934,13 +890,9 @@ let strXml = ' Work' + ' Play' + ''; -let arrayBuffer = new ArrayBuffer(strXml.length); -let bufView = new Uint8Array(arrayBuffer); -let strLen = strXml.length; -for (let tmp = 0; tmp < strLen; ++tmp) { - bufView[tmp] = strXml.charCodeAt(tmp); -} -let that = new xml.XmlPullParser(arrayBuffer); +let textEncoder = new util.TextEncoder(); +let arrbuffer = textEncoder.encodeInto(strXml); +let that = new xml.XmlPullParser(arrbuffer.buffer); let arrTag = {}; let str = ""; let i = 0; diff --git a/en/application-dev/reference/apis/js-apis-zlib.md b/en/application-dev/reference/apis/js-apis-zlib.md index 96eacdacfb44cc7dc157f640fae81be96df42da1..05a99a8f76cf5195fed45d270945b9dc0aa8f25a 100644 --- a/en/application-dev/reference/apis/js-apis-zlib.md +++ b/en/application-dev/reference/apis/js-apis-zlib.md @@ -142,6 +142,7 @@ Compresses a file. This API uses an asynchronous callback to return the result. **Error codes** For details about the error codes, see [zlib Error Codes](../errorcodes/errorcode-zlib.md). + | ID| Error Message | | -------- | --------------------------------------| | 900001 | The input source file is invalid. | diff --git a/en/application-dev/reference/arkui-js-lite/figures/#000000.png b/en/application-dev/reference/arkui-js-lite/figures/000000.png similarity index 100% rename from en/application-dev/reference/arkui-js-lite/figures/#000000.png rename to en/application-dev/reference/arkui-js-lite/figures/000000.png diff --git a/en/application-dev/reference/arkui-js-lite/js-common-styles.md b/en/application-dev/reference/arkui-js-lite/js-common-styles.md index 15d76dc7b93a04aa82644b52f3a69f834d9aa1c8..52b7e4c81ed17f40e65b8dcfcc0a359729453429 100644 --- a/en/application-dev/reference/arkui-js-lite/js-common-styles.md +++ b/en/application-dev/reference/arkui-js-lite/js-common-styles.md @@ -4,21 +4,21 @@ You can set universal styles for components in the **style** attribute or **.css** files. -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| width | <length> \| <percentage>5+ | - | No| Component width.

If this attribute is not set, the default value **0** is used.| -| height | <length> \| <percentage>5+ | - | No| Component height.

If this attribute is not set, the default value **0** is used.| -| padding | <length> | 0 | No| Shorthand attribute to set the padding for all sides in a declaration.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| -| padding-[left\|top\|right\|bottom] | <length> | 0 | No| Left, top, right, and bottom padding.| -| margin | <length> \| <percentage>5+ | 0 | No| Shorthand attribute to set the margin for all sides in a declaration. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| -| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No| Left, top, right, and bottom margins.| -| border-width | <length> | 0 | No| Shorthand attribute to set the margin for all sides.| -| border-color | <color> | black | No| Shorthand attribute to set the color for all borders.| -| border-radius | <length> | - | No| Radius of round-corner borders. | -| background-color | <color> | - | No| Background color.| -| opacity5+ | number | 1 | No| Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent.| -| display | string | flex | No| Type of the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| -| [left\|top] | <length> \| <percentage>6+ | - | No| Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element. | +| Name | Type | Default Value | Mandatory | Description | +| ---------------------------------- | ---------------------------------------- | ----- | ---- | ---------------------------------------- | +| width | <length> \| <percentage>5+ | - | No | Component width.

If this attribute is not set, the default value **0** is used. | +| height | <length> \| <percentage>5+ | - | No | Component height.

If this attribute is not set, the default value **0** is used. | +| padding | <length> | 0 | No | Shorthand attribute to set the padding for all sides in a declaration.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| +| padding-[left\|top\|right\|bottom] | <length> | 0 | No | Left, top, right, and bottom padding. | +| margin | <length> \| <percentage>5+ | 0 | No | Shorthand attribute to set the margin for all sides in a declaration. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| +| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No | Left, top, right, and bottom margins. | +| border-width | <length> | 0 | No | Shorthand attribute to set the margin for all sides. | +| border-color | <color> | black | No | Shorthand attribute to set the color for all borders. | +| border-radius | <length> | - | No | Radius of round-corner borders. | +| background-color | <color> | - | No | Background color. | +| opacity5+ | number | 1 | No | Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent. | +| display | string | flex | No | Type of the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| +| [left\|top] | <length> \| <percentage>6+ | - | No | Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element.| > **NOTE** @@ -37,152 +37,152 @@ You can set universal styles for components in the **style** attribute or **.css **Table 1** Color enums -| Name| Hexadecimal Code| Color| -| -------- | -------- | -------- | -| aliceblue | \#f0f8ff | ![aliceblue](figures/aliceblue.png) | -| antiquewhite | \#faebd7 | ![antiquewhite](figures/antiquewhite.png) | -| aqua | \#00ffff | ![aqua](figures/aqua.png) | -| aquamarine | \#7fffd4 | ![aquamarine](figures/aquamarine.png) | -| azure | \#f0ffff | ![azure](figures/azure.png) | -| beige | \#f5f5dc | ![beige](figures/beige.png) | -| bisque | \#ffe4c4 | ![bisque](figures/bisque.png) | -| black | \#000000 | ![#000000](figures/#000000.png) | -| blanchedalmond | \#ffebcd | ![blanchedalmond](figures/blanchedalmond.png) | -| blue | \#0000ff | ![blue](figures/blue.png) | -| blueviolet | \#8a2be2 | ![blueviolet](figures/blueviolet.png) | -| brown | \#a52a2a | ![brown](figures/brown.png) | -| burlywood | \#deB887 | ![burlywood](figures/burlywood.png) | -| cadetblue | \#5f9ea0 | ![cadetblue](figures/cadetblue.png) | -| chartreuse | \#7fff00 | ![chartreuse](figures/chartreuse.png) | -| chocolate | \#d2691e | ![chocolate](figures/chocolate.png) | -| coral | \#ff7f50 | ![coral](figures/coral.png) | -| cornflowerblue | \#6495ed | ![cornflowerblue](figures/cornflowerblue.png) | -| cornsilk | \#fff8dc | ![cornsilk](figures/cornsilk.png) | -| crimson | \#dc143c | ![crimson](figures/crimson.png) | -| cyan | \#00ffff | ![cyan](figures/cyan.png) | -| darkblue | \#00008b | ![darkblue](figures/darkblue.png) | -| darkcyan | \#008b8b | ![darkcyan](figures/darkcyan.png) | -| darkgoldenrod | \#b8860b | ![darkgoldenrod](figures/darkgoldenrod.png) | -| darkgray | \#a9a9a9 | ![darkgray](figures/darkgray.png) | -| darkgreen | \#006400 | ![darkgreen](figures/darkgreen.png) | -| darkgrey | \#a9a9a9 | ![darkgrey](figures/darkgrey.png) | -| darkkhaki | \#bdb76b | ![darkkhaki](figures/darkkhaki.png) | -| darkmagenta | \#8b008b | ![darkmagenta](figures/darkmagenta.png) | -| darkolivegreen | \#556b2f | ![darkolivegreen](figures/darkolivegreen.png) | -| darkorange | \#ff8c00 | ![darkorange](figures/darkorange.png) | -| darkorchid | \#9932cc | ![darkorchid](figures/darkorchid.png) | -| darkred | \#8b0000 | ![darkred](figures/darkred.png) | -| darksalmon | \#e9967a | ![darksalmon](figures/darksalmon.png) | -| darkseagreen | \#8fbc8f | ![darkseagreen](figures/darkseagreen.png) | -| darkslateblue | \#483d8b | ![darkslateblue](figures/darkslateblue.png) | -| darkslategray | \#2f4f4f | ![darkslategray](figures/darkslategray.png) | -| darkslategrey | \#2f4f4f | ![darkslategrey](figures/darkslategrey.png) | -| darkturquoise | \#00ced1 | ![darkturquoise](figures/darkturquoise.png) | -| darkviolet | \#9400d3 | ![darkviolet](figures/darkviolet.png) | -| deeppink | \#ff1493 | ![deeppink](figures/deeppink.png) | -| deepskyblue | \#00bfff | ![deepskyblue](figures/deepskyblue.png) | -| dimgray | \#696969 | ![dimgray](figures/dimgray.png) | -| dimgrey | \#696969 | ![dimgrey](figures/dimgrey.png) | -| dodgerblue | \#1e90ff | ![dodgerblue](figures/dodgerblue.png) | -| firebrick | \#b22222 | ![firebrick](figures/firebrick.png) | -| floralwhite | \#fffaf0 | ![floralwhite](figures/floralwhite.png) | -| forestgreen | \#228b22 | ![forestgreen](figures/forestgreen.png) | -| fuchsia | \#ff00ff | ![fuchsia](figures/fuchsia.png) | -| gainsboro | \#dcdcdc | ![gainsboro](figures/gainsboro.png) | -| ghostwhite | \#f8f8ff | ![ghostwhite](figures/ghostwhite.png) | -| gold | \#ffd700 | ![gold](figures/gold.png) | -| goldenrod | \#daa520 | ![goldenrod](figures/goldenrod.png) | -| gray | \#808080 | ![gray](figures/gray.png) | -| green | \#008000 | ![green](figures/green.png) | -| greenyellow | \#adff2f | ![greenyellow](figures/greenyellow.png) | -| grey | \#808080 | ![grey](figures/grey.png) | -| honeydew | \#f0fff0 | ![honeydew](figures/honeydew.png) | -| hotpink | \#ff69b4 | ![hotpink](figures/hotpink.png) | -| indianred | \#cd5c5c | ![indianred](figures/indianred.png) | -| indigo | \#4b0082 | ![indigo](figures/indigo.png) | -| ivory | \#fffff0 | ![ivory](figures/ivory.png) | -| khaki | \#f0e68c | ![khaki](figures/khaki.png) | -| lavender | \#e6e6fa | ![lavender](figures/lavender.png) | -| lavenderblush | \#fff0f5 | ![lavenderblush](figures/lavenderblush.png) | -| lawngreen | \#7cfc00 | ![lawngreen](figures/lawngreen.png) | -| lemonchiffon | \#fffacd | ![lemonchiffon](figures/lemonchiffon.png) | -| lightblue | \#add8e6 | ![lightblue](figures/lightblue.png) | -| lightcoral | \#f08080 | ![lightcoral](figures/lightcoral.png) | -| lightcyan | \#e0ffff | ![lightcyan](figures/lightcyan.png) | +| Name | Hexadecimal Code | Color | +| -------------------- | -------- | ---------------------------------------- | +| aliceblue | \#f0f8ff | ![aliceblue](figures/aliceblue.png) | +| antiquewhite | \#faebd7 | ![antiquewhite](figures/antiquewhite.png) | +| aqua | \#00ffff | ![aqua](figures/aqua.png) | +| aquamarine | \#7fffd4 | ![aquamarine](figures/aquamarine.png) | +| azure | \#f0ffff | ![azure](figures/azure.png) | +| beige | \#f5f5dc | ![beige](figures/beige.png) | +| bisque | \#ffe4c4 | ![bisque](figures/bisque.png) | +| black | \#000000 | ![000000](figures/000000.png) | +| blanchedalmond | \#ffebcd | ![blanchedalmond](figures/blanchedalmond.png) | +| blue | \#0000ff | ![blue](figures/blue.png) | +| blueviolet | \#8a2be2 | ![blueviolet](figures/blueviolet.png) | +| brown | \#a52a2a | ![brown](figures/brown.png) | +| burlywood | \#deB887 | ![burlywood](figures/burlywood.png) | +| cadetblue | \#5f9ea0 | ![cadetblue](figures/cadetblue.png) | +| chartreuse | \#7fff00 | ![chartreuse](figures/chartreuse.png) | +| chocolate | \#d2691e | ![chocolate](figures/chocolate.png) | +| coral | \#ff7f50 | ![coral](figures/coral.png) | +| cornflowerblue | \#6495ed | ![cornflowerblue](figures/cornflowerblue.png) | +| cornsilk | \#fff8dc | ![cornsilk](figures/cornsilk.png) | +| crimson | \#dc143c | ![crimson](figures/crimson.png) | +| cyan | \#00ffff | ![cyan](figures/cyan.png) | +| darkblue | \#00008b | ![darkblue](figures/darkblue.png) | +| darkcyan | \#008b8b | ![darkcyan](figures/darkcyan.png) | +| darkgoldenrod | \#b8860b | ![darkgoldenrod](figures/darkgoldenrod.png) | +| darkgray | \#a9a9a9 | ![darkgray](figures/darkgray.png) | +| darkgreen | \#006400 | ![darkgreen](figures/darkgreen.png) | +| darkgrey | \#a9a9a9 | ![darkgrey](figures/darkgrey.png) | +| darkkhaki | \#bdb76b | ![darkkhaki](figures/darkkhaki.png) | +| darkmagenta | \#8b008b | ![darkmagenta](figures/darkmagenta.png) | +| darkolivegreen | \#556b2f | ![darkolivegreen](figures/darkolivegreen.png) | +| darkorange | \#ff8c00 | ![darkorange](figures/darkorange.png) | +| darkorchid | \#9932cc | ![darkorchid](figures/darkorchid.png) | +| darkred | \#8b0000 | ![darkred](figures/darkred.png) | +| darksalmon | \#e9967a | ![darksalmon](figures/darksalmon.png) | +| darkseagreen | \#8fbc8f | ![darkseagreen](figures/darkseagreen.png) | +| darkslateblue | \#483d8b | ![darkslateblue](figures/darkslateblue.png) | +| darkslategray | \#2f4f4f | ![darkslategray](figures/darkslategray.png) | +| darkslategrey | \#2f4f4f | ![darkslategrey](figures/darkslategrey.png) | +| darkturquoise | \#00ced1 | ![darkturquoise](figures/darkturquoise.png) | +| darkviolet | \#9400d3 | ![darkviolet](figures/darkviolet.png) | +| deeppink | \#ff1493 | ![deeppink](figures/deeppink.png) | +| deepskyblue | \#00bfff | ![deepskyblue](figures/deepskyblue.png) | +| dimgray | \#696969 | ![dimgray](figures/dimgray.png) | +| dimgrey | \#696969 | ![dimgrey](figures/dimgrey.png) | +| dodgerblue | \#1e90ff | ![dodgerblue](figures/dodgerblue.png) | +| firebrick | \#b22222 | ![firebrick](figures/firebrick.png) | +| floralwhite | \#fffaf0 | ![floralwhite](figures/floralwhite.png) | +| forestgreen | \#228b22 | ![forestgreen](figures/forestgreen.png) | +| fuchsia | \#ff00ff | ![fuchsia](figures/fuchsia.png) | +| gainsboro | \#dcdcdc | ![gainsboro](figures/gainsboro.png) | +| ghostwhite | \#f8f8ff | ![ghostwhite](figures/ghostwhite.png) | +| gold | \#ffd700 | ![gold](figures/gold.png) | +| goldenrod | \#daa520 | ![goldenrod](figures/goldenrod.png) | +| gray | \#808080 | ![gray](figures/gray.png) | +| green | \#008000 | ![green](figures/green.png) | +| greenyellow | \#adff2f | ![greenyellow](figures/greenyellow.png) | +| grey | \#808080 | ![grey](figures/grey.png) | +| honeydew | \#f0fff0 | ![honeydew](figures/honeydew.png) | +| hotpink | \#ff69b4 | ![hotpink](figures/hotpink.png) | +| indianred | \#cd5c5c | ![indianred](figures/indianred.png) | +| indigo | \#4b0082 | ![indigo](figures/indigo.png) | +| ivory | \#fffff0 | ![ivory](figures/ivory.png) | +| khaki | \#f0e68c | ![khaki](figures/khaki.png) | +| lavender | \#e6e6fa | ![lavender](figures/lavender.png) | +| lavenderblush | \#fff0f5 | ![lavenderblush](figures/lavenderblush.png) | +| lawngreen | \#7cfc00 | ![lawngreen](figures/lawngreen.png) | +| lemonchiffon | \#fffacd | ![lemonchiffon](figures/lemonchiffon.png) | +| lightblue | \#add8e6 | ![lightblue](figures/lightblue.png) | +| lightcoral | \#f08080 | ![lightcoral](figures/lightcoral.png) | +| lightcyan | \#e0ffff | ![lightcyan](figures/lightcyan.png) | | lightgoldenrodyellow | \#fafad2 | ![lightgoldenrodyellow](figures/lightgoldenrodyellow.png) | -| lightgray | \#d3d3d3 | ![lightgray](figures/lightgray.png) | -| lightgreen | \#90ee90 | ![lightgreen](figures/lightgreen.png) | -| lightpink | \#ffb6c1 | ![lightpink](figures/lightpink.png) | -| lightsalmon | \#ffa07a | ![lightsalmon](figures/lightsalmon.png) | -| lightseagreen | \#20b2aa | ![lightseagreen](figures/lightseagreen.png) | -| lightskyblue | \#87cefa | ![lightskyblue](figures/lightskyblue.png) | -| lightslategray | \#778899 | ![lightslategray](figures/lightslategray.png) | -| lightslategrey | \#778899 | ![lightslategrey](figures/lightslategrey.png) | -| lightsteelblue | \#b0c4de | ![lightsteelblue](figures/lightsteelblue.png) | -| lightyellow | \#ffffe0 | ![lightyellow](figures/lightyellow.png) | -| lime | \#00ff00 | ![lime](figures/lime.png) | -| limegreen | \#32cd32 | ![limegreen](figures/limegreen.png) | -| linen | \#faf0e6 | ![linen](figures/linen.png) | -| magenta | \#ff00ff | ![magenta](figures/magenta.png) | -| maroon | \#800000 | ![maroon](figures/maroon.png) | -| mediumaquamarine | \#66cdaa | ![mediumaquamarine](figures/mediumaquamarine.png) | -| mediumblue | \#0000cd | ![mediumblue](figures/mediumblue.png) | -| mediumorchid | \#ba55d3 | ![mediumorchid](figures/mediumorchid.png) | -| mediumpurple | \#9370db | ![mediumpurple](figures/mediumpurple.png) | -| mediumseagreen | \#3cb371 | ![mediumseagreen](figures/mediumseagreen.png) | -| mediumslateblue | \#7b68ee | ![mediumslateblue](figures/mediumslateblue.png) | -| mediumspringgreen | \#00fa9a | ![mediumspringgreen](figures/mediumspringgreen.png) | -| mediumturquoise | \#48d1cc | ![mediumturquoise](figures/mediumturquoise.png) | -| mediumvioletred | \#c71585 | ![mediumvioletred](figures/mediumvioletred.png) | -| midnightblue | \#191970 | ![midnightblue](figures/midnightblue.png) | -| mintcream | \#f5fffa | ![mintcream](figures/mintcream.png) | -| mistyrose | \#ffe4e1 | ![mistyrose](figures/mistyrose.png) | -| moccasin | \#ffe4b5 | ![moccasin](figures/moccasin.png) | -| navajowhite | \#ffdead | ![navajowhite](figures/navajowhite.png) | -| navy | \#000080 | ![navy](figures/navy.png) | -| oldlace | \#fdf5e6 | ![oldlace](figures/oldlace.png) | -| olive | \#808000 | ![olive](figures/olive.png) | -| olivedrab | \#6b8e23 | ![olivedrab](figures/olivedrab.png) | -| orange | \#ffa500 | ![orange](figures/orange.png) | -| orangered | \#ff4500 | ![orangered](figures/orangered.png) | -| orchid | \#da70d6 | ![orchid](figures/orchid.png) | -| palegoldenrod | \#eee8aa | ![palegoldenrod](figures/palegoldenrod.png) | -| palegreen | \#98fb98 | ![palegreen](figures/palegreen.png) | -| paleturquoise | \#afeeee | ![paleturquoise](figures/paleturquoise.png) | -| palevioletred | \#db7093 | ![palevioletred](figures/palevioletred.png) | -| papayawhip | \#ffefd5 | ![papayawhip](figures/papayawhip.png) | -| peachpuff | \#ffdab9 | ![peachpuff](figures/peachpuff.png) | -| peru | \#cd853f | ![peru](figures/peru.png) | -| pink | \#ffc0cb | ![pink](figures/pink.png) | -| plum | \#dda0dd | ![plum](figures/plum.png) | -| powderblue | \#b0e0e6 | ![powderblue](figures/powderblue.png) | -| purple | \#800080 | ![purple](figures/purple.png) | -| rebeccapurple | \#663399 | ![rebeccapurple](figures/rebeccapurple.png) | -| red | \#ff0000 | ![red](figures/red.png) | -| rosybrown | \#bc8f8f | ![rosybrown](figures/rosybrown.png) | -| royalblue | \#4169e1 | ![royalblue](figures/royalblue.png) | -| saddlebrown | \#8b4513 | ![saddlebrown](figures/saddlebrown.png) | -| salmon | \#fa8072 | ![salmon](figures/salmon.png) | -| sandybrown | \#f4a460 | ![sandybrown](figures/sandybrown.png) | -| seagreen | \#2e8b57 | ![seagreen](figures/seagreen.png) | -| seashell | \#fff5ee | ![seashell](figures/seashell.png) | -| sienna | \#a0522d | ![sienna](figures/sienna.png) | -| silver | \#c0c0c0 | ![silver](figures/silver.png) | -| skyblue | \#87ceeb | ![skyblue](figures/skyblue.png) | -| slateblue | \#6a5acd | ![slateblue](figures/slateblue.png) | -| slategray | \#708090 | ![slategray](figures/slategray.png) | -| slategrey | \#708090 | ![slategray](figures/slategray.png) | -| snow | \#fffafa | ![snow](figures/snow.png) | -| springgreen | \#00ff7f | ![springgreen](figures/springgreen.png) | -| steelblue | \#4682b4 | ![steelblue](figures/steelblue.png) | -| tan | \#d2b48c | ![tan](figures/tan.png) | -| teal | \#008080 | ![teal](figures/teal.png) | -| thistle | \#d8Bfd8 | ![thistle](figures/thistle.png) | -| tomato | \#ff6347 | ![tomato](figures/tomato.png) | -| turquoise | \#40e0d0 | ![turquoise](figures/turquoise.png) | -| violet | \#ee82ee | ![violet](figures/violet.png) | -| wheat | \#f5deb3 | ![wheat](figures/wheat.png) | -| white | \#ffffff | ![white](figures/white.png) | -| whitesmoke | \#f5f5f5 | ![whitesmoke](figures/whitesmoke.png) | -| yellow | \#ffff00 | ![yellow](figures/yellow.png) | -| yellowgreen | \#9acd32 | ![yellowgreen](figures/yellowgreen.png) | +| lightgray | \#d3d3d3 | ![lightgray](figures/lightgray.png) | +| lightgreen | \#90ee90 | ![lightgreen](figures/lightgreen.png) | +| lightpink | \#ffb6c1 | ![lightpink](figures/lightpink.png) | +| lightsalmon | \#ffa07a | ![lightsalmon](figures/lightsalmon.png) | +| lightseagreen | \#20b2aa | ![lightseagreen](figures/lightseagreen.png) | +| lightskyblue | \#87cefa | ![lightskyblue](figures/lightskyblue.png) | +| lightslategray | \#778899 | ![lightslategray](figures/lightslategray.png) | +| lightslategrey | \#778899 | ![lightslategrey](figures/lightslategrey.png) | +| lightsteelblue | \#b0c4de | ![lightsteelblue](figures/lightsteelblue.png) | +| lightyellow | \#ffffe0 | ![lightyellow](figures/lightyellow.png) | +| lime | \#00ff00 | ![lime](figures/lime.png) | +| limegreen | \#32cd32 | ![limegreen](figures/limegreen.png) | +| linen | \#faf0e6 | ![linen](figures/linen.png) | +| magenta | \#ff00ff | ![magenta](figures/magenta.png) | +| maroon | \#800000 | ![maroon](figures/maroon.png) | +| mediumaquamarine | \#66cdaa | ![mediumaquamarine](figures/mediumaquamarine.png) | +| mediumblue | \#0000cd | ![mediumblue](figures/mediumblue.png) | +| mediumorchid | \#ba55d3 | ![mediumorchid](figures/mediumorchid.png) | +| mediumpurple | \#9370db | ![mediumpurple](figures/mediumpurple.png) | +| mediumseagreen | \#3cb371 | ![mediumseagreen](figures/mediumseagreen.png) | +| mediumslateblue | \#7b68ee | ![mediumslateblue](figures/mediumslateblue.png) | +| mediumspringgreen | \#00fa9a | ![mediumspringgreen](figures/mediumspringgreen.png) | +| mediumturquoise | \#48d1cc | ![mediumturquoise](figures/mediumturquoise.png) | +| mediumvioletred | \#c71585 | ![mediumvioletred](figures/mediumvioletred.png) | +| midnightblue | \#191970 | ![midnightblue](figures/midnightblue.png) | +| mintcream | \#f5fffa | ![mintcream](figures/mintcream.png) | +| mistyrose | \#ffe4e1 | ![mistyrose](figures/mistyrose.png) | +| moccasin | \#ffe4b5 | ![moccasin](figures/moccasin.png) | +| navajowhite | \#ffdead | ![navajowhite](figures/navajowhite.png) | +| navy | \#000080 | ![navy](figures/navy.png) | +| oldlace | \#fdf5e6 | ![oldlace](figures/oldlace.png) | +| olive | \#808000 | ![olive](figures/olive.png) | +| olivedrab | \#6b8e23 | ![olivedrab](figures/olivedrab.png) | +| orange | \#ffa500 | ![orange](figures/orange.png) | +| orangered | \#ff4500 | ![orangered](figures/orangered.png) | +| orchid | \#da70d6 | ![orchid](figures/orchid.png) | +| palegoldenrod | \#eee8aa | ![palegoldenrod](figures/palegoldenrod.png) | +| palegreen | \#98fb98 | ![palegreen](figures/palegreen.png) | +| paleturquoise | \#afeeee | ![paleturquoise](figures/paleturquoise.png) | +| palevioletred | \#db7093 | ![palevioletred](figures/palevioletred.png) | +| papayawhip | \#ffefd5 | ![papayawhip](figures/papayawhip.png) | +| peachpuff | \#ffdab9 | ![peachpuff](figures/peachpuff.png) | +| peru | \#cd853f | ![peru](figures/peru.png) | +| pink | \#ffc0cb | ![pink](figures/pink.png) | +| plum | \#dda0dd | ![plum](figures/plum.png) | +| powderblue | \#b0e0e6 | ![powderblue](figures/powderblue.png) | +| purple | \#800080 | ![purple](figures/purple.png) | +| rebeccapurple | \#663399 | ![rebeccapurple](figures/rebeccapurple.png) | +| red | \#ff0000 | ![red](figures/red.png) | +| rosybrown | \#bc8f8f | ![rosybrown](figures/rosybrown.png) | +| royalblue | \#4169e1 | ![royalblue](figures/royalblue.png) | +| saddlebrown | \#8b4513 | ![saddlebrown](figures/saddlebrown.png) | +| salmon | \#fa8072 | ![salmon](figures/salmon.png) | +| sandybrown | \#f4a460 | ![sandybrown](figures/sandybrown.png) | +| seagreen | \#2e8b57 | ![seagreen](figures/seagreen.png) | +| seashell | \#fff5ee | ![seashell](figures/seashell.png) | +| sienna | \#a0522d | ![sienna](figures/sienna.png) | +| silver | \#c0c0c0 | ![silver](figures/silver.png) | +| skyblue | \#87ceeb | ![skyblue](figures/skyblue.png) | +| slateblue | \#6a5acd | ![slateblue](figures/slateblue.png) | +| slategray | \#708090 | ![slategray](figures/slategray.png) | +| slategrey | \#708090 | ![slategray](figures/slategray.png) | +| snow | \#fffafa | ![snow](figures/snow.png) | +| springgreen | \#00ff7f | ![springgreen](figures/springgreen.png) | +| steelblue | \#4682b4 | ![steelblue](figures/steelblue.png) | +| tan | \#d2b48c | ![tan](figures/tan.png) | +| teal | \#008080 | ![teal](figures/teal.png) | +| thistle | \#d8Bfd8 | ![thistle](figures/thistle.png) | +| tomato | \#ff6347 | ![tomato](figures/tomato.png) | +| turquoise | \#40e0d0 | ![turquoise](figures/turquoise.png) | +| violet | \#ee82ee | ![violet](figures/violet.png) | +| wheat | \#f5deb3 | ![wheat](figures/wheat.png) | +| white | \#ffffff | ![white](figures/white.png) | +| whitesmoke | \#f5f5f5 | ![whitesmoke](figures/whitesmoke.png) | +| yellow | \#ffff00 | ![yellow](figures/yellow.png) | +| yellowgreen | \#9acd32 | ![yellowgreen](figures/yellowgreen.png) | diff --git a/en/application-dev/reference/arkui-js-lite/js-components-basic-chart.md b/en/application-dev/reference/arkui-js-lite/js-components-basic-chart.md index 7a0a07fe1bee64329c6fe292f881856b941e6ee1..2c8f4c0550f7794d975eb7014e30506c034e9a1d 100644 --- a/en/application-dev/reference/arkui-js-lite/js-components-basic-chart.md +++ b/en/application-dev/reference/arkui-js-lite/js-components-basic-chart.md @@ -14,118 +14,118 @@ Not supported ## Attributes -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| type | string | No| Chart type. Dynamic modification is not supported. Available values include:
- **bar**: bar chart
- **line**: line chart
Default value: **line**| -| options | ChartOptions | Yes| Chart parameters. You can set the minimum value, maximum value, scale, and line width of the x-axis or y-axis, whether to display the x-axis and y-axis, and whether the line is smooth. Dynamic modification is not supported.| -| datasets | Array<ChartDataset> | Yes| Data sets. You can set multiple datasets and their background colors.| -| id | string | No| Unique ID of the component.| -| style | string | No| Style declaration of the component.| -| class | string | No| Style class of the component, which is used to refer to a style table.| -| ref | string | No| Reference information of child elements, which is registered with the parent component on **$refs**.| +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ---------------------------------------- | +| type | string | No | Chart type. Dynamic modification is not supported. Available values include:
- **bar**: bar chart
- **line**: line chart
Default value: **line**| +| options | ChartOptions | Yes | Chart parameters. You can set the minimum value, maximum value, scale, and line width of the x-axis or y-axis, whether to display the x-axis and y-axis, and whether the line is smooth. Dynamic modification is not supported.| +| datasets | Array<ChartDataset> | Yes | Data sets. You can set multiple datasets and their background colors. | +| id | string | No | Unique ID of the component. | +| style | string | No | Style declaration of the component. | +| class | string | No | Style class of the component, which is used to refer to a style table. | +| ref | string | No | Reference information of child elements, which is registered with the parent component on **$refs**.| **Table 1** ChartOptions -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| xAxis | ChartAxis | Yes| X-axis parameters. You can set the minimum value, maximum value, and scale of the x-axis, and whether to display the x-axis.| -| yAxis | ChartAxis | Yes| Y-axis parameters. You can set the minimum value, maximum value, and scale of the y-axis, and whether to display the y-axis.| -| series | ChartSeries | No| Data series parameters which cover the following:
- Line style, such as the line width and whether the line is smooth.
- Style and size of the white point at the start of the line.
**NOTE**
Only line charts support this attribute. | +| Name | Type | Mandatory | Description | +| ------ | ----------- | ---- | ---------------------------------------- | +| xAxis | ChartAxis | Yes | X-axis parameters. You can set the minimum value, maximum value, and scale of the x-axis, and whether to display the x-axis. | +| yAxis | ChartAxis | Yes | Y-axis parameters. You can set the minimum value, maximum value, and scale of the y-axis, and whether to display the y-axis. | +| series | ChartSeries | No | Data series parameters which cover the following:
- Line style, such as the line width and whether the line is smooth.
- Style and size of the white point at the start of the line.
**NOTE**
Only line charts support this attribute.| **Table 2** ChartDataset -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| backgroundColor(deprecated) | <color> | \#ff6384 | No| Color of a line or bar. This attribute is not recommended.| -| strokeColor | <color> | \#ff6384 | No| Line color. Only line charts support this attribute.| -| fillColor | <color> | \#ff6384 | No| Fill color. For line charts, the value indicates the gradient color to fill.| -| data | Array<number> | - | Yes| Data of the drawn line or bar.| -| gradient | boolean | false | No| Whether to display the gradient color. Only line charts support this attribute.| +| Name | Type | Default Value | Mandatory | Description | +| --------------------------- | ------------------- | -------- | ---- | -------------------- | +| backgroundColor(deprecated) | <color> | \#ff6384 | No | Color of a line or bar. This attribute is not recommended. | +| strokeColor | <color> | \#ff6384 | No | Line color. Only line charts support this attribute. | +| fillColor | <color> | \#ff6384 | No | Fill color. For line charts, the value indicates the gradient color to fill. | +| data | Array<number> | - | Yes | Data of the drawn line or bar. | +| gradient | boolean | false | No | Whether to display the gradient color. Only line charts support this attribute.| **Table 3** ChartAxis -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| min | number | 0 | No| Minimum value of the axis.
Negative numbers are not supported. Only line charts support this attribute.| -| max | number | 100 | No| Maximum value of the axis.
Negative numbers are not supported. Only line charts support this attribute.| -| axisTick | number | 10 | No| Number of scales displayed on the axis.
**NOTE**
The value ranges from 1 to 20. The display effect depends on the calculation result of Number of pixels occupied by the image width/(**max**-**min**).
Lite wearables support integer calculation, and an error may occur in the case of inexhaustible division. Specifically, a segment of space may be left at the end of the x-axis.
In the bar chart, the number of bars in each group of data is the same as the number of scales, and the bars are displayed at the scales.| -| display | boolean | false | No| Whether to display the axis.| -| color | <color> | \#c0c0c0 | No| Axis color.| +| Name | Type | Default Value | Mandatory | Description | +| -------- | ------------- | -------- | ---- | ---------------------------------------- | +| min | number | 0 | No | Minimum value of the axis.
Negative numbers are not supported. Only line charts support this attribute. | +| max | number | 100 | No | Maximum value of the axis.
Negative numbers are not supported. Only line charts support this attribute. | +| axisTick | number | 10 | No | Number of scales displayed on the axis.
**NOTE**
The value ranges from 1 to 20. The display effect depends on the calculation result of Number of pixels occupied by the image width/(**max**-**min**).
Lite wearables support integer calculation, and an error may occur in the case of inexhaustible division. Specifically, a segment of space may be left at the end of the x-axis.
In the bar chart, the number of bars in each group of data is the same as the number of scales, and the bars are displayed at the scales.| +| display | boolean | false | No | Whether to display the axis. | +| color | <color> | \#c0c0c0 | No | Axis color. | **Table 4** ChartSeries -| Name| Type| Mandatory| Description| -| -------- | -------- | -------- | -------- | -| lineStyle | ChartLineStyle | No| Line style, such as the line width and whether the line is smooth.| -| headPoint | PointStyle | No| Style and size of the white point at the start of the line.| -| topPoint | PointStyle | No| Style and size of the top point.| -| bottomPoint | PointStyle | No| Style and size of the bottom point.| -| loop | ChartLoop | No| Whether to start drawing again when the screen is looped.| +| Name | Type | Mandatory | Description | +| ----------- | -------------- | ---- | -------------------- | +| lineStyle | ChartLineStyle | No | Line style, such as the line width and whether the line is smooth. | +| headPoint | PointStyle | No | Style and size of the white point at the start of the line. | +| topPoint | PointStyle | No | Style and size of the top point. | +| bottomPoint | PointStyle | No | Style and size of the bottom point. | +| loop | ChartLoop | No | Whether to start drawing again when the screen is looped.| **Table 5** ChartLineStyle -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| width | <length> | 1px | No| Line width.| -| smooth | boolean | false | No| Whether the line is smooth.| +| Name | Type | Default Value | Mandatory | Description | +| ------ | -------------- | ----- | ---- | ----- | +| width | <length> | 1px | No | Line width.| +| smooth | boolean | false | No | Whether the line is smooth.| **Table 6** PointStyle -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| shape | string | circle | No| Shape of the highlight point. Available values are as follows:
- circle| -| size | <length> | 5px | No| Size of the highlight point.| -| strokeWidth | <length> | 1px | No| Stroke width.| -| strokeColor | <color> | \#ff0000 | No| Stroke color.| -| fillColor | <color> | \#ff0000 | No| Fill color.| -| display | boolean | true | No| Whether to display the highlight spot.| +| Name | Type | Default Value | Mandatory | Description | +| ----------- | -------------- | -------- | ---- | ---------------------------------- | +| shape | string | circle | No | Shape of the highlight point. Available values are as follows:
- circle| +| size | <length> | 5px | No | Size of the highlight point. | +| strokeWidth | <length> | 1px | No | Stroke width. | +| strokeColor | <color> | \#ff0000 | No | Stroke color. | +| fillColor | <color> | \#ff0000 | No | Fill color. | +| display | boolean | true | No | Whether to display the highlight spot. | **Table 7** ChartLoop -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| margin | <length> | 1 | No| Number of erased points (horizontal distance between the latest drawn point and the earliest point). You are not advised to use **margin** together with **topPoint**, **bottomPoint**, or **headPoint** for mini-, small- and standard-system devices. If you do so, there is a possibility that the point is in the erase area and invisible.| +| Name | Type | Default Value | Mandatory | Description | +| ------ | -------------- | ---- | ---- | ---------------------------------------- | +| margin | <length> | 1 | No | Number of erased points (horizontal distance between the latest drawn point and the earliest point). You are not advised to use **margin** together with **topPoint**, **bottomPoint**, or **headPoint** for mini-, small- and standard-system devices. If you do so, there is a possibility that the point is in the erase area and invisible.| ## Methods -| Methods| Parameter| Description| -| -------- | -------- | -------- | +| Methods | Parameter | Description | +| ------ | ---------------------------------------- | ---------------------------------------- | | append | {
serial: number, // Set the data subscript of the line chart to be updated.
data: Array<number>, // Set the new data.
} | Dynamically add data to an existing data series. The target series is specified based on **serial**, which is the subscript of the datasets array and starts from 0. **datasets[index].data** is not updated. Only line charts support this attribute. The value is incremented by 1 based on the horizontal coordinate and is related to the **xAxis min/max** setting.| ## Events -| Name| Parameter| Description| -| -------- | -------- | -------- | -| click | - | Triggered when the component is clicked. | -| longpress | - | Triggered when the component is long pressed. | -| swipe5+ | [SwipeEvent](js-common-events.md) | Triggered when a user quickly swipes on the component. | +| Name | Parameter | Description | +| ------------------ | --------------------------------- | ----------- | +| click | - | Triggered when the component is clicked. | +| longpress | - | Triggered when the component is long pressed. | +| swipe5+ | [SwipeEvent](js-common-events.md) | Triggered when a user quickly swipes on the component.| ## Styles -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| width | <length> \| <percentage>5+ | - | No| Component width.
If this attribute is not set, the default value **0** is used. | -| height | <length> \| <percentage>5+ | - | No| Component height.
If this attribute is not set, the default value **0** is used. | -| padding | <length> | 0 | No| Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| -| padding-[left\|top\|right\|bottom] | <length> | 0 | No| Left, top, right, and bottom padding.| -| margin | <length> \| <percentage>5+ | 0 | No| Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| -| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No| Left, top, right, and bottom margins.| -| border-width | <length> | 0 | No| Shorthand attribute to set the margin for all sides.| -| border-color | <color> | black | No| Shorthand attribute to set the color for all borders.| -| border-radius | <length> | - | No| Radius of round-corner borders. | -| background-color | <color> | - | No| Background color.| -| display | string | flex | No| How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| -| [left\|top] | <length> \| <percentage>6+ | - | No| Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element. | +| Name | Type | Default Value | Mandatory | Description | +| ---------------------------------- | ---------------------------------------- | ----- | ---- | ---------------------------------------- | +| width | <length> \| <percentage>5+ | - | No | Component width.

If this attribute is not set, the default value **0** is used. | +| height | <length> \| <percentage>5+ | - | No | Component height.

If this attribute is not set, the default value **0** is used. | +| padding | <length> | 0 | No | Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| +| padding-[left\|top\|right\|bottom] | <length> | 0 | No | Left, top, right, and bottom padding. | +| margin | <length> \| <percentage>5+ | 0 | No | Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| +| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No | Left, top, right, and bottom margins. | +| border-width | <length> | 0 | No | Shorthand attribute to set the margin for all sides. | +| border-color | <color> | black | No | Shorthand attribute to set the color for all borders. | +| border-radius | <length> | - | No | Radius of round-corner borders. | +| background-color | <color> | - | No | Background color. | +| display | string | flex | No | How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| +| [left\|top] | <length> \| <percentage>6+ | - | No | Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element.| ## Example 1. Line chart - + ```html
@@ -134,7 +134,7 @@ Not supported
``` - + ```css /* xxx.css */ .container { @@ -155,7 +155,7 @@ Not supported } ``` - + ```js // xxx.js export default { @@ -211,7 +211,7 @@ Not supported ![lite_line](figures/lite_line.PNG) 2. Bar chart - + ```html
@@ -219,7 +219,7 @@ Not supported
``` - + ```css /* xxx.css */ .container { @@ -236,7 +236,7 @@ Not supported } ``` - + ```js // xxx.js export default { diff --git a/en/application-dev/reference/arkui-js-lite/js-components-basic-image-animator.md b/en/application-dev/reference/arkui-js-lite/js-components-basic-image-animator.md index 97383611f9b1228304aa47ebe97a5d0610f18ee8..226eff9f6c284140b5c671d2135dbe212b609590 100644 --- a/en/application-dev/reference/arkui-js-lite/js-components-basic-image-animator.md +++ b/en/application-dev/reference/arkui-js-lite/js-components-basic-image-animator.md @@ -14,68 +14,68 @@ Not supported ## Attributes -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| images | Array<ImageFrame> | - | Yes| Image frame information. The frame information includes the image path, size, and location. The supported image formats include PNG, JPG, and BMP. For details about **ImageFrame**, see Table 1.
**NOTE**
Use data binding, for example, **images = {{images}}**, to specify the image. Declare the corresponding variable in the JavaScript: **images: [{src: "/common/heart-rate01.png"}, {src: "/common/heart-rate02.png"}]**. | -| iteration | number \| string | infinite | No| Number of times that the frame animation is played. **number** indicates a fixed number of playback operations, and **infinite** indicates an unlimited number of playback operations.| -| reverse | boolean | false | No| Playback sequence.
- **true**: Images are played from the last one to the first one.
- **false**: Images are played from the first one to the last one. | -| fixedsize | boolean | true | No| Whether the image size is the same as the component size.
- **true**: The image size is the same as the component size. In this case, the width, height, top, and left attributes of the image are invalid.
- **false**: The image size is different from the component size. In this case, the width, height, top, and left attributes of each image must be set separately. | -| duration | string | - | Yes| Single video playback duration, in seconds (s) or milliseconds (ms). The default unit is ms. If the value is **0**, no image is played. The value change takes effect only at the start of the next cycle. | -| fillmode5+ | string | forwards | No| Status of the frame animation after its playback is complete. Available values are as follows:
- **none**: restores to the initial status.
- **forwards**: retains the ending status defined for the last key frame.| -| id | string | - | No| Unique ID of the component.| -| style | string | - | No| Style declaration of the component.| -| class | string | - | No| Style class of the component, which is used to refer to a style table.| -| ref | string | - | No| Reference information of child elements, which is registered with the parent component on **$refs**.| +| Name | Type | Default Value | Mandatory | Description | +| --------------------- | -------------------------- | -------- | ---- | ---------------------------------------- | +| images | Array<ImageFrame> | - | Yes | Image frame information. The frame information includes the image path, size, and location. The supported image formats include PNG, JPG, and BMP. For details about **ImageFrame**, see Table 1.
**NOTE**
Use data binding, for example, **images = {{images}}**, to specify the image. Declare the corresponding variable in the JavaScript: **images: [{src: "/common/heart-rate01.png"}, {src: "/common/heart-rate02.png"}]**.| +| iteration | number \| string | infinite | No | Number of times that the frame animation is played. **number** indicates a fixed number of playback operations, and **infinite** indicates an unlimited number of playback operations.| +| reverse | boolean | false | No | Playback sequence.
- **true**: Images are played from the last one to the first one.
- **false**: Images are played from the first one to the last one.| +| fixedsize | boolean | true | No | Whether the image size is the same as the component size.
- **true**: The image size is the same as the component size. In this case, the width, height, top, and left attributes of the image are invalid.
- **false**: The image size is different from the component size. In this case, the width, height, top, and left attributes of each image must be set separately.| +| duration | string | - | Yes | Single video playback duration, in seconds (s) or milliseconds (ms). The default unit is ms. If the value is **0**, no image is played. The value change takes effect only at the start of the next cycle.| +| fillmode5+ | string | forwards | No | Status of the frame animation after its playback is complete. Available values are as follows:
- **none**: restores to the initial status.
- **forwards**: retains the ending status defined for the last key frame.| +| id | string | - | No | Unique ID of the component. | +| style | string | - | No | Style declaration of the component. | +| class | string | - | No | Style class of the component, which is used to refer to a style table. | +| ref | string | - | No | Reference information of child elements, which is registered with the parent component on **$refs**.| **Table 1** ImageFrame -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| src | <uri> | - | Yes| Image path.| -| width | <length> | 0 | No| Image width.| -| height | <length> | 0 | No| Image height.| -| top | <length> | 0 | No| Vertical coordinate of the image relative to the upper left corner of the component.| -| left | <length> | 0 | No| Horizontal coordinate of the image relative to the upper left corner of the component.| +| Name | Type | Default Value | Mandatory | Description | +| ------ | -------------- | ---- | ---- | ---------------- | +| src | <uri> | - | Yes | Image path. | +| width | <length> | 0 | No | Image width. | +| height | <length> | 0 | No | Image height. | +| top | <length> | 0 | No | Vertical coordinate of the image relative to the upper left corner of the component.| +| left | <length> | 0 | No | Horizontal coordinate of the image relative to the upper left corner of the component.| ## Events -| Name| Parameter| Description| -| -------- | -------- | -------- | -| stop | - | Triggered when the frame animation stops| -| click | - | Triggered when the component is clicked. | -| longpress | - | Triggered when the component is long pressed. | -| swipe5+ | [SwipeEvent](js-common-events.md) | Triggered when a user quickly swipes on the component. | +| Name | Parameter | Description | +| ------------------ | --------------------------------- | ----------- | +| stop | - | Triggered when the frame animation stops | +| click | - | Triggered when the component is clicked. | +| longpress | - | Triggered when the component is long pressed. | +| swipe5+ | [SwipeEvent](js-common-events.md) | Triggered when a user quickly swipes on the component.| ## Styles -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| width | <length> \| <percentage>5+ | - | No| Component width.

If this attribute is not set, the default value **0** is used.| -| height | <length> \| <percentage>5+ | - | No| Component height.

If this attribute is not set, the default value **0** is used.| -| padding | <length> | 0 | No| Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| -| padding-[left\|top\|right\|bottom] | <length> | 0 | No| Left, top, right, and bottom padding.| -| margin | <length> \| <percentage>5+ | 0 | No| Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| -| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No| Left, top, right, and bottom margins.| -| border-width | <length> | 0 | No| Shorthand attribute to set the margin for all sides.| -| border-color | <color> | black | No| Shorthand attribute to set the color for all borders.| -| border-radius | <length> | - | No| Radius of round-corner borders.| -| background-color | <color> | - | No| Background color.| -| opacity5+ | number | 1 | No| Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent.| -| display | string | flex | No| How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| -| [left\|top] | <length> \| <percentage>6+ | - | No| left\|Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element.| +| Name | Type | Default Value | Mandatory | Description | +| ---------------------------------- | ---------------------------------------- | ----- | ---- | ---------------------------------------- | +| width | <length> \| <percentage>5+ | - | No | Component width.

If this attribute is not set, the default value **0** is used. | +| height | <length> \| <percentage>5+ | - | No | Component height.

If this attribute is not set, the default value **0** is used. | +| padding | <length> | 0 | No | Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| +| padding-[left\|top\|right\|bottom] | <length> | 0 | No | Left, top, right, and bottom padding. | +| margin | <length> \| <percentage>5+ | 0 | No | Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| +| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No | Left, top, right, and bottom margins. | +| border-width | <length> | 0 | No | Shorthand attribute to set the margin for all sides. | +| border-color | <color> | black | No | Shorthand attribute to set the color for all borders. | +| border-radius | <length> | - | No | Radius of round-corner borders. | +| background-color | <color> | - | No | Background color. | +| opacity5+ | number | 1 | No | Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent. | +| display | string | flex | No | How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| +| [left\|top] | <length> \| <percentage>6+ | - | No | left\|Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element.| ## Methods -| Name| Parameter| Description| -| -------- | -------- | -------- | -| start | - | Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame.| -| pause | - | Pauses the frame animation playback of an image.| -| stop | - | Stops the frame animation playback of an image.| -| resume | - | Resumes the frame animation playback of an image.| -| getState | - | Obtains the playback state. Available values are as follows:
- playing
- paused
- stopped| +| Name | Parameter | Description | +| -------- | ---- | ---------------------------------------- | +| start | - | Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. | +| pause | - | Pauses the frame animation playback of an image. | +| stop | - | Stops the frame animation playback of an image. | +| resume | - | Resumes the frame animation playback of an image. | +| getState | - | Obtains the playback state. Available values are as follows:
- playing
- paused
- stopped| ## Example diff --git a/en/application-dev/reference/arkui-js-lite/js-components-basic-slider.md b/en/application-dev/reference/arkui-js-lite/js-components-basic-slider.md index 8e69b18afe816c1691743976bf7ab72c2b124a36..14a1804c4b47d769b5020fb820ac768a3f434316 100644 --- a/en/application-dev/reference/arkui-js-lite/js-components-basic-slider.md +++ b/en/application-dev/reference/arkui-js-lite/js-components-basic-slider.md @@ -14,52 +14,52 @@ Not supported ## Attributes -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| min | number | 0 | No| Minimum value of the slider.| -| max | number | 100 | No| Maximum value of the slider.| -| value | number | 0 | No| Initial value of the slider.| -| id | string | - | No| Unique ID of the component.| -| style | string | - | No| Style declaration of the component.| -| class | string | - | No| Style class of the component, which is used to refer to a style table.| -| ref | string | - | No| Reference information of child elements, which is registered with the parent component on **$refs**.| +| Name | Type | Default Value | Mandatory | Description | +| ----- | ------ | ---- | ---- | ---------------------------------------- | +| min | number | 0 | No | Minimum value of the slider. | +| max | number | 100 | No | Maximum value of the slider. | +| value | number | 0 | No | Initial value of the slider. | +| id | string | - | No | Unique ID of the component. | +| style | string | - | No | Style declaration of the component. | +| class | string | - | No | Style class of the component, which is used to refer to a style table. | +| ref | string | - | No | Reference information of child elements, which is registered with the parent component on **$refs**.| ## Events -| Name| Parameter| Description| -| -------- | -------- | -------- | -| change | ChangeEvent | Triggered when the value changes.| -| click | - | Triggered when the component is clicked. | -| longpress | - | Triggered when the component is long pressed. | -| swipe5+ | [SwipeEvent](js-common-events.md) | Triggered when a user quickly swipes on the component. | +| Name | Parameter | Description | +| ------------------ | --------------------------------- | -------------- | +| change | ChangeEvent | Triggered when the value changes.| +| click | - | Triggered when the component is clicked. | +| longpress | - | Triggered when the component is long pressed. | +| swipe5+ | [SwipeEvent](js-common-events.md) | Triggered when a user quickly swipes on the component. | - **Table 2** ChangeEvent + **Table 1** ChangeEvent -| Attribute| Type| Description| -| -------- | -------- | -------- | +| Attribute | Type | Description | +| ---------------------------------------- | ------ | ------------- | | progress(deprecated5+) | string | Current value of the slider.| -| value5+ | number | Current value of the slider.| +| value5+ | number | Current value of the slider.| ## Styles -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| color | <color> | \#000000 | No| Background color of the slider.| -| selected-color | <color> | \#ffffff | No| Selected color of the slider.| -| width | <length> \| <percentage>5+ | - | No| Component width.
If this attribute is not set, the default value **0** is used. | -| height | <length> \| <percentage>5+ | - | No| Component height.
If this attribute is not set, the default value **0** is used. | -| padding | <length> | 0 | No| Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| -| padding-[left\|top\|right\|bottom] | <length> | 0 | No| Left, top, right, and bottom padding.| -| margin | <length> \| <percentage>5+ | 0 | No| Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| -| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No| Left, top, right, and bottom margins.| -| border-width | <length> | 0 | No| Shorthand attribute to set the margin for all sides.| -| border-color | <color> | black | No| Shorthand attribute to set the color for all borders.| -| border-radius | <length> | - | No| Radius of round-corner borders.| -| background-color | <color> | - | No| Background color.| -| display | string | flex | No| How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| -| [left\|top] | <length> \| <percentage>6+ | - | No| Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element. | +| Name | Type | Default Value | Mandatory | Description | +| ---------------------------------- | ---------------------------------------- | -------- | ---- | ---------------------------------------- | +| color | <color> | \#000000 | No | Background color of the slider. | +| selected-color | <color> | \#ffffff | No | Selected color of the slider. | +| width | <length> \| <percentage>5+ | - | No | Component width.
If this attribute is not set, the default value **0** is used. | +| height | <length> \| <percentage>5+ | - | No | Component height.
If this attribute is not set, the default value **0** is used. | +| padding | <length> | 0 | No | Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| +| padding-[left\|top\|right\|bottom] | <length> | 0 | No | Left, top, right, and bottom padding. | +| margin | <length> \| <percentage>5+ | 0 | No | Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| +| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No | Left, top, right, and bottom margins. | +| border-width | <length> | 0 | No | Shorthand attribute to set the margin for all sides. | +| border-color | <color> | black | No | Shorthand attribute to set the color for all borders. | +| border-radius | <length> | - | No | Radius of round-corner borders. | +| background-color | <color> | - | No | Background color. | +| display | string | flex | No | How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| +| [left\|top] | <length> \| <percentage>6+ | - | No | Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element.| ## Example diff --git a/en/application-dev/reference/arkui-js-lite/js-components-common-animation.md b/en/application-dev/reference/arkui-js-lite/js-components-common-animation.md index 8533e8dd7830abc31d5bd362ed115b083161fb69..ef2c39dc69ef2779e3e70c8ca61ff713f726e3d9 100644 --- a/en/application-dev/reference/arkui-js-lite/js-components-common-animation.md +++ b/en/application-dev/reference/arkui-js-lite/js-components-common-animation.md @@ -4,44 +4,44 @@ Components support dynamic rotation, translation, and scaling effects. These effects can be set in the **style** attribute or **.css** files. -| Name| Type| Default Value| Description| -| -------- | -------- | -------- | -------- | -| transform | string | - | Translation, rotation, and scaling attributes. For details, see Table 1. | -| animation-name | string | - | @keyframes rule. For details, see Table 2. | -| animation-delay | <time> | 0 | Delay for playing the animation, in ms or s, for example, **1000 ms** or **1s**. The default unit is ms. | -| animation-duration | <time> | 0 | Animation duration, in ms or s, for example, **1000 ms** or **1s**. The default unit is ms.
**NOTE**
**animation-duration** must be specified. Otherwise, the duration is **0**, which means the animation will not be played. | -| animation-iteration-count | number \| infinite | 1 | Number of times that an animation is played. The animation is played once by default. You can set the value to **infinite** to play the animation infinitely.| -| animation-timing-function | string |
linear | Speed curve of an animation, which makes the animation more fluent.
- **linear**: The animation speed keeps unchanged.
- **ease-in**: The animation starts at a low speed. The cubic-bezier curve (0.42, 0.0, 1.0, 1.0) is used
- **ease-out**: The animation ends at a low speed. The cubic-bezier curve (0.0, 0.0, 0.58, 1.0) is used.
- **ease-in-out**: The animation starts and ends at a low speed. The cubic-bezier curve (0.42, 0.0, 0.58, 1.0) is used. | -| animation-fill-mode | string | none | Start and end styles of the animation.
- **none**: No style is applied to the target before or after the animation is executed.
- **forwards**: The target keeps the state at the end of the animation (defined in the last key frame) after the animation is executed.| +| Name | Type | Default Value | Description | +| ------------------------- | ---------------------------------- | ----------- | ---------------------------------------- | +| transform | string | - | Translation, rotation, and scaling attributes. For details, see Table 1. | +| animation-name | string | - | \@keyframes rule. For details, see Table 2. | +| animation-delay | <time> | 0 | Delay for playing the animation, in ms or s, for example, **1000 ms** or **1s**. \|The default unit is ms.| +| animation-duration | <time> | 0 | Animation duration, in ms or s, for example, **1000 ms** or **1s**. \|The default unit is ms.
**NOTE**
**animation-duration** must be specified. Otherwise, the duration is **0**, which means the animation will not be played.| +| animation-iteration-count | number \| infinite | 1 | Number of times that an animation is played. The animation is played once by default. You can set the value to **infinite** to play the animation infinitely. | +| animation-timing-function | string |
linear | Speed curve of an animation, which makes the animation more fluent.
Available values are as follows:
- **linear**: The animation speed keeps unchanged.
- **ease-in**: The animation starts at a low speed. The cubic-bezier curve (0.42, 0.0, 1.0, 1.0) is used
- **ease-out**: The animation ends at a low speed. The cubic-bezier curve (0.0, 0.0, 0.58, 1.0) is used.
- **ease-in-out**: The animation starts and ends at a low speed. The cubic-bezier curve (0.42, 0.0, 0.58, 1.0) is used.| +| animation-fill-mode | string | none | Start and end styles of the animation.
- **none**: No style is applied to the target before or after the animation is executed.
- **forwards**: The target keeps the state at the end of the animation (defined in the last key frame) after the animation is executed.| **Table 1** transform -| Name| Type| Description| -| -------- | -------- | -------- | -| translateX | <length> | Moves an element along the x-axis.| -| translateY | <length> | Moves an element along the y-axis.| -| rotate | <deg> \| <rad> | Rotates an element.| +| Name | Type | Description | +| ---------- | ------------------------------------ | ---------- | +| translateX | <length> | Moves an element along the x-axis.| +| translateY | <length> | Moves an element along the y-axis.| +| rotate | <deg> \| <rad> | Rotates an element. | > **NOTE** > > Only images of the original size can be rotated on lite wearables. - **Table 2** @keyframes + **Table 2** \@keyframes -| Name| Type| Default Value| Description| -| -------- | -------- | -------- | -------- | -| background-color | <color> | - | Background color applied to the component after the animation is played.| -| width | <length> | - | Width value applied to the component after the animation is played.| -| height | <length> | - | Height value applied to the component after the animation is played.| -| transform | string | - | Transformation type applied to a component. For details, see Table 1.| +| Name | Type | Default Value | Description | +| ---------------- | -------------- | ---- | ------------------ | +| background-color | <color> | - | Background color applied to the component after the animation is played. | +| width | <length> | - | Width value applied to the component after the animation is played. | +| height | <length> | - | Height value applied to the component after the animation is played. | +| transform | string | - | Transformation type applied to a component. For details, see Table 1.| If there is no default value for when an animation will start or end, use **from** and **to** to specify the start and end of the display. The following is an example: -``` +```css @keyframes Go { from { diff --git a/en/application-dev/reference/arkui-js-lite/js-components-common-mediaquery.md b/en/application-dev/reference/arkui-js-lite/js-components-common-mediaquery.md index c01a9c145991b2cf4eabc971d718cb8132c9ee97..43a11aa1f7a691186eb436a19383913f0471ffa5 100644 --- a/en/application-dev/reference/arkui-js-lite/js-components-common-mediaquery.md +++ b/en/application-dev/reference/arkui-js-lite/js-components-common-mediaquery.md @@ -45,8 +45,8 @@ You can use media logical operators to implement complex media query. The follow **Table 1** Media logical operators -| Type | Description | -| --------------- | ------------------------------------------------------------ | +| Type | Description | +| --------------- | ---------------------------------------- | | and | The **and** operator is used to combine multiple media features into one media query, in a logical AND operation. The query is valid only when all media features are true. It can also combine media types and media functions.
For example, **screen and (device-type: liteWearable) and (max-height: 454)** evaluates to **true** when the device type is wearable and the maximum height of the application is 454 pixel units.| | or9+ | The **or** operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true.
For example, **screen and (max-height: 454) or (round-screen: true)** evaluates to **true** when the maximum height of the application is 454 pixel units or the device screen is round.| @@ -55,18 +55,18 @@ You can use media logical operators to implement complex media query. The follow ## Media Features -| Type | Description | -| ---------------- | ------------------------------------------------------------ | -| height | Height of the display area on the application page. | -| min-height | Minimum height of the display area on the application page. | -| max-height | Maximum height of the display area on the application page. | -| width | Width of the display area on the application page. | -| min-width | Minimum width of the display area on the application page. | -| max-width | Maximum width of the display area on the application page. | +| Type | Description | +| ---------------- | ---------------------------------------- | +| height | Height of the display area on the application page. | +| min-height | Minimum height of the display area on the application page. | +| max-height | Maximum height of the display area on the application page. | +| width | Width of the display area on the application page. | +| min-width | Minimum width of the display area on the application page. | +| max-width | Maximum width of the display area on the application page. | | aspect-ratio | Ratio of the width to the height of the display area on the application page.
Example: **aspect-ratio: 1/2**| | min-aspect-ratio | Minimum ratio of the width to the height of the display area on the application page. | | max-aspect-ratio | Maximum ratio of the width to the height of the display area on the application page. | -| round-screen | Screen type. The value **true** means that the screen is round, and **false** means the opposite. | +| round-screen | Screen type. The value **true** means that the screen is round, and **false** means the opposite.| ## Sample Code for the Common Media Feature diff --git a/en/application-dev/reference/arkui-js-lite/js-components-container-stack.md b/en/application-dev/reference/arkui-js-lite/js-components-container-stack.md index 2ce76b90cf9ad62ad1b95c0e08af46ee79d7d096..c099a46be788de55f5832bc94614c569ba2b0bad 100644 --- a/en/application-dev/reference/arkui-js-lite/js-components-container-stack.md +++ b/en/application-dev/reference/arkui-js-lite/js-components-container-stack.md @@ -9,47 +9,47 @@ The **\** component provides a stack container where child components are ## Child Components -Supported +Supported. ## Attributes -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| id | string | - | No| Unique ID of the component.| -| style | string | - | No| Style declaration of the component.| -| class | string | - | No| Style class of the component, which is used to refer to a style table.| -| ref | string | - | No| Reference information of child elements, which is registered with the parent component on **$refs**.| +| Name | Type | Default Value | Mandatory | Description | +| ----- | ------ | ---- | ---- | ---------------------------------------- | +| id | string | - | No | Unique ID of the component. | +| style | string | - | No | Style declaration of the component. | +| class | string | - | No | Style class of the component, which is used to refer to a style table. | +| ref | string | - | No | Reference information of child elements, which is registered with the parent component on **$refs**.| ## Events -| Name| Parameter| Description| -| -------- | -------- | -------- | -| click | - | Triggered when the component is clicked.| -| longpress | - | Triggered when the component is long pressed.| +| Name | Parameter | Description | +| ------------------ | --------------------------------- | ----------- | +| click | - | Triggered when the component is clicked. | +| longpress | - | Triggered when the component is long pressed. | | swipe5+ | [SwipeEvent](js-common-events.md) | Triggered when a user quickly swipes on the component.| ## Styles -| Name| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| width | <length> \| <percentage>5+ | - | No| Component width.
If this attribute is not set, the default value **0** is used. | -| height | <length> \| <percentage>5+ | - | No| Component height.
If this attribute is not set, the default value **0** is used. | -| padding | <length> | 0 | No| Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| -| padding-[left\|top\|right\|bottom] | <length> | 0 | No| Left, top, right, and bottom padding.| -| margin | <length> \| <percentage>5+ | 0 | No| Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| -| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No| Left, top, right, and bottom margins.| -| border-width | <length> | 0 | No| Shorthand attribute to set the margin for all sides.| -| border-color | <color> | black | No| Shorthand attribute to set the color for all borders.| -| border-radius | <length> | - | No| Radius of round-corner borders.| -| background-color | <color> | - | No| Background color.| -| opacity5+ | number | 1 | No| Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent.| -| display | string | flex | No| How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| -| [left\|top] | <length> \| <percentage>6+ | - | No| Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element. | - -> **NOTE** +| Name | Type | Default Value | Mandatory | Description | +| ---------------------------------- | ---------------------------------------- | ----- | ---- | ---------------------------------------- | +| width | <length> \| <percentage>5+ | - | No | Component width.

If this attribute is not set, the default value **0** is used. | +| height | <length> \| <percentage>5+ | - | No | Component height.

If this attribute is not set, the default value **0** is used. | +| padding | <length> | 0 | No | Shorthand attribute to set the padding for all sides.
The attribute can have one to four values:
- If you set only one value, it specifies the padding for all the four sides.
- If you set two values, the first value specifies the top and bottom padding, and the second value specifies the left and right padding.
- If you set three values, the first value specifies the top padding, the second value specifies the left and right padding, and the third value specifies the bottom padding.
- If you set four values, they respectively specify the padding for top, right, bottom, and left sides (in clockwise order).| +| padding-[left\|top\|right\|bottom] | <length> | 0 | No | Left, top, right, and bottom padding. | +| margin | <length> \| <percentage>5+ | 0 | No | Shorthand attribute to set the margin for all sides. The attribute can have one to four values:
- If you set only one value, it specifies the margin for all the four sides.
- If you set two values, the first value specifies the top and bottom margins, and the second value specifies the left and right margins.
- If you set three values, the first value specifies the top margin, the second value specifies the left and right margins, and the third value specifies the bottom margin.
- If you set four values, they respectively specify the margin for top, right, bottom, and left sides (in clockwise order).| +| margin-[left\|top\|right\|bottom] | <length> \| <percentage>5+ | 0 | No | Left, top, right, and bottom margins. | +| border-width | <length> | 0 | No | Shorthand attribute to set the margin for all sides. | +| border-color | <color> | black | No | Shorthand attribute to set the color for all borders. | +| border-radius | <length> | - | No | Radius of round-corner borders. | +| background-color | <color> | - | No | Background color. | +| opacity5+ | number | 1 | No | Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent. | +| display | string | flex | No | How and whether to display the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered| +| [left\|top] | <length> \| <percentage>6+ | - | No | Edge of the element.
- **left**: left edge position of the element. This attribute defines the offset between the left edge of the margin area of a positioned element and left edge of its containing block.
- **top**: top edge position of the element. This attribute defines the offset between the top edge of a positioned element and that of a block included in the element.| + +> **NOTE** > > The absolute positioning does not support a percentage. Therefore, **margin** cannot be set for the child components of the **\** component. diff --git a/en/application-dev/reference/arkui-js-lite/js-framework-file.md b/en/application-dev/reference/arkui-js-lite/js-framework-file.md index ade304c4d50a1aacac56a140c1bf3a3669165580..e03caae24cb2ddfd8c20c7517baef2420160bedc 100644 --- a/en/application-dev/reference/arkui-js-lite/js-framework-file.md +++ b/en/application-dev/reference/arkui-js-lite/js-framework-file.md @@ -50,7 +50,7 @@ Application resources can be accessed via an absolute or relative path. In this > > - If code files A and B are in the same directory, you can use either a relative or absolute path in code file B to reference resource files. > -> - If code files A and B are in different directories, you must use an absolute path in code file B to reference resource files. The reason is that the directory of code file B changes during Webpack packaging. +> - If code files A and B are in different directories, you must use an absolute path in code file B to reference resource files, because the directory of code file B changes during Webpack packaging. > diff --git a/en/application-dev/reference/arkui-js-lite/js-framework-js-tag.md b/en/application-dev/reference/arkui-js-lite/js-framework-js-tag.md index 37d08081341fb43d1228d2cd9b211b14cf39f35a..868e668195e277d512bd98c99b0404261b198eab 100644 --- a/en/application-dev/reference/arkui-js-lite/js-framework-js-tag.md +++ b/en/application-dev/reference/arkui-js-lite/js-framework-js-tag.md @@ -4,10 +4,10 @@ The "js" tag contains the instance name and page route information. -| Tag| Type| Default Value| Mandatory| Description| -| -------- | -------- | -------- | -------- | -------- | -| name | string | default | Yes| Name of the JavaScript instance.| -| pages | Array | - | Yes| Route information. For details, see ["pages"](#pages).| +| Tag | Type | Default Value | Mandatory | Description | +| ----- | ------ | ------- | ---- | ----------------------------- | +| name | string | default | Yes | Name of the JavaScript instance. | +| pages | Array | - | Yes | Route information. For details, see ["pages"](#pages).| > **NOTE** @@ -34,10 +34,10 @@ The **"pages"** defines the route information of each page. Each page consists o > **NOTE** > -> -> - The application home page is fixed to **pages/index/index**. -> -> - The page name should not be a component name, for example, **text.hml** or **button.hml**. +> +> - The application home page is fixed to **pages/index/index**. +> +> - The page name should not be a component name, for example, **text.hml** or **button.hml**. ## Example @@ -46,7 +46,7 @@ The **"pages"** defines the route information of each page. Each page consists o ``` { "app": { - "bundleName": "com.huawei.player", + "bundleName": "com.example.player", "version": { "code": 1, "name": "1.0" diff --git a/en/application-dev/reference/arkui-js-lite/js-framework-syntax-css.md b/en/application-dev/reference/arkui-js-lite/js-framework-syntax-css.md index 79b1d9938cac9f7f804a85407a74d6bd08931628..7e3bf96dde9606c86a70d75f1c89fe62a47d155d 100644 --- a/en/application-dev/reference/arkui-js-lite/js-framework-syntax-css.md +++ b/en/application-dev/reference/arkui-js-lite/js-framework-syntax-css.md @@ -14,16 +14,16 @@ CSS files can be imported using the **\@import** statement. This facilitates mod The **.css** file with the same name as the **.hml** file in each page directory describes the styles of components on the HML page, determining how the components will be displayed. 1. Internal style: The **style** and **class** attributes can be used to specify the component style. Sample code: - - ``` + + ```html
Hello World
``` - - ``` + + ```css /* index.css */ .container { justify-content: center; @@ -31,16 +31,16 @@ The **.css** file with the same name as the **.hml** file in each page directory ``` 2. External style files: You need to import the files. For example, create a **style.css** file in the **common** directory and import the file at the beginning of **index.css**. - - ``` + + ```css /* style.css */ .title { font-size: 50px; } ``` - - ``` + + ```css /* index.css */ @import '../../common/style.css'; .container { @@ -53,16 +53,16 @@ The **.css** file with the same name as the **.hml** file in each page directory A CSS selector is used to select elements for which styles need to be added to. The following table lists the supported selectors. -| Selector| Example| Description| -| -------- | -------- | -------- | -| .class | .container | Selects all components whose **class** is **container**.| -| \#id | \#titleId | Selects all components whose **id** is **titleId**.| -| , | .title, .content | Selects all components whose **class** is **title** or **content**.| +| Selector | Example | Description | +| ------ | --------------------- | ------------------------------------- | +| .class | .container | Selects all components whose **class** is **container**. | +| \#id | \#titleId | Selects all components whose **id** is **titleId**. | +| , | .title, .content | Selects all components whose **class** is **title** or **content**.| Example: -``` +```html
Title @@ -73,7 +73,7 @@ Example: ``` -``` +```css /* Page style xxx.css */ /* Set the style for the components whose class is title. */ .title { @@ -95,15 +95,17 @@ Example: A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected elements. -| Name| Available Components| Description| -| -------- | -------- | -------- | -| :active |
input[type="button"] | Selects the element activated by a user, for example, a pressed button. Only the **background-color** and **background-image** attributes can be set for the pseudo-class selector on lite wearables.| + + +| Name | Available Components | Description | +| -------- | ----------------------------------- | ---------------------------------------- | +| :active |
input[type="button"] | Selects the element activated by a user, for example, a pressed button. Only the **background-color** and **background-image** attributes can be set for the pseudo-class selector on lite wearables.| | :checked | input[type="checkbox", type="radio"]| Selects the element whose **checked** attribute is **true**. Only the **background-color** and **background-image** attributes can be set for the pseudo-class selector on lite wearables.| The following is an example for you to use the **:active** pseudo-class to control the style when a user presses the button. -``` +```html
@@ -111,7 +113,7 @@ The following is an example for you to use the **:active** pseudo-class to contr ``` -``` +```css /* index.css */ .button:active { background-color: #888888;/* After the button is activated, the background color is changed to #888888. */ @@ -124,8 +126,8 @@ The following is an example for you to use the **:active** pseudo-class to contr Precompilation is a program that uses specific syntax to generate CSS files. It provides variables and calculation, helping you define component styles more conveniently. Currently, Less, Sass, and Scss are supported. To use precompiled styles, change the suffix of the original **.css** file. For example, change **index.css** to **index.less**, **index.sass**, or **index.scss**. - The following **index.less** file is changed from **index.css**. - - ``` + + ```css /* index.less */ /* Define a variable. */ @colorBackground: #000000; @@ -135,8 +137,8 @@ Precompilation is a program that uses specific syntax to generate CSS files. It ``` - Reference a precompiled style file. For example, if the **style.scss** file is located in the **common** directory, change the original **index.css** file to **index.scss** and import **style.scss**. - - ``` + + ```css /* style.scss */ /* Define a variable. */ $colorBackground: #000000; @@ -144,8 +146,8 @@ Precompilation is a program that uses specific syntax to generate CSS files. It Reference the precompiled style file in **index.scss**: - - ``` + + ```css /* index.scss */ /* Import style.scss. */ @import '../../common/style.scss'; @@ -154,7 +156,7 @@ Precompilation is a program that uses specific syntax to generate CSS files. It } ``` - + > **NOTE** > > Place precompiled style files in the **common** directory. diff --git a/en/application-dev/reference/arkui-js-lite/js-framework-syntax-hml.md b/en/application-dev/reference/arkui-js-lite/js-framework-syntax-hml.md index b9f5bec1e13aaf9bc2112fdee9e43cdcc322641d..b111895cb5421d3b5d4310c56f85929c216615ec 100644 --- a/en/application-dev/reference/arkui-js-lite/js-framework-syntax-hml.md +++ b/en/application-dev/reference/arkui-js-lite/js-framework-syntax-hml.md @@ -7,7 +7,7 @@ The OpenHarmony Markup Language (HML) is an HTML-like language that allows you t ## HML Page Structure -``` +```html
Image Show @@ -21,7 +21,7 @@ The OpenHarmony Markup Language (HML) is an HTML-like language that allows you t ## Data Binding -``` +```html
{{content[1]}} @@ -29,7 +29,7 @@ The OpenHarmony Markup Language (HML) is an HTML-like language that allows you t ``` -``` +```js // xxx.js export default { data: { @@ -42,9 +42,9 @@ export default { ``` > **NOTE** -> - To make the array data modification take effect, use the **splice** method to change array items. -> -> - ECMAScript 6.0 syntax is not supported in HML. +> - To make the array data modification take effect, use the **splice** method to change array items. +> +> - ECMAScript 6.0 syntax is not supported in HML. ## Event Binding @@ -52,7 +52,7 @@ export default { The callback bound to an event receives an event object parameter, which can be used to obtain the event information. -``` +```html
@@ -73,7 +73,7 @@ The callback bound to an event receives an event object parameter, which can be ``` -``` +```js // xxx.js export default { data: { @@ -88,11 +88,11 @@ export default { > **NOTE** > -> Event bubbling is supported since API version 5. After you upgrade the SDK and run an existing JavaScript application, events bound using a traditional statement (such as **onclick**) will not bubble. However, if you use the new SDK to repack the JavaScript application, such events will bubble. To avoid service logic errors, replace the traditional statement with one supported by the new SDK. For example, replace **onclick** with **grab:click**. +> Event bubbling is supported since API version 5. After you upgrade the SDK and run an existing JavaScript application, events bound using a traditional statement (such as **onclick**) will not bubble. However, if you use the new SDK to repack the JavaScript application, such events will bubble. To avoid service logic errors, replace the traditional statement with one supported by the new SDK. For example, replace **onclick** with **grab:click**. **Example:** -``` +```html
{{count}} @@ -108,8 +108,8 @@ export default { ``` -``` -/* xxx.js */ +```js +// xxx.js export default { data: { count: 0 @@ -127,7 +127,7 @@ export default { ``` -``` +```css /* xxx.css */ .container { display: flex; @@ -164,7 +164,7 @@ export default { ## Loop Rendering -``` +```html
@@ -184,7 +184,7 @@ export default { ``` -``` +```js // xxx.js export default { data: { @@ -211,11 +211,12 @@ The **tid** attribute accelerates the **for** loop and improves the re-rendering - for="(i, v) in array": **i** indicates the element index, and **v** indicates the element variable. All elements of the array object will be looped through. -> **NOTE** +> **NOTE** +> > - Each element in the array must have the data attribute specified by **tid**. Otherwise, an exception may occur. -> +> > - The attribute specified by **tid** in the array must be unique. Otherwise, performance loss occurs. In the above example, only **id** and **name** can be used as **tid** because they are unique fields. -> +> > - The **tid** field does not support expressions. @@ -224,7 +225,7 @@ The **tid** attribute accelerates the **for** loop and improves the re-rendering There are two ways to implement conditional rendering: **if-elif-else** or **show**. In **if-elif-else**, when the **if** statement evaluates to **false**, the component is not built in the VDOM and is not rendered. For **show**, when show is **false**, the component is not rendered but is built in the VDOM. In addition, the **if-elif-else** statements must be used in sibling nodes. Otherwise, the compilation fails. The following example uses both ways to implement conditional rendering: -``` +```html
@@ -236,8 +237,8 @@ There are two ways to implement conditional rendering: **if-elif-else** or **sho ``` -``` -// xxx.css +```css +/* xxx.css */ .container{ flex-direction: column; align-items: center; @@ -250,7 +251,7 @@ There are two ways to implement conditional rendering: **if-elif-else** or **sho ``` -``` +```js // xxx.js export default { data: { @@ -269,7 +270,7 @@ export default { In the optimized rendering (**show**), if **show** is **true**, the node is rendered properly; if it is **false**, the display style will be **none**. -``` +```html
@@ -278,8 +279,8 @@ In the optimized rendering (**show**), if **show** is **true**, the node is rend ``` -``` -// xxx.css +```css +/* xxx.css */ .container{ flex-direction: column; align-items: center; @@ -292,7 +293,7 @@ In the optimized rendering (**show**), if **show** is **true**, the node is rend ``` -``` +```js // xxx.js export default { data: { @@ -305,4 +306,5 @@ export default { ``` > **NOTE** -> Do not use **for** and **if** attributes at the same time in an element. +> +> Do not use **for** and **if** attributes at the same time in an element. diff --git a/en/application-dev/reference/arkui-js-lite/js-framework-syntax-js.md b/en/application-dev/reference/arkui-js-lite/js-framework-syntax-js.md index 3ce76d4463643c979cf619749b2a8a5c80dae1c1..e9d71fc2ff680dfba5b95e7bae676854a1e68a28 100644 --- a/en/application-dev/reference/arkui-js-lite/js-framework-syntax-js.md +++ b/en/application-dev/reference/arkui-js-lite/js-framework-syntax-js.md @@ -31,7 +31,7 @@ The ECMAScript 6.0 syntax is supported. Lite wearables only support the followin - Module declaration Import functionality modules. - + ``` import router from '@system.router'; ``` @@ -39,7 +39,7 @@ The ECMAScript 6.0 syntax is supported. Lite wearables only support the followin - Code reference Import JavaScript code. - + ``` import utils from '../../common/utils.js'; ``` @@ -48,17 +48,17 @@ The ECMAScript 6.0 syntax is supported. Lite wearables only support the followin ## Objects - Page objects - | Attribute| Type| Description| - | -------- | -------- | -------- | - | data | Object/Function | Data model of the page. If the attribute is of the function type, the return value must be of the object type. The name cannot start with a dollar sign ($) or underscore (_). Do not use reserved words (**for**, **if**, **show**, and **tid**). | - | $refs | Object | DOM elements or child component instances that have registered the **ref** attribute. For an example, see [Obtaining a DOM Element](#obtaining-a-dom-element).| + | Attribute | Type | Description | + | ----- | --------------- | ---------------------------------------- | + | data | Object/Function | Data model of the page. If the attribute is of the function type, the return value must be of the object type. The name cannot start with a dollar sign ($) or underscore (_). Do not use reserved words (**for**, **if**, **show**, and **tid**).
| + | $refs | Object | DOM elements or child component instances that have registered the **ref** attribute. For an example, see [Obtaining a DOM Element](#obtaining-a-dom-element). | ## Obtaining a DOM Element Use **$refs** to obtain a DOM element. -``` +```html
@@ -66,57 +66,57 @@ Use **$refs** to obtain a DOM element. ``` -``` -// index.js -export default { - data: { - images: [ - { src: '/common/frame1.png' }, - { src: '/common/frame2.png' }, - { src: '/common/frame3.png' }, - ], - }, - handleClick() { - const animator = this.$refs.animator; // Obtain the DOM element whose $refs attribute is animator. - const state = animator.getState(); - if (state === 'paused') { - animator.resume(); - } else if (state === 'stopped') { - animator.start(); - } else { - animator.pause(); - } - }, -}; -``` + ```js + // index.js + export default { + data: { + images: [ + { src: '/common/frame1.png' }, + { src: '/common/frame2.png' }, + { src: '/common/frame3.png' }, + ], + }, + handleClick() { + const animator = this.$refs.animator; // Obtain the DOM element whose $refs attribute is animator. + const state = animator.getState(); + if (state === 'paused') { + animator.resume(); + } else if (state === 'stopped') { + animator.start(); + } else { + animator.pause(); + } + }, + }; + ``` ## Lifecycle APIs - Page lifecycle APIs - | Name | Type| Parameter| Return Value| Description| Triggered When| - | -------- | -------- | -------- | -------- | -------- | -------- | - | onInit | Function | N/A| N/A| Listens for page initialization.| Page initialization is complete. This API is called only once in the page lifecycle.| - | onReady | Function | N/A| N/A| Listens for page creation.| A page is created. This API is called only once in the page lifecycle.| - | onShow | Function | N/A| N/A| Listens for page display. | The page is displayed.| - | onHide | Function | N/A| N/A| Listens for page disappearance.| The page disappears.| - | onDestroy | Function | N/A| N/A| Listens for page destruction.| The page is destroyed.| - + | Name | Type | Parameter | Return Value | Description | Triggered When | + | --------- | -------- | ---- | ---- | ------ | ------------------- | + | onInit | Function | N/A | N/A | Listens for page initialization. | Page initialization is complete. This API is called only once in the page lifecycle.| + | onReady | Function | N/A | N/A | Listens for page creation.| A page is created. This API is called only once in the page lifecycle. | + | onShow | Function | N/A | N/A | Listens for page display. | The page is displayed. | + | onHide | Function | N/A | N/A | Listens for page disappearance. | The page disappears. | + | onDestroy | Function | N/A | N/A | Listens for page destruction. | The page is destroyed. | + The lifecycle APIs of page A are called in the following sequence: - Open page A: onInit() -> onReady() -> onShow() - + - Open page B on page A: onHide() -> onDestroy() - + - Go back to page A from page B: onInit() -> onReady() -> onShow() - + - Exit page A: onHide() -> onDestroy() - + - Hide page A: onHide() - + - Show background page A on the foreground: onShow() - Application lifecycle APIs - | Name | Type| Parameter| Return Value| Description| Triggered When| - | -------- | -------- | -------- | -------- | -------- | -------- | - | onCreate | Function | N/A| N/A| Listens for application creation.| The application is created.| - | onDestroy | Function | N/A| N/A| Listens for application exit.| The application exits.| + | Name | Type | Parameter | Return Value | Description | Triggered When | + | --------- | -------- | ---- | ---- | ---- | --------- | + | onCreate | Function | N/A | N/A | Listens for application creation.| The application is created.| + | onDestroy | Function | N/A | N/A | Listens for application exit.| The application exits.| diff --git a/en/application-dev/reference/arkui-js/figures/tab.gif b/en/application-dev/reference/arkui-js/figures/tab.gif index fea6fcac566df71d32643b81579a59bbe4e1b580..525ea0d263d29509fdcefb7165bc3029d31aacf6 100644 Binary files a/en/application-dev/reference/arkui-js/figures/tab.gif and b/en/application-dev/reference/arkui-js/figures/tab.gif differ diff --git a/en/application-dev/reference/arkui-ts/figures/LinearGradientDataPanel.PNG b/en/application-dev/reference/arkui-ts/figures/LinearGradientDataPanel.PNG new file mode 100644 index 0000000000000000000000000000000000000000..5dbe4fdeef5f231fd2145da2bbaa82b433458d6c Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/LinearGradientDataPanel.PNG differ diff --git a/en/application-dev/reference/arkui-ts/figures/dataPanel.PNG b/en/application-dev/reference/arkui-ts/figures/dataPanel.PNG index b360ca62d5d961ff107b2a703621123b3b48aa46..559a2370feae57233fb39cad218a8ca77241fed9 100644 Binary files a/en/application-dev/reference/arkui-ts/figures/dataPanel.PNG and b/en/application-dev/reference/arkui-ts/figures/dataPanel.PNG differ diff --git a/en/application-dev/reference/arkui-ts/ts-appendix-enums.md b/en/application-dev/reference/arkui-ts/ts-appendix-enums.md index 020c9d6eb2f6828712a97cfe64deb347d43cc8bf..bf4d48665a378934f14c413db9408fa09fb5705f 100644 --- a/en/application-dev/reference/arkui-ts/ts-appendix-enums.md +++ b/en/application-dev/reference/arkui-ts/ts-appendix-enums.md @@ -293,12 +293,12 @@ Since API version 9, this API is supported in ArkTS widgets. | Name | Description | | -------- | ------------------------------------------------------------ | -| Auto | The default configuration of the container (**\** or **\**) is used. | -| Start | The items in the container (**\** or **\**) are aligned with the cross-start edge. | -| Center | The items in the container (**\** or **\**) are centered along the cross axis. | -| End | The items in the container (**\** or **\**) are aligned with the cross-end edge. | -| Stretch | The items in the container (**\** or **\**) are stretched and padded along the cross axis. If the flex container has the **Wrap** attribute set to **FlexWrap.Wrap** or **FlexWrap.WrapReverse**, the items are stretched to the cross size of the widest element on the current row or column. In other cases, the items with no size set are stretched to the container size.| -| Baseline | The items in the container (**\** or **\**) are aligned in such a manner that their text baselines are aligned along the cross axis. | +| Auto | The default configuration of the flex container is used. | +| Start | The items in the flex container are aligned with the cross-start edge. | +| Center | The items in the flex container are centered along the cross axis. | +| End | The items in the flex container are aligned with the cross-end edge. | +| Stretch | The items in the flex container are stretched and padded along the cross axis. If the flex container has the **Wrap** attribute set to **FlexWrap.Wrap** or **FlexWrap.WrapReverse**, the items are stretched to the cross size of the widest element on the current row or column. In other cases, the items with no size set are stretched to the container size.| +| Baseline | The items in the flex container are aligned in such a manner that their text baselines are aligned along the cross axis. | ## FlexDirection @@ -414,7 +414,7 @@ Since API version 9, this API is supported in ArkTS widgets. | Name | Description | | --------------------- | -------------------------------------- | -| None | No clipping or ellipsis is used for text overflow. | +| None | Extra-long text is clipped. | | Clip | Extra-long text is clipped. | | Ellipsis | An ellipsis (...) is used to represent text overflow.| | Marquee10+ | Text continuously scrolls when text overflow occurs. | @@ -528,3 +528,11 @@ This API is supported in ArkTS widgets. | MAX_LINES_FIRST | Prioritize the **maxLines** settings. | | MIN_FONT_SIZE_FIRST | Prioritize the **minFontSize** settings. | | LAYOUT_CONSTRAINT_FIRST | Prioritize the layout constraint settings in terms of height.| + +## TransitionEdge10+ +| Name| Description| +| -------- | -------- | +| TOP | Top edge of the window.| +| BOTTOM | Bottom edge of the window.| +| START | Left edge of the window.| +| END | Right edge of the window.| diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md b/en/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md index b2ab19b168a0415f8ddd82cee4a41faa3282848d..2ad1d1ce835fe6c0fcffa7379860711cb49d396d 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-checkbox.md @@ -30,7 +30,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | Name | Type| Description| | ------------- | ------- | -------- | -| select | boolean | Whether the check box is selected.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.| +| select | boolean | Whether the check box is selected.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.
Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | selectedColor | [ResourceColor](ts-types.md#resourcecolor) | Color of the check box when it is selected.
Since API version 9, this API is supported in ArkTS widgets.| | unselectedColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Border color of the check box when it is not selected.| | mark10+ | [MarkStyle](#markstyle10) | Internal icon style of the check box.| @@ -39,9 +39,9 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the In addition to the [universal events](ts-universal-events-click.md), the following attributes are supported. -| Name | Description | +| Name | Description | | -------------------------------------------- | ------------------------------------------------------------ | -| onChange(callback: (value: boolean) => void) | Triggered when the selected status of the check box changes due to a manual operation.
- The value **true** means that the check box is selected.
- The value **false** means that the check box is not selected.
Since API version 9, this API is supported in ArkTS widgets.| +| onChange(callback: (value: boolean) => void) | Triggered when the selected status of the check box changes.
- The value **true** means that the check box is selected.
- The value **false** means that the check box is not selected.
Since API version 9, this API is supported in ArkTS widgets. | ## MarkStyle10+ diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md b/en/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md index d6beb514c6590f6b4f977b37052d78f180ff8f51..37da4ad0bdf5b41ae99f617a6d06789fb075c922 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-checkboxgroup.md @@ -30,7 +30,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | Name| Type| Description| | -------- | -------- | -------- | -| selectAll | boolean | Whether to select all.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**
If the **select** attribute is set for a [\](ts-basic-components-checkbox.md) component in the same group, the setting of the **\** has a higher priority.| +| selectAll | boolean | Whether to select all.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**
If the **select** attribute is set for a [\](ts-basic-components-checkbox.md) component in the same group, the setting of the **\** has a higher priority.
Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | selectedColor | [ResourceColor](ts-types.md#resourcecolor) | Color of the selected check box.
Since API version 9, this API is supported in ArkTS widgets.| | unselectedColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Border color of the check box when it is not selected.| | mark10+ | [MarkStyle](#markstyle10) | Internal icon style of the check box.| @@ -41,7 +41,7 @@ In addition to the [universal events](ts-universal-events-click.md), the followi | Name| Description| | -------- | -------- | -| onChange (callback: (event: [CheckboxGroupResult](#checkboxgroupresult)) => void ) |Triggered when the selected status of the check box group or any check box wherein changes due to a manual operation.
Since API version 9, this API is supported in ArkTS widgets.| +| onChange (callback: (event: [CheckboxGroupResult](#checkboxgroupresult)) => void ) |Triggered when the selected status of the check box group or any check box wherein changes.
Since API version 9, this API is supported in ArkTS widgets.| ## CheckboxGroupResult diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md b/en/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md index 41db34a3c7167bc08af84c54586af4981a265efc..3a56d0d8d44bc724a4290556f25d3366e5e7c339 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md @@ -24,7 +24,7 @@ Since API version 9, this API is supported in ArkTS widgets. | Name | Type | Mandatory | Description| | ----------------- | -------- | ----- | -------- | -| values | number[] | Yes | Data value list. A maximum of nine values are supported. If more than nine values are set, only the first nine ones are used. A value less than 0 evaluates to the value **0**. | +| values | number[] | Yes | Data value list. A maximum of nine values are supported. If more than nine values are set, only the first nine ones are used. A value less than 0 evaluates to the value **0**.| | max | number | No | - When set to a value greater than 0, this parameter indicates the maximum value in the **values** list.
- When set to a value equal to or smaller than 0, this parameter indicates the sum of values in the **values** list. The values are displayed in proportion.
Default value: **100**| | type8+ | [DataPanelType](#datapaneltype) | No| Type of the data panel (dynamic modification is not supported).
Default value: **DataPanelType.Circle**| @@ -46,20 +46,20 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | Name | Type| Mandatory| Description| | ------------- | ------- | ---- | -------- | -| closeEffect | boolean | Yes| Whether to disable the rotation effect for the component.
Default value: **false**.| +| closeEffect | boolean | Yes| Whether to disable the rotation and shadow effects for the component.
Default value: **false**
**NOTE**
This attribute enables or disables the shadow effect only when **trackShadow** is not set.
The shadow effect enabled through this attribute is in the default style.| | valueColors10+ | Array<[ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient](#lineargradient10)> | Yes| Array of data segment colors. A value of the **ResourceColor** type indicates a solid color, and A value of the **LinearGradient** type indicates a color gradient.| -| trackBackgroundColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Yes| Background color.| -| strokeWidth10+ | [Length](ts-types.md#Length) | Yes| Stroke width of the border.| -| trackShadow10+ | [DataPanelShadowOption](#datapanelshadowoption10) | Yes| Shadow style. If this attribute is not set, the shadow effect is disabled.| +| trackBackgroundColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Yes| Background color.
Default value: **'#081824'**| +| strokeWidth10+ | [Length](ts-types.md#Length) | Yes| Stroke width of the border.
Default value: **24**
Unit: vp
**NOTE**
A value less than 0 evaluates to the default value.
This attribute does not take effect when the data panel type is **DataPanelType.Line**.| +| trackShadow10+ | [DataPanelShadowOption](#datapanelshadowoption10) | Yes| Shadow style.
**NOTE**
If this attribute is set to **null**, the shadow effect is disabled.| ## DataPanelShadowOption10+ | Name | Type| Mandatory| Description| | ------------- | ------- | ---- | -------- | -| radius | number \| [Resource](ts-types.md#resource)| No| Shadow blur radius.
Default value: **5vp**| -| colors | Array<[ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient](#lineargradient10)> | No| Array of shadow colors for data segments.
Default value: same as the value of **valueColors**.| -| offsetX | number \| [Resource](ts-types.md#resource)| No| Offset on the x-axis.
Default value: **5vp**| -| offsetY | number \| [Resource](ts-types.md#resource)| No| Offset on the y-axis.
Default value: **5vp**| +| radius | number \| [Resource](ts-types.md#resource)| No| Shadow blur radius.
Default value: **5**
Unit: vp
**NOTE**
A value less than or equal to 0 evaluates to the default value.| +| colors | Array<[ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient](#lineargradient10)> | No| Array of shadow colors for data segments.
Default value: same as the value of **valueColors**
**NOTE**
If the number of the set shadow colors is less than that of the data segments, the number of the displayed shadow colors is the same as the former.
If the number of the set shadow colors is greater than that of the data segments, the number of the displayed shadow colors is the same as the latter.| +| offsetX | number \| [Resource](ts-types.md#resource)| No| Offset on the x-axis.
Default value: **5**
Unit: vp| +| offsetY | number \| [Resource](ts-types.md#resource)| No| Offset on the y-axis.
Default value: **5**
Unit: vp| ## LinearGradient10+ @@ -79,12 +79,14 @@ Describes the gradient color stop. | Name | Type| Mandatory| Description| | ------------- | ------- | ---- | -------- | | color | [ResourceColor](ts-types.md#resourcecolor) | Yes| Color value.| -| offset | [Length](ts-types.md#Length) | Yes| Gradient color stop (proportion value between 0 and 1).| +| offset | [Length](ts-types.md#Length) | Yes| Gradient color stop (proportion value between 0 and 1). A value less than 0 evaluates to the value **0**. A value greater than 1 evaluates to the value **1**.| ## Example +### Example 1 + ```ts // xxx.ets @Entry @@ -133,3 +135,48 @@ struct DataPanelExample { ``` ![dataPanel](figures/dataPanel.PNG) + +### Example 2 + +```ts +// xxx.ets +@Entry +@Component +struct LinearGradientDataPanelExample { + public values1: number[] = [20, 20, 20, 20] + public color1: LinearGradient = new LinearGradient([{ color: "#65EEC9A3", offset: 0 }, { color: "#FFEF629F", offset: 1 }]) + public color2: LinearGradient = new LinearGradient([{ color: "#FF67F9D4", offset: 0 }, { color: "#FFFF9554", offset: 1 }]) + public colorShadow1: LinearGradient = new LinearGradient([{ color: "#65EEC9A3", offset: 0 }, { color: "#65EF629F", offset: 1 }]) + public colorShadow2: LinearGradient = new LinearGradient([{ color: "#65e26709", offset: 0 }, { color: "#65efbd08", offset: 1 }]) + public colorShadow3: LinearGradient = new LinearGradient([{ color: "#6572B513", offset: 0 }, { color: "#6508efa6", offset: 1 }]) + public colorShadow4: LinearGradient = new LinearGradient([{ color: "#65ed08f5", offset: 0 }, { color: "#65ef0849", offset: 1 }]) + @State color3: string = '#00FF00' + @State color4: string = '#20FF0000' + @State bgColor: string = '#08182431' + @State offsetX: number = 15 + @State offsetY: number = 15 + @State radius: number = 5 + @State colorArray: Array = [this.color1, this.color2, this.color3, this.color4] + @State shadowColorArray: Array = [this.colorShadow1, this.colorShadow2, this.colorShadow3, this.colorShadow4] + + build() { + Column({ space: 5 }) { + Text('LinearGradient').fontSize(9).fontColor(0xCCCCCC).textAlign(TextAlign.Start).width('100%').margin({ top: 20, left: 20}) + DataPanel({ values: this.values1, max: 100, type: DataPanelType.Circle }) + .width(300) + .height(300) + .valueColors(this.colorArray) + .trackShadow({ + radius: this.radius, + colors: this.shadowColorArray, + offsetX: this.offsetX, + offsetY: this.offsetY + }) + .strokeWidth(30) + .trackBackgroundColor(this.bgColor) + }.width('100%').margin({ top: 5 }) + } +} +``` + +![LinearGradientDataPanel](figures/LinearGradientDataPanel.PNG) diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-datepicker.md b/en/application-dev/reference/arkui-ts/ts-basic-components-datepicker.md index 1b4f2c165ed231af18e4ad15a9588247fd60d161..e5aa84e29ece1a1a11f91a0a66fc6526bdc1b2ab 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-datepicker.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-datepicker.md @@ -20,11 +20,11 @@ Creates a date picker in the given date range. **Parameters** -| Name | Type| Mandatory | Description | -| -------- | ---- | ---- | -------------------------------------- | -| start | Date | No | Start date of the picker.
Default value: **Date('1970-1-1')** | -| end | Date | No | End date of the picker.
Default value: **Date('2100-12-31')**| -| selected | Date | No | Date of the selected item.
Default value: current system date | +| Name | Type| Mandatory| Description | +| -------- | -------- | ---- | ------------------------------------------------------------ | +| start | Date | No | Start date of the picker.
Default value: **Date('1970-1-1')** | +| end | Date | No | End date of the picker.
Default value: **Date('2100-12-31')** | +| selected | Date | No | Date of the selected item.
Default value: current system date
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| ## Attributes diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-menu.md b/en/application-dev/reference/arkui-ts/ts-basic-components-menu.md index 594bf9fe6a1e8107e29a4dffc3b4b8c444ff92af..0136146723cecb5883d6300b006450922d7f2b00 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-menu.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-menu.md @@ -4,7 +4,9 @@ The **\** component is a vertical list of items presented to the user. > **NOTE** > -> This component is supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> - This component is supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> - The **\** component must be used together with the [bindMenu](ts-universal-attributes-menu.md) or [bindContextMenu](ts-universal-attributes-menu.md) method. It does not work when used alone. ## Child Components diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-menuitem.md b/en/application-dev/reference/arkui-ts/ts-basic-components-menuitem.md index a4616a22ad0712d5fe1d419f5d3a981c1fb6876f..305f14aa458274050f5c182ab8131d921ff91bf6 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-menuitem.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-menuitem.md @@ -36,7 +36,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | Name | Type | Description | | ------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| selected | boolean | Whether the menu item is selected.
Default value: **false** | +| selected | boolean | Whether the menu item is selected.
Default value: **false**
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | selectIcon | boolean \| [ResourceStr](ts-types.md#resourcestr)10+ | Whether to display the selected icon for a menu item is selected.
Default value: **false**
**true**: When a menu item is selected, the default tick icon is displayed.
**false**: When a menu item is selected, no icon is displayed.
**ResourceStr**: When a menu item is selected, the specified icon is displayed.| | contentFont10+ | [Font](ts-types.md#font) | Font style of the menu item content. | | contentFontColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Font color of the menu item content. | @@ -47,7 +47,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | Name | Type | Description | | -------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| onChange | (selected: boolean) => void | Triggered when the selection status of the menu item is changed manually.
The value **true** means that the menu item is selected, and **false** means the opposite. | +| onChange | (selected: boolean) => void | Triggered when the selection status of the menu item is changed manually.
The value **true** means that the menu item is selected, and **false** means the opposite.| ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-radio.md b/en/application-dev/reference/arkui-ts/ts-basic-components-radio.md index ee4275214beebdb3abd55b5eab9a8934f5f0226c..b76cb22dd303044b2e7456859da454cd815d957a 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-radio.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-radio.md @@ -31,7 +31,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | Name| Type| Description| | -------- | -------- | -------- | -| checked | boolean | Whether the radio button is selected.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.| +| checked | boolean | Whether the radio button is selected.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.
Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | radioStyle10+ | [RadioStyle](#radiostyle) | Style of the radio button in selected or deselected state.
Since API version 10, this API is supported in ArkTS widgets.| ## Events diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-rating.md b/en/application-dev/reference/arkui-ts/ts-basic-components-rating.md index 1b7b256be8889e800345b24a58d1b4d56afca3dc..efc15c08f744eb3cf89c534a2bc21d8397d729b2 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-rating.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-rating.md @@ -20,10 +20,10 @@ Since API version 9, this API is supported in ArkTS widgets. **Parameters** -| Name | Type | Mandatory | Description | -| --------- | ------- | ---- | ---------------------------------------- | -| rating | number | Yes | Value to rate.
Default value: **0**
Value range: [0, stars]
A value less than 0 evaluates to the value **0**. A value greater than the value of **stars** evaluates to the value of **stars**.| -| indicator | boolean | No | Whether the component is used only as an indicator and cannot be operated.
Default value: **false**
**NOTE**
When **indicator** is set to **true**, the default component height is 12.0 vp, and the component width is calculated as follows: Height x Value of **stars**.
When **indicator** is set to **false**, the default component height is 28.0 vp, and the component width is calculated as follows: Height x Value of **stars**.| +| Name | Type| Mandatory| Description | +| --------- | -------- | ---- | ------------------------------------------------------------ | +| rating | number | Yes | Value to rate.
Default value: **0**
Value range: [0, stars]
A value less than 0 evaluates to the value **0**. A value greater than the value of **stars** evaluates to the value of **stars**.
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| +| indicator | boolean | No | Whether the component is used only as an indicator and cannot be operated.
Default value: **false**
**NOTE**
When **indicator** is set to **true**, the default component height is 12.0 vp, and the component width is calculated as follows: Height x Value of **stars**.
When **indicator** is set to **false**, the default component height is 28.0 vp, and the component width is calculated as follows: Height x Value of **stars**.| ## Attributes diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-search.md b/en/application-dev/reference/arkui-ts/ts-basic-components-search.md index 9ad4212ae53e93d286b2bdb4816bfa84b85ac39c..16a4df18ac1ff7b20ba22b935418ddeb710f3bab 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-search.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-search.md @@ -20,7 +20,7 @@ Search(options?: { value?: string; placeholder?: ResourceStr; icon?: string; con | ----------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ | | value | string | No | Text input in the search text box.
Since API version 10, this parameter supports two-way binding through [$$](../../quick-start/arkts-two-way-sync.md).| | placeholder | [ResourceStr](ts-types.md#resourcestr)10+ | No | Text displayed when there is no input. | -| icon | string | No | Path to the search icon. By default, the system search icon is used.
For details about the supported image types, see [Image](ts-basic-components-image.md).| +| icon | string | No | Path to the search icon. By default, the system search icon is used.
**NOTE**
The icon data source can be a local or online image.
- The supported formats include PNG, JPG, BMP, SVG, GIF, and pixelmap.
- The Base64 string is supported in the following format: data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data], where [base64 data] is a Base64 string.| | controller | SearchController | No | Controller of the **\** component. | ## Attributes diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-select.md b/en/application-dev/reference/arkui-ts/ts-basic-components-select.md index 8bb39f7eaa9cad64eb6c56936a42ddd88eaa75c6..06ea2a8cfc12b54048c6a91c70313fcc48c876f9 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-select.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-select.md @@ -23,24 +23,35 @@ Select(options: Array\<[SelectOption](#selectoption)\>) ## Attributes +In addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported. + | Name | Type | Description | | ----------------------- | ------------------------------------- | --------------------------------------------- | -| selected | number | Index of the initial selected option in the drop-down list box. The index of the first option is **0**.
If this attribute is not set, the default value **-1** is used, indicating that no option is selected.| -| value | string | Text of the drop-down button. | -| font | [Font](ts-types.md#font) | Text font of the drop-down button. | -| fontColor | [ResourceColor](ts-types.md#resourcecolor) | Text color of the drop-down button. | -| selectedOptionBgColor | [ResourceColor](ts-types.md#resourcecolor) | Background color of the selected option in the drop-down list box. | -| selectedOptionFont | [Font](ts-types.md#font) | Text font of the selected option in the drop-down list box. | -| selectedOptionFontColor | [ResourceColor](ts-types.md#resourcecolor) | Text color of the selected option in the drop-down list box. | -| optionBgColor | [ResourceColor](ts-types.md#resourcecolor) | Background color of an option in the drop-down list box. | -| optionFont | [Font](ts-types.md#font) | Text font of an option in the drop-down list box. | -| optionFontColor | [ResourceColor](ts-types.md#resourcecolor) | Text color of an option in the drop-down list box. | +| selected | number | Index of the initial selected option in the drop-down list box. The index of the first option is **0**.
If this attribute is not set, the default value **-1** is used, indicating that no option is selected.
Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| +| value | string | Text of the drop-down button. By default, it will be replaced by the content of the selected option.
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| +| font | [Font](ts-types.md#font) | Text font of the drop-down button.
Default value:
{
size: '16fp',
weight: FontWeight.Medium
} | +| fontColor | [ResourceColor](ts-types.md#resourcecolor) | Text color of the drop-down button.
Default value: **'\#E6FFFFFF'**| +| selectedOptionBgColor | [ResourceColor](ts-types.md#resourcecolor) | Background color of the selected option in the drop-down list box.
Default value: **'\#33007DFF'**| +| selectedOptionFont | [Font](ts-types.md#font) | Text font of the selected option in the drop-down list box.
Default value:
{
size: '16fp',
weight: FontWeight.Regular
} | +| selectedOptionFontColor | [ResourceColor](ts-types.md#resourcecolor) | Text color of the selected option in the drop-down list box.
Default value: **'\#ff007dff'**| +| optionBgColor | [ResourceColor](ts-types.md#resourcecolor) | Background color of an option in the drop-down list box.
Default value: **'\#ffffffff'**| +| optionFont | [Font](ts-types.md#font) | Text font of an option in the drop-down list box.
Default value:
{
size: '16fp',
weight: FontWeight.Regular
} | +| optionFontColor | [ResourceColor](ts-types.md#resourcecolor) | Text color of an option in the drop-down list box.
Default value: **'\#ff182431'**| +| space10+ | [Length](ts-types.md#length) | Spacing between the text and arrow of an option.
**NOTE**
This attribute cannot be set in percentage.| +| arrowPosition10+ | [ArrowPosition](#arrowposition10) | Alignment between the text and arrow of an option.
Default value: **ArrowPosition.END**| + +## ArrowPosition10+ + +| Name | Description | +| ------------------- | ------------------ | +| END10+ | The text is in front of the arrow.| +| START10+ | The arrow is in front of the text.| ## Events -| Name | Description | -| ----------------------------------------------------------- | ------------------------------------------------------------ | -| onSelect(callback: (index: number, value?: string) => void) | Invoked when an option in the drop-down list box is selected.
**index**: index of the selected option.
**value**: value of the selected option. | +| Name | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | +| onSelect(callback: (index: number, value?: string) => void) | Invoked when an option in the drop-down list box is selected.
**index**: index of the selected option.
**value**: value of the selected option.| ## Example @@ -49,20 +60,28 @@ Select(options: Array\<[SelectOption](#selectoption)\>) @Entry @Component struct SelectExample { + @State text: string = "TTTTT" + @State index: number = 2 + @State space: number = 8 + @State arrowPosition: ArrowPosition = ArrowPosition.END build() { Column() { Select([{ value: 'aaa', icon: "/common/public_icon.svg" }, { value: 'bbb', icon: "/common/public_icon.svg" }, { value: 'ccc', icon: "/common/public_icon.svg" }, { value: 'ddd', icon: "/common/public_icon.svg" }]) - .selected(2) - .value('TTTTT') + .selected(this.index) + .value(this.text) .font({ size: 16, weight: 500 }) .fontColor('#182431') .selectedOptionFont({ size: 16, weight: 400 }) .optionFont({ size: 16, weight: 400 }) - .onSelect((index: number) => { + .space(this.space) + .arrowPosition(this.arrowPosition) + .onSelect((index:number, text: string)=>{ console.info('Select:' + index) + this.index = index; + this.text = text; }) }.width('100%') } diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md b/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md index efc17049a39e3a97e1ae038ac7f18c7b3b255fd2..4958173d84c8894bd661ddfd0cdfd05f9041b251 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md @@ -22,7 +22,7 @@ Since API version 9, this API is supported in ArkTS widgets. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| value | number | No| Current progress.
Default value: **0**| +| value | number | No| Current progress.
Default value: min
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | min | number | No| Minimum value.
Default value: **0**| | max | number | No| Maximum value.
Default value: **100**
**NOTE**
If the value of **min** is greater than or equal to the value of **max**, the default value **0** is used for **min** and the default value **100** is used for **max**.
If the value is not within the [min, max] range, the value of **min** or **max**, whichever is closer.| | step | number | No| Step of the slider.
Default value: **1**
Value range: [0.01, max]
**NOTE**
If this parameter is set to a value less than 0 or a percentage, the default value is used.| diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md b/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md index 5b29d3de61a0454ec72890a778ffd61420fe3ad9..fac942c34194b86dbb92ce27f21a85c57f5fa409 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md @@ -22,7 +22,7 @@ Stepper(value?: { index?: number }) | Name| Type| Mandatory | Description| | ------| -------- | --------------- | -------- | -| index | number | No| Index of the **\** that is currently displayed.
Default value: **0**| +| index | number | No| Index of the **\** that is currently displayed.
Default value: **0**
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| ## Attributes diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-text.md b/en/application-dev/reference/arkui-ts/ts-basic-components-text.md index 2c6e87d2812bb855b685d3176c5f1fed68eee3e6..9a52243939d77e88ba48b793830784aa51ebc608 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-text.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-text.md @@ -26,28 +26,31 @@ Since API version 9, this API is supported in ArkTS widgets. ## Attributes -In addition to the [universal attributes](ts-universal-attributes-size.md), the following attributes are supported. +In addition to the [universal attributes](ts-universal-attributes-size.md) and [universal text attributes](ts-universal-attributes-text-style.md), the following attributes are supported. | Name | Type | Description | | ----------------------- | ----------------------------------- | ------------------------------------------- | -| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | Horizontal alignment mode of the text.
Default value: **TextAlign.Start**
**NOTE**
The text takes up the full width of the **\** component. To set the vertical alignment for the text, use the [align](ts-universal-attributes-location.md) attribute.
Since API version 9, this API is supported in ArkTS widgets.| -| textOverflow | {overflow: [TextOverflow](ts-appendix-enums.md#textoverflow)} | Display mode when the text is too long.
Default value: **{overflow: TextOverflow.Clip}**
**NOTE**
Text is clipped at the transition between words. To clip text in the middle of a word, add **\u200B** between characters.
If **overflow** is set to **TextOverflow.None**, **TextOverflow.Clip**, or **TextOverflow.Ellipsis**, this attribute must be used with **maxLines**. Otherwise, the setting does not take effect. If **overflow** is set to **TextOverflow.Marquee**, the text scrolls in a line, and therefore **maxLines** does not need to be set.
Since API version 9, this API is supported in ArkTS widgets. | -| maxLines | number | Maximum number of lines in the text.
Default value: **Infinity**
**NOTE**
By default, text is automatically folded. If this attribute is specified, the text will not exceed the specified number of lines. If there is extra text, you can use **textOverflow** to specify how it is displayed.
Since API version 9, this API is supported in ArkTS widgets.| +| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | Horizontal alignment mode of the text.
Default value: **TextAlign.Start**
**NOTE**
The text takes up the full width of the **\** component. To set vertical alignment for the text, use the [align](ts-universal-attributes-location.md) attribute. The **align** attribute alone does not control the horizontal position of the text. In other words, **Alignment.TopStart**, **Alignment.Top**, and **Alignment.TopEnd** produce the same effect, top-aligning the text; **Alignment.Start**, **Alignment.Center**, and **Alignment.End** produce the same effect, centered-aligning the text vertically; **Alignment.BottomStart**, **Alignment.Bottom**, and **Alignment.BottomEnd** produce the same effect, bottom-aligning the text. Yet, it can work with the **textAlign** attribute to jointly determine the horizontal position of the text.
Since API version 9, this API is supported in ArkTS widgets.| +| textOverflow | {overflow: [TextOverflow](ts-appendix-enums.md#textoverflow)} | Display mode when the text is too long.
Default value: **{overflow: TextOverflow.Clip}**
**NOTE**
Text is clipped at the transition between words. To clip text in the middle of a word, add **\u200B** between characters.
If **overflow** is set to **TextOverflow.None**, **TextOverflow.Clip**, or **TextOverflow.Ellipsis**, this attribute must be used with **maxLines**. Otherwise, the setting does not take effect. **TextOverflow.None** produces the same effect as **TextOverflow.Clip**. If **overflow** is set to **TextOverflow.Marquee**, the text scrolls in a line, and neither **maxLines** nor **copyOption** takes effect.
Since API version 9, this API is supported in ArkTS widgets.| +| maxLines | number | Maximum number of lines in the text.
Default value: **Infinity**
**NOTE**
By default, text is automatically folded. If this attribute is specified, the text will not exceed the specified number of lines. If there is extra text, you can use **textOverflow** to specify how it is displayed.
Since API version 9, this API is supported in ArkTS widgets. | | lineHeight | string \| number \| [Resource](ts-types.md#resource) | Text line height. If the value is less than or equal to **0**, the line height is not limited and the font size is adaptive. If the value of the number type, the unit fp is used.
Since API version 9, this API is supported in ArkTS widgets.| | decoration | {
type: [TextDecorationType](ts-appendix-enums.md#textdecorationtype),
color?: [ResourceColor](ts-types.md#resourcecolor)
} | Style and color of the text decorative line.
Default value: {
type: TextDecorationType.None,
color: Color.Black
}
Since API version 9, this API is supported in ArkTS widgets.| | baselineOffset | number \| string | Baseline offset of the text. The default value is **0**.
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**

If this attribute is set to a percentage, the default value is used.| -| letterSpacing | number \| string | Letter spacing.
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**

If this attribute is set to a percentage, the default value is used.| +| letterSpacing | number \| string | Letter spacing.
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**
If this attribute is set to a percentage, the default value is used.
If this attribute is set to a negative value, the letters will overlap each other. | | minFontSize | number \| string \| [Resource](ts-types.md#resource) | Minimum font size.
For the setting to take effect, this attribute must be used together with **maxFontSize**, **maxLines**, or layout constraint settings.
Since API version 9, this API is supported in ArkTS widgets. | | maxFontSize | number \| string \| [Resource](ts-types.md#resource) | Maximum font size.
For the setting to take effect, this attribute must be used together with **minFontSize**, **maxLines**, or layout constraint settings.
Since API version 9, this API is supported in ArkTS widgets. | | textCase | [TextCase](ts-appendix-enums.md#textcase) | Text case.
Default value: **TextCase.Normal**
Since API version 9, this API is supported in ArkTS widgets.| | copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | Whether copy and paste is allowed.
Default value: **CopyOptions.None**
This API is supported in ArkTS widgets.| +| draggable9+ | boolean | Drag effect of the selected text.
This attribute cannot be used with the [onDragStart](ts-universal-events-drag-drop.md) event.
It must be used with **copyOption** to enable the selected text to be dragged and copied.
Default value: **false**| | textShadow10+ | [ShadowOptions](ts-universal-attributes-image-effect.md#shadowoptions) | Text shadow.| -| heightAdaptivePolicy10+ | [TextHeightAdaptivePolicy](ts-appendix-enums.md#TextHeightAdaptivePolicy10) | How the adaptive height is determined for the text.| +| heightAdaptivePolicy10+ | [TextHeightAdaptivePolicy](ts-appendix-enums.md#textheightadaptivepolicy10) | How the adaptive height is determined for the text.
Default value: **TextHeightAdaptivePolicy.MAX_LINES_FIRST**
**NOTE**
When this attribute is set to **TextHeightAdaptivePolicy.MAX_LINES_FIRST**, the **maxLines** attribute takes precedence for adjusting the text height. If the **maxLines** setting results in a layout beyond the layout constraints, the text will shrink to a font size between `minFontSize` and `maxFontSize` to allow for more content to be shown.
When this attribute is set to **TextHeightAdaptivePolicy.MIN_FONT_SIZE_FIRST**, the **minFontSize** attribute takes precedence for adjusting the text height. If the text can fit in one line with the `minFontSize` setting, the text will enlarge to the largest possible font size between `minFontSize` and `maxFontSize`.
When this attribute is set to **TextHeightAdaptivePolicy.LAYOUT_CONSTRAINT_FIRST**, the layout constraints take precedence for adjusting the text height. If the resultant layout is beyond the layout constraints, the text will shrink to a font size between `minFontSize` and `maxFontSize` to respect the layout constraints. If the layout still exceeds the layout constraints after the font size is reduced to **minFontSize**, the lines that exceed the layout constraints are deleted. | | textIndent10+ | number \| string | Indentation of the first line.
Default value: **0**| > **NOTE** > > The **\** component cannot contain both the text and the child component **\** or **\**. If both of them exist, only the content in **\** or **\** is displayed. +> +> For the **\** component, the default value of the [clip](ts-universal-attributes-sharp-clipping.md) attribute is **true**. ## Events @@ -112,7 +115,7 @@ struct TextExample1 { Text('TextOverflow+maxLines').fontSize(9).fontColor(0xCCCCCC) // Clip the text when the value of maxLines is exceeded. Text('This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content. This is the setting of textOverflow to Clip text content This is the setting of textOverflow to None text content.') - .textOverflow({ overflow: TextOverflow.None }) + .textOverflow({ overflow: TextOverflow.Clip }) .maxLines(1) .fontSize(12) .border({ width: 1 }) diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md b/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md index 244b6990bba8d9ccc0817e5eb96b8769d38530df..f3af7b67cb3eb17ada3be85777566ce874b1a72e 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-textarea.md @@ -21,7 +21,7 @@ TextArea(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Tex | Name | Type | Mandatory | Description | | ----------------------- | ---------------------------------------- | ---- | -------------- | | placeholder | [ResourceStr](ts-types.md#resourcestr) | No | Placeholder text displayed when there is no input. It is not displayed once there is any input. | -| text | [ResourceStr](ts-types.md#resourcestr) | No | Current text input.
If the component has [stateStyles](ts-universal-attributes-polymorphic-style.md) or any other attribute that may trigger updating configured, you are advised to bind the state variable to the text in real time through the **onChange** event,
so as to prevent display errors when the component is updated. | +| text | [ResourceStr](ts-types.md#resourcestr) | No | Current text input.
If the component has [stateStyles](ts-universal-attributes-polymorphic-style.md) or any other attribute that may trigger updating configured, you are advised to bind the state variable to the text in real time through the **onChange** event,
so as to prevent display errors when the component is updated.
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | controller8+ | [TextAreaController](#textareacontroller8) | No | Text area controller.| @@ -36,7 +36,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | textAlign | [TextAlign](ts-appendix-enums.md#textalign) | Horizontal alignment of the text.
Default value: **TextAlign.Start**| | caretColor | [ResourceColor](ts-types.md#resourcecolor) | Color of the caret in the text box. | | inputFilter8+ | {
value: [ResourceStr](ts-types.md#resourcestr),
error?: (value: string) => void
} | Regular expression for input filtering. Only inputs that comply with the regular expression can be displayed. Other inputs are filtered out. The specified regular expression can match single characters, but not strings.
- **value**: regular expression to set.
- **error**: filtered-out content to return when regular expression matching fails.| -| copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | Whether copy and paste is allowed.
If this attribute is set to **CopyOptions.None**, the paste operation is allowed, but not the copy or cut operation.| +| copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | Whether copy and paste is allowed.
If this attribute is set to **CopyOptions.None**, the paste operation is allowed, but the copy and cut operations are not.| > **NOTE** > @@ -47,13 +47,13 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the In addition to the [universal events](ts-universal-events-click.md), the following events are supported. -| Name | Description | +| Name | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | -| onChange(callback: (value: string) => void) | Triggered when the input in the text box changes.
- **value**: text entered. | -| onEditChange(callback: (isEditing: boolean) => void)10+ | Triggered when the input status changes. When the cursor is placed in the text box, it is in the editing state. Otherwise, it is in the non-editing state. If the value of **isEditing** is **true**, text input is in progress. | -| onCopy8+(callback:(value: string) => void) | Triggered when the copy button on the pasteboard, which displays when the text box is long pressed, is clicked.
- **value**: text to be copied. | -| onCut8+(callback:(value: string) => void) | Triggered when the cut button on the pasteboard, which displays when the text box is long pressed, is clicked.
- **value**: text to be cut. | -| onPaste8+(callback:(value: string) => void) | Triggered when the paste button on the pasteboard, which displays when the text box is long pressed, is clicked.
- **value**: text to be pasted. | +| onChange(callback: (value: string) => void) | Triggered when the input in the text box changes.
- **value**: text entered.| +| onEditChange(callback: (isEditing: boolean) => void)10+ | Triggered when the input status changes. When the cursor is placed in the text box, it is in the editing state. Otherwise, it is in the non-editing state. If the value of **isEditing** is **true**, text input is in progress.| +| onCopy8+(callback:(value: string) => void) | Triggered when the copy button on the pasteboard, which displays when the text box is long pressed, is clicked.
- **value**: text to be copied.| +| onCut8+(callback:(value: string) => void) | Triggered when the cut button on the pasteboard, which displays when the text box is long pressed, is clicked.
- **value**: text to be cut.| +| onPaste8+(callback:(value: string) => void) | Triggered when the paste button on the pasteboard, which displays when the text box is long pressed, is clicked.
- **value**: text to be pasted.| ## TextAreaController8+ @@ -81,14 +81,14 @@ Sets the position of the caret. setTextSelection(selectionStart: number, selectionEnd: number): void -Sets the text selection range. +Sets the text selection range and highlights the selected text when the component is focused. This API works only when the value of **selectionStart** is less than that of **selectionEnd**. **Parameters** -| Name | Type| Mandatory| Description | -| -------------- | -------- | ---- | ------------------ | -| selectionStart | number | Yes | Start of the selection range.| -| selectionEnd | number | Yes | End of the selection range.| +| Name | Type| Mandatory| Description | +| -------------- | -------- | ---- | ------------------------------------------------------------ | +| selectionStart | number | Yes | Start position of the text selection range. The start position of text in the text box is 0.
A value less than 0 evaluates to the value **0**. A value greater than the maximum text length evaluates to the maximum text length.
| +| selectionEnd | number | Yes | End position of the text selection range.
A value less than 0 evaluates to the value **0**. A value greater than the maximum text length evaluates to the maximum text length.
| ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md b/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md index cf42e030a17593607b5d4ff4a5c0711ed9dc22ad..588f88057abe66a553dd25dc8337503b8786e65a 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-textinput.md @@ -21,7 +21,7 @@ TextInput(value?:{placeholder?: ResourceStr, text?: ResourceStr, controller?: Te | Name | Type | Mandatory | Description | | ----------------------- | ---------------------------------------- | ---- | --------------- | | placeholder | [ResourceStr](ts-types.md#resourcestr) | No | Placeholder text displayed when there is no input. | -| text | [ResourceStr](ts-types.md#resourcestr) | No | Current text input.
If the component has [stateStyles](ts-universal-attributes-polymorphic-style.md) or any other attribute that may trigger updating configured, you are advised to bind the state variable to the text in real time through the **onChange** event,
so as to prevent display errors when the component is updated. | +| text | [ResourceStr](ts-types.md#resourcestr) | No | Current text input.
If the component has [stateStyles](ts-universal-attributes-polymorphic-style.md) or any other attribute that may trigger updating configured, you are advised to bind the state variable to the text in real time through the **onChange** event,
so as to prevent display errors when the component is updated.
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | controller8+ | [TextInputController](#textinputcontroller8) | No | Text input controller.| @@ -42,7 +42,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | showPasswordIcon9+ | boolean | Whether to display the show password icon at the end of the password text box.
Default value: **true**| | style9+ | [TextInputStyle](#textinputstyle9) | Text input style.
Default value: **TextInputStyle.Default**| | textAlign9+ | [TextAlign](ts-appendix-enums.md#textalign) | Alignment mode of the text in the text box.
Default value: **TextAlign.Start** | -| selectedBackgroundColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Background color of the selected text.| +| selectedBackgroundColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Background color of the selected text.
If the opacity is not set, the color is opaque. For example, **0x80000000** indicates black with 50% opacity.| | caretStyle10+ | {
width: [Length](ts-types.md#length)
} | Caret style. | | caretPosition10+ | number | Caret position.| @@ -81,15 +81,15 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the In addition to the [universal events](ts-universal-events-click.md), the following events are supported. -| Name | Description | +| Name | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | -| onChange(callback: (value: string) => void) | Triggered when the input changes.
**value**: text content.
This event is triggered when any of the following conditions is met:
1. Keyboard input is received.
2. Paste and cut is performed.
3. Ctrl+V is pressed. | -| onSubmit(callback: (enterKey: EnterKeyType) => void) | Triggered when the Enter key on the keyboard is pressed. The return value is the current type of the Enter key.
**enterKeyType**: type of the Enter key. For details, see [EnterKeyType](#enterkeytype). | -| onEditChanged(callback: (isEditing: boolean) => void)(deprecated) | Triggered when the input status changes. Since API version 8, **onEditChange** is recommended. | -| onEditChange(callback: (isEditing: boolean) => void)8+ | Triggered when the input status changes. When the cursor is placed in the text box, it is in the editing state. Otherwise, it is in the non-editing state. If the value of **isEditing** is **true**, text input is in progress. | -| onCopy(callback:(value: string) => void)8+ | Triggered when the copy button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be copied. | -| onCut(callback:(value: string) => void)8+ | Triggered when the cut button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be cut. | -| onPaste(callback:(value: string) => void)8+ | Triggered when the paste button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be pasted. | +| onChange(callback: (value: string) => void) | Triggered when the input changes.
**value**: text content.
This event is triggered when any of the following conditions is met:
1. Keyboard input is received.
2. Paste and cut is performed.
3. Ctrl+V is pressed.| +| onSubmit(callback: (enterKey: EnterKeyType) => void) | Triggered when the Enter key on the keyboard is pressed. The return value is the current type of the Enter key.
**enterKeyType**: type of the Enter key. For details, see [EnterKeyType](#enterkeytype).| +| onEditChanged(callback: (isEditing: boolean) => void)(deprecated) | Triggered when the input status changes. Since API version 8, **onEditChange** is recommended.| +| onEditChange(callback: (isEditing: boolean) => void)8+ | Triggered when the input status changes. When the cursor is placed in the text box, it is in the editing state. Otherwise, it is in the non-editing state. If the value of **isEditing** is **true**, text input is in progress.| +| onCopy(callback:(value: string) => void)8+ | Triggered when the copy button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be copied.| +| onCut(callback:(value: string) => void)8+ | Triggered when the cut button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be cut.| +| onPaste(callback:(value: string) => void)8+ | Triggered when the paste button on the pasteboard, which displays when the text box is long pressed, is clicked.
**value**: text to be pasted.| ## TextInputController8+ diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md b/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md index 831d427ccc5e558a6119408f105a0277a888323b..633e92d812e4aca2db4c68842a0e6745732c52b1 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-timepicker.md @@ -20,9 +20,9 @@ Creates a time picker, which is in 24-hour format by default. **Parameters** -| Name | Type| Mandatory | Description | -| -------- | ---- | ---- | ------------------------ | -| selected | Date | No | Time of the selected item.
Default value: current system time| +| Name | Type| Mandatory| Description | +| -------- | -------- | ---- | ------------------------------------------------------------ | +| selected | Date | No | Time of the selected item.
Default value: current system time
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| ## Attributes diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md b/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md index 191c4839533806a43c41e2c27f500dd10ca18e8d..7a78929dca57da1194d9454042286393f8a773b2 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-toggle.md @@ -22,7 +22,7 @@ Since API version 9, this API is supported in ArkTS widgets. | Name| Type| Mandatory | Description | | ---- | ---------- | -----| -------------- | | type | [ToggleType](#toggletype) | Yes | Type of the toggle.| -| isOn | boolean | No | Whether the toggle is turned on. The value **true** means that the toggle is turned on, and **false** means the opposite.
Default value: **false**| +| isOn | boolean | No | Whether the toggle is turned on. The value **true** means that the toggle is turned on, and **false** means the opposite.
Default value: **false**
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| ## ToggleType @@ -31,9 +31,9 @@ Since API version 9, this API is supported in ArkTS widgets. | Name | Description | | -------- | ---------------- | -| Checkbox | Check box type.
**NOTE**
The default value of the universal attribute [margin](ts-universal-attributes-size.md) is as follows:
{
top: 12 vp,
right: 12 vp,
bottom: 12 vp,
left: 12 vp
} | +| Checkbox | Check box type.
**NOTE**
The default value of the universal attribute [margin](ts-universal-attributes-size.md) is as follows:
{
top: 12 px,
right: 12 px,
bottom: 12 px,
left: 12 px
} | | Button | Button type. The set string, if any, will be displayed inside the button. | -| Switch | Switch type.
**NOTE**
The default value of the universal attribute [margin](ts-universal-attributes-size.md) is as follows:
{
top: 14 vp,
right:6 vp,
bottom: 6 vp,
left: 14 vp
} | +| Switch | Switch type.
**NOTE**
The default value of the universal attribute [margin](ts-universal-attributes-size.md) is as follows:
{
top: 6px,
right: 14px,
bottom: 6 px,
left: 14 px
} | ## Attributes diff --git a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md index 35211ab1665ca4dbee56199a3c449ae9ff2a8a0b..8801033ff3864cef03d0271db00a8d1dfb92d3da 100644 --- a/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md +++ b/en/application-dev/reference/arkui-ts/ts-components-canvas-canvasgradient.md @@ -22,7 +22,7 @@ Since API version 9, this API is supported in ArkTS widgets. | Name | Type | Mandatory | Default Value | Description | | ------ | ------ | ---- | --------- | ---------------------------- | | offset | number | Yes | 0 | Relative position of the gradient stop along the gradient vector. The value ranges from 0 to 1.| -| color | string | Yes | '#ffffff' | Gradient color to set. | +| color | string | Yes | '#ffffff' | Gradient color to set. For details about the color notation, see the description of the string type in [ResourceColor](ts-types.md#resourcecolor). | **Example** diff --git a/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md b/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md index ed5df7b82fd0f73742ca53af4920172c90398fe5..df19454da7610c2d52acfd958c7c35e0e3073e33 100644 --- a/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md +++ b/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md @@ -21,7 +21,7 @@ AlphabetIndexer(value: {arrayValue: Array<string>, selected: number}) | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | arrayValue | Array<string> | Yes| Array of strings to be displayed in the alphabetic index bar. The value cannot be null.| -| selected | number | Yes | Index of the initially selected item. If the value exceeds the value range, the default value 0 is used. | +| selected | number | Yes | Index of the initially selected item. If the value exceeds the value range, the default value 0 is used.
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| ## Attributes @@ -38,9 +38,9 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | selectedFont | [Font](ts-types.md#font) | Font style of the selected text.
Default value:
{
size:10,
style:FontStyle.Normal,
weight:FontWeight.Normal,
family:'HarmonyOS Sans'
} | | popupFont | [Font](ts-types.md#font) | Font style of the pop-up text.
Default value:
{
size:10,
style:FontStyle.Normal,
weight:FontWeight.Normal,
family:'HarmonyOS Sans'
} | | font | [Font](ts-types.md#font) | Default font style of the alphabetic index bar.
Default value:
{
size:10,
style:FontStyle.Normal,
weight:FontWeight.Normal,
family:'HarmonyOS Sans'
} | -| itemSize | string \| number | Size of an item in the alphabetic index bar. The item is a square, and the side length needs to be set. This attribute cannot be set to a percentage.
Default value: **24.0** | +| itemSize | string \| number | Size of an item in the alphabetic index bar. The item is a square, and the side length needs to be set. This attribute cannot be set to a percentage.
Default value: **24.0**
Unit: vp| | alignStyle | value: [IndexerAlign](#indexeralign),
offset10+?: [Length](ts-types.md#length) | Alignment style of the alphabetic index bar.
**value**: alignment of the alphabetic index bar with the pop-up window, which can be left-aligned or right-aligned.
Default value: **IndexerAlign.Right**
**offset**: spacing between the pop-up window and the alphabetic index bar. A value greater than or equal to 0 is valid. If this attribute is set to a value less than 0 or is not set, the spacing is the same as **popupPosition.x**.| -| selected | number | Index of the selected item.
Default value: **0**| +| selected | number | Index of the selected item.
Default value: **0**
Since API version 10, this parameter supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | popupPosition | [Position](ts-types.md#position8) | Position of the pop-up window relative to the center of the indexer bar's top border.
Default value: **{x:96.0, y:48.0}**| | popupSelectedColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Color of the selected text excluding the initial letter in the pop-up window.
Default value: **#FF182431**| | popupUnselectedColor10+ | [ResourceColor](ts-types.md#resourcecolor) | Color of the unselected text in the pop-up window.
Default value: **#FF182431**| @@ -56,7 +56,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the ## Events -Only the following events are supported. +In addition to the [universal events](ts-universal-events-click.md), the following events are supported. | Name| Description| | -------- | -------- | diff --git a/en/application-dev/reference/arkui-ts/ts-container-panel.md b/en/application-dev/reference/arkui-ts/ts-container-panel.md index 14fe7d33b3a061db80c361c620bd1010c4624806..bc38624a2bfaa00817283a74515a1ecfd647f2cd 100644 --- a/en/application-dev/reference/arkui-ts/ts-container-panel.md +++ b/en/application-dev/reference/arkui-ts/ts-container-panel.md @@ -33,7 +33,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | Name| Type| Description| | -------- | -------- | -------- | | type | [PanelType](#paneltype)| Type of the panel.
Default value: **PanelType.Foldable**| -| mode | [PanelMode](#panelmode) | Initial status of the panel.
Default value for the Minibar type: **PanelMode.Mini**
Default value for other types: **PanelMode.Half**
Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables. | +| mode | [PanelMode](#panelmode) | Initial status of the panel.
Default value for the Minibar type: **PanelMode.Mini**
Default value for other types: **PanelMode.Half**
Since API version 10, this attribute supports [$$](../../quick-start/arkts-two-way-sync.md) for two-way binding of variables.| | dragBar | boolean | Whether to enable a drag bar. The value **true** means that the drag bar will be displayed, and **false** means the opposite.
Default value: **true**| | fullHeight | string \| number | Panel height in the **PanelMode.Full** mode.
Default value: main axis height of the panel minus 8 vp
**NOTE**
This attribute cannot be set in percentage.| | halfHeight | string \| number | Panel height in the **PanelMode.Half** mode.
Default value: half of the main axis height of the panel
**NOTE**
This attribute cannot be set in percentage.| diff --git a/en/application-dev/reference/arkui-ts/ts-container-scroll.md b/en/application-dev/reference/arkui-ts/ts-container-scroll.md index d54ecbf1d4a50be563e2c712648ae0a56dc19daa..e56281bb9e1915186abcc64e4a9911a99aea18d7 100644 --- a/en/application-dev/reference/arkui-ts/ts-container-scroll.md +++ b/en/application-dev/reference/arkui-ts/ts-container-scroll.md @@ -139,7 +139,7 @@ Scrolls to the item with the specified index. > **NOTE** > -> Only the **\** and **\** components are supported. +> Only the **\**, **\**, and **\** components are supported. **Parameters** diff --git a/en/application-dev/reference/arkui-ts/ts-container-swiper.md b/en/application-dev/reference/arkui-ts/ts-container-swiper.md index fdf1227af8f71876d7d1207bf2f205e3fcc053e3..6900431ed2d867680b5f6135325a1c6565b9a430 100644 --- a/en/application-dev/reference/arkui-ts/ts-container-swiper.md +++ b/en/application-dev/reference/arkui-ts/ts-container-swiper.md @@ -44,7 +44,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the | displayMode | SwiperDisplayMode | Mode in which elements are displayed along the main axis. This attribute takes effect only when **displayCount** is not set.
Default value: **SwiperDisplayMode.Stretch**| | cachedCount8+ | number | Number of child components to be cached.
Default value: **1**
**NOTE**
**cachedCount** has caching optimized. You are advised not to use it together with [LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md).| | disableSwipe8+ | boolean | Whether to disable the swipe feature.
Default value: **false** | -| curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | Animation curve. The ease-in/ease-out curve is used by default. For details about common curves, see [Curve](ts-appendix-enums.md#curve). You can also create custom curves (interpolation curve objects) by using the API provided by the [interpolation calculation](../apis/js-apis-curve.md) module.
Default value: **Curve.Ease**| +| curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | Animation curve. The ease-in/ease-out curve is used by default. For details about common curves, see [Curve](ts-appendix-enums.md#curve). You can also create custom curves (interpolation curve objects) by using the API provided by the [interpolation calculation](../apis/js-apis-curve.md) module.
Default value: **Curve.Linear**| | indicatorStyle8+ | {
left?: [Length](ts-types.md#length),
top?: [Length](ts-types.md#length),
right?: [Length](ts-types.md#length),
bottom?: [Length](ts-types.md#length),
size?: [Length](ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](ts-types.md),
selectedColor?: [ResourceColor](ts-types.md)
} | Style of the navigation point indicator.
\- **left**: distance between the navigation point indicator and the left edge of the **\** component.
\- **top**: distance between the navigation point indicator and the top edge of the **\** component.
\- **right**: distance between the navigation point indicator and the right edge of the **\** component.
\- **bottom**: distance between the navigation point indicator and the bottom edge of the **\** component.
\- **size**: diameter of the navigation point indicator.
\- **mask**: whether to enable the mask for the navigation point indicator.
\- **color**: color of the navigation point indicator.
\- **selectedColor**: color of the selected navigation dot.| | displayCount8+ | number \| string | Number of elements to display per page.
Default value: **1**
**NOTE**
If the value is of the string type, it can only be **'auto'**, whose display effect is the same as that of **SwiperDisplayMode.AutoLinear**.
If the value is of the number type, child components stretch (shrink) on the main axis after the swiper width [deducting the result of itemSpace x (displayCount – 1)] is evenly distributed among them on the main axis.| | effectMode8+ | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | Swipe effect. For details, see **EdgeEffect**.
Default value: **EdgeEffect.Spring**
**NOTE**
The spring effect does not take effect when the controller API is called.| diff --git a/en/application-dev/reference/arkui-ts/ts-custom-component-lifecycle.md b/en/application-dev/reference/arkui-ts/ts-custom-component-lifecycle.md index 8c0149ffd66fd3269d0bd28189a25e70f96cf89e..148129e651983ba9ba54a017cd6d30d79272571d 100644 --- a/en/application-dev/reference/arkui-ts/ts-custom-component-lifecycle.md +++ b/en/application-dev/reference/arkui-ts/ts-custom-component-lifecycle.md @@ -113,6 +113,63 @@ Since API version 9, this API is supported in ArkTS widgets. | children | Array<[LayoutChild](#layoutchild9)> | Child component layout information. | | constraint | [ConstraintSizeOptions](ts-types.md#constraintsizeoptions) | Size constraint information of the parent component.| +## onRecycle10+ + +onRecycle?(params: { [key: string]: unknown }): void + +Invoked when a custom component previously placed in the cache for future reuse is re-added to the node tree, with the parameters used for constructing the component passed in. + +Since API version 10, this API is supported in ArkTS widgets. + +**Parameters** + +| Name| Type | Description | +| ------ | -------------------------- | -------------------- | +| params | { [key: string]: unknown } | Parameters used for constructing the custom component.| + + +```ts +// xxx.ets +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + @State switch: boolean = true + + build() { + Column() { + Button(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + .onClick(() => { + this.switch = !this.switch + }) + if (this.switch) { + Child() + } + } + .height("100%") + .width('100%') + } +} + +@Recycle +@Component +struct Child { + onRecycle(params) { + console.info("Recycle Child") + } + + build() { + Column() { + Text("Child Component") + .fontSize(20) + } + .borderWidth(2) + .height(100) + } +} +``` ## LayoutChild9+ diff --git a/en/application-dev/reference/arkui-ts/ts-gesture-settings.md b/en/application-dev/reference/arkui-ts/ts-gesture-settings.md index 8268db6dca2ea26db846b343060cc001294905f0..6b37f324306957502522eddda9c14be98bee3797 100644 --- a/en/application-dev/reference/arkui-ts/ts-gesture-settings.md +++ b/en/application-dev/reference/arkui-ts/ts-gesture-settings.md @@ -11,29 +11,29 @@ Bind different types of gesture events to components and set response methods fo Use the following attributes to bind gesture recognition to a component. When a gesture is recognized, the event callback is invoked to notify the component. -| Name | Type | Default Value | Description | -| --------------- | ---------------------------------------- | --------------------------------------- | ---------------------------------------- | -| gesture | gesture: [GestureType](#gesturetype),
mask?: [GestureMask](#gesturemask) | gesture: -,
mask: GestureMask.Normal | Gesture to bind.
- **gesture**: type of the gesture to bind.
- **mask**: event response setting. | -| priorityGesture | gesture: [GestureType](#gesturetype),
mask?: [GestureMask](#gesturemask) | gesture: -,
mask: GestureMask.Normal | Gesture to preferentially recognize.
- **gesture**: type of the gesture to bind.
- **mask**: event response setting.
By default, a component recognizes gestures bound through **gesture**. When **priorityGesture** is configured for its parent component, the component preferentially recognizes gestures bound through **priorityGesture**. | -| parallelGesture | gesture: [GestureType](#gesturetype),
mask?: [GestureMask](#gesturemask) | gesture: -,
mask: GestureMask.Normal | Gesture that can be triggered together with the child component gesture.
- **gesture**: type of the gesture to bind.
- **mask**: event response setting.
The gesture event is not a bubbling event. When **parallelGesture** is set for the parent component, gesture events that are the same for the parent and child components can be triggered, thereby implementing a bubbling effect. If both the single-tap gesture event and the double-tap gesture event are bound to the parent and child components, only the single-tap gesture event is responded. | +| Name| Type| Default Value| Description| +| -------- | -------- | -------- | -------- | +| gesture | gesture: [GestureType](#gesturetype),
mask?: [GestureMask](#gesturemask) | gesture: -,
mask: GestureMask.Normal | Gesture to bind.
- **gesture**: type of the gesture to bind.
- **mask**: mask for gesture events.| +| priorityGesture | gesture: [GestureType](#gesturetype),
mask?: [GestureMask](#gesturemask) | gesture: -,
mask: GestureMask.Normal | Gesture to preferentially recognize.
- **gesture**: type of the gesture to bind.
- **mask**: mask for gesture events.
1. By default, the child component preferentially recognizes the gesture specified by **gesture**, and the parent component preferentially recognizes the gesture specified by **priorityGesture** (if set).
2. With regard to long press gestures, the component with the shortest minimum hold-down time responds first, ignoring the **priorityGesture** settings.| +| parallelGesture | gesture: [GestureType](#gesturetype),
mask?: [GestureMask](#gesturemask) | gesture: -,
mask: GestureMask.Normal | Gesture that can be triggered together with the child component gesture.
- **gesture**: type of the gesture to bind.
- **mask**: mask for gesture events.
The gesture event is not a bubbling event. When **parallelGesture** is set for the parent component, gesture events that are the same for the parent and child components can be triggered, thereby implementing a bubbling effect. If both the single-tap gesture event and the double-tap gesture event are bound to the parent and child components, only the single-tap gesture event is responded.| ## GestureType -| Name | Description | -| ---------------------------------------- | ---------------------------------------- | -| [TapGesture](ts-basic-gestures-tapgesture.md) | Tap gesture, which can be a single-tap or multi-tap gesture. | -| [LongPressGesture](ts-basic-gestures-longpressgesture.md) | Long press gesture. | -| [PanGesture](ts-basic-gestures-pangesture.md) | Pan gesture, which requires a minimum 5 vp movement distance of a finger on the screen. | -| [PinchGesture](ts-basic-gestures-pinchgesture.md) | Pinch gesture. | -| [RotationGesture](ts-basic-gestures-rotationgesture.md) | Rotation gesture. | -| [SwipeGesture](ts-basic-gestures-swipegesture.md) | Swipe gesture, which can be recognized when the swipe speed is 100 vp/s or higher. | -| [GestureGroup](ts-combined-gestures.md) | A group of gestures. Continuous recognition, parallel recognition, and exclusive recognition are supported. | +| Name| Description| +| -------- | -------- | +| [TapGesture](ts-basic-gestures-tapgesture.md) | Tap gesture, which can be a single-tap or multi-tap gesture.| +| [LongPressGesture](ts-basic-gestures-longpressgesture.md) | Long press gesture.| +| [PanGesture](ts-basic-gestures-pangesture.md) | Pan gesture, which requires a minimum 5 vp movement distance of a finger on the screen.| +| [PinchGesture](ts-basic-gestures-pinchgesture.md) | Pinch gesture.| +| [RotationGesture](ts-basic-gestures-rotationgesture.md) | Rotation gesture.| +| [SwipeGesture](ts-basic-gestures-swipegesture.md) | Swipe gesture, which can be recognized when the swipe speed is 100 vp/s or higher.| +| [GestureGroup](ts-combined-gestures.md) | A group of gestures. Continuous recognition, parallel recognition, and exclusive recognition are supported.| ## GestureMask -| Name | Description | -| -------------- | ---------------------------------------- | -| Normal | The gestures of child components are not ignored and are recognized based on the default gesture recognition sequence. | +| Name| Description| +| -------- | -------- | +| Normal | The gestures of child components are not ignored and are recognized based on the default gesture recognition sequence.| | IgnoreInternal | The gestures of child components are ignored, including the built-in gestures. For example, if the child component is **\**, its built-in swipe gesture is also ignored.| ## Gesture Response Event @@ -42,52 +42,52 @@ The component binds gesture objects of different **GestureType**s through gestur **TapGesture** -| Name | Description | -| ---------------------------------------- | ---------------------------------------- | -| onAction((event?:GestureEvent) => void) | Callback invoked when a tap gesture is recognized. | +| Name| Description| +| -------- | -------- | +| onAction((event?:GestureEvent) => void) | Callback invoked when a tap gesture is recognized.| ## GestureEvent -| Name | Type | Description | -| ----------------------- | ---------------------------------------- | ---------------------------------------- | -| repeat | boolean | Whether the event is triggered repeatedly. This attribute is used for the **LongPressGesture** event. | -| offsetX | number | Offset of the gesture event on the x-axis, in vp. This attribute is used for the **PanGesture** event. A positive value means to pan from left to right, and a negative value means the opposite. | -| offsetY | number | Offset of the gesture event on the y-axis, in vp. This attribute is used for the **PanGesture** event. A positive value means to pan from top to bottom, and a negative value means the opposite. | -| angle | number | Rotation angle for the **RotationGesture** event;
angle of the swipe gesture for the **SwipeGesture** event, that is, the change in the included angle between the line segment created by the two fingers and the horizontal direction.
**NOTE**
Angle calculation method: After a swipe gesture is recognized, a line connecting the two fingers is identified as the initial line. As the fingers swipe, the line between the fingers rotates. Based on the coordinates of the initial line's and current line's end points, an arc tangent function is used to calculate the respective included angle of the points relative to the horizontal direction by using the following formula: Rotation angle = arctan2(cy2-cy1,cx2-cx1) – arctan2(y2-y1,x2-x1) The initial line is used as the coordinate system. The clockwise rotation is 0 to 180 degrees, and the counter-clockwise rotation is –180 to 0 degrees. | -| scale | number | Scale ratio. This attribute is used for the **PinchGesture** event. | -| pinchCenterX | number | X-coordinate of the center of the pinch gesture, in px relative to the upper left corner of the current component. This attribute is used for the **PinchGesture** event. | -| pinchCenterY | number | Y-coordinate of the center of the pinch gesture, in px relative to the upper left corner of the current component. This attribute is used for the **PinchGesture** event. | -| speed8+ | number | Swipe gesture speed, that is, the average swipe speed of all fingers. The unit is vp/s. This attribute is used for the **SwipeGesture** event. | -| fingerList8+ | [FingerInfo](#fingerinfo)[] | Information about all fingers that trigger the event, which is used for the **LongPressGesture** and **TapGesture** events. | -| timestamp8+ | number | Timestamp of the event. | -| target8+ | [EventTarget](ts-universal-events-click.md#eventtarget8) | Display area of the element that triggers the gesture event. | -| source8+ | [SourceType](#sourcetype) | Event input device. | -| pressure9+ | number | Press pressure. | -| tiltX9+ | number | Angle between the projection of the stylus on the device plane and the x-axis. | -| tiltY9+ | number | Angle between the projection of the stylus on the device plane and the y-axis. | -| sourceTool9+ | [SourceTool](#sourcetool) | Event input source. | +| Name| Type| Description| +| -------- | -------- | -------- | +| repeat | boolean | Whether the event is triggered repeatedly. This attribute is used for the **LongPressGesture** event.| +| offsetX | number | Offset of the gesture event on the x-axis, in vp. This attribute is used for the **PanGesture** event. A positive value means to pan from left to right, and a negative value means the opposite.| +| offsetY | number | Offset of the gesture event on the y-axis, in vp. This attribute is used for the **PanGesture** event. A positive value means to pan from top to bottom, and a negative value means the opposite.| +| angle | number | Rotation angle for the **RotationGesture** event;
angle of the swipe gesture for the **SwipeGesture** event, that is, the change in the included angle between the line segment created by the two fingers and the horizontal direction.
**NOTE**
Angle calculation method: After a swipe gesture is recognized, a line connecting the two fingers is identified as the initial line. As the fingers swipe, the line between the fingers rotates. Based on the coordinates of the initial line's and current line's end points, an arc tangent function is used to calculate the respective included angle of the points relative to the horizontal direction by using the following formula: Rotation angle = arctan2(cy2-cy1,cx2-cx1) – arctan2(y2-y1,x2-x1) The initial line is used as the coordinate system. The clockwise rotation is 0 to 180 degrees, and the counter-clockwise rotation is –180 to 0 degrees.| +| scale | number | Scale ratio. This attribute is used for the **PinchGesture** event.| +| pinchCenterX | number | X-coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component. This attribute is used for the **PinchGesture** event.| +| pinchCenterY | number | Y-coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component. This attribute is used for the **PinchGesture** event.| +| speed8+ | number | Swipe gesture speed, that is, the average swipe speed of all fingers. The unit is vp/s. This attribute is used for the **SwipeGesture** event.| +| fingerList8+ | [FingerInfo](#fingerinfo)[] | Information about all fingers that trigger the event. This attribute is used for the **LongPressGesture** and **TapGesture** events.| +| timestamp8+ | number | Timestamp of the event.| +| target8+ | [EventTarget](ts-universal-events-click.md#eventtarget8) | Display area of the element that triggers the gesture event.| +| source8+ | [SourceType](#sourcetype) | Event input device.| +| pressure9+ | number | Press pressure.| +| tiltX9+ | number | Angle between the projection of the stylus on the device plane and the x-axis.| +| tiltY9+ | number | Angle between the projection of the stylus on the device plane and the y-axis.| +| sourceTool9+ | [SourceTool](#sourcetool) | Event input source.| ## SourceType -| Name | Description | -| ----------- | -------------------- | -| Unknown | Unknown device type. | -| Mouse | Mouse. | -| TouchScreen | Touchscreen. | +| Name| Description| +| -------- | -------- | +| Unknown | Unknown device type.| +| Mouse | Mouse.| +| TouchScreen | Touchscreen.| ## FingerInfo -| Name | Type | Description | -| ------- | ------ | ---------------------------------------- | -| id | number | Index of a finger. | -| globalX | number | X-coordinate relative to the upper left corner of the application window. | -| globalY | number | Y-coordinate relative to the upper left corner of the application window. | -| localX | number | X-coordinate relative to the upper left corner of the current component. | -| localY | number | Y-coordinate relative to the upper left corner of the current component. | +| Name| Type| Description| +| -------- | -------- | -------- | +| id | number | Index of a finger.| +| globalX | number | X-coordinate relative to the upper left corner of the application window.| +| globalY | number | Y-coordinate relative to the upper left corner of the application window.| +| localX | number | X-coordinate relative to the upper left corner of the current component.| +| localY | number | Y-coordinate relative to the upper left corner of the current component.| ## SourceTool -| Name | Description | -| ------- | --------------------- | -| Unknown | Unknown input source. | -| Finger | Finger input. | -| Pen | Stylus input. | +| Name| Description| +| -------- | -------- | +| Unknown | Unknown input source.| +| Finger | Finger input.| +| Pen | Stylus input.| ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md index 11394a20c84757bfff4fc3d95fc72a7f2c3ee428..8032455b78bf4a4e5654dfc939f23cfbdeafc2e3 100644 --- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md +++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-gradient-color.md @@ -12,9 +12,9 @@ Create a more gorgeous look for a component by applying a gradient color effect | Name | Type | Description | | -------------- | -------------------------------------------- | ----------------------------------- | -| linearGradient | {
angle?: number \| string,
direction?: [GradientDirection](ts-appendix-enums.md#gradientdirection),
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | Linear gradient.
- **angle**: start angle of the linear gradient. A positive value indicates a clockwise rotation from the origin, (0, 0).
Default value: **180**
- **direction**: direction of the linear gradient. It does not take effect when **angle** is set.
Default value: **GradientDirection.Bottom**
- **colors**: colors of the linear gradient.
- **repeating**: whether the colors are repeated.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.| -| sweepGradient | {
center: Point,
start?: number \| string,
end?: number \| string,
rotation?: number\|string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | Sweep gradient, which can sweep around the specified center point in the 0–360 degree range. If the rotation angle exceeds the range, a monochrome color instead of a gradient will be drawn.
- **center**: center point of the sweep gradient, that is, the coordinates relative to the upper left corner of the current component.
- **start**: start point of the sweep gradient.
Default value: **0**
- **end**: end point of the sweep gradient.
Default value: **0**
- **rotation**: rotation angle of the sweep gradient.
Default value: **0**
- **colors**: colors of the sweep gradient.
- **repeating**: whether the colors are repeated.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**
A value less than 0 evaluates to the value **0**. A value greater than 360 evaluates to the value **1**.
When the data type of **start**, **end**, and **rotation** is string, the value **"90"** or **"90%"** is equivalent to **90**. | -| radialGradient | {
center: Point,
radius: number \| string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | Radial gradient.
- **center**: center point of the radial gradient, that is, the coordinates relative to the upper left corner of the current component.
- **radius**: radius of the radial gradient.
Value range: [0, +∞)
**NOTE**
A value less than 0 evaluates to the value **0**.
- **colors**: colors of the radial gradient.
- **repeating**: whether the colors are repeated.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets. | +| linearGradient | {
angle?: number \| string,
direction?: [GradientDirection](ts-appendix-enums.md#gradientdirection),
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | Linear gradient.
- **angle**: start angle of the linear gradient. A positive value indicates a clockwise rotation from the origin, (0, 0).
Default value: **180**
- **direction**: direction of the linear gradient. It does not take effect when **angle** is set.
Default value: **GradientDirection.Bottom**
- **colors**: colors of the linear gradient.
- **repeating**: whether the colors are repeated.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.| +| sweepGradient | {
center: [Point](./ts-drawing-components-polygon.md#point),
start?: number \| string,
end?: number \| string,
rotation?: number\|string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | Sweep gradient, which can sweep around the specified center point in the 0–360 degree range. If the rotation angle exceeds the range, a monochrome color instead of a gradient will be drawn.
- **center**: center point of the sweep gradient, that is, the coordinates relative to the upper left corner of the current component.
- **start**: start point of the sweep gradient.
Default value: **0**
- **end**: end point of the sweep gradient.
Default value: **0**
- **rotation**: rotation angle of the sweep gradient.
Default value: **0**
- **colors**: colors of the sweep gradient.
- **repeating**: whether the colors are repeated.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.
**NOTE**
A value less than 0 evaluates to the value **0**. A value greater than 360 evaluates to the value **1**.
When the data type of **start**, **end**, and **rotation** is string, the value **"90"** or **"90%"** is equivalent to **90**.| +| radialGradient | {
center: [Point](./ts-drawing-components-polygon.md#point),
radius: number \| string,
colors: Array<[ColorStop](ts-basic-components-gauge.md#colorstop)>,
repeating?: boolean
} | Radial gradient.
- **center**: center point of the radial gradient, that is, the coordinates relative to the upper left corner of the current component.
- **radius**: radius of the radial gradient.
Value range: [0, +∞)
**NOTE**
A value less than 0 evaluates to the value **0**.
- **colors**: colors of the radial gradient.
- **repeating**: whether the colors are repeated.
Default value: **false**
Since API version 9, this API is supported in ArkTS widgets.| ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md b/en/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md index c58595fb1861bfb73d5f7700af3cf7d0c130c53e..f5780d429c83b008ec2bdfec8a078d9a260df878 100644 --- a/en/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md +++ b/en/application-dev/reference/arkui-ts/ts-universal-attributes-menu.md @@ -4,7 +4,9 @@ A context menu – a vertical list of items – can be bound to a component and > **NOTE** > -> The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. +> - The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. +> +> - **CustomBuilder** does not support the use of **bindMenu** and **bindContextMenu** methods. To display a multi-level menu, use the [\](ts-basic-components-menu.md) component instead. ## Attributes @@ -29,7 +31,7 @@ A context menu – a vertical list of items – can be bound to a component and | ------ | -------------------------------- | ---- | ------------------------------------------------------ | | title | string | No | Menu title. | | offset | [Position](ts-types.md#position8) | No | Offset for showing the context menu, which should not cause the menu to extend beyond the screen.| -| placement | [Placement](ts-appendix-enums.md#placement8) | No| Preferred position of the context menu. If the set position is insufficient for holding the component, it will be automatically adjusted.
Default value: **Placement.Bottom**| +| placement | [Placement](ts-appendix-enums.md#placement8) | No| Preferred position of the context menu. If the set position is insufficient for holding the component, it will be automatically adjusted.
**NOTE**
Setting **placement** to **undefined** or **null** is equivalent to not setting it at all.| | onAppear | () => void | No| Callback triggered when the menu is displayed.| | onDisappear | () => void | No| Callback triggered when the menu is hidden.| @@ -38,7 +40,7 @@ A context menu – a vertical list of items – can be bound to a component and | Name | Type | Mandatory| Description | | ----------- | -------------------------------------------- | ---- | ------------------------------------------------------------ | | offset | [Position](ts-types.md#position8) | No | Offset for showing the context menu, which should not cause the menu to extend beyond the screen. | -| placement | [Placement](ts-appendix-enums.md#placement8) | No | Preferred position of the context menu. If the set position is insufficient for holding the component, it will be automatically adjusted.
Default value: **Placement.Bottom**| +| placement | [Placement](ts-appendix-enums.md#placement8) | No | Preferred position of the context menu. If the set position is insufficient for holding the component, it will be automatically adjusted.
**NOTE**
Setting **placement** to **undefined** or **null** is equivalent to not setting it at all.| | onAppear | () => void | No | Callback triggered when the menu is displayed. | | onDisappear | () => void | No | Callback triggered when the menu is hidden. | diff --git a/en/application-dev/reference/errorcodes/errorcode-ability.md b/en/application-dev/reference/errorcodes/errorcode-ability.md index b8ca0fb14876dadf9b5e925f715430c1f6a26e24..fa1aea9015cd83a9ba19c7c5c0c4f75610d15c73 100644 --- a/en/application-dev/reference/errorcodes/errorcode-ability.md +++ b/en/application-dev/reference/errorcodes/errorcode-ability.md @@ -204,7 +204,7 @@ The system has a large number of concurrent requests. No action is required. Wait for the previous abilities to finish startup. -## 100001 Internal Error +## 16000050 Internal Error **Error Message** @@ -519,7 +519,7 @@ The method has registered. **Description** -THis error code is reported when the method has been registered. +This error code is reported when the method has been registered. **Possible Causes** @@ -583,6 +583,24 @@ The mission listener does not exist. Check the mission listener ID. +## 16300003 Target Application Is Not the Invoker Application + +**Error Message** + +The target application is not self application. + +**Description** + +This error code is reported when the application to start is not the application that calls the API. + +**Possible Causes** + +The application to start and the invoker application are not the same application. + +**Solution** + +Ensure that the application to start is the invoker application. + ## 18500001 Invalid Bundle Name **Error Message** @@ -638,7 +656,7 @@ This error code is reported when the patch package fails to be deployed. 4. If a patch package has been deployed, the **versionCode** of the new patch package is not later than that of the previous patch package. 5. If the **type** field is set to **patch**, the signature information is different from that of the application. 6. If the **type** field is set to **patch** and a debug version is to be installed, a **hotreload** patch is in use. -7. If the **type** field is set to **hotreload** and a debug version is to be installed, a **patch** patch is in use. If the **type** field is set to **hotreload**, a release version is to be installed. +7. If the **type** field is set to **hotreload** and a debug version is to be installed, a **patch** package is in use. If the **type** field is set to **hotreload**, a release version is to be installed. **Solution** @@ -656,7 +674,7 @@ This error code is reported when the patch package fails to be enabled. **Possible Causes** -The patch package is in an incorect state. +The patch package is in an incorrect state. **Solution** @@ -706,7 +724,7 @@ Failed to unload the patch. **Description** -This error code is reported when when the Ark engine fails to uninstall the patch. +This error code is reported when the Ark engine fails to uninstall the patch. **Possible Causes** @@ -733,3 +751,21 @@ Common kernel errors such as memory application and multi-thread processing erro **Solution** Ensure sufficient sytem memory. + +## 18500009 Application Has a Quick Fix Task Being Processed + +**Error Message** + +The application has a apply quick fix task that is being processed. + +**Description** + +This error code is reported when the application has a quick fix task that is under processing. + +**Possible Causes** + +When you try to cancel a quick fix task for an application, the application has a quick repair task that is under processing. + +**Solution** + +Wait until the quick fix task is complete. diff --git a/en/application-dev/reference/errorcodes/errorcode-backgroundTaskMgr.md b/en/application-dev/reference/errorcodes/errorcode-backgroundTaskMgr.md index a92c890358492459fdf13ef213ac3a392628a5b7..d2bd2b2bab4cce2b073012354999b2d2d706c0dd 100644 --- a/en/application-dev/reference/errorcodes/errorcode-backgroundTaskMgr.md +++ b/en/application-dev/reference/errorcodes/errorcode-backgroundTaskMgr.md @@ -38,7 +38,7 @@ Try again later or restart the device. **Error Message** -IPC failed. +Inner transact failed. **Possible Causes** @@ -67,7 +67,7 @@ Try again later or restart the device. **Error Message** -Continuous task verification failed. +Background task verification failed. **Possible Causes** @@ -120,7 +120,7 @@ Task storage failed. **Error Message** -Caller information verification failed for a transient task. +Caller information verification failed. **Possible Causes** @@ -138,7 +138,7 @@ Caller information verification failed for a transient task. **Error Message** -Transient task verification failed. +Background task verification failed. **Possible Causes** @@ -157,7 +157,7 @@ Transient task verification failed. **Error Message** -Caller information verification failed when applying for efficiency resources. +Caller information verification failed. **Possible Causes** diff --git a/en/application-dev/reference/errorcodes/errorcode-media.md b/en/application-dev/reference/errorcodes/errorcode-media.md index 154e8bebb06101e414eed77a18042f5653d1691e..0a0c34817377a4df2808ac9dba79566c96e4d96e 100644 --- a/en/application-dev/reference/errorcodes/errorcode-media.md +++ b/en/application-dev/reference/errorcodes/errorcode-media.md @@ -1,4 +1,4 @@ -# Media Error Codes +# Media Error Codes > **NOTE** > @@ -27,7 +27,7 @@ Destroy this instance and re-create it. If the re-creation fails, stop related o **Error Message** -Operate not permit. +Operation not allowed. **Description** @@ -45,7 +45,7 @@ Switch the instance to the correct state and perform the operation. **Error Message** -IO error. +I/O error. **Description** @@ -63,7 +63,7 @@ Ensure that the network is normal, destroy this instance, and re-create it. If t **Error Message** -Time out. +Operation timeout. **Description** @@ -71,7 +71,7 @@ The operation timed out. **Possible Causes** -1. The network connection times out. +1. The network connection times out. (The default network timeout period is 15 seconds, and the timer starts after the buffered event is reported.) 2. Accessing other modules times out. **Solution** diff --git a/en/application-dev/reference/errorcodes/errorcode-multimodalinput.md b/en/application-dev/reference/errorcodes/errorcode-multimodalinput.md index 6933bfcf7075ca21cf7a63959f11059da061ff36..4c269a4a723459598a3f1117b820881619be648f 100644 --- a/en/application-dev/reference/errorcodes/errorcode-multimodalinput.md +++ b/en/application-dev/reference/errorcodes/errorcode-multimodalinput.md @@ -1,4 +1,4 @@ -# Screen Hopping Error Codes +# Screen Hopping Error Codes (To Be Deprecated) > **NOTE** > diff --git a/en/application-dev/reference/errorcodes/errorcode-workScheduler.md b/en/application-dev/reference/errorcodes/errorcode-workScheduler.md index 34e8a080061c3c7be0c0eb64c0c9bf617ff26d05..24b92da43813930c24a0215744f6130179f58074 100644 --- a/en/application-dev/reference/errorcodes/errorcode-workScheduler.md +++ b/en/application-dev/reference/errorcodes/errorcode-workScheduler.md @@ -53,7 +53,7 @@ Try again later or restart the device. **Error Message** -Checking workInfo failed. +Check workInfo failed. **Possible Causes** diff --git a/en/application-dev/reference/js-service-widget-ui/js-service-widget-common-gradient.md b/en/application-dev/reference/js-service-widget-ui/js-service-widget-common-gradient.md index fbfe2c4db91511503d37bba3ad2100a912aee020..2c338d915e21c6a66ba684824739914c86966ff8 100644 --- a/en/application-dev/reference/js-service-widget-ui/js-service-widget-common-gradient.md +++ b/en/application-dev/reference/js-service-widget-ui/js-service-widget-common-gradient.md @@ -33,54 +33,52 @@ background: repeating-linear-gradient(direction/angle, color, color, ...); The color can be specified in any of the following formats: \#ff0000, \#ffff0000, rgb(255, 0, 0), and rgba(255, 0, 0, 1). At least two colors must be specified. -- Parameters +**Parameters** - | Name | Type | Default Value | Mandatory | Description | - | --------- | ---------------------------------------- | ---------------------------- | ---- | ---------------------------------------- | - | direction | to <side-or-corner> <side-or-corner> = [left \| right] \|\| [top \| bottom] | to bottom (gradient from top to bottom)| No | Transition direction. For example, **to left** (gradient from right to left) or **to bottom right** (gradient from upper left corner to lower right corner).| - | angle | <deg> | 180deg | No | Transition direction, which is the angle between the gradient line and the y-axis (in the clockwise direction), with the geometric center of the element being the origin of coordinates and the horizontal axis being the x-axis.| - | color | <color> [<length>\|<percentage>] | - | Yes | Colors among which smooth transitions are rendered. | +| Name | Type | Default Value | Mandatory | Description | +| --------- | ---------------------------------------- | ---------------------------- | ---- | ---------------------------------------- | +| direction | to <side-or-corner> <side-or-corner> = [left \| right] \|\| [top \| bottom] | to bottom (gradient from top to bottom)| No | Transition direction. For example, **to left** (gradient from right to left) or **to bottom right** (gradient from upper left corner to lower right corner).| +| angle | <deg> | 180deg | No | Transition direction, which is the angle between the gradient line and the y-axis (in the clockwise direction), with the geometric center of the element being the origin of coordinates and the horizontal axis being the x-axis.| +| color | <color> [<length>\|<percentage>] | - | Yes | Colors among which smooth transitions are rendered. | -- Example +**Example** - 1. Gradient from top to bottom (default) +1. Gradient from top to bottom (default) - ```css - #gradient { - height: 300px; - width: 600px; - /* Gradient starts from red at the top to green at the bottom. */ - background: linear-gradient(red, #00ff00); - } - ``` + ```css + #gradient { + height: 300px; + width: 600px; + /* Gradient starts from red at the top to green at the bottom. */ + background: linear-gradient(red, #00ff00); + } + ``` - ![111](figures/111.PNG) + ![111](figures/111.PNG) - 2. Gradient at an angle of 45° +2. Gradient at an angle of 45° + ```css + /* Gradient at an angle of 45°, changing from red to green */ + background: linear-gradient(45deg, rgb(255, 0, 0),rgb(0, 255, 0)); + ``` - ```css - /* Gradient at an angle of 45°, changing from red to green */ - background: linear-gradient(45deg, rgb(255, 0, 0),rgb(0, 255, 0)); - ``` + ![222](figures/222.PNG) - ![222](figures/222.PNG) +3. Gradient from left to right - 3. Gradient from left to right + ```css + /* Gradient from left to right, which is available in the 270 px width between the left 90 px and the left 360 px (600*0.6) */ + background: linear-gradient(to right, rgb(255, 0, 0) 90px, rgb(0, 255, 0) 60%); + ``` - ```css - /* Gradient from left to right, which is available in the 270 px width between the left 90 px and the left 360 px (600*0.6) */ - background: linear-gradient(to right, rgb(255, 0, 0) 90px, rgb(0, 255, 0) 60%); - ``` + ![333](figures/333.PNG) +4. Repeating gradient - ![333](figures/333.PNG) + ```css + /* Repeating gradient from left to right, the area of which is 30 px (60 – 30) and the opacity is 0.5 */ + background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30vp,rgba(0, 0, 255, .5) 60vp); + ``` - 4. Repeating gradient - - ```css - /* Repeating gradient from left to right, the area of which is 30 px (60 – 30) and the opacity is 0.5 */ - background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30vp,rgba(0, 0, 255, .5) 60vp); - ``` - - ![444](figures/444.PNG) + ![444](figures/444.PNG) diff --git a/en/application-dev/reference/native-apis/_mind_spore.md b/en/application-dev/reference/native-apis/_mind_spore.md index 7e546e8f958341e55b9f59cd4123b274c78cc0f1..ded41297291a904a08793bd2cd94e2ab667a10a0 100644 --- a/en/application-dev/reference/native-apis/_mind_spore.md +++ b/en/application-dev/reference/native-apis/_mind_spore.md @@ -5,14 +5,6 @@ Provides APIs related to MindSpore Lite model inference. -Copyright 2021 Huawei Technologies Co., Ltd - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - -[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - \@Syscap SystemCapability.Ai.MindSpore **Since:** diff --git a/en/application-dev/reference/native-lib/Readme-EN.md b/en/application-dev/reference/native-lib/Readme-EN.md index e57d19d10689c860c3a0f5f5904986e9d7e40742..d0ac26033d50f5bf9b3a2f94bf90d141d6db86be 100644 --- a/en/application-dev/reference/native-lib/Readme-EN.md +++ b/en/application-dev/reference/native-lib/Readme-EN.md @@ -4,6 +4,7 @@ - [Native Standard Libraries Supported by Openharmony](third_party_libc/musl.md) - Appendix - [Native API Symbols Not Exported](third_party_libc/musl-peculiar-symbol.md) + - [Native API Symbols That May Fail to Be Invoked Due to Permission Control](third_party_libc/musl-permission-control-symbol.md) - [EGL Symbols Exported from Native APIs](third_party_opengl/egl-symbol.md) - [OpenGL ES 3.0 Symbols Exported from Native APIs](third_party_opengl/openglesv3-symbol.md) - [OpenSL ES Interfaces Supported by Native APIs](third_party_opensles/opensles.md) \ No newline at end of file diff --git a/en/application-dev/reference/syscap-list.md b/en/application-dev/reference/syscap-list.md index 13f565e43ee3cbdc19d843a3385ffb84e91b05de..f550259f41ac46bd6841083f87c412ba4e6c9a0f 100644 --- a/en/application-dev/reference/syscap-list.md +++ b/en/application-dev/reference/syscap-list.md @@ -295,6 +295,14 @@ Input device management | ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | | Yes | No | No | Yes | Yes | Yes | No | No | +## SystemCapability.MultimodalInput.Input.RemoteInputDevice + +Remote input device + +| Default | Sports Watch| Smart Watch| Tablet| Head Unit| Smart TV| Smart Vision | Router | +| ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | +| Yes | No | No | Yes | Yes | Yes | No | No | + ## SystemCapability.MultimodalInput.Input.InputMonitor Input event listener @@ -319,6 +327,14 @@ Input event simulator | ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | | Yes | No | No | Yes | Yes | Yes | No | No | +## SystemCapability.MultimodalInput.Input.InputFilter + +Input filter + +| Default | Sports Watch| Smart Watch| Tablet| Head Unit| Smart TV| Smart Vision | Router | +| ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | +| Yes | No | No | Yes | Yes | Yes | No | No | + ## SystemCapability.PowerManager.BatteryManager.Extension Battery manager extension capability @@ -1333,7 +1349,7 @@ Webview component | Default | Sports Watch| Smart Watch| Tablet| Head Unit| Smart TV| Smart Vision | Router | | ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | -| Yes | No | Yes | Yes | Yes | Yes | No | No | +| Yes | No | No | Yes | Yes | No | No | No | ## SystemCapability.Cloud.AAID @@ -1623,9 +1639,9 @@ Quick fix | ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | | Yes | No | Yes | Yes | Yes | Yes | No | No | -## SystemCapability.MultimodalInput.Input.Pointer +## SystemCapability.MultimodalInput.Input.ShortKey -Pointer input enhancement +Shortcut keys | Default | Sports Watch| Smart Watch| Tablet| Head Unit| Smart TV| Smart Vision | Router | | ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | @@ -1654,3 +1670,11 @@ General type | Default | Sports Watch| Smart Watch| Tablet| Head Unit| Smart TV| Smart Vision | Router | | ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | + +## SystemCapability.Msdp.DeviceStatus.Cooperate + +Device status awareness + +| Default | Sports Watch| Smart Watch| Tablet| Head Unit| Smart TV| Smart Vision | Router | +| ------- | ------ | ------ | ---- | ---- | ------ | ------------ | ------ | +| Yes | No | No | Yes | No | No | No | No | diff --git a/en/application-dev/security/permission-list.md b/en/application-dev/security/permission-list.md index f598c23376424ab5dbcb99e99691584ce444dc7d..4fb1f38e88257a8e2dc9ad8e4a64da851a9d20b6 100644 --- a/en/application-dev/security/permission-list.md +++ b/en/application-dev/security/permission-list.md @@ -26,7 +26,7 @@ Allows an application to configure Bluetooth on a device, initiate or cancel a s ## ohos.permission.MANAGE_BLUETOOTH -Allows an application to pair with a Bluetooth device and access the contacts or messages of the device. +Allows an application to pair with a Bluetooth device and access the Contacts or messages of the device. **Permission level**: system_basic @@ -994,6 +994,16 @@ Allows the device administrator application to set application running policies. **Enable via ACL**: TRUE +## ohos.permission.ENTERPRISE_SET_SCREENOFF_TIME + +Allows the device administrator application to set the screen off time. + +**Permission level**: system_basic + +**Authorization mode**: system_grant + +**Enable via ACL**: TRUE + ## ohos.permission.NFC_TAG Allows an application to read NFC tag information. @@ -1076,7 +1086,7 @@ Allows an application to read cell broadcast messages received by the device. ## ohos.permission.READ_CONTACTS -Allows an application to read contacts. +Allows an application to read the Contacts. **Permission level**: system_basic @@ -1506,7 +1516,7 @@ Allows an application to install, uninstall, enable, and disable certificates an **Authorization mode**: system_grant -**Enable ACL**: FALSE +**Enable via ACL**: TRUE ## ohos.permission.ACCESS_CERT_MANAGER @@ -1877,3 +1887,33 @@ Allows an application to modify HiView data. **Authorization mode**: system_grant **Enable via ACL**: TRUE + +## ohos.permission.ACCESS_CAST_ENGINE_MIRROR + +Allows an application to use the mirror projection capability. + +**Permission level**: system_basic + +**Authorization mode**: system_grant + +**Enable via ACL**: TRUE + +## ohos.permission.ACCESS_CAST_ENGINE_STREAM + +Allows an application to invoke the local or online media resource projection capability. + +**Permission level**: system_basic + +**Authorization mode**: system_grant + +**Enable via ACL**: TRUE + +## ohos.permission.CLOUDDATA_CONFIG + +Allows an application to obtain the device-cloud information of the configuration database. + +**Permission level**: system_basic + +**Authorization mode**: system_grant + +**Enable via ACL**: TRUE diff --git a/en/application-dev/task-management/transient-task-dev-guide.md b/en/application-dev/task-management/transient-task-dev-guide.md index a83ba2094138e2271f55758484f483a9a7ddbaed..cb540210efac85a45f709b878b6b85dcf9024084 100644 --- a/en/application-dev/task-management/transient-task-dev-guide.md +++ b/en/application-dev/task-management/transient-task-dev-guide.md @@ -6,7 +6,7 @@ By default, an application can run for a period of 6 to 12 seconds after it swit You are advised not to call the [requestSuspendDelay()](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#backgroundtaskmanagerrequestsuspenddelay) method to apply for delayed suspension after the application is running in the background. Instead, you need to call this interface to declare the execution time of the extended application to the system before performing any time-consuming operation. It is recommended that an application calls [requestSuspendDelay()](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#backgroundtaskmanagerrequestsuspenddelay) when it is running in the foreground, so as not to affect the transient task quota of the application. -An application can obtain the remaining duration before being suspended by calling [getRemainingDelayTime()](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#backgroundtaskmanagergetremainingdelaytimecallback). Each application has a daily time quota for transient tasks. Therefore, after the time-consuming task finishes execution, the application should call [cancelSuspendDelay()](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#backgroundtaskmanagercancelsuspenddelay) to cancel the transient task in a timely manner. +An application can obtain the remaining duration before being suspended by calling [getRemainingDelayTime()](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#backgroundtaskmanagergetremainingdelaytime). Each application has a daily time quota for transient tasks. Therefore, after the time-consuming task finishes execution, the application should call [cancelSuspendDelay()](../reference/apis/js-apis-resourceschedule-backgroundTaskManager.md#backgroundtaskmanagercancelsuspenddelay) to cancel the transient task in a timely manner. Typical time-consuming tasks include saving status data to the local database, opening and processing a large file, and synchronizing data to the cloud server. diff --git a/en/application-dev/telephony/telephony-sms.md b/en/application-dev/telephony/telephony-sms.md index 714d2f182b9e5452065db19f171b5dc45e522f73..400f06ac804cbbcf5875cdca518dec3cf978cc2a 100644 --- a/en/application-dev/telephony/telephony-sms.md +++ b/en/application-dev/telephony/telephony-sms.md @@ -31,11 +31,11 @@ The Short Messaging Service (SMS) module provides basic SMS management functions | Name | Description | | ------------------------------------------------------------ | ------------------------------------------------------- | -| createMessage(pdu: Array, specification: string, callback: AsyncCallback): void | Creates an SMS message instance based on the PDU and the specified SMS protocol.| +| createMessage(pdu: Array, specification: string, callback: AsyncCallback\): void | Creates an SMS message instance based on the PDU and the specified SMS protocol.| | sendMessage(options: SendMessageOptions): void | Sends text or data SMS messages. | -| getDefaultSmsSlotId(callback: AsyncCallback): void | Obtains the ID of the default SIM card used to send SMS messages. | -| setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback): void | Sets the SMSC address based on the specified slot ID. | -| getSmscAddr(slotId: number, callback: AsyncCallback): void | Obtains the SMSC address based on the specified slot ID. | +| getDefaultSmsSlotId(callback: AsyncCallback\): void | Obtains the ID of the default SIM card used to send SMS messages. | +| setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback\): void | Sets the SMSC address based on the specified slot ID. | +| getSmscAddr(slotId: number, callback: AsyncCallback\): void | Obtains the SMSC address based on the specified slot ID. | ## How to Develop diff --git a/en/application-dev/ui/arkts-common-components-xcomponent.md b/en/application-dev/ui/arkts-common-components-xcomponent.md new file mode 100644 index 0000000000000000000000000000000000000000..b6bdb5633f2275fda550f7ae2c6c7f75ed420d0f --- /dev/null +++ b/en/application-dev/ui/arkts-common-components-xcomponent.md @@ -0,0 +1,302 @@ +# XComponent + + +As a drawing component, the \<[XComponent](../reference/arkui-ts/ts-basic-components-xcomponent.md)> is usually used to meet relatively complex drawing customization requirements, for example, display of a camera preview stream and drawing of a game image. + + +You can specify the **type** parameter to implement different features. Two options are mainly available for this parameter: **surface** and **component**. + + +With the **\** of the **surface** type, you can pass data to the surface independently owned by it to render the image. + + +With the **\** of the **component** type, you can dynamically load the displayed content. + + +## surface Type + +When the **\** is set to the **surface** type, you can write EGL/OpenGL ES and media data and display it on the **\**. + +You can also have the **\** laid out and rendered together with other components. + +The **\** has an independent surface, which provides a native window for you to create the EGL/OpenGL ES environment on the native (C/C++) side and use the standard OpenGL ES for development. + +In addition, media-related applications (such as videos and cameras) can write data to the surface provided by the **\** to present the corresponding image. + + +## Using EGL/OpenGL ES for Rendering + + +### Key Points of Native Code Development + +OpenHarmony applications use native APIs to implement interactions between JS and C/C++ code. This is also the case with the **\**. For details, see [Using N-APIs in Application Projects](../napi/napi-guidelines.md). + +The type of the file for processing the JS logic on the native side is .so. + +- Each module has a .so file. + +- The .so file is named in the format of lib{moduleName}.so. + + +In the scenario where the **\** is used for standard OpenGL ES development, the content of the **CMAKELists.txt** file is as follows: + + + +``` +cmake_minimum_required(VERSION 3.4.1) +project(XComponent) # Project name + +set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +# Path for searching for header files +include_directories(${NATIVERENDER_ROOT_PATH} + ${NATIVERENDER_ROOT_PATH}/include + ) + +# Compile the target .so file. SHARED indicates the dynamic library. +add_library(nativerender SHARED + xxx.cpp + ) + +# Search for related libraries (including OpenGL ES libraries and NDK APIs provided by the ). +find_library( EGL-lib + EGL ) + +find_library( GLES-lib + GLESv3 ) + +find_library( libace-lib + ace_ndk.z ) + +# Dependencies required for compiling .so files +target_link_libraries(nativerender PUBLIC ${EGL-lib} ${GLES-lib} ${libace-lib} libace_napi.z.so libc++.a) +``` + + +### Registering the N-API Module + + +```c++ +static napi_value Init(napi_env env, napi_value exports) +{ + // Define the API exposed on the module. + napi_property_descriptor desc[] ={ + DECLARE_NAPI_FUNCTION("changeColor", PluginRender::NapiChangeColor), + }; + // You can mount the native method (PluginRender::NapiChangeColor) to exports through this API. exports is bound to a JS object at the JS layer through the JS engine. + NAPI_CALL(env, napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc)); + return exports; +} + +static napi_module nativerenderModule = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = Init, // Specify the callback for when the corresponding module is loaded. + .nm_modname = "nativerender", // Specify the module name. For -related development, the name must be the same as the value of libraryname in the on ArkTS. + .nm_priv = ((void*)0), + .reserved = { 0 }, +}; + +extern "C" __attribute__((constructor)) void RegisterModule(void) +{ + // Register the SO module. + napi_module_register(&nativerenderModule);c +} +``` + + +### Parsing the NativeXComponent Instance + +**NativeXComponent** provides an instance at the native layer for the **\**, which can be used as a bridge for binding with the **\** at the JS layer. The NDK APIs provided by the **\** depend on this instance. For details about the NDK APIs, see [Native XComponent](../reference/native-apis/_o_h___native_x_component.md). + + +The **NativeXComponent** instance can be obtained by parsing the callback (that is, the **Init** function in [NAPI module registration](#registering-the-n-api-module)) when the module is loaded. + + + +```c++ +{ + // ... + napi_status status; + napi_value exportInstance = nullptr; + OH_NativeXComponent *nativeXComponent = nullptr; + // Parse the attribute of the wrapped NativeXComponent pointer. + status = napi_get_named_property(env, exports, OH_NATIVE_XCOMPONENT_OBJ, &exportInstance); + if (status != napi_ok) { + return false; + } + // Use the napi_unwrap API to parse the NativeXComponent instance pointer. + status = napi_unwrap(env, exportInstance, reinterpret_cast(&nativeXComponent)); + // ... +} +``` + + +### Registering XComponent Callback + +Based on the NativeXComponent pointer obtained by [parsing the NativeXComponent instance](#parsing-the-nativexcomponent-instance), perform callback registration through the **OH_NativeXComponent_RegisterCallback** API. + + + +```c++ +{ + ... + OH_NativeXComponent *nativeXComponent = nullptr; + // Parse the NativeXComponent instance. + + OH_NativeXComponent_Callback callback; + callback->OnSurfaceCreated = OnSurfaceCreatedCB; // Invoked when a surface is successfully created. You can obtain the handle to the native window from this event. + callback->OnSurfaceChanged = OnSurfaceChangedCB; // Invoked when the surface changes. You can obtain the native window handle and XComponent change information from this event. + callback->OnSurfaceDestroyed = OnSurfaceDestroyedCB; // Invoked when the surface is destroyed. You can release resources in this event. + callback->DispatchTouchEvent = DispatchTouchEventCB; // Invoked when a touch event occurs. You can obtain the touch event information from this event. + + OH_NativeXComponent_RegisterCallback(nativeXComponent, callback); + ... +} +``` + + +### Creating the EGL/OpenGL ES Environment + +In the registered **OnSurfaceCreated** callback, you can obtain the handle to the native window (which is essentially the surface independently owned by the **\**). Therefore, you can create the EGL/OpenGL ES environment for your application to start the development of the rendering logic. + + +```c++ +EGLCore* eglCore_; // EGLCore is a class that encapsulates OpenGL-related APIs. +uint64_t width_; +uint64_t height_; +void OnSurfaceCreatedCB(OH_NativeXComponent* component, void* window) +{ + int32_t ret = OH_NativeXComponent_GetXComponentSize(component, window, &width_, &height_); + if (ret === OH_NATIVEXCOMPONENT_RESULT_SUCCESS) { + eglCore_->GLContextInit(window, width_, height_); // Initialize the OpenGL environment. + } +} +``` + + +### ArkTS Syntax + +You can use the **\** to develop EGL/OpenGL ES rendering by using the following code on the ArkTS side: + + +```ts +XComponent({ id: 'xcomponentId1', type: 'surface', libraryname: 'nativerender' }) + .onLoad((context) => {}) + .onDestroy(() => {}) +``` + +- **id**: corresponds to an **\** and must be unique. Generally, you can use the **OH_NativeXComponent_GetXComponentId** API on the native side to obtain the corresponding ID and bind the corresponding **\**. + +- **libraryname**: name of the loaded module, which must be the same as the value of **nm_modname** used when the Napi module is registered on the native side. + + > **NOTE** + > + > An application loads modules to implement cross-language invoking in either of the following modes: + > + > 1. Use the **import** mode of the NAPI. + > + > ```ts + > import nativerender from "libnativerender.so" + > ``` + > + > 2. Use the **\**. + > + > While this mode also uses the NAPI mechanism as the **import** mode, it enables you to use the NDK APIs of the **\**, by having the **NativeXComponent** instance of the **\** exposed to the native layer of the application when the dynamic library is loaded. + +- **onLoad** event + - Trigger time: when the surface of the **\** is prepared. + - **context** parameter: where the native API exposed on the module is mounted. Its usage is similar to the usage of the **context2** instance obtained after the module is directly loaded using **import context2 from "libnativerender.so"**. + - Time sequence: When the **onLoad** event is subject to the surface. The following figure shows the time sequence of the **onLoad** event and the **OnSurfaceCreated** event on the native side. + + ![onLoad](figures/onLoad.png) + +- **onDestroy** event + + Trigger time: when the **\** is destroyed, in the same manner as that when an ArkUI component is destroyed. The following figure shows the time sequence of the **onDestroy** event and the **OnSurfaceDestroyed** event on the native side. + + ![onDestroy](figures/onDestroy.png) + + +### Writing Media Data + +The surface held by the **\** complies with the producer-consumer model. + +In OpenHarmony, components that comply with the producer design, such as the camera and video player, can write data to the surface held by the **\** and display the data through the **\**. + +![picture-1](figures/picture-1.png) + +You can bind the **\** to the **XComponentController** to obtain the surface ID (**surfaceId**, which uniquely identifies a surface) and send it to the corresponding component API. + + +```ts +@State surfaceId:string = ""; +mXComponentController: XComponentController = new XComponentController(); +XComponent({ id: '', type: 'surface', controller: this.mXComponentController }) + .onLoad(() => { + this.surfaceId = this.mXComponentController.getXComponentSurfaceId() + }) +``` + +For details about component APIs, see [AVPlayer](../reference/apis/js-apis-media.md#avplayer9) and [Camera](../reference/apis/js-apis-camera.md). + + +### component Type + +When the **\** is set to the **component** type, you can execute non-UI logic to dynamically load the displayed content. + + +>**NOTE** +> +> When **type** is set to **component**, the **\** functions as a container, where child components are laid out vertically. +> +> - Vertical alignment: [FlexAlign](../reference/arkui-ts/ts-appendix-enums.md#flexalign).Start +> +> - Horizontal alignment: [FlexAlign](../reference/arkui-ts/ts-appendix-enums.md#flexalign).Center +> +> The component does not respond to any events. +> +> Layout changes and event responses can be set by mounting child components. +> +> The non-UI logic written internally needs to be encapsulated in one or more functions. + + +### Example Scenario + + +```ts +@Builder +function addText(label: string): void { + Text(label) + .fontSize(40) +} + +@Entry +@Component +struct Index { + @State message: string = 'Hello XComponent' + @State messageCommon: string = 'Hello World' + build() { + Row() { + Column() { + XComponent({ id: 'xcomponentId-container', type: 'component' }) { + addText(this.message) + Divider() + .margin(4) + .strokeWidth(2) + .color('#F1F3F5') + .width("80%") + Column() { + Text(this.messageCommon) + .fontSize(30) + } + } + } + .width('100%') + } + .height('100%') + } +} +``` + +![en-us_image_0000001511900428](figures/en-us_image_0000001511900428.png) diff --git a/en/application-dev/ui/arkts-drawing-customization-on-canvas.md b/en/application-dev/ui/arkts-drawing-customization-on-canvas.md new file mode 100644 index 0000000000000000000000000000000000000000..7e0e1f79da9c0f26c210a939a54586a09f083832 --- /dev/null +++ b/en/application-dev/ui/arkts-drawing-customization-on-canvas.md @@ -0,0 +1,348 @@ +# Drawing Custom Graphics Using the Canvas + + +**Canvas** provides a canvas component for drawing custom graphics. You can use the **CanvasRenderingContext2D** and **OffscreenCanvasRenderingContext2D** objects to draw graphics on the **Canvas** component. The drawing objects can be basic shapes, text, and images. + + +## Drawing Custom Graphics on the Canvas + +You can draw custom graphics on the canvas in any of the following ways: + + +- Use [CanvasRenderingContext2D](../reference/arkui-ts/ts-canvasrenderingcontext2d.md). + + ```ts + @Entry + @Component + struct CanvasExample1 { + // Configure the parameters of the CanvasRenderingContext2D object, including whether to enable anti-aliasing. The value true indicates that anti-aliasing is enabled. + private settings: RenderingContextSettings = new RenderingContextSettings(true) + // Create a CanvasRenderingContext2D object by calling CanvasRenderingContext2D object in Canvas. + private context: CanvasRenderingContext2D= new CanvasRenderingContext2D(this.settings) + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + // Invoke the CanvasRenderingContext2D object in Canvas. + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // You can draw content here. + this.context.strokeRect(50, 50, 200, 150); + }) + } + .width('100%') + .height('100%') + } + } + + ``` + + ![2023022793003(1)](figures/2023022793003(1).jpg) + +- Drawing offscreen onto a canvas is a process where content to draw onto the canvas is first drawn in the buffer, and then converted into a picture, and finally the picture is drawn on the canvas. This process increases the drawing efficiency. Specifically, the implementation is as follows: + 1. Use the **transferToImageBitmap** API to create an **ImageBitmap** object for the image that is recently rendered off the screen canvas. + 2. Use the **transferFromImageBitmap** API of the **CanvasRenderingContext2D** object to display the created **ImageBitmap** object. + + For details, see [OffscreenCanvasRenderingContext2D](../reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md). + + ```ts + @Entry + @Component + struct CanvasExample2 { + // Configure the parameters of the CanvasRenderingContext2D and OffscreenCanvasRenderingContext2D objects, including whether to enable anti-aliasing. The value true indicates that anti-aliasing is enabled. + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + // Create an OffscreenCanvasRenderingContext2D object. width indicates the width of the offscreen canvas, and height indicates the height of the offscreen canvas. + private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings) + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // You can draw content here. + this.offContext.strokeRect(50, 50, 200, 150); + // Display the image rendered by the offscreen drawing value on the common canvas. + let image = this.offContext.transferToImageBitmap(); + this.context.transferFromImageBitmap(image); + }) + } + .width('100%') + .height('100%') + } + } + + ``` + + ![2023022793003(1)](figures/2023022793003(1).jpg) + + >**NOTE** + > + >The APIs called for drawing on the canvas through the **CanvasRenderingContext2D** and **OffscreenCanvasRenderingContext2D** objects are the same. Unless otherwise specified, the value unit of the parameters in these APIs is vp. + +- Before loading the Lottie animation on the canvas, download the Lottie as follows: + + ```ts + import lottie from '@ohos/lottie' + ``` + + For details about the APIs, see [Lottie](../reference/arkui-ts/ts-components-canvas-lottie.md). + + >**NOTE** + > + >Before using Lottie for the first time, run the **ohpm install \@ohos/lottieETS** command in the Terminal window to download Lottie. + + +## Initializing the Canvas Component + +**onReady(event: () => void)** is the event callback when the **Canvas** component initialization is complete. After this event is called, the determined width and height of the **Canvas** component can be obtained. The **CanvasRenderingContext2D** and **OffscreenCanvasRenderingContext2D** objects can then be used to call related APIs to draw graphics. + +```ts +Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() => { + this.context.fillStyle = '#0097D4'; + this.context.fillRect(50, 50, 100, 100); + }) + +``` + +![2023022793350(1)](figures/2023022793350(1).jpg) + + +## Canvas Component Drawing Modes + +Two modes are available for drawing with the **Canvas** component: + +- After the **onReady()** callback of the **Canvas** component is invoked, use the **CanvasRenderingContext2D** and **OffscreenCanvasRenderingContext2D** objects to call related APIs for drawing. + + ```ts + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + this.context.beginPath(); + this.context.moveTo(50, 50); + this.context.lineTo(280, 160); + this.context.stroke(); + }) + ``` + + ![2023022793719(1)](figures/2023022793719(1).jpg) + +- Define an individual **path2d** object to build an ideal path, and then call the **stroke** or **fill** API of the **CanvasRenderingContext2D** and **OffscreenCanvasRenderingContext2D** objects to draw the path. For details, see [Path2D](../reference/arkui-ts/ts-components-canvas-path2d.md). + + ```ts + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + let region = new Path2D(); + region.arc(100, 75, 50, 0, 6.28); + this.context.stroke(region); + }) + ``` + + ![2023022794031(1)](figures/2023022794031(1).jpg) + + +## Common Usage of the Canvas Component + +**OffscreenCanvasRenderingContext2D** and **CanvasRenderingContext2D** provide a large number of attributes and methods, which can be used to draw text and graphics and process pixels. They are the core of the **Canvas** component. Common APIs include [fill](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#fill), [clip](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#clip), and [stroke](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#stroke). In addition, [fillStyle](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#fillstyle), [globalAlpha](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#globalalpha), [strokeStyle](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#strokestyle), and more attributes are provided to spruce up the graphics. This topic describes typical usage of the canvas. + +- Draw a basic shape. + + +You can draw a basic shape by calling APIs such as [arc](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#arc), [ellipse](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#ellipse), and [rect](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#rect). + + ```ts + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // Draw a rectangle. + this.context.beginPath(); + this.context.rect(100, 50, 100, 100); + this.context.stroke(); + // Draw a circle on the canvas. + this.context.beginPath(); + this.context.arc(150, 250, 50, 0, 6.28); + this.context.stroke(); + // Draw an oval on the canvas. + this.context.beginPath(); + this.context.ellipse(150, 450, 50, 100, Math.PI * 0.25, Math.PI * 0, Math.PI * 2); + this.context.stroke(); + }) + + ``` + +![2023022794521(1)](figures/2023022794521(1).jpg) + +- Draw text. + + You can use APIs such as [fillText](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#filltext) and [strokeText](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#stroketext) to draw text. + + ```ts + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // Draw filled text on the canvas. + this.context.font = '50px sans-serif'; + this.context.fillText("Hello World!", 50, 100); + // Draw a text stroke on the canvas. + this.context.font = '55px sans-serif'; + this.context.strokeText("Hello World!", 50, 150); + }) + ``` + + ![2023022795105(1)](figures/2023022795105(1).jpg) + +- Draw images and processes image pixel information. + + You can draw an image by calling APIs such as [drawImage](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#drawimage) and [putImageData](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#putimagedata). You can also process image pixel information by calling APIs such as [createImageData](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#createimagedata), [getPixelMap](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#getpixelmap), and [getImageData](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#getimagedata). + + ```ts + @Entry + @Component + struct GetImageData { + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + private offContext: OffscreenCanvasRenderingContext2D = new OffscreenCanvasRenderingContext2D(600, 600, this.settings) + private img:ImageBitmap = new ImageBitmap("/common/images/1234.png") + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // Use the drawImage API to draw an image in the area with the width and height of 130 starting from (0, 0). + this.offContext.drawImage(this.img,0,0,130,130); + // Use the getImageData API to obtain the image data with the width and height of 130 starting from (50, 50). + let imagedata = this.offContext.getImageData(50,50,130,130); + // Use the putImageData API to draw the obtained image data in the area starting from (150, 150). + this.offContext.putImageData(imagedata,150,150); + // Draw the offscreen drawing content to the canvas. + let image = this.offContext.transferToImageBitmap(); + this.context.transferFromImageBitmap(image); + }) + } + .width('100%') + .height('100%') + } + } + ``` + + ![drawimage](figures/drawimage.PNG) + +- Other usage + + **Canvas** also provides other usage. For example, regarding [CanvasGradient](../reference/arkui-ts/ts-components-canvas-canvasgradient.md), you can create a linear gradient with [createLinearGradient](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#createlineargradient) or create a radial gradient with [createRadialGradient](../reference/arkui-ts/ts-canvasrenderingcontext2d.md#createradialgradient), among others. + + ```ts + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // Create a CanvasGradient object with radial gradient colors. + let grad = this.context.createRadialGradient(200,200,50, 200,200,200) + // Set the gradient color stop for the CanvasGradient object, including the offset and colors. + grad.addColorStop(0.0, '#E87361'); + grad.addColorStop(0.5, '#FFFFF0'); + grad.addColorStop(1.0, '#BDDB69'); + // Fill the rectangle with the CanvasGradient object. + this.context.fillStyle = grad; + this.context.fillRect(0, 0, 400, 400); + }) + ``` + + ![2023022700701(1)](figures/2023022700701(1).jpg) + + +## Example Scenario + +- Draw a basic shape. + + ```ts + @Entry + @Component + struct ClearRect { + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // Set the fill color to blue. + this.context.fillStyle = '#0097D4'; + // Take (50, 50) as the upper left corner and draw a rectangle with the width and height of 200. + this.context.fillRect(50,50,200,200); + // Use (70, 70) as the upper left corner and clear the area with the width of 150 and height of 100. + this.context.clearRect(70,70,150,100); + }) + } + .width('100%') + .height('100%') + } + } + + ``` + + ![2023022701120(1)](figures/2023022701120(1).jpg) + +- Draw an irregular shape. + + ```ts + @Entry + @Component + struct Path2d { + private settings: RenderingContextSettings = new RenderingContextSettings(true); + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings); + + build() { + Row() { + Column() { + Canvas(this.context) + .width('100%') + .height('100%') + .backgroundColor('#F5DC62') + .onReady(() =>{ + // Use the Path2D API to create a pentagon. + let path = new Path2D(); + path.moveTo(150, 50); + path.lineTo(50, 150); + path.lineTo(100, 250); + path.lineTo(200, 250); + path.lineTo(250, 150); + path.closePath(); + // Set the fill color to blue. + this.context.fillStyle = '#0097D4'; + // Draw the pentagon described by Path2D in the canvas in fill mode. + this.context.fill(path); + }) + } + .width('100%') + } + .height('100%') + } + } + ``` + + ![2023032422159](figures/2023032422159.jpg) + diff --git a/en/application-dev/ui/arkts-graphics-display.md b/en/application-dev/ui/arkts-graphics-display.md index df77d7661115f10ac59cb348933208df50896c40..38cf2605333d884701952b0bebce21e09d2c3d06 100644 --- a/en/application-dev/ui/arkts-graphics-display.md +++ b/en/application-dev/ui/arkts-graphics-display.md @@ -117,7 +117,7 @@ Data sources of the archived type can be classified into local resources, online } } ``` - 2. Check the format of the URL obtained from the media library is as follows: + 2. Check the format of the URL obtained from the media library: ​ ```ts Image('file://media/5') diff --git a/en/application-dev/ui/arkts-layout-update-animation.md b/en/application-dev/ui/arkts-layout-update-animation.md new file mode 100644 index 0000000000000000000000000000000000000000..d5110e2eac29cd3dfe6b235479b75969cf541d54 --- /dev/null +++ b/en/application-dev/ui/arkts-layout-update-animation.md @@ -0,0 +1,270 @@ +# Layout Update Animation + + +[Explicit animation](../reference/arkui-ts/ts-explicit-animation.md) (**animateTo**) and [attribute animation](../reference/arkui-ts/ts-animatorproperty.md) (**animation**) are the most basic and common animation features provided by ArkUI. When the layout attributes (such as the [size](../reference/arkui-ts/ts-universal-attributes-size.md) and [position](../reference/arkui-ts/ts-universal-attributes-location.md)) attributes change, you can use the attribute animation or explicit animation to transit to the new layout parameter status based on the animation parameters. + + +| Animation Type| Description | +| ---- | ---------------------------------------- | +| Explicit animation| Triggered by changes in a closure, including component addition and deletion caused by data changes and component attribute changes.| Complex animation scenarios| +| Attribute animation| Triggered when the attribute changes. The animation setting is simple. | + + +## Using Explicit Animation to Create Layout Update Animation + +The API for explicit animation is as follows: + + +```ts +animateTo(value: AnimateParam, event: () => void): void +``` + +The first parameter specifies the animation parameter, and the second parameter is the closure function of the animation. + +The following is an example of using explicit animation to create a layout update animation. In the example, when the **\** component's **alignItems** attribute is updated, the layout of its child components changes. As long as the attribute is updated in the closure function of **animateTo**, animation is performed as configured through **animateTo** for all changes caused by the attribute toward the end value. + + +```ts +@Entry +@Component +struct LayoutChange { + // Used to control the alignItems attribute of a column. + @State itemAlign: HorizontalAlign = HorizontalAlign.Start; + allAlign: HorizontalAlign[] = [HorizontalAlign.Start, HorizontalAlign.Center, HorizontalAlign.End]; + alignIndex: number = 0; + + build() { + Column() { + Column({ space: 10 }) { + Button("1").width(100).height(50) + Button("2").width(100).height(50) + Button("3").width(100).height(50) + } + .margin(20) + .alignItems(this.itemAlign) + .borderWidth(2) + .width("90%") + .height(200) + + Button("click").onClick(() => { + // The animation duration is 1000 ms, and the curve is EaseInOut. + animateTo({ duration: 1000, curve: Curve.EaseInOut }, () => { + this.alignIndex = (this.alignIndex + 1) % this.allAlign.length; + // Modify the this.itemAlign parameter in the closure function to change the layout of child elements in the container. The animation for transition to the new position is applied. + this.itemAlign = this.allAlign[this.alignIndex]; + }); + }) + } + .width("100%") + .height("100%") + } +} +``` + + +![layoutChange1](figures/layoutChange1.gif) + + +In addition to directly changing the layout, you can also change the width, height, and position of a component. + + + +```ts +@Entry +@Component +struct LayoutChange2 { + @State myWidth: number = 100; + @State myHeight: number = 50; + // Flag. true and false correspond to a group of myWidth and myHeight values, respectively. + @State flag: boolean = false; + + build() { + Column({ space: 10 }) { + Button("text") + .type(ButtonType.Normal) + .width(this.myWidth) + .height(this.myHeight) + .margin(20) + Button("area: click me") + .fontSize(12) + .margin(20) + .onClick(() => { + animateTo({ duration: 1000, curve: Curve.Ease }, () => { + // In the animation closure, the state variables that control the width and height of the first button are changed based on the flag settings so that the width and height of the first button are animated. + if (this.flag) { + this.myWidth = 100; + this.myHeight = 50; + } else { + this.myWidth = 200; + this.myHeight = 100; + } + this.flag = !this.flag; + }); + }) + } + .width("100%") + .height("100%") + } +} +``` + + +In the click event of the second button, the **animateTo** API is used to modify the **this.myWidth** and **this.myHeight** state variables in the closure. As these two state variables set the width and height of the first button, the width and height animation is performed for the first button. The display effect is shown below. + + +![layoutChange2_animateTo](figures/layoutChange2_animateTo.gif) + + +At the same time, the second button also produces a position animation. After the width and height of the first button are changed, the layout of other components in the column is also changed, and the second button is among those other components. + + +If you do not want the second button to have an animation effect, you can use either of the following methods: 1. Add a container outside the first button so that the sizes before and after the animation are within the range of the container. In this way, the position of the second button is not affected by the position of the first button. The key code is as follows: + + + +```ts +Column({ space: 10 }) { + Column() { + // The button is placed in a container that is large enough so that it does not affect the position of the outer component. + Button("text") + .type(ButtonType.Normal) + .width(this.myWidth) + .height(this.myHeight) + } + .margin(20) + .width(200) + .height(100) + + Button("area: click me") + .fontSize(12) + .onClick(() => { + animateTo({ duration: 1000, curve: Curve.Ease }, () => { + // In the animation closure, the state variables that control the width and height of the first button are changed based on the flag settings so that the width and height of the first button are animated. + if (this.flag) { + this.myWidth = 100; + this.myHeight = 50; + } else { + this.myWidth = 200; + this.myHeight = 100; + } + this.flag = !this.flag; + }); + }) +} +.width("100%") +.height("100%") +``` + + +![layoutChange2_animateTo_change](figures/layoutChange2_animateTo_change.gif) + + +2. Add layout constraints to the second button. For example, add position constraints so that the position of the second button is not affected by the width and height of the first button. The sample code is as follows: + + + +```ts +Column({ space: 10 }) { + Button("text") + .type(ButtonType.Normal) + .width(this.myWidth) + .height(this.myHeight) + .margin(20) + + Button("area: click me") + .fontSize(12) + // Set the position attribute to a fixed value so that the position of the second button is not affected by the width and height of the first button. + .position({ x: "30%", y: 200 }) + .onClick(() => { + animateTo({ duration: 1000, curve: Curve.Ease }, () => { + // In the animation closure, the state variables that control the width and height of the first button are changed based on the flag settings so that the width and height of the first button are animated. + if (this.flag) { + this.myWidth = 100; + this.myHeight = 50; + } else { + this.myWidth = 200; + this.myHeight = 100; + } + this.flag = !this.flag; + }); + }) +} +.width("100%") +.height("100%") +``` + + +## Using Attribute Animation to Generate Layout Update Animation + +Unlike explicit animation, which requires the attribute changes for triggering animation to be placed in the closure function, attribute animation does not need to use the closure. You only need to append the **animation** attribute to the target component attribute. + +The API of the attribute animation is as follows: + + +```ts +animation(value: AnimateParam) +``` + +This API accepts an animation parameter as its argument. If you want the component to generate an animation with the value change of an attribute, add this attribute before the **animation** attribute. Otherwise, you can place the attribute after the **animation** attribute. The previous example of explicit animation can be easily implemented with attribute animation. The sample code is as follows: + + + +```ts +@Entry +@Component +struct LayoutChange2 { + @State myWidth: number = 100; + @State myHeight: number = 50; + @State flag: boolean = false; + @State myColor: Color = Color.Blue; + + build() { + Column({ space: 10 }) { + Button("text") + .type(ButtonType.Normal) + .width(this.myWidth) + .height(this.myHeight) + // The animation takes effect only for the type, width, and height attributes. The duration is 1000 ms, and the curve is Ease. + .animation({ duration: 1000, curve: Curve.Ease }) + // The animation does not take effect for the backgroundColor and margin attributes. + .backgroundColor(this.myColor) + .margin(20) + + Button("area: click me") + .fontSize(12) + .onClick(() => { + // Change the attribute value. Animation transition is performed for attributes configured with attribute animation. + if (this.flag) { + this.myWidth = 100; + this.myHeight = 50; + this.myColor = Color.Blue; + } else { + this.myWidth = 200; + this.myHeight = 100; + this.myColor = Color.Pink; + } + this.flag = !this.flag; + }) + } + } +} +``` + + +In the preceding example, the **animation** attribute of the first button takes effect only for the **type**, **width**, and **height** attributes written before the **animation** attribute, but does not take effect for the **backgroundColor** and **margin** attributes written after. In the running result, the **width** and **height** attributes execute the animation based on the **animation** settings, while the **backgroundColor** attribute changes without any animation applied. The display effect is shown below. + + + + + + +![size-change-animation](figures/size-change-animation.gif) + + +>**NOTE** +> +> 1. Attribute animations are executed according to the configured attribute animation settings. Each component can have its own attribute animation settings. +> +> 2. Explicit animations are executed on all GUI differences caused before and after animation closures, and they share the same animation settings. Therefore, explicit animations are applicable to scenarios where animations are executed in a unified manner. Explicit animations can also be used for animations caused by non-attribute variables, such as **if/else** statements and deletion of array elements used by **ForEach**. +> +> 3. If an attribute animation is configured for an attribute and the attribute value is changed in the explicit animation closure, the attribute animation takes precedence, under the configured animation settings. diff --git a/en/application-dev/ui/figures/2023022700701(1).jpg b/en/application-dev/ui/figures/2023022700701(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..53a5dba3a495af6562da8e2bee506c88b0c7d7ba Binary files /dev/null and b/en/application-dev/ui/figures/2023022700701(1).jpg differ diff --git a/en/application-dev/ui/figures/2023022701120(1).jpg b/en/application-dev/ui/figures/2023022701120(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..950c2ea49f2407f07277f319ec8099cf1e2ce5dd Binary files /dev/null and b/en/application-dev/ui/figures/2023022701120(1).jpg differ diff --git a/en/application-dev/ui/figures/2023022793003(1).jpg b/en/application-dev/ui/figures/2023022793003(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..5f89a57ecd79bf7f46cc19eb49acf9dbbaaa1edd Binary files /dev/null and b/en/application-dev/ui/figures/2023022793003(1).jpg differ diff --git a/en/application-dev/ui/figures/2023022793350(1).jpg b/en/application-dev/ui/figures/2023022793350(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..74205f7d264efc72ccac31d2aeb9af7da0255d55 Binary files /dev/null and b/en/application-dev/ui/figures/2023022793350(1).jpg differ diff --git a/en/application-dev/ui/figures/2023022793719(1).jpg b/en/application-dev/ui/figures/2023022793719(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..328ea27be52901f0aa1e2a77764840c7e14f3e80 Binary files /dev/null and b/en/application-dev/ui/figures/2023022793719(1).jpg differ diff --git a/en/application-dev/ui/figures/2023022794031(1).jpg b/en/application-dev/ui/figures/2023022794031(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..67104a5b1dfc638e56e7ce322d68e555b009c8a7 Binary files /dev/null and b/en/application-dev/ui/figures/2023022794031(1).jpg differ diff --git a/en/application-dev/ui/figures/2023022794521(1).jpg b/en/application-dev/ui/figures/2023022794521(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..fef7086bd78fdccf2833994a0824613d8519466a Binary files /dev/null and b/en/application-dev/ui/figures/2023022794521(1).jpg differ diff --git a/en/application-dev/ui/figures/2023022795105(1).jpg b/en/application-dev/ui/figures/2023022795105(1).jpg new file mode 100644 index 0000000000000000000000000000000000000000..e729f45969660af14b82ed8c8e5f3c0b1af0e00c Binary files /dev/null and b/en/application-dev/ui/figures/2023022795105(1).jpg differ diff --git a/en/application-dev/ui/figures/2023032422159.jpg b/en/application-dev/ui/figures/2023032422159.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f9fb080dee7e023179932a79b1d5421f0d91824e Binary files /dev/null and b/en/application-dev/ui/figures/2023032422159.jpg differ diff --git a/en/application-dev/ui/figures/drawimage.PNG b/en/application-dev/ui/figures/drawimage.PNG new file mode 100644 index 0000000000000000000000000000000000000000..f5061126ce9c48cea3cffcef05ecf5ea994735bd Binary files /dev/null and b/en/application-dev/ui/figures/drawimage.PNG differ diff --git a/en/application-dev/ui/figures/en-us_image_0000001511900428.png b/en/application-dev/ui/figures/en-us_image_0000001511900428.png new file mode 100644 index 0000000000000000000000000000000000000000..53fb84e3c75c85055eb4e7a0797dc4600f9dd304 Binary files /dev/null and b/en/application-dev/ui/figures/en-us_image_0000001511900428.png differ diff --git a/en/application-dev/ui/figures/layoutChange1.gif b/en/application-dev/ui/figures/layoutChange1.gif new file mode 100644 index 0000000000000000000000000000000000000000..3e03ce67601e2c8b1b4702ede58a7b95c9c65414 Binary files /dev/null and b/en/application-dev/ui/figures/layoutChange1.gif differ diff --git a/en/application-dev/ui/figures/layoutChange2_animateTo.gif b/en/application-dev/ui/figures/layoutChange2_animateTo.gif new file mode 100644 index 0000000000000000000000000000000000000000..ad94cb26c2874bc45ca84a2aaf5d58bbcd864685 Binary files /dev/null and b/en/application-dev/ui/figures/layoutChange2_animateTo.gif differ diff --git a/en/application-dev/ui/figures/layoutChange2_animateTo_change.gif b/en/application-dev/ui/figures/layoutChange2_animateTo_change.gif new file mode 100644 index 0000000000000000000000000000000000000000..14d804c7a0f1e843f218b2551af6f8b51dc421bb Binary files /dev/null and b/en/application-dev/ui/figures/layoutChange2_animateTo_change.gif differ diff --git a/en/application-dev/ui/figures/onDestroy.png b/en/application-dev/ui/figures/onDestroy.png new file mode 100644 index 0000000000000000000000000000000000000000..8615ef3b721eab8e90b7602ed20ac9ddd3cb2e07 Binary files /dev/null and b/en/application-dev/ui/figures/onDestroy.png differ diff --git a/en/application-dev/ui/figures/onLoad.png b/en/application-dev/ui/figures/onLoad.png new file mode 100644 index 0000000000000000000000000000000000000000..69c39d25de8323e5b20d5324da322796d051b102 Binary files /dev/null and b/en/application-dev/ui/figures/onLoad.png differ diff --git a/en/application-dev/ui/figures/picture-1.png b/en/application-dev/ui/figures/picture-1.png new file mode 100644 index 0000000000000000000000000000000000000000..85e91bba345c1b0012d0c6f031baa7ee43ef867a Binary files /dev/null and b/en/application-dev/ui/figures/picture-1.png differ diff --git a/en/application-dev/ui/figures/size-change-animation.gif b/en/application-dev/ui/figures/size-change-animation.gif new file mode 100644 index 0000000000000000000000000000000000000000..fe95f4162af64d2f5cbf4c71645a0317a8fff019 Binary files /dev/null and b/en/application-dev/ui/figures/size-change-animation.gif differ diff --git a/en/application-dev/website.md b/en/application-dev/website.md index b0467126d53d2757607b249734ddc940bfd95150..f8e6f89f51a8ac406def90fb058ce2f80f2d5c73 100644 --- a/en/application-dev/website.md +++ b/en/application-dev/website.md @@ -948,34 +948,33 @@ - [Multi-Language Capability](reference/js-service-widget-ui/js-service-widget-multiple-languages.md) - [Version Compatibility Adaptation](reference/js-service-widget-ui/js-service-widget-version-compatibility.md) - [Theme Configuration](reference/js-service-widget-ui/js-service-widget-theme.md) - - Components - - Universal - - [Universal Attributes](reference/js-service-widget-ui/js-service-widget-common-attributes.md) - - [Universal Styles](reference/js-service-widget-ui/js-service-widget-common-styles.md) - - [Universal Events](reference/js-service-widget-ui/js-service-widget-common-events.md) - - [Gradient Styles](reference/js-service-widget-ui/js-service-widget-common-gradient.md) - - [Media Query](reference/js-service-widget-ui/js-service-widget-common-mediaquery.md) - - [Custom Font Styles](reference/js-service-widget-ui/js-service-widget-common-customizing-font.md) - - [Accessibility](reference/js-service-widget-ui/js-service-widget-common-accessibility.md) - - [Atomic Layout](reference/js-service-widget-ui/js-service-widget-common-atomic-layout.md) - - Container Components - - [badge](reference/js-service-widget-ui/js-service-widget-container-badge.md) - - [div](reference/js-service-widget-ui/js-service-widget-container-div.md) - - [list](reference/js-service-widget-ui/js-service-widget-container-list.md) - - [list-item](reference/js-service-widget-ui/js-service-widget-container-list-item.md) - - [stack](reference/js-service-widget-ui/js-service-widget-container-stack.md) - - [swiper](reference/js-service-widget-ui/js-service-widget-container-swiper.md) - - Basic Components - - [button](reference/js-service-widget-ui/js-service-widget-basic-button.md) - - [calendar](reference/js-service-widget-ui/js-service-widget-basic-calendar.md) - - [chart](reference/js-service-widget-ui/js-service-widget-basic-chart.md) - - [clock](reference/js-service-widget-ui/js-service-widget-basic-clock.md) - - [divider](reference/js-service-widget-ui/js-service-widget-basic-divider.md) - - [image](reference/js-service-widget-ui/js-service-widget-basic-image.md) - - [input](reference/js-service-widget-ui/js-service-widget-basic-input.md) - - [progress](reference/js-service-widget-ui/js-service-widget-basic-progress.md) - - [span](reference/js-service-widget-ui/js-service-widget-basic-span.md) - - [text](reference/js-service-widget-ui/js-service-widget-basic-text.md) + - Universal Components + - [Universal Attributes](reference/js-service-widget-ui/js-service-widget-common-attributes.md) + - [Universal Styles](reference/js-service-widget-ui/js-service-widget-common-styles.md) + - [Universal Events](reference/js-service-widget-ui/js-service-widget-common-events.md) + - [Gradient Styles](reference/js-service-widget-ui/js-service-widget-common-gradient.md) + - [Media Query](reference/js-service-widget-ui/js-service-widget-common-mediaquery.md) + - [Custom Font Styles](reference/js-service-widget-ui/js-service-widget-common-customizing-font.md) + - [Accessibility](reference/js-service-widget-ui/js-service-widget-common-accessibility.md) + - [Atomic Layout](reference/js-service-widget-ui/js-service-widget-common-atomic-layout.md) + - Container Components + - [badge](reference/js-service-widget-ui/js-service-widget-container-badge.md) + - [div](reference/js-service-widget-ui/js-service-widget-container-div.md) + - [list](reference/js-service-widget-ui/js-service-widget-container-list.md) + - [list-item](reference/js-service-widget-ui/js-service-widget-container-list-item.md) + - [stack](reference/js-service-widget-ui/js-service-widget-container-stack.md) + - [swiper](reference/js-service-widget-ui/js-service-widget-container-swiper.md) + - Basic Components + - [button](reference/js-service-widget-ui/js-service-widget-basic-button.md) + - [calendar](reference/js-service-widget-ui/js-service-widget-basic-calendar.md) + - [chart](reference/js-service-widget-ui/js-service-widget-basic-chart.md) + - [clock](reference/js-service-widget-ui/js-service-widget-basic-clock.md) + - [divider](reference/js-service-widget-ui/js-service-widget-basic-divider.md) + - [image](reference/js-service-widget-ui/js-service-widget-basic-image.md) + - [input](reference/js-service-widget-ui/js-service-widget-basic-input.md) + - [progress](reference/js-service-widget-ui/js-service-widget-basic-progress.md) + - [span](reference/js-service-widget-ui/js-service-widget-basic-span.md) + - [text](reference/js-service-widget-ui/js-service-widget-basic-text.md) - [Custom Component Basic Usage](reference/js-service-widget-ui/js-service-widget-custom-basic-usage.md) - [Data Types](reference/js-service-widget-ui/js-service-widget-appendix-types.md) - JS and TS APIs @@ -1097,6 +1096,7 @@ - [@ohos.events.emitter (Emitter)](reference/apis/js-apis-emitter.md) - [@ohos.notificationManager (NotificationManager) (Recommended)](reference/apis/js-apis-notificationManager.md) - [@ohos.notificationSubscribe (NotificationSubscribe) (Recommended)](reference/apis/js-apis-notificationSubscribe.md) + - [@ohos.application.StaticSubscriberExtensionContext (NotificationSubscribe) (Recommended)](reference/apis/js-apis-application-StaticSubscriberExtensionContext.md) - [System Common Events (To Be Deprecated Soon)](reference/apis/commonEvent-definitions.md) - [@ohos.commonEvent (Common Event) (To Be Deprecated Soon)](reference/apis/js-apis-commonEvent.md) - [@ohos.notification (Notification) (To Be Deprecated Soon)](reference/apis/js-apis-notification.md) @@ -1114,6 +1114,10 @@ - [NotificationFlags](reference/apis/js-apis-inner-notification-notificationFlags.md) - [NotificationRequest](reference/apis/js-apis-inner-notification-notificationRequest.md) - [NotificationSlot](reference/apis/js-apis-inner-notification-notificationSlot.md) + - [NotificationSorting](reference/apis/js-apis-inner-notification-notificationSorting.md) + - [NotificationSortingMap](reference/apis/js-apis-inner-notification-notificationSortingMap.md) + - [NotificationSubscribeInfo](reference/apis/js-apis-inner-notification-notificationSubscribeInfo.md) + - [NotificationSubscriber](reference/apis/js-apis-inner-notification-notificationSubscriber.md) - [NotificationTemplate](reference/apis/js-apis-inner-notification-notificationTemplate.md) - [NotificationUserInput](reference/apis/js-apis-inner-notification-notificationUserInput.md) - Common Events @@ -1227,7 +1231,7 @@ - [@ohos.file.storageStatistics (Application Storage Statistics)](reference/apis/js-apis-file-storage-statistics.md) - [@ohos.file.volumeManager (Volume Management)](reference/apis/js-apis-file-volumemanager.md) - [@ohos.filemanagement.userFileManager (User Data Management)](reference/apis/js-apis-userFileManager.md) - - [@ohos.fileShare (File Sharing)](reference/apis/js-apis-fileShare.md) + - [@ohos.fileshare (File Sharing)](reference/apis/js-apis-fileShare.md) - Telephony Service - [@ohos.contact (Contacts)](reference/apis/js-apis-contact.md) - [@ohos.telephony.call (Call)](reference/apis/js-apis-call.md) @@ -1285,7 +1289,7 @@ - [@ohos.systemTimer (System Timer)](reference/apis/js-apis-system-timer.md) - [@ohos.wallpaper (Wallpaper)](reference/apis/js-apis-wallpaper.md) - [@ohos.web.webview (Webview)](reference/apis/js-apis-webview.md) - - [console (Log)](reference/apis/js-apis-logs.md) + - [Console](reference/apis/js-apis-logs.md) - [Timer](reference/apis/js-apis-timer.md) - application - [AccessibilityExtensionContext](reference/apis/js-apis-inner-application-accessibilityExtensionContext.md) @@ -1294,6 +1298,7 @@ - [@ohos.batteryStatistics (Battery Statistics)](reference/apis/js-apis-batteryStatistics.md) - [@ohos.brightness (Screen Brightness)](reference/apis/js-apis-brightness.md) - [@ohos.charger (Charging Type)](reference/apis/js-apis-charger.md) + - [@ohos.cooperate (Screen Hopping)](reference/apis/js-apis-devicestatus-cooperate.md) - [@ohos.deviceInfo (Device Information)](reference/apis/js-apis-device-info.md) - [@ohos.distributedHardware.deviceManager (Device Management)](reference/apis/js-apis-device-manager.md) - [@ohos.geoLocationManager (Geolocation Manager)](reference/apis/js-apis-geoLocationManager.md) @@ -1501,6 +1506,7 @@ - [Thermal Manager Error Codes](reference/errorcodes/errorcode-thermal.md) - [Device Management Error Codes](reference/errorcodes/errorcode-device-manager.md) - [Location Subsystem Error Codes](reference/errorcodes/errorcode-geoLocationManager.md) + - [Screen Hopping Error Codes](reference/errorcodes/errorcode-devicestatus.md) - [Screen Hopping Error Codes](reference/errorcodes/errorcode-multimodalinput.md) - [Sensor Error Codes](reference/errorcodes/errorcode-sensor.md) - [Vibrator Error Codes](reference/errorcodes/errorcode-vibrator.md) @@ -1605,16 +1611,16 @@ - [OH_Huks_ParamSet](reference/native-apis/_o_h___huks___param_set.md) - [OH_Huks_PubKeyInfo](reference/native-apis/_o_h___huks___pub_key_info.md) - [OH_Huks_Result](reference/native-apis/_o_h___huks___result.md) - - Standard Libraries Supported by Native APIs - - [Node_API](reference/native-lib/third_party_napi/napi.md) - - [libuv](reference/native-lib/third_party_libuv/libuv.md) - - [Native Standard Libraries Supported by Openharmony](reference/native-lib/third_party_libc/musl.md) - - Appendix - - [Native API Symbols Not Exported](reference/native-lib/third_party_libc/musl-peculiar-symbol.md) - - [Native API Symbols That May Fail to Be Invoked Due to Permission Control](reference/native-lib/third_party_libc/musl-permission-control-symbol.md) - - [EGL Symbols Exported from Native APIs](reference/native-lib/third_party_opengl/egl-symbol.md) - - [OpenGL ES 3.0 Symbols Exported from Native APIs](reference/native-lib/third_party_opengl/openglesv3-symbol.md) - - [OpenSL ES Interfaces Supported by Native APIs](reference/native-lib/third_party_opensles/opensles.md) + - Standard Libraries Supported by Native APIs + - [Node_API](reference/native-lib/third_party_napi/napi.md) + - [libuv](reference/native-lib/third_party_libuv/libuv.md) + - [Native Standard Libraries Supported by Openharmony](reference/native-lib/third_party_libc/musl.md) + - Appendix + - [Native API Symbols Not Exported](reference/native-lib/third_party_libc/musl-peculiar-symbol.md) + - [Native API Symbols That May Fail to Be Invoked Due to Permission Control](reference/native-lib/third_party_libc/musl-permission-control-symbol.md) + - [EGL Symbols Exported from Native APIs](reference/native-lib/third_party_opengl/egl-symbol.md) + - [OpenGL ES 3.0 Symbols Exported from Native APIs](reference/native-lib/third_party_opengl/openglesv3-symbol.md) + - [OpenSL ES Interfaces Supported by Native APIs](reference/native-lib/third_party_opensles/opensles.md) - FAQs - [Full SDK Compilation Guide](faqs/full-sdk-compile-guide.md) - [Guide to Switching to Full SDK](faqs/full-sdk-switch-guide.md) diff --git a/en/device-dev/kernel/kernel-small-bundles-container.md b/en/device-dev/kernel/kernel-small-bundles-container.md index 6ed99455975e6c71f72056795759f8bdb9df4f01..d658570e55696121010701f36bc43fc542fe1b9b 100644 --- a/en/device-dev/kernel/kernel-small-bundles-container.md +++ b/en/device-dev/kernel/kernel-small-bundles-container.md @@ -189,7 +189,9 @@ int clone(int (*fn)(void *), void *stack, int flags, void *arg, ... int unshare(int flags); ``` - **NOTE**
For the PID or Time container, **unshare()** moves the child process (not the process itself) to a new container created. + > **NOTE** + > + > For the PID or Time container, **unshare()** moves the child process (not the process itself) to a new container created. - **setns** @@ -199,7 +201,9 @@ int clone(int (*fn)(void *), void *stack, int flags, void *arg, ... int setns(int fd, int nstype); ``` - **NOTE**
For the PID or Time container, **setns()** moves the child process (not the process itself) to another container. + > **NOTE** + > + > For the PID or Time container, **setns()** moves the child process (not the process itself) to another container. ### Destroying a Container @@ -307,8 +311,6 @@ inum = CONTAINER_IDEX_BASE + (unsigned int)i; - The container features are controlled by compiler macros. - - Container compiler macro definition: - ``` // Macro of the container feature LOSCFG_CONTAINER @@ -321,7 +323,7 @@ inum = CONTAINER_IDEX_BASE + (unsigned int)i; LOSCFG_TIME_CONTAINER LOSCFG_IPC_CONTAINER ``` - + ### Development Examples diff --git a/en/device-dev/kernel/kernel-standard-newip.md b/en/device-dev/kernel/kernel-standard-newip.md index a5681a40970b2729c488eeec59067678185de798..2e6285aca8f1fb34a07496762ba888eecc0fdece 100644 --- a/en/device-dev/kernel/kernel-standard-newip.md +++ b/en/device-dev/kernel/kernel-standard-newip.md @@ -16,7 +16,7 @@ The network layer header ranges from 20 to 60 bytes for an IPv4 packet and is 40 New IP supports variable-length multi-semantic addresses (min. 1 byte) and customized header encapsulation (min. 5 bytes). Simplified packet headers reduce overheads and improve transmission efficiency. -New IP provides 25.9% less packet header overheads than IPv4 and 44.9% less than IPv6. +New IP provides 25.9% fewer packet header overheads than IPv4 and 44.9% less than IPv6. New IP provides at least 1% higher payload transmission efficiency than IPv4 and 2.33% higher than IPv6. @@ -33,6 +33,7 @@ The following figure shows a New IP Wi-Fi packet header. "EtherType = 0xEADD" in ![](figures/newip-header.png) - **Dispatch** indicates the encapsulation type. The value **0b0** indicates the New IP encapsulation child class, which is 1 bit long (**0b** indicates that the following values are binary). + - **Bitmap** is of variable length. By default, it is seven bits following the **Dispatch** valid bit. The length of **Bitmap** can be extended contiguously. If the last bit of **Bitmap** is **0**, it indicates the end of **Bitmap**. If the last bit is **1**, it means one more byte until the last bit **0**. - **Value** indicates the field value. The length is an integer multiple of 1 byte. The value type and length are determined by the semantic table of the header field. @@ -43,7 +44,7 @@ The **Bitmap** field is defined as follows: | Bitmap first byte | - | - | - | The eight bits are from the most significant bit to the least significant bit. | | Dispatch | 0 | - | Set to **0**. | **0**: indicates a New IP packet; **1**: indicates a non-New-IP packet. | | Whether the packet header carries the TTL | 1 | 1 | Set to **1**. | Indicates the number of remaining hops. | -| Whether the packet header carries the total length | 2 | 2 | Set to **0** for UDP and **1** for TCP.| Total length of the new IP packet (including the header) | +| Whether the packet header carries the total length | 2 | 2 | Set to **0** for UDP and **1** for TCP.| Total length of the New IP packet (including the header) | | Whether the packet header carries the Next Header | 3 | 1 | Set to **1**. | Protocol type. | | Reserve | 4 | Reserved | Set to **0**. | Reserved. | | Whether the packet header carries the destination address | 5 | Variable length (1 to 8 bytes)| Set to **1**. | Destination address. | @@ -65,7 +66,7 @@ Only the bitmap fields defined in New IP are parsed. All the bitmap fields with ## Variable-Length Address Format -Different from IPv4 and IPv6, which use fixed-length addresses, New IP supports variable-length addresses and parse of the address length. The packet header may not carry the address length field. The encoding format of new IP addresses is as follows: +Different from IPv4 and IPv6, which use fixed-length addresses, New IP supports variable-length addresses and parse of the address length. The packet header may not carry the address length field. The encoding format of New IP addresses is as follows: | First Byte | Semantics | Valid Range of Address | | ---------- | ------------------------------------------------------------ | ------------------------------------------------------------ | @@ -90,7 +91,7 @@ Different from IPv4 and IPv6, which use fixed-length addresses, New IP supports ### Enabling New IP -Only the Linux 5.10 kernel of the RK3568 development board supports the New IP kernel protocol stack. To enable New IP, search for "NEWIP" in the kernel module configuration file of the RK3568 development board and set related parameters as follows: +Only the Linux 5.10 kernel of the RK3568 development board supports the New IP kernel protocol stack. To enable New IP, search for "NEWIP" in the kernel module configuration file of the RK3568 development board and set related parameters as follows: ``` # kernel/linux/config/linux-5.10/arch/arm64/configs/rk3568_standard_defconfig @@ -133,17 +134,15 @@ static u32 sk_ehashfn(const struct sock *sk) &sk->sk_v6_daddr, sk->sk_dport); #endif -#if IS_ENABLED(CONFIG_NEWIP_HOOKS) - if (sk->sk_family == AF_NINET) { - u32 ret = 0; + if (trace_vendor_ninet_ehashfn_enabled()) { + if (sk->sk_family == AF_NINET) { + u32 ret = 0; /* Register the New IP ehash function. */ - trace_ninet_ehashfn_hook(sock_net(sk), &sk->sk_nip_rcv_saddr, sk->sk_num, - &sk->sk_nip_daddr, sk->sk_dport, &ret); - return ret; + trace_vendor_ninet_ehashfn(sk, &ret); + return ret; + } } -#endif - /* IPv4 */ return inet_ehashfn(sock_net(sk), sk->sk_rcv_saddr, sk->sk_num, @@ -243,15 +242,15 @@ struct sockaddr_nin { ## New IP Development -Only the OpenHarmony Linux-5.10 kernel supports New IP kernel protocol stack. You must manually configure IP address and route data for New IP in user mode, and connect the two devices through the router Wi-Fi. If you want to automatically switch to the new IP kernel protocol stack after configuring the new IP address and route, see the description in the blue box in the following figure. +Only the OpenHarmony Linux-5.10 kernel supports New IP kernel protocol stack. You must manually configure IP address and route data for New IP in user mode, and connect the two devices through the router Wi-Fi. If you want to automatically switch to the New IP kernel protocol stack after configuring the New IP address and route, see the description in the blue box in the following figure. ![](figures/newip-development.png) -For details about the address and route configuration, see [examples](https://gitee.com/openharmony/kernel_common_modules_newip/tree/master/examples). Modify the CC definition in Makefile based on the CPU you use, compile the CC definition into a binary file, and push the file to the development board. Refer to the figure above to configure the address and route data for New IP. +For details about the address and route configuration, see [examples](https://gitee.com/openharmony/kernel_linux_common_modules/tree/master/newip/examples). Modify the CC definition in Makefile based on the CPU you use, compile the CC definition into a binary file, and push the file to the development board. Refer to the figure above to configure the address and route data for New IP. | File | Description | | ------------------ | -------------------------------------------------------- | -| nip_addr.c | Sample code for configuring variable-length New IP addresses (any valid New IP address can be configured). | +| nip_addr.c | Sample code for configuring variable-length New IP addresses (any valid New IP address can be configured).| | nip_route.c | Sample code for configuring New IP route information (any valid New IP address can be configured). | | check_nip_enable.c | Code for obtaining the New IP capabilities of the local host. | @@ -277,7 +276,7 @@ Check the New IP address and route information on device 2. ## Sample Code for Receiving and Sending New IP Packets -The following table lists the related sample code. For details about how to use the user-mode APIs of the New IP stack, see [examples](https://gitee.com/openharmony/kernel_common_modules_newip/tree/master/examples). Fixed addresses and routes are configured in the demo code. You do not need to manually specify the addresses and routes when executing the binary program. +The following table lists the related sample code. For details about how to use the user-mode APIs of the New IP stack, see [examples](https://gitee.com/openharmony/kernel_linux_common_modules/tree/master/newip/examples). Fixed addresses and routes are configured in the demo code. You do not need to manually specify the addresses and routes when executing the binary program. | File | Description | | --------------------- | ------------------------------ | @@ -376,7 +375,7 @@ allowxperm thread_xxx thread_xxx:socket ioctl { 0x8933 0x8916 0x890B }; ## WireShark Packet Parsing Template -The default packet parsing rules of Wireshark cannot parse New IP packets. You can add a New IP packet parsing template to Wireshark to parse New IP packets. For details about the template, see [New IP packet parsing template](https://gitee.com/openharmony/kernel_common_modules_newip/blob/master/tools/wireshark_cfg_for_newip.lua). +The default packet parsing rules of Wireshark cannot parse New IP packets. You can add a New IP packet parsing template to Wireshark to parse New IP packets. For details about the template, see [New IP packet parsing template](https://gitee.com/openharmony/kernel_linux_common_modules/blob/master/newip/tools/wireshark_cfg_for_newip.lua). The procedure is as follows: @@ -394,7 +393,7 @@ D:\tools\WireShark\wireshark_cfg_for_newip.lua Path of the WireShark configuration file: C:\Program Files\Wireshark\init.lua -Add the following to the end of the **init.lua** file (Windows 11, for example): +Add the following to the end of the init.lua file (Windows 11, for example): dofile("D:\\tools\\WireShark\\wireshark_cfg_for_newip.lua") ``` diff --git a/en/device-dev/subsystems/Readme-EN.md b/en/device-dev/subsystems/Readme-EN.md index 3ffc19418a1e83b0e87abc59cbfc460dfca1a392..d56854b895f3138843dba4ef56bd2858f82316d2 100644 --- a/en/device-dev/subsystems/Readme-EN.md +++ b/en/device-dev/subsystems/Readme-EN.md @@ -126,4 +126,6 @@ - [Thermal Policy Customization](subsys-thermal_policy.md) - [Thermal Scene Customization](subsys-thermal_scene.md) - Power Management - - [Power Mode Customization](subsys-power-mode-customization.md) \ No newline at end of file + - [Power Mode Customization](subsys-power-mode-customization.md) + - [Default Hibernation Behavior Customization](subsys-power-default-sleep-behavior-customization.md) + - [Wakeup Source Customization](subsys-power-wakeup-source-customization.md) \ No newline at end of file diff --git a/en/device-dev/subsystems/subsys-boot-init-seccomp.md b/en/device-dev/subsystems/subsys-boot-init-seccomp.md index 33f566d8c2e638d3ec384c3990b046f97dcb628d..9ba6a0ed8a5ce8d3f84515e32de5d7b4fb043141 100644 --- a/en/device-dev/subsystems/subsys-boot-init-seccomp.md +++ b/en/device-dev/subsystems/subsys-boot-init-seccomp.md @@ -1,29 +1,21 @@ # Seccomp Policy Development - ## Overview - ### Introduction - Secure computing mode (Seccomp) is a security mechanism provided by the Linux kernel. In the Linux system, a large number of system calls can be opened to user-mode programs without any restrictions. However, not all of these system calls are necessarily needed for user-mode programs. In this case, abuse of system calls can lead to system threats. For example, if a process has a security vulnerability, an attacker can run a shellcode segment to trigger system calls that are not triggered during normal execution, resulting in privilege escalation or private information leakage. To prevent such security risks, Seccomp limits the scope of system calls that can be used by programs, so as to reduce system exposure and improve security. ### Operating Mechanism +1. Basic mechanism -- Basic mechanism - - Seccomp policies exist in the form of policy files. During compilation and building, a policy file is parsed to generate a source file that contains the BPF instruction policies, and then the source file is compiled into a dynamic policy library. During startup of a user-mode process, Seccomp system calls are invoked to load the BPF instruction policies into the kernel through the dynamic policy library. - -- Basic features + Seccomp policies exist in the form of policy files. During compilation and building, a policy file is parsed to generate a source file that contains the BPF instruction policies, and then the source file is compiled into a dynamic policy library. During startup of a user-mode process, Seccomp system calls are invoked to load the BPF instruction policies into the kernel through the dynamic policy library. - - A child process inherits the Seccomp policies of its parent process. - - After a Seccomp policy is loaded to the kernel during process running, the policy exists in the memory as a singly linked list and cannot be modified. - - Seccomp policies can be set for a process for multiple times. When a process executes a system call, the kernel traverses the policies specified for the nodes in the singly linked list, and then compares the policies to obtain the policy with the highest priority. +2. Basic features + - A child process inherits the Seccomp policies of its parent process. + - After a Seccomp policy is loaded to the kernel during process running, the policy exists in the memory as a singly linked list and cannot be modified. + - Seccomp policies can be set for a process for multiple times. When a process executes a system call, the kernel traverses the policies specified for the nodes in the singly linked list, and then compares the policies to obtain the policy with the highest priority. ### Constraints - -- System restrictions - - The system used must be a standard system, and the options listed below must be enabled in the kernel. You can find the kernel option configuration file of the product in **//kernel/linux/config/{linux_version}/arch/{target_cpu}/configs/**. +- System restrictions
The system used must be a standard system, and the options listed below must be enabled in the kernel. You can find the kernel option configuration file of the product in **//kernel/linux/config/{linux_version}/arch/{target_cpu}/configs/**. ```shell CONFIG_HAVE_ARCH_SECCOMP=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y @@ -32,7 +24,6 @@ Secure computing mode (Seccomp) is a security mechanism provided by the Linux ke ``` - Feature restrictions - - The Seccomp policy for non-privileged processes complies with the baseline blocklist mechanism. - If a process needs to use system calls in the baseline blocklist, the system calls must be declared in the privileged process policy file. - The same Seccomp policy is enabled for all application processes. @@ -40,13 +31,9 @@ Secure computing mode (Seccomp) is a security mechanism provided by the Linux ke - Personalized Seccomp policies can be enabled for the native service processes incubated by the init process. ## Enabling Seccomp - ### When to Use - To meet product security requirements, you can enable Seccomp to limit the scope of system calls that can be invoked by processes. The development procedure below describes how to enable the basic functions and policies of Seccomp. Note that the basic functions must meet the feature restrictions described in [Constraints](#constraints). For details about the basic policy file, see [Policy File Overview](#policy-file-overview). - ### How to Develop - 1. Add the following field to **vendor/Product vendor/Product name/config.json**: ```c "build_seccomp": true @@ -74,18 +61,14 @@ To meet product security requirements, you can enable Seccomp to limit the scope ] } ``` - 2. Perform a full build on the product code to generate an image. ``` ./build.sh --product-name *product name* --ccache --build-target make_all --target-cpu *specified CPU* ``` - 3. Burn the image into the device. ### Debugging and Verification - Check whether Seccomp is enabled for application processes and system service processes. - 1. Run the shell command to obtain the process ID (that is, **target pid**) of the target process. ``` ps -ef | grep xxx @@ -108,34 +91,30 @@ Check whether Seccomp is enabled for application processes and system service pr **Table 1** Description of the Seccomp status | Parameter | Description | | --- | --- | - | Seccomp | Whether Seccomp is enabled.
- **0**: disabled.
- **1**: enabled with the strict mode. Only the read, write, exit, and sigreturn system calls are allowed.
- **2**: enabled with the filter mode. The customized policies can be enabled by loading BPF instruction sets. | + | Seccomp | - **0**: disabled.
- **1**: enabled with the strict mode. Only the read, write, exit, and sigreturn system calls are allowed.
- **2**: enabled with the filter mode. The customized policies can be enabled by loading BPF instruction sets. | | Seccomp_filters | Number of Seccomp policies set for a process. | ## Customizing Seccomp Policies for a Process - ### When to Use - If the basic Seccomp policy has been enabled for a product, you can customize Seccomp policies for native service processes incubated by the init process to adapt to diversified security requirements. In this case, the Seccomp policies of other native service processes remain unchanged. - ### How to Develop 1. Collect statistics on the system calls required by the 32-bit and 64-bit systems by using the static analysis and Strace statistics methods described in [System Call Statistic Methods](#system-call-statistic-methods). In this way, you will obtain the initial Seccomp policy. 2. Write a policy file. For details, see [How to Write a Common Policy File](#how-to-write-a-common-policy-file). 3. Write and build the **BUILD.gn** file. - 1. Store the policy file in the code repository of the service subsystem and create a **BUILD.gn** file. For example, create the **seccomp_policy** folder in the service code repository, and create the policy file and **BUILD.gn** file in the folder. + 1. Store the policy file in the code repository of the service subsystem and create a **BUILD.gn** file. For example, create the **seccomp_policy** folder in the service code repository, and create the policy file and **BUILD.gn** file in the folder. ```shell //path/to/code/seccomp_policy ├── BUILD.gn └── example.seccomp.policy ``` - 2. To parse the policy file and build the policy dynamic library, use the **ohos_prebuilt_seccomp** template to declare the Seccomp policy file path of the process in the **BUILD.gn** file. The **ohos_prebuilt_seccomp** template is defined in the **//base/startup/init/services/modules/seccomp/scripts/seccomp_policy_fixer.gni** file. The following table describes the parameters in the template. **Table 2** Parameters in the ohos_prebuilt_seccomp template | Parameter | Description | | --- | --- | - | sources | Path of the policy configuration file, mandatory. | + | sources | Path of the policy configuration file, mandatory.| | filtername | Filter name, mandatory. The value must be the same as the value of **Services name** in the [boot configuration file](subsys-boot-init-cfg.md) of the process. Otherwise, the attempt to enable Seccomp will fail. This parameter determines the name of the dynamic policy library generated after the build. For example, if **filtername** is set to **xxx**, the name of the dynamic policy library is **libxxx_filter.z.so**. | | process_type | Process type, mandatory. If the process is one incubated by the init process, set this parameter to **system**; if the process is an application process, set this parameter to **app**.| | part_name | Part name, mandatory. | @@ -143,7 +122,7 @@ If the basic Seccomp policy has been enabled for a product, you can customize Se | install_enable | Option specifying whether to install the policy file to the image, mandatory. Set the value to **true**. | | install_images | Installation location in the image, mandatory. | - For example: + Example ```python #Import the template file. import("//base/startup/init/services/modules/seccomp/scripts/seccomp_policy_fixer.gni") @@ -163,7 +142,6 @@ If the basic Seccomp policy has been enabled for a product, you can customize Se install_images = [ "xxxxx" ] } ``` - 3. Add the build target of **xxxx_seccomp_filter** to other **BUILD.gn** files. ```python if (build_seccomp) { @@ -174,12 +152,10 @@ If the basic Seccomp policy has been enabled for a product, you can customize Se ```shell ./build.sh --product-name *product name* --ccache --build-target xxxx_seccomp_filter --target-cpu *specified CPU* ``` - If an error message that contains the following information is reported, the process needs to use the system calls in the baseline blocklist. In such a case, you need to declare the corresponding system call in **privileged_process.seccomp.policy**. For details, see [How to Write a Privileged Process Policy File](#how-to-write-a-privileged-process-policy-file). After the declaration is done, try again until the build is successful. ```shell xx of allow list is in block list ``` - 5. Use the hdc tool to push the dynamic policy library to the device and restart the device. ```shell # Push an appropriate library path based on the installation location in the image. For example, if the image is **system** and the system architecture is 32-bit, the path of the dynamic policy library is **/system/lib/seccomp/**. @@ -187,19 +163,15 @@ If the basic Seccomp policy has been enabled for a product, you can customize Se hdc file send /path/to/libxxx_filter.z.so /path/to/lib(or lib64)/seccomp/ hdc shell reboot ``` - 6. Use the [audit statistics](#audit-statistics) method to check and supplement the Seccomp policies. Repeat steps 4 to 6 until the process can run properly. ### Debugging and Verification - 1. If Seccomp is not enabled for the target process, [check the Seccomp status](#debugging-and-verification) of the target process. 2. If the process is terminated and audit log information is present in the kernel logs, the Seccomp policy is enabled but the policy list is incomplete. You can find an example audit log in [Audit Statistics](#audit-statistics). 3. If the process is not terminated, comment out the system calls (for example, **setuid**) related to the specified uid in the Seccomp policy file. Rebuild the dynamic policy library, push the library to the image, and restart the process. Then, check whether the process is terminated by Seccomp. If the process is terminated, Seccomp has been enabled. ## FAQs - ### How do I determine whether a process termination is caused by Seccomp? - **Symptom** If a process is terminated under certain conditions, how do I determine whether the issue is caused by Seccomp? @@ -235,9 +207,7 @@ Use either of the following methods: ``` ## Reference - ### Seccomp source code directory - ``` base/startup/init/services/modules/seccomp ├── BUILD.gn @@ -259,11 +229,7 @@ base/startup/init/services/modules/seccomp ``` ### Policy File Overview - -- Location - - Basic policy files are stored in **//base/startup/init/services/modules/seccomp/seccomp_policy**. - +- Location
Basic policy files are stored in **//base/startup/init/services/modules/seccomp/seccomp_policy**. - Basic policy files **Table 3** Description of policy files @@ -278,7 +244,6 @@ base/startup/init/services/modules/seccomp | privileged_process.seccomp.policy | Privileged process policy file. If certain processes need to use the system calls on the baseline blocklist, you need to declare the corresponding process identifiers and baseline blocklists in this file.| ### How to Write a Common Policy File - - To declare a configuration item, write **@** followed by the configuration item, for example, **@returnValue**. - Add the content of a configuration item from the next line of this configuration item to the beginning of the next configuration item. - To comment out a line, add a pound sign (#) at the beginning of this line. @@ -333,7 +298,6 @@ swapon;all ``` ### How to Write a Privileged Process Policy File - - To declare a configuration item, write **@** followed by the configuration item, for example, **@allowBlockList**. - Add the content of a configuration item from the next line of this configuration item to the beginning of the next configuration item. - To comment out a line, add a pound sign (#) at the beginning of this line. @@ -362,32 +326,30 @@ swapon;all ``` ### System Call Statistic Methods - **Table 6** Comparison of statistic methods | Statistic Method | Description | Advantage | Disadvantage | | --- | --- | --- | --- | |
Static analysis |
Analyze the ELF disassembly code to obtain the call relationship, collect statistics on the APIs that call the libc library, and then parse the LibC library to obtain the call relationship between the LibC APIs and the system call numbers. In this way, you will obtain the system call numbers used by the ELF file.|
Statistics collection is supported for system calls in abnormal branches. |
Parsing of call relationship is not supported for pointer functions. | -| Strace statistics | Use Strace to trace service processes or test processes when the device is running. During the trace, the invoked system calls are recorded into logs. Collect the logs after the trace is complete, and use a script to parse the logs and generate a Seccomp policy file.| Easy to use. | System calls can be completely collected only when all code branches are traversed. | +| Strace statistics | Use Strace to trace service processes when the device is running. During the trace, the invoked system calls are recorded into logs. Collect the logs after the trace is complete, and use a script to parse the logs and generate a Seccomp policy file.| Easy to use. | System calls can be completely collected only when all code branches are traversed. | | Audit statistics | After the Seccomp policy is enabled for a process, Seccomp intercepts invalid system calls and records audit log information containing the system call numbers into kernel logs. Collect the logs after the trace is complete, and use a script to parse the logs and generate a Seccomp policy file.| This method can be used as a supplement to the preceding methods. | Logs may be lost.
System calls can be completely collected only when all code branches are traversed. | -> **Disclaimer: Using Third-Party Software or Websites** -> -> We may recommend software, information, products, or websites owned or operated by third parties. Such recommendations are usually provided via hyperlinks or other methods to help you access third-party resources.
-> We strive to direct you to useful and trusted resources, but it is beyond our reach to guarantee the software, information, products, or services provided by or at third-party resources, or to track changes in these resources. Therefore, we are unable to assume the responsibility for the compliance, accuracy, and completeness of the content or results of any third-party resources, nor for any loss or damage caused by the use or failure of products or services provided by third-party resources. - #### Static Analysis - 1. Prepare the environment. 1. Prepare a Linux environment. 2. Download the cross compilers arm-linux-musleabi and aarch64-linux-musl. ```shell + wget https://musl.cc/arm-linux-musleabi-cross.tgz + wget https://musl.cc/aarch64-linux-musl-cross.tgz + + tar -zxvf arm-linux-musleabi-cross.tgz + tar -zxvf aarch64-linux-musl-cross.tgz + # Add the tool execution path to the environment variable. export PATH=$PATH:/path/to/arm-linux-musleabi-cross/bin export PATH=$PATH:/path/to/aarch64-linux-musl-cross/bin ``` - 3. Download the OpenHarmony source code. - For details, see [Obtaining Source Code](../get-code/sourcecode-acquire.md). + 3. Download the OpenHarmony source code. For details, see [Obtaining Source Code](../get-code/sourcecode-acquire.md). 2. Compile **seccomp_filter** to obtain the dependency files **libsyscall_to_nr_arm** and **libsyscall_to_nr_arm64**. @@ -399,10 +361,10 @@ swapon;all cp out/*product name* /gen/base/startup/init/services/modules/seccomp/gen_system_filter/libsyscall_to_nr_arm* base/startup/init/services/modules/seccomp/scripts/tools/ ``` -3. Copy the **generate_code_from_policy.py** script file to the tool folder. This script is available at **//base/startup/init/services/modules/seccomp/scripts/**. +3. Copy the **generate_code_from_policy.py** script file to the tool folder. This script file is available at **//base/startup/init/services/modules/seccomp/scripts/**. ```shell # Go to the root directory of the OpenHarmony source code. - cd /root/to/OpenharmonyCode; + cd /root/to/OpenHarmonyCode; # Go to the directory where the **generate_code_from_policy.py** script file is located. cd base/startup/init/services/modules/seccomp/scripts/; # Copy the **generate_code_from_policy.py** script file. @@ -414,22 +376,31 @@ swapon;all ./build.sh --product-name *product file* --ccache --target-cpu arm64 --build-target *target file* ``` -5. Modify the **collect_elf_syscall.py** script file, and change the paths of the objdump and readelf tools to their absolute paths in the Linux environment. The tools are stored in **//prebuilts**, and more particularly, **//prebuilts/clang/ohos/linux-x86_64/15.0.4/llvm/bin**. +5. If full build has not been performed before and the dependent dynamic libraries for step 4 are not in the **//out** directory, copy the related dynamic libraries to the **//out** directory. The following code is for reference only. If other dynamic libraries are involved, copy them in a similar way. + ```shell + # Go to the root directory of the source code. + cd /root/to/OpenHarmonyCode + # Create the **aarch64-linux-ohos** folder in **out/*product name*/lib.unstripped/** to store the dependent dynamic libraries. + mkdir out/*product name*/lib.unstripped/aarch64-linux-ohos + # Copy the related dynamic libraries to the //out directory. + cp prebuilts/clang/ohos/${host_platform_dir}/llvm/lib/clang/${clang_version}/lib/aarch64-linux-ohos/*.so out/*product name*/lib.unstripped/aarch64-linux-ohos/ + cp prebuilts/clang/ohos/${host_platform_dir}/${clang_version}/llvm/lib/aarch64-linux-ohos/*.so out/*product name*/lib.unstripped/aarch64-linux-ohos/ + ``` + +6. Modify the **collect_elf_syscall.py** script file, and change the paths of the objdump and readelf tools to their absolute paths in the Linux environment. This script file is available at **base/startup/init/services/modules/seccomp/scripts/tools/**. The **objdump** and **readelf** tools available at **//prebuilts**. ```python #modified the path of objdump and readelf path def get_obj_dump_path(): - obj_dump_path = '/path/to/prebuilts/clang/ohos/linux-x86_64/15.0.4/llvm/bin/llvm-objdump' + obj_dump_path = '/path/to/llvm-objdump' return obj_dump_path def get_read_elf_path(): - read_elf_path = '/path/to/prebuilts/clang/ohos/linux-x86_64/15.0.4/llvm/bin/llvm-readelf' + read_elf_path = '/path/to/llvm-readelf' return read_elf_path ``` -6. Use the **collect_elf_syscall.py** script file to parse and generate the corresponding policy file **xxx.seccomp.policy**. - - The script file is available at **//base/startup/init/services/modules/seccomp/scripts/tools/**. +7. Use the **collect_elf_syscall.py** script file to parse and generate the corresponding policy file **xxx.seccomp.policy**. **Table 7** Parameters in the collect_elf_syscall.py script file | Parameter | Description | @@ -462,59 +433,10 @@ swapon;all ``` #### Strace Statistics - 1. Use the cross compilers arm-linux-musleabi and aarch64-linux-musl to build the Strace tool for the 32-bit and 64-bit architectures, respectively. -2. [Trace the test process](#tracing-the-test-process) to obtain Strace logs. -3. [Trace the service process](#tracing-the-service-process) to obtain the Strace logs. -4. [Parse Strace logs](#parsing-strace-logs) by using scripts to obtain the Seccomp policy file. - -##### Tracing the Test Process - -1. Push the Strace tool to the device. - ```shell - hdc shell mount -rw -o remount / - hdc file send /path/to/strace /system/bin/ - hdc shell chmod a+x /system/bin/strace - ``` - -2. Modify the local embedded code in the [developer test framework](https://gitee.com/openharmony/testfwk_developer_test) so that Strace is executed in the test suite to trace the test process. - - Modify the **_init_gtest** and **_run_gtest** functions in **src/core/driver/drivers.py** as follows. If a line starts with a plus sign (+), the line is added; if a line starts with a hyphen (-), the line is deleted. - - ```python - --- a/src/core/driver/drivers.py - +++ b/src/core/driver/drivers.py - @@ -500,6 +500,8 @@ class CppTestDriver(IDriver): - "rm -rf %s" % self.config.target_test_path) - self.config.device.execute_shell_command( - "mkdir -p %s" % self.config.target_test_path) - + self.config.device.execute_shell_command( - + "mkdir -p /data/strace") - self.config.device.execute_shell_command( - "mount -o rw,remount,rw /") - if "fuzztest" == self.config.testtype[0]: - @@ -539,10 +541,11 @@ class CppTestDriver(IDriver): - test_para, - seed) - else: - - command = "cd %s; rm -rf %s.xml; chmod +x *; ./%s %s" % ( - + command = "cd %s; rm -rf %s.xml; chmod +x *; strace -ff -o /data/strace/%s.strace.log ./%s %s" % ( - self.config.target_test_path, - filename, - filename, - + filename, - test_para) - else: - coverage_outpath = self.config.coverage_outpath - ``` -3. Execute related service test cases. -4. Obtain Strace logs from **/data/strace** on the device. - ```shell - hdc file recv /data/strace /path/to/base/startup/init/services/modules/seccomp/scripts/tools/ - ``` - +2. [Trace the service process](#tracing-the-service-process) to obtain the Strace logs. +3. [Parse Strace logs](#parsing-strace-logs) by using scripts to obtain the Seccomp policy file. ##### Tracing the Service Process - 1. Modify the embedded code in the init repository. Specifically, add the following content to **//base/startup/init/services/init/init_common_service.c** before executing the **SetSystemseccompPolicy** function to set the Seccomp policy. If the line starts with a plus sign (+), the line is added; if the line starts with a hyphen (-), the line is deleted. **xxxx** must be the same as the value of **Services name** in the [boot configuration file](subsys-boot-init-cfg.md) of the process. ```c --- a/services/init/init_common_service.c @@ -563,7 +485,6 @@ swapon;all ``` ##### Parsing Strace Logs - 1. Copy the dependency files to the Strace log folder for later use. The dependency files are those generated in step 2 in [Static Analysis](#static-analysis). ```shell cp out/*product name* /gen/base/startup/init/services/modules/seccomp/gen_system_filter/libsyscall_to_nr_arm* base/startup/init/services/modules/seccomp/scripts/tools/strace/ @@ -600,7 +521,6 @@ swapon;all ``` #### Audit Statistics - 1. Enable the initial Seccomp policy. For details, see [Customizing Seccomp Policies for a Process](#customizing-seccomp-policies-for-a-process). 2. Obtain logs. 1. Create a folder for storing logs. @@ -636,8 +556,7 @@ swapon;all Example audit log: ```shell - <5>[ 198.963101] audit: type=1326 audit(1659528178.748:27): auid=4294967295 uid=0 gid=1000 ses=4294967295 subj=u:r:appspawn:s0 pid=2704 comm="config_dialog_s" exe="/system/bin/appspawn" sig=31 arch=40000028 syscall= - 208 compat=1 ip=0xf7b79400 code=0x80000000 + <5>[ 198.963101] audit: type=1326 audit(1659528178.748:27): auid=4294967295 uid=0 gid=1000 ses=4294967295 subj=u:r:appspawn:s0 pid=2704 comm="config_dialog_s" exe="/system/bin/appspawn" sig=31 arch=40000028 syscall=208 compat=1 ip=0xf7b79400 code=0x80000000 ``` **Table 9** Key parameters in audit logs | Parameter | Description | @@ -646,7 +565,7 @@ swapon;all | sig | Semaphore. The value **31** indicates **SIGSYS**, which is the signal sent to the process when Seccomp interception occurs. | | arch | Architecture ID. The value **40000028** indicates **arm**, and the value **c00000b7** indicates **arm64**. | | syscall | System call ID. | - | compat | The value **1** indicates the compatibility mode, that is, the arm64 kernel uses arm system calls. | + | compat | The value **1** indicates the compatibility mode, that is, the arm64 kernel uses arm system calls.| 1. Copy the dependency files to the log folder for later use. The dependency files are those generated in step 2 in [Static Analysis](#static-analysis). @@ -659,7 +578,7 @@ swapon;all | Parameter | Description | | --- | --- | | --src-path | Folder for storing log files. It must contain **libsyscall_to_nr_arm** and **libsyscall_to_nr_arm64**. The folder name must not end with a slash (/), for example, **./audit**.| - | --filter-name | Name of the generated policy file. For example, if the input value is **test**, the generated file name is **test.seccomp.policy**. | + | --filter-name | Name of the generated policy file. For example, if the input value is **test**, the generated file name is **test.seccomp.policy**.| ```shell cd base/startup/init/services/modules/seccomp/scripts/tools @@ -667,7 +586,6 @@ swapon;all ``` ### Combining Multiple Policy Files - During [colltatistics on system calls](#system-call-statistic-methods), multiple policy files may be generated. In these policy files, system calls may be repeated or disordered. To solve these problems, you can combine policy files to sort system calls by arm64/arm and by system call number in ascending order. **Table 11** Parameters in the merge_policy.py script file @@ -675,7 +593,6 @@ During [colltatistics on system calls](#system-call-statistic-methods), multiple | --- | --- | | --src-files | Files to be processed, including **libsyscall_to_nr_arm** and **libsyscall_to_nr_arm64**.| | --filter-name | Name of the generated policy file. For example, if the input value is **test**, the generated file name is **test.seccomp.policy**. | - 1. Copy the dependency files to the log folder for later use. ```shell cp out/*product name* /gen/base/startup/init/services/modules/seccomp/gen_system_filter/libsyscall_to_nr_arm* base/startup/init/services/modules/seccomp/scripts/tools/ diff --git a/en/device-dev/subsystems/subsys-boot-init-sysparam.md b/en/device-dev/subsystems/subsys-boot-init-sysparam.md index 1b5541a741273c7db7551bc6441bbfb44d1532a6..af860ca17d428c3f0d9b847dbebd0d2fc3a89fde 100644 --- a/en/device-dev/subsystems/subsys-boot-init-sysparam.md +++ b/en/device-dev/subsystems/subsys-boot-init-sysparam.md @@ -1,30 +1,39 @@ # Parameter Management + ## Overview + ### Function -The parameter management module, namely, sysparam, provides an easy-to-use key-value pair access interface for system services to configure service functions based on their own system parameters. +The parameter management subsystem, namely, sysparam, provides easy-to-use key-value pair access interfaces for system services to customize functions based on their own system parameters. ### Basic Concepts -Figure 1 System parameter operation primitives +#### Operation Primitives + +Figure 1 shows the primitives used to operate system parameters. For details about how they work, see Table 1. + +Figure 1 Overview of system parameter operation primitives ![System parameter operation primitives](figures/system-parameter-operation-primitives.png) **Table 1** Description of system parameter operation primitives -| Operation Primitive| Description| + +| Operation Primitive | Description | | -------- | -------- | | get | Obtains the value of a system parameter. | | set | Sets the value of a system parameter. | | wait | Waits for value change of a system parameter synchronously.| -| watch | Observes value change of a system parameter asynchronously.| +| watch | Watches for the value change of a system parameter asynchronously.| -#### System Parameter Definition +#### Parameter Definition - Naming format - A system parameter name consists of multiple segments in dotted notation. Each segment can be a string that consists of letters, digits, and underscores (_). The total length cannot exceed 96 bytes. System parameter names are categorized into the following two types. + A system parameter name consists of multiple segments in dotted notation. Each segment can be a string that consists of letters, digits, and underscores (_). The total length cannot exceed 96 bytes. + + Two naming formats are supported for system parameters, as described in Table 2. - **Table 2** System parameter names + **Table 2** Description of system parameter naming formats | Type | Example | Description | | -------- | -------- | -------- | @@ -33,31 +42,33 @@ Figure 1 System parameter operation primitives - Type - System parameters are categorized into three types. + System parameters are categorized into three types, as described in Table 3. - **Table 3** System parameter types + **Table 3** Description of system parameter types | Type| Prefix| Description| | -------- | -------- | -------- | - | Constant| const. | Constant parameter, which will not be changed once a value is assigned. The value can contain a maximum of 4,096 bytes (including the terminator).| - | Writable| Others| Writable parameter, which will be lost after system restart. The value can contain a maximum of 96 bytes (including the terminator).| - | Persistent| persist. | Writable and persistent parameter, which will not be lost after system restart. The value can contain a maximum of 96 bytes (including the terminator).| + | Constant| const. | Constant parameter, which will not change once a value is assigned. The value can contain a maximum of 4,096 bytes (including the end-of-text character).| + | Writable| Others| Writable parameter, which will be discarded after a system restart. The value can contain a maximum of 96 bytes (including the end-of-text character).| + | Persistent| persist. | Writable and persistent parameter, which will not be discarded after a system restart. The value can contain a maximum of 96 bytes (including the end-of-text character).| - The general naming format is as follows: + Given below is the general naming format for system parameters: ``` [ const | persist ].$sub_system.$desc ``` - **$sub_system** is the name of the subsystem or module. + wherein, + + - **$sub_system** is the subsystem or module name. - **$desc** indicates the description of a system parameter. The description can contain multiple segments in dotted notation. + - **$desc** is the parameter description, which can contain multiple segments in dotted notation. -#### Definition Rules +#### Parameter Definition Rule -Each subsystem defines the system parameters of its own modules, including the system parameter name, default value, and access permission information. +System parameters are defined per module on each subsystem. The parameter definition includes the system parameter name, default value, and access permission information. -- System parameter value definition file +- Value definition file - - The system parameter value definition file ends with the **.para** extension. An example of the file format is as follows: + - A value definition file of system parameters ends with the **.para** extension. The following is an example format of file content: ```shell # This is comment @@ -66,43 +77,49 @@ Each subsystem defines the system parameters of its own modules, including the s const.telephony.enable=false|true const.test.withblank=My Value - const.test.withcomment=MyValue # This should be ommitted + const.test.withcomment=MyValue # This should be omitted const.test.multiline="This is a multiline parameter. Line2 value. Last line." ``` - - You must use a complete system parameter command when assigning a value for a system parameter. The following table describes the value assignment modes. + - A complete system parameter command is required to assign a value for a system parameter. See Table 4 for the value assignment modes. - **Table 4** Value assignment modes + **Table 4** Description of value assignment modes | Type| Example| Description| | -------- | -------- | -------- | - | String | const.product.name=OHOS-PRODUCT | A multi-line string must be enclosed in double quotation marks ("").| - | Number | const.os.version.api=26 | Numbers do not need to be enclosed in quotation marks.| + | String | const.product.name=OHOS-PRODUCT | A string that spans multiple lines must be enclosed in double quotation marks ("").| + | Number | const.os.version.api=26 | A number that spans multiple lines does not need to be enclosed in double quotation marks ("").| | Boolean | const.telephony.enable=false | A Boolean value can be **0**, **1**, **false**, or **true**.| - DAC definition file - Currently, access permissions of system parameters are managed in Discretionary Access Control (DAC) mode. The access permission definition file ends with the **.para.dac** extension. The following is an example: + Access permissions of system parameters are managed in discretionary access control (DAC) mode. A DAC definition file ends with the **.para.dac** extension. The following is an example format of DAC information: ```java const.product.="root:root:660" ``` - As shown above, we can use **parameter directory** to define the same access permission for system parameters with the same prefix. The DAC information is divided into three segments, user, group, and UGO rule, which are separated using a semicolon (:). + As shown in this example, a **parameter directory** can be used to define the same access permission for system parameters with the same prefix. A piece of DAC information is divided into three segments, user, group, and Ugo rule, which are separated using a semicolon (:). + + > **NOTE** + > + > Ugo is the abbreviation for user access, group access, ad other system user's access, respectively. These permissions are set to allow or deny access to members of their own group, or any other groups. + + Figure 2 shows the Ugo rule structure. - The following figure shows the structure of the UGO rule. + **Figure 2** Overview of the Ugo rule structure - **Figure 2** UGO rule structure + ![Ugo rule](figures/dac-definition.png) - ![UGO rule](figures/dac-definition.png) +- SELinux policy -- SELinux policy for system parameter configuration + An SELinux policy defines the access permissions for all users, programs, processes, and files. - - Add SELinux tags. + - Adding an SELinux tag - To add a SELinux tag to system parameters, you first need to define the tag in the **/base/security/selinux/sepolicy/base/public/parameter.te** file. For example: + To add an SELinux tag to system parameters, you first need to define the tag in the **/base/security/selinux/sepolicy/base/public/parameter.te** file. For example: ```java type servicectrl_param, parameter_attr @@ -114,62 +131,71 @@ Each subsystem defines the system parameters of its own modules, including the s ohos.servicectrl. u:object_r:servicectrl_param:s0 ``` - - Grant operation permissions. For example, to grant operation permissions such as map for the init process, add the following content to the **/base/security/selinux/sepolicy/ohos_policy/startup/init/public/init.te** file: + - Granting access permissions for a process + + For example, to grant access permissions such as map for the init process, add the following code to the **/base/security/selinux/sepolicy/ohos_policy/startup/init/public/init.te** file: ```java allow servicectrl_param tmpfs:filesystem associate; allow init servicectrl_param:file { map open read relabelto relabelfrom }; ``` - - Set the write permission. For example, grant the system parameter write permission for services such as **init**, **samgr**, and **hdf_devmgr**. + - Granting the write permission + + For example, to grant the write permission for services such as **init**, **samgr**, and **hdf_devmgr**, use the following code: ```java allow { init samgr hdf_devmgr } servicectrl_param:parameter_service { set }; ``` - - Set the read permission. If you want to grant the permission only for certain services, replace **xxx** with the services in the following code: + - Granting the read permission + + If you want to grant the read permission only for certain services, replace **xxx** with these services in the following code: ```java allow { xxx } servicectrl_param:file { map open read }; ``` - - If you want to grant the permission for all services, use the following code: + - Granting access permissions for all services + + If you want to grant access permissions for all services, use the following code: ```java allow { domain -limit_domain } servicectrl_param:file { map open read }; ``` -- Suggestions +- System parameter tag - Keep only two system parameter tags for each subsystem: + You are advised to keep only two system parameter tags for each subsystem: - A private tag to control system parameter settings. - - A public tag to grant access from all services. + - A public tag to grant access permissions from all services. - Loading sequence - The following table provides the sequence of loading system parameters. + System parameters are loaded by priority in the specified sequence, as described in Table 5. + + **Table 5** Description of the system parameter loading sequence - **Table 5** System parameter loading sequence | Type| Path| Description| | -------- | -------- | -------- | | Kernel parameters | /proc/cmdline | Convert some values of kernel parameters into system parameters. Specifically, convert all **ohospara.xxx=valXXX** parameters to **ohos.boot.xxx=valXXX** parameters.| | OS system parameters| /system/etc/param/ohos_const/*.para | Load the definition file containing OS constants preferentially. | | Vendor parameters| /vendor/etc/param/*.para | Load the system parameters defined by vendors with the secondary priority. | - | System parameters| /system/etc/param/*.para | Load the parameters defined by each subsystem. If a system parameter already exists, ignore it.| - | Persistent parameters| /data/parameters/ | If persistent parameters exist, load them at last. Persistent parameters will overwrite the default system parameters that have been loaded.| + | System parameters| /system/etc/param/*.para | Load the system parameters defined by each subsystem. A system parameter will be ignored if it already exists.| + | Persistent parameters| /data/parameters/ | Load persistent parameters, if any, at last. Persistent parameters will overwrite the default system parameters that have been loaded.| -#### System Parameter Tag File Size +#### Tag File Size -If one tag corresponds to more than five system parameters, you need to set the size of the system parameter tag file in **/base/startup/init/services/etc/param/ohos.para.size**. The size value is **512** by default. +If one tag is associated with more than five system parameters, you need to set the size of the system parameter tag file in **/base/startup/init/services/etc/param/ohos.para.size**. The default value is **512**. -Configuring rule: +The configuration rule is as follows: System parameter tag = Size -Example: +For example: ```java startup_init_param=40960 @@ -178,18 +204,21 @@ startup_init_param=40960 ### Constraints -The service management module is available only for the mini system and standard system. +The parameter management subsystem is available only for the mini system and standard system. ## How to Develop -### Use Cases +### Application Scenario + You can set specific system parameters as needed to meet your service demand. -### Available APIs +### Implementation Method - - Shell commands +The parameter management subsystem allows you to manage system parameters by running shell commands or calling **syspara** APIs. - You can operate system parameters directly by using shell commands. This operation mode is available only for the standard system. The following table lists the shell commands. + - Shell command mode + + You can operate system parameters directly by running shell commands. This operation mode is available only for the standard system. Table 6 is a list of the shell commands. **Table 6** Description of shell commands @@ -198,53 +227,54 @@ You can set specific system parameters as needed to meet your service demand. | param get [**key**] | Obtains the system parameter value of the specified key. If no key name is specified, all system parameter values will be returned.| | param set **key value** | Sets the specified value for the specified key.| | param wait **key** **value** | Waits for the system parameter value of the specified key to match the specified value. Fuzzy match is supported. For example, * indicates any value, and val* indicates matching of only the first three val characters.| - | param watch | Observes value change of a system parameter asynchronously.| + | param watch | Watches for the value change of a system parameter asynchronously.| - - syspara APIs + - syspara API mode - The following table lists the APIs used to obtain system parameter values. The return result is a const string and the free operation is not supported. + Besides shell commands, you can use **syspara** APIs to manage system parameters. The return result is a constant string and the **free** operation is not supported. Table 7 is a list of the **syspara** APIs. **Table 7** Description of syspara APIs + | API| Description| | -------- | -------- | | int GetParameter(const char\* key, const char\* def, char\* value, unsigned int len) | Obtains system parameters.| | int SetParameter(const char\* key, const char\* value) | Sets or updates system parameters.| | const char\* GetDeviceType(void) | Obtains the device type.| - | const char\* GetManufacture(void) | Obtains the device manufacturer.| - | const char\* GetBrand(void) | Obtains the device brand.| - | const char\* GetMarketName(void) | Obtains the device marketing name.| - | const char\* GetProductSeries(void) | Obtains the device series name.| - | const char\* GetProductModel(void) | Obtains the device authentication model.| - | const char\* GetSoftwareModel(void) | Obtains the device software model.| - | const char\* GetHardwareModel(void) | Obtains the device hardware model.| - | const char\* GetHardwareProfile(void) | Obtains the device hardware profile.| - | const char\* GetSerial(void) | Obtains the device serial number (SN).| - | const char\* GetOSFullName(void) | Obtains the operating system name.| - | const char\* GetDisplayVersion(void) | Obtains the software version visible to users.| - | const char\* GetBootloaderVersion(void) | Obtains the bootloader version of this device.| - | const char\* GetSecurityPatchTag(void) | Obtains the security patch tag.| - | const char\* GetAbiList(void) | Obtains the list of application binary interfaces (ABIs) supported on this device.| - | int GetSdkApiVersion(void) | Obtains the SDK API level that matches the current system software.| - | int GetFirstApiVersion(void) | Obtains the first SDK API level of the system software.| - | const char\* GetIncrementalVersion(void) | Obtains the incremental version.| + | const char\* GetManufacture(void) | Obtains the device's manufacturer name.| + | const char\* GetBrand(void) | Obtains the device's brand name.| + | const char\* GetMarketName(void) | Obtains the device's marketing name.| + | const char\* GetProductSeries(void) | Obtains the device's product series name.| + | const char\* GetProductModel(void) | Obtains the device's product model.| + | const char\* GetSoftwareModel(void) | Obtains the device's software model.| + | const char\* GetHardwareModel(void) | Obtains the device's hardware model.| + | const char\* GetHardwareProfile(void) | Obtains the device's hardware profile.| + | const char\* GetSerial(void) | Obtains the device's serial number (SN).| + | const char\* GetOSFullName(void) | Obtains the device's OS name.| + | const char\* GetDisplayVersion(void) | Obtains the device's displayed software version.| + | const char\* GetBootloaderVersion(void) | Obtains the device's bootloader version.| + | const char\* GetSecurityPatchTag(void) | Obtains the device's security patch tag.| + | const char\* GetAbiList(void) | Obtains the list of supported application binary interfaces (ABIs).| + | int GetSdkApiVersion(void) | Obtains the SDK API version that matches the current system software.| + | int GetFirstApiVersion(void) | Obtains the first SDK API version of the system software.| + | const char\* GetIncrementalVersion(void) | Obtains the incremental version of the system software.| | const char\* GetVersionId(void) | Obtains the version ID.| | const char\* GetBuildType(void) | Obtains the build type.| - | const char\* GetBuildUser(void) | Obtains the build account user name.| - | const char\* GetBuildHost(void) | Obtains the build host name.| + | const char\* GetBuildUser(void) | Obtains the build user.| + | const char\* GetBuildHost(void) | Obtains the build host.| | const char\* GetBuildTime(void) | Obtains the build time.| - | const char\* GetBuildRootHash(void) | Obtains the buildroot hash value of this version.| + | const char\* GetBuildRootHash(void) | Obtains the buildroot hash value of the current version.| | const char\* GetOsReleaseType(void) | Obtains the system release type.| - | int GetDevUdid(char \*udid, int size) | Obtains the device identifier (UDID).| - | const char *AclGetSerial(void); | Obtains the device SN (with ACL check).| - | int AclGetDevUdid(char *udid, int size); | Obtains the UDID (with ACL check).| + | int GetDevUdid(char \*udid, int size) | Obtains the device's unique device ID (UDID).| + | const char *AclGetSerial(void); | Obtains the device's SN with ACL check.| + | int AclGetDevUdid(char *udid, int size); | Obtains the device's UDID with ACL check.| -### How to Develop +### Development Procedure -1. System parameter definition +#### Parameter Definition - You can define default system parameters and implement permission control on them by configuring the subsystem or product .para and .para.dac files. +You can define default system parameters and implement permission control on them by configuring the .para and .para.dac files of the respective subsystem or product. - ​ On a standard system, use the ohos_prebuilt_para template to install the configuration file to the /etc/param/ directory. The following is an example of the GN script: +- On a standard system, use the ohos_prebuilt_para template to install the configuration file to the /etc/param/ directory. The following is an example of the GN script: ```go import("//base/startup/init/services/etc/param/param_fixer.gni") @@ -262,7 +292,7 @@ You can set specific system parameters as needed to meet your service demand. } ``` - On a small system, run the copy command to copy the corresponding system parameter definition file to the system/etc/param directory. +- On a small system, run the copy command to copy the corresponding system parameter definition file to the system/etc/param directory. ```go copy("ohos.para") { sources = [ "//base/startup/init/services/etc/param/ohos.para" ] @@ -273,7 +303,7 @@ You can set specific system parameters as needed to meet your service demand. outputs = [ "$root_out_dir/system/etc/param/ohos.para.dac" ] } ``` - On a mini system, convert all defined default system parameters into header files through **action** and compile them into the system. +- On a mini system, convert all defined default system parameters into header files through **action** and compile them into the system. ```go action("lite_const_param_to") { script = "//base/startup/init/scripts/param_cfg_to_code.py" @@ -289,7 +319,7 @@ You can set specific system parameters as needed to meet your service demand. outputs = [ "$target_gen_dir/${target_name}_param_cfg_to_code.log" ] } ``` -2. Development example +#### Development Example ``` // set && get char key1[] = "rw.sys.version"; diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md index 2f5cd08ffab5ac1499f9e4a6e324caf1de64f106..76d048f3056769b13338e3a7629d6be00d2513ae 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md @@ -81,10 +81,6 @@ The **condition** parameter must be in the specified JSON string format. For exa "and":[ {"param":"type_","op":">","value":0}, {"param":"uid_","op":"=","value":1201} - ], - "or":[ - {"param":"NAME","op":"=","value":"SysEventService"}, - {"param":"NAME","op":"=","value":"SysEventSource"} ] } } @@ -93,7 +89,6 @@ The **condition** parameter must be in the specified JSON string format. For exa - The **version** field is mandatory, indicating the supported version of the input condition. Currently, only **V1** is supported. - The **condition** field is mandatory, indicating the input condition. - The **and** field is optional, indicating the AND relationship between conditions. - - The **or** field is optional, indicating the OR relationship between conditions. - The **param** field is mandatory, indicating the parameter name for condition matching. The value must be a string. - The **op** field is mandatory, indicating the parameter comparison operator for condition matching. The value must be a string. Supported comparison operators include the following: =, >, <, >=, and <=. - The **value** field is mandatory, indicating the parameter value for condition matching. The value must be a string or an integer. diff --git a/en/device-dev/subsystems/subsys-power-default-sleep-behavior-customization.md b/en/device-dev/subsystems/subsys-power-default-sleep-behavior-customization.md new file mode 100644 index 0000000000000000000000000000000000000000..032395511926c8466dd714b79687d08bb3222085 --- /dev/null +++ b/en/device-dev/subsystems/subsys-power-default-sleep-behavior-customization.md @@ -0,0 +1,161 @@ +# Default Hibernation Behavior Customization + +## Overview + +### Introduction + +By default, after a device screen is turned off, OpenHarmony starts the running lock loop detection thread and then enters the hibernation state. For different devices, the mode of turning off the screen is different, which can be closing the lid, setting a timeout, or pressing the power button. Besides, the default hibernation behavior is also different, which can be performing no action, powering off the screen, or entering the hibernation state. To address this issue, OpenHarmony provides the default hibernation behavior customization function, allowing you to customize the default hibernation behavior depending on your hardware specifications. + +### Constraints + +The configuration paths for battery level customization are subject to the configuration policy. +The configuration path for battery level customization is subject to the [configuration policy](https://gitee.com/openharmony/customization_config_policy). In this development guide, `/vendor` is used as an example of the configuration path. During actual development, you need to modify the customization path based on the product configuration policy. + +## How to Develop + +### Setting Up the Environment + +**Hardware requirements:** + +Development board running the standard system, for example, the DAYU200 or Hi3516D V300 open source suite. + +**Environment requirements:** + +For details about the requirements on the Linux environment, see [Quick Start](../quick-start/quickstart-overview.md). + +### Getting Started with Development + +The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/master/rk3568) as an example to illustrate default hibernation behavior customization. + +1. Create the `power_manager` folder in the product directory [/vendor/hihope/rk3568](https://gitee.com/openharmony/vendor_hihope/tree/master/rk3568). + +2. Create a target folder by referring to the [default folder of hibernation behavior configuration](https://gitee.com/openharmony/powermgr_power_manager/tree/master/services/native/profile), and install it in `/vendor/hihope/rk3568/power_manager`. The content is as follows: + + ```text + profile + ├── BUILD.gn + ├── power_suspend.json + ``` + +3. Write the custom `power_suspend.json` file that contains the custom default hibernation behavior. The following is an example of hibernation behavior configuration: + + ```json + { + "powerkey": { + "action": 1, + "delayMs": 0 + }, + "timeout": { + "action": 1, + "delayMs": 0 + }, + "lid": { + "action": 1, + "delayMs": 0 + }, + "switch": { + "action": 1, + "delayMs": 0 + } + } + ``` + + **Table 1** Description of hibernation sources + + | Hibernation Source| Description| + | -------- | -------- | + | powerkey | Hibernation by power button| + | timeout | Hibernation by timeout| + | lid | Hibernation by lid| + | switch | Hibernation by switch| + + **Table 2** Description of the hibernation source configuration + + | Item| Description| + | -------- | -------- | + | action | Action to take after the screen is turned off. Set this parameter to an enumerated value. For details, see Table 3.| + | delayMs | Delay, in ms.| + + **Table 3** Description of action + + | action | Value| Description| + | -------- | -------- | -------- | + | ACTION_NONE | 0 | No action.| + | ACTION_AUTO_SUSPEND | 1 | Automatically entering the sleep mode.| + | ACTION_FORCE_SUSPEND | 2 | Forcibly entering the sleep mode.| + | ACTION_HIBERNATE | 3 | Entering the hibernation state.| + | ACTION_SHUTDOWN | 4 | Shutting down the system.| + +4. Write the `BUILD.gn` file by referring to the [BUILD.gn](https://gitee.com/openharmony/powermgr_power_manager/blob/master/services/native/profile/BUILD.gn) file in the default folder of hibernation behavior configuration to pack the `power_suspend.json` file to the `/vendor/etc/power_config` directory. The configuration is as follows: + + ```shell + import("//build/ohos.gni") # Reference build/ohos.gni. + + ohos_prebuilt_etc("suspend_config") { + source = "power_suspend.json" + relative_install_dir = "power_config" + install_images = [ chipset_base_dir ] # Required configuration for installing the battery_config.json file in the vendor directory. + part_name = "product_rk3568" # Set part_name to product_rk3568 for subsequent build. + } + ``` + +5. Add the build target to `module_list` in [ohos.build](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/ohos.build) in the `/vendor/hihope/rk3568` directory. For example: + + ```json + { + "parts": { + "product_rk3568": { + "module_list": [ + "//vendor/hihope/rk3568/default_app_config:default_app_config", + "//vendor/hihope/rk3568/image_conf:custom_image_conf", + "//vendor/hihope/rk3568/preinstall-config:preinstall-config", + "//vendor/hihope/rk3568/resourceschedule:resourceschedule", + "//vendor/hihope/rk3568/etc:product_etc_conf", + "//vendor/hihope/rk3568/power_manager/profile:wakeup_config" // Add the configuration for building of suspend_config. + ] + } + }, + "subsystem": "product_hihope" + } + ``` + In the preceding code, `//vendor/hihope/rk3568/power_manager/` is the folder path, `profile` is the folder name, and `suspend_config` is the build target. + +6. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md). + + ```shell + ./build.sh --product-name rk3568 --ccache + ``` + +7. Burn the customized version to the DAYU200 development board. + +### Debugging and Verification + +1. Customize hibernation sources in the `power_suspend.json` file. + ```json + { + "powerkey": { + "action": 4, + "delayMs": 0 + }, + "timeout": { + "action": 1, + "delayMs": 0 + }, + "lid": { + "action": 1, + "delayMs": 0 + }, + "switch": { + "action": 1, + "delayMs": 0 + } + } + ``` + +2. Power on the device, and then press the power button. + + The device is powered off. + +3. Power on the device again, and then wait for a while. + + The device screen is turned off. diff --git a/en/device-dev/subsystems/subsys-power-stats-power-average-customization.md b/en/device-dev/subsystems/subsys-power-stats-power-average-customization.md index d7867ed30ad70c2088416d5668441803a4d6ebfb..384b4350f417afc69717d0a4a98102f6ce66d4f5 100644 --- a/en/device-dev/subsystems/subsys-power-stats-power-average-customization.md +++ b/en/device-dev/subsystems/subsys-power-stats-power-average-customization.md @@ -4,7 +4,7 @@ ### Introduction -By default, OpenHarmony provides the power consumption statistics feature. However, the power consumption benchmarks vary according to hardware specifications of different products. To address this issue, OpenHarmony provides the power consumption statistics customization function, allowing you to customize power consumption benchmarks depending on your hardware specifications. +By default, OpenHarmony provides the power consumption statistics feature. However, the power consumption benchmarks vary according to hardware specifications of different products. To address this issue, OpenHarmony provides the power consumption statistics customization function, allowing you to customize power consumption benchmarks depending on your hardware specifications. ### Basic Concepts diff --git a/en/device-dev/subsystems/subsys-power-wakeup-source-customization.md b/en/device-dev/subsystems/subsys-power-wakeup-source-customization.md new file mode 100644 index 0000000000000000000000000000000000000000..a4d8f57c4792175adefa295470730f3fa19c2d46 --- /dev/null +++ b/en/device-dev/subsystems/subsys-power-wakeup-source-customization.md @@ -0,0 +1,178 @@ +# Wakeup Source Customization + +## Overview + +### Introduction + +OpenHarmony supports multiple wakeup sources, such as the power button, keyboard, and mouse, and provides custom modes for turning on and off these wakeup sources. After a device enters the sleep state, you can turn on the screen and wake up the device by pressing the power button, keyboard, or mouse. However, different products may support different peripherals, for example, stylus or folio keyboard. To address this issue, OpenHarmony provides the wakeup source customization function, allowing you to customize wakeup sources depending on your hardware specifications. + +### Constraints + +The configuration paths for battery level customization are subject to the configuration policy. +The configuration path for battery level customization is subject to the [configuration policy](https://gitee.com/openharmony/customization_config_policy). In this development guide, `/vendor` is used as an example of the configuration path. During actual development, you need to modify the customization path based on the product configuration policy. + +## How to Develop + +### Setting Up the Environment + +**Hardware requirements:** + +Development board running the standard system, for example, the DAYU200 or Hi3516D V300 open source suite. + +**Environment requirements:** + +For details about the requirements on the Linux environment, see [Quick Start](../quick-start/quickstart-overview.md). + +### Getting Started with Development + +The following uses [DAYU200](https://gitee.com/openharmony/vendor_hihope/tree/master/rk3568) as an example to illustrate wakeup source customization. + +1. Create the `power_manager` folder in the product directory [/vendor/hihope/rk3568](https://gitee.com/openharmony/vendor_hihope/tree/master/rk3568). + +2. Create a target folder by referring to the [default folder of wakeup source configuration](https://gitee.com/openharmony/powermgr_power_manager/tree/master/services/native/profile), and install it in `/vendor/hihope/rk3568/power_manager`. The content is as follows: + + ```text + profile + ├── BUILD.gn + ├── power_wakeup.json + ``` + +3. Write the custom `power_wakeup.json` file that contains the custom wakeup sources. The following is an example of wakeup source configuration: + + ```json + { + "powerkey": { + "enable": true + }, + "keyborad": { + "enable": true + }, + "mouse": { + "enable": true + }, + "touchscreen": { + "enable": true, + "click": 2 + }, + "touchpad": { + "enable": true + }, + "pen": { + "enable": true + }, + "lid": { + "enable": true + }, + "switch": { + "enable": true + } + } + ``` + + **Table 1** Description of wakeup sources + + | Wakeup Source| Description| + | -------- | -------- | + | powerkey | Wakeup by power button| + | keyborad | Wakeup by keyboard| + | mouse | Wakeup by mouse| + | touchscreen | Wakeup by touchscreen| + | touchpad | Wakeup by touchpad| + | pen | Wakeup by stylus| + | lid | Wakeup by lid| + | switch | Wakeup by switch| + + **Table 2** Description of the wakeup source configuration + + | Item| Type| Description| + | -------- | -------- | -------- | + | enable | bool | Whether to enable wakeup listening| + | click | int | Number of clicks| + + +4. Write the `BUILD.gn` file by referring to the [BUILD.gn](https://gitee.com/openharmony/powermgr_power_manager/blob/master/services/native/profile/BUILD.gn) file in the default folder of wakeup source configuration to pack the `power_wakeup.json` file to the `/vendor/etc/power_config` directory. The configuration is as follows: + + ```shell + import("//build/ohos.gni") # Reference build/ohos.gni. + + ohos_prebuilt_etc("wakeup_config") { + source = "power_wakeup.json" + relative_install_dir = "power_config" + install_images = [ chipset_base_dir ] # Required configuration for installing the battery_config.json file in the vendor directory. + part_name = "product_rk3568" # Set part_name to product_rk3568 for subsequent build. + } + ``` + +5. Add the build target to `module_list` in [ohos.build](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/ohos.build) in the `/vendor/hihope/rk3568` directory. For example: + + ```json + { + "parts": { + "product_rk3568": { + "module_list": [ + "//vendor/hihope/rk3568/default_app_config:default_app_config", + "//vendor/hihope/rk3568/image_conf:custom_image_conf", + "//vendor/hihope/rk3568/preinstall-config:preinstall-config", + "//vendor/hihope/rk3568/resourceschedule:resourceschedule", + "//vendor/hihope/rk3568/etc:product_etc_conf", + "//vendor/hihope/rk3568/power_manager/profile:wakeup_config" // Add the configuration for building of wakeup_config. + ] + } + }, + "subsystem": "product_hihope" + } + ``` + In the preceding code, `//vendor/hihope/rk3568/power_manager/` is the folder path, `profile` is the folder name, and `wakeup_config` is the build target. + +6. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md). + + ```shell + ./build.sh --product-name rk3568 --ccache + ``` + +7. Burn the customized version to the DAYU200 development board. + +### Debugging and Verification + +1. Customize wakeup sources in the `power_wakeup.json` file. + ```json + { + "powerkey": { + "enable": true + }, + "keyborad": { + "enable": true + }, + "mouse": { + "enable": true + }, + "touchscreen": { + "enable": false, + "click": 2 + }, + "touchpad": { + "enable": false + }, + "pen": { + "enable": false + }, + "lid": { + "enable": false + }, + "switch": { + "enable": false + } + } + ``` + +2. After the device is powered on, press the power button to switch the device to the sleep mode. Then, press the power button again. + + The device screen is turned on and the device is woken up. + +3. Press the power button to switch the device to the sleep mode, and then press the keyboard. + + The device screen is turned on and the device is woken up. + +4. Press the power button to switch the device to the sleep mode, and then move the mouse. + + The device screen is turned on and the device is woken up. diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-web.md index 806f1270619d8aec7e7efcf95f41b7a45cc602e8..aff1454a2ed5fca720e5924f863361a294dacb8f 100644 --- a/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-web.md +++ b/en/release-notes/changelogs/OpenHarmony_3.2.10.7/changelog-web.md @@ -465,3 +465,64 @@ Example: } } ``` + +## cl.web.11 Removal of webDebuggingAccess + +The definition of the **webDebuggingAccess** API is inappropriate. This API should take effect for all **Web** instances. In light of this, it is removed and replaced by the new API **setWebDebuggingAccess**. + +**Change Impacts** + +This API must be deprecated and replaced with the **setWebDebuggingAccess** API. + +**Key API/Component Changes** + +| Class| API Type| Declaration| Change Type| +| -- | -- | -- | -- | +|WebAttribute | method | webDebugggingAccess(webDebugggingAccess: boolean): WebAttribute| Deleted| + +**Adaptation Guide** + +Use the new API **setWebDebuggingAccess**. + +## cl.web.12 Adding of setWebDebuggingAccess + +Added the static API **setWebDebuggingAccess** to **WebviewController**. It sets whether to enable web debugging works for all **Web** instances. + +**Change Impacts** + +The original **webDebugggingAccess** API must be replaced with the new API in the application. + +**Key API/Component Changes** + +| Class| API Type| Declaration| Change Type| +| -- | -- | -- | -- | +|webview.WebviewController | method | static setWebDebugggingAccess(webDebugggingAccess: boolean): void| Added| + +**Adaptation Guide** + +The following exemplifies how to enable web debugging: + +```ts +// xxx.ets +import web_webview from '@ohos.web.webview'; + +@Entry +@Component +struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController(); + + aboutToAppear():void { + try { + web_webview.WebviewController.setWebDebuggingAccess(true); + } catch(error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + } + + build() { + Column() { + Web({ src: 'www.example.com', controller: this.controller }) + } + } +} +``` diff --git a/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-notification.md b/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-notification.md new file mode 100644 index 0000000000000000000000000000000000000000..6912ea1b5e419a71e017f54e91202ff5570f2477 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_3.2.12.2/changelog-notification.md @@ -0,0 +1,21 @@ +# Notification Subsystem Changelog + +Compared with OpenHarmony 3.2 Release, OpenHarmony 3.2.12.2 provides more detailed error code information for the APIs of the notification subsystem. + +## cl.notification.1 Added and Optimized API Error Code Description + +The error code description and all error codes that may be returned by the APIs are commented out. This helps developers control the error process more accurately. + +**Change Impact** + +The external declaration of the JS APIs of API version 9 is affected, but the API functionalities are not affected. You can determine whether to adapt to the JS APIs. + +**Key API/Component Changes** + +The comments of the following modules are updated. For details, see the corresponding external API declaration and API development guide. + +| Module | Major Change | +| --------------------------- | ------------------------------------------------------------ | +| @ohos.commonEventManager | Added the description of error codes 801, 1500007, and 1500008. | +| @ohos.notificationManager | Added the description of error codes 201, 202, 1600001, 1600002, 1600003, 1600004, 1600005, 1600007, 1600008, 1600009, 1600010, and 17700001, and adjusted the description of error code 401.| +| @ohos.notificationSubscribe | Added the description of error codes 201, 202, 1600001, 1600002, 1600003, 1600007, 1600008, and 17700001, and adjusted the description of error code 401.| diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelog-web.md b/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelog-web.md index 0077fba6b1d4332475ea8b8ffca6501333eb3282..26713e17d3561260b45b3b0da193693610e245c7 100644 --- a/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelog-web.md +++ b/en/release-notes/changelogs/OpenHarmony_4.0.2.2/changelog-web.md @@ -1,4 +1,4 @@ -# Web Subsystem ChangeLog +# Web Subsystem Changelog Compared with earlier versions, OpenHarmony 4.0.2.2 has the following API changes in its web subsystem: @@ -22,7 +22,7 @@ Use the new API **setWebDebuggingAccess**. ## cl.web.2 Adding of setWebDebuggingAccess -The static API **setWebDebuggingAccess** is added to **WebviewController**. It sets whether to enable web debugging, and the setting takes effect for all **Web** instances. +Added the static API **setWebDebuggingAccess** to **WebviewController**. It sets whether to enable web debugging works for all **Web** instances. **Change Impacts** @@ -61,5 +61,3 @@ struct WebComponent { } } } - -``` \ No newline at end of file diff --git a/en/release-notes/changelogs/OpenHarmony_4.0.7.1/changelog-resourceschedule.md b/en/release-notes/changelogs/OpenHarmony_4.0.7.1/changelog-resourceschedule.md new file mode 100644 index 0000000000000000000000000000000000000000..a58424e3fa627df44c21d8b9a16b8fbfaa3583b5 --- /dev/null +++ b/en/release-notes/changelogs/OpenHarmony_4.0.7.1/changelog-resourceschedule.md @@ -0,0 +1,75 @@ +# Resource Scheduler Subsystem Changelog + +## cl.resourceschedule.reminderAgent.1 + +The reminder agent allows you to customize buttons for system applications. Clicking a custom button will redirect you to the specified application page. + +**Change Impact** + +For system applications developed based on OpenHarmony 4.0.7.1 and later SDK versions, you can set custom buttons for reminders. + +**Key API/Component Changes** + +| Module| Class| Method/Attribute/Enum/Constant| Change Type| +| -- | -- | -- | -- | +| reminderAgentManager | ActionButtonType | ACTION_BUTTON_TYPE_CUSTOM = 2 | Added| +| reminderAgentManager | ActionButton | wantAgent?: WantAgent | Added| +| reminderAgentManager | WantAgent | uri?: string | Added| +| reminderAgentManager | ReminderRequest | actionButton?: [ActionButton?, ActionButton?, ActionButton?] | Changed| + +**Adaptation Guide** + +```ts +import reminderAgentManager from '@ohos.reminderAgentManager'; + +let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = { + reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM, // The reminder type is alarm clock. + ... + actionButton: [ + { + title: 'Remind later', + type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE + }, + { + title: 'Close', + type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE + }, + { + title: 'Custom', + type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CUSTOM, + wantAgent: { + pkgName: "com.example.myapplication", + abilityName: "EntryAbility", + } + }, + ] +} +``` + +## cl.resourceschedule.reminderAgent.2 + +The reminder agent allows you to set reminders to automatically disappear at the given time. + +**Change Impact** + +For system applications developed based on OpenHarmony 4.0.7.1 and later SDK versions, you can set the reminders to disappear automatically. + +**Key API/Component Changes** + +| Module| Class| Method/Attribute/Enum/Constant| Change Type| +| -- | -- | -- | -- | +| reminderAgentManager | ReminderRequest | tapDismissed?: boolean | Added| +| reminderAgentManager | ReminderRequest | autoDeletedTime?: number | Added| + +**Adaptation Guide** + +```ts +import reminderAgentManager from '@ohos.reminderAgentManager'; + +let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = { + reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM, // The reminder type is alarm clock. + ... + tapDismissed: true, + autoDeletedTime: 300, +} +``` diff --git a/zh-cn/application-dev/application-models/accessibilityextensionability.md b/zh-cn/application-dev/application-models/accessibilityextensionability.md index 98008c1a530809057f2f7f1e3831e4fb0b9f38f6..088262861fe48b0d92ef3b5eef2f35395b0eae57 100644 --- a/zh-cn/application-dev/application-models/accessibilityextensionability.md +++ b/zh-cn/application-dev/application-models/accessibilityextensionability.md @@ -1,4 +1,4 @@ -# AccessibilityExtensionAbility开发指南 +# AccessibilityExtensionAbility AccessibilityExtensionAbility基于ExtensionAbility框架,提供无障碍扩展服务,开发者可以基于AccessibilityExtensionAbility模板开发自己的辅助功能应用,协助用户完成一些快捷的交互过程。 diff --git a/zh-cn/application-dev/application-models/application-component-configuration-fa.md b/zh-cn/application-dev/application-models/application-component-configuration-fa.md index 440bff8f9ea4bf49a6ace78b4b17202b086c5574..058bd41922b672a9370d94524e76bb1b571df262 100644 --- a/zh-cn/application-dev/application-models/application-component-configuration-fa.md +++ b/zh-cn/application-dev/application-models/application-component-configuration-fa.md @@ -10,7 +10,7 @@ - **应用图标和标签配置** - FA模型不支持直接配置应用图标和标签,会以符合规则的PageAbility的图标和标签作为应用图标和标签。PageAbility的图标和标签配置请参见[PageAbility组件配置](pageability-configuration.md)。需在config.json文件的abilities标签下配置icon字段,标签值为资源文件的索引。图标需要在配置IDE的资源文件中,路径为/resource/base/media。取值示例:$media:ability_icon。标签值为资源文件的索引,标识Ability对用户显示的名称。取值可以是Ability名称,也可以是对该名称的资源索引,以支持多语言。如果在该Ability的skills属性中,actions的取值包含 "action.system.home",entities取值中包含"entity.system.home",则该Ability的icon和label将同时作为应用的icon和label。如果存在多个符合条件的Ability,则取位置靠前的Ability的icon和label作为应用的icon和label。应用图标和标签配置可以参考[ablities标签说明](../quick-start/module-structure.md)。 + FA模型不支持直接配置应用图标和标签,会以符合规则的PageAbility的图标和标签作为应用图标和标签。PageAbility的图标和标签配置请参见[PageAbility组件配置](pageability-configuration.md)。需在config.json文件的abilities标签下配置icon字段,标签值为资源文件的索引。图标需要在配置IDE的资源文件中,路径为/resource/base/media。取值示例:$media:ability_icon。标签值为资源文件的索引,标识Ability对用户显示的名称。取值可以是Ability名称,也可以是对该名称的资源索引,以支持多语言。如果在该Ability的skills属性中,actions的取值包含 "action.system.home",entities取值中包含"entity.system.home",则该Ability的icon和label将同时作为应用的icon和label。如果存在多个符合条件的Ability,则取位置靠前的Ability的icon和label作为应用的icon和label。应用图标和标签配置可以参考[abilities标签说明](../quick-start/module-structure.md)。 ```json "abilities": [ @@ -36,4 +36,4 @@ - **组件权限申请配置** - 组件权限申请配置需在confog.json中的module标签下配置reqPermission字段。来声明需要申请权限的名称,申请权限的原因以及权限使用的场景。组件权限申请可以参考[reqPermission标签说明](../quick-start/module-structure.md)。 \ No newline at end of file + 组件权限申请配置需在config.json中的module标签下配置reqPermission字段。来声明需要申请权限的名称,申请权限的原因以及权限使用的场景。组件权限申请可以参考[reqPermission标签说明](../quick-start/module-structure.md)。 \ No newline at end of file diff --git a/zh-cn/application-dev/application-models/application-component-configuration-stage.md b/zh-cn/application-dev/application-models/application-component-configuration-stage.md index 4765ee6c30a2b15b542cbc017bcaf468bf99f295..7bc5c21d3cfb0d2f780dc84e8923399dd2437d12 100644 --- a/zh-cn/application-dev/application-models/application-component-configuration-stage.md +++ b/zh-cn/application-dev/application-models/application-component-configuration-stage.md @@ -62,7 +62,7 @@ } } ``` - OpenHarmony系统对无图标应用严格管控,防止一些恶意应用故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户的手机安全。 + OpenHarmony系统对无图标应用严格管控,防止一些恶意应用故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户终端设备的安全。 如果应用确需隐藏入口图标,需要配置AllowAppDesktopIconHide应用特权,具体配置方式参考[应用特权配置指南](../../device-dev/subsystems/subsys-app-privilege-config-guide.md)。详细的入口图标及入口标签的显示规则如下。 diff --git a/zh-cn/application-dev/application-models/arkts-ui-widget-working-principles.md b/zh-cn/application-dev/application-models/arkts-ui-widget-working-principles.md index a9fe611ff2dab83d847e9cbea3db9c401f35a4e0..f51d3a6aca67f5047c487eeb588211d21551fc68 100644 --- a/zh-cn/application-dev/application-models/arkts-ui-widget-working-principles.md +++ b/zh-cn/application-dev/application-models/arkts-ui-widget-working-principles.md @@ -49,10 +49,12 @@ ArkTS卡片相较于JS卡片具备了更加丰富的能力,但也增加了使 - 卡片的事件处理和使用方的事件处理是独立的,建议在使用方支持左右滑动的场景下卡片内容不要使用左右滑动功能的组件,以防手势冲突影响交互体验。 -当前ArkTS卡片的能力会持续加强,如下能力会在后续版本支持: +除此之外,当前ArkTS卡片还存在如下约束: -- 不支持断点调试能力,会在后续版本支持。 +- 暂不支持导入模块。 -- 不支持import,会在后续版本支持。 +- 暂不支持极速预览。 -- 不支持极速预览,会在后续版本支持。 +- 暂不支持断点调试能力。 + +- 暂不支持Hot Reload热重载。 diff --git a/zh-cn/application-dev/application-models/component-startup-rules-fa.md b/zh-cn/application-dev/application-models/component-startup-rules-fa.md index e5d4cb541b39af727c7721b9469cae606d9f56b2..05339c898e390eacd48f90d0f83b19a8186a0dc5 100644 --- a/zh-cn/application-dev/application-models/component-startup-rules-fa.md +++ b/zh-cn/application-dev/application-models/component-startup-rules-fa.md @@ -34,7 +34,7 @@ - **跨应用启动FA模型的ServiceAbility组件或DataAbility组件,对端应用需配置关联启动** - 只针对跨应用场景 - 只针对目标组件为ServiceAbility与DataAbility生效 - - 目标应用的AssociateWakeUp为**ture**,其提供的ServiceAbility与DataAbility才允许被其他应用访问 + - 目标应用的AssociateWakeUp为**true**,其提供的ServiceAbility与DataAbility才允许被其他应用访问 - 只有系统预置应用才允许配置AssociateWakeUp字段,其余应用AssociateWakeUp默认为**false** diff --git a/zh-cn/application-dev/application-models/enterprise-extensionAbility.md b/zh-cn/application-dev/application-models/enterprise-extensionAbility.md index 1f2e24f30ebcb28d7b632283cfef4cfbb60da5b8..a3e8bebe24a65a7a7ec455c3e8072207bb28241a 100644 --- a/zh-cn/application-dev/application-models/enterprise-extensionAbility.md +++ b/zh-cn/application-dev/application-models/enterprise-extensionAbility.md @@ -1,4 +1,4 @@ -# EnterpriseAdminExtensionAbility开发指南 +# EnterpriseAdminExtensionAbility ## EnterpriseAdminExtensionAbility简介 diff --git a/zh-cn/application-dev/application-models/inputmethodextentionability.md b/zh-cn/application-dev/application-models/inputmethodextentionability.md index 53b3e6124398b5284bca31f73e8212fd2dad4ae6..658a0defe188d991eaf4e9fa496cf5ddab564caf 100644 --- a/zh-cn/application-dev/application-models/inputmethodextentionability.md +++ b/zh-cn/application-dev/application-models/inputmethodextentionability.md @@ -1,4 +1,4 @@ -# InputMethodExtensionAbility开发指南 +# InputMethodExtensionAbility ## 使用场景 [InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md)基于[ExtensionAbility](extensionability-overview.md)框架,用于开发输入法应用。 diff --git a/zh-cn/application-dev/application-models/serviceextensionability.md b/zh-cn/application-dev/application-models/serviceextensionability.md index 143b7c53190d15f18ad647f278ca9cfb67af42a5..53910c106c132262c4ad4ecdfdf1a26ae24cc09b 100644 --- a/zh-cn/application-dev/application-models/serviceextensionability.md +++ b/zh-cn/application-dev/application-models/serviceextensionability.md @@ -392,7 +392,7 @@ ServiceExtensionAbility服务组件在[onConnect()](../reference/apis/js-apis-ap console.info(TAG, 'getBundleNameByUid: ' + callerBundleName); // 对客户端包名进行识别 if (callerBundleName != 'com.example.connectextapp') { // 识别不通过 - console.info(TAG, 'The caller bundle is not in whitelist, reject'); + console.info(TAG, 'The caller bundle is not in trustlist, reject'); return; } // 识别通过,执行正常业务逻辑 diff --git a/zh-cn/application-dev/application-models/thread-model-fa.md b/zh-cn/application-dev/application-models/thread-model-fa.md index fb97b7cd0b9969583a4b3256a8f72791ca823e0f..4a9a35de25a81a6ad3c2442b7c60f3d70c068a3e 100644 --- a/zh-cn/application-dev/application-models/thread-model-fa.md +++ b/zh-cn/application-dev/application-models/thread-model-fa.md @@ -1,4 +1,4 @@ -# 线程模型 +# 线程模型概述 FA模型下的线程主要有如下三类: diff --git a/zh-cn/application-dev/application-models/windowextensionability.md b/zh-cn/application-dev/application-models/windowextensionability.md index 2d0cd23f2fe5622afa472bdf60248e14ff61836c..ceb33277174804374eca36ab98786e1c43d148c2 100644 --- a/zh-cn/application-dev/application-models/windowextensionability.md +++ b/zh-cn/application-dev/application-models/windowextensionability.md @@ -1,4 +1,4 @@ -# WindowExtensionAbility +# WindowExtensionAbility(仅对系统应用开放) [WindowExtensionAbility](../reference/apis/js-apis-application-windowExtensionAbility.md)是一种ExtensionAbility组件,用于提供界面组合扩展能力,允许系统应用进行跨应用的界面拉起和嵌入。 @@ -15,7 +15,7 @@ WindowExtensionAbility必须和[AbilityComponent](../reference/arkui-ts/ts-conta > -## 设置一个嵌入式UIAbility(仅对系统应用开放) +## 设置一个嵌入式UIAbility WindowExtensionAbility提供了onConnect()、onDisconnect()和onWindowReady()生命周期回调,根据需要重写对应的回调方法。 @@ -79,7 +79,7 @@ WindowExtensionAbility提供了onConnect()、onDisconnect()和onWindowReady()生 ``` -## 拉起一个嵌入式UIAbility(仅对系统应用开放) +## 拉起一个嵌入式UIAbility 系统应用可以通过AbilityComponent容器加载创建好的WindowExtensionAbility。 diff --git a/zh-cn/application-dev/application-test/arkxtest-guidelines.md b/zh-cn/application-dev/application-test/arkxtest-guidelines.md index f638915e4b248b6cb63c19901cfb5a4db4ccff4e..a7853c68efae3a1f75847e79aae5da8612156282 100644 --- a/zh-cn/application-dev/application-test/arkxtest-guidelines.md +++ b/zh-cn/application-dev/application-test/arkxtest-guidelines.md @@ -1,4 +1,4 @@ -# 自动化测试框架使用指南 +# 自动化测试框架使用指导 ## 概述 diff --git a/zh-cn/application-dev/connectivity/http-request.md b/zh-cn/application-dev/connectivity/http-request.md index 02459f5296451f936bdf14d5aa1a2637474d64e0..b70938d8a2416722798558c9dd13a99501cf6e81 100644 --- a/zh-cn/application-dev/connectivity/http-request.md +++ b/zh-cn/application-dev/connectivity/http-request.md @@ -78,6 +78,8 @@ httpRequest.request( // data.header为HTTP响应头,可根据业务需要进行解析 console.info('header:' + JSON.stringify(data.header)); console.info('cookies:' + JSON.stringify(data.cookies)); // 8+ + // 当该请求使用完毕时,调用destroy方法主动销毁 + httpRequest.destroy(); } else { console.info('error:' + JSON.stringify(err)); // 取消订阅HTTP响应头事件 diff --git a/zh-cn/application-dev/connectivity/ipc-rpc-overview.md b/zh-cn/application-dev/connectivity/ipc-rpc-overview.md index 9bae7408831c2dceffce76425c579d265fd39f2a..c0bba08366f8167e024bd91162f3c132e4da81fe 100755 --- a/zh-cn/application-dev/connectivity/ipc-rpc-overview.md +++ b/zh-cn/application-dev/connectivity/ipc-rpc-overview.md @@ -7,8 +7,8 @@ IPC(Inter-Process Communication)与RPC(Remote Procedure Call)用于实 > **说明:** > Stage模型不能直接使用本文介绍的IPC和RPC,需要通过以下能力实现相关业务场景: ->- IPC典型使用场景为[后台服务](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/background-services.md),后台服务通过IPC机制提供跨进程的服务调用能力。 ->- RPC典型使用场景为[多端协同](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/application-models/hop-multi-device-collaboration.md),多端协同通过RPC机制提供远端接口调用与数据传递。 +>- IPC典型使用场景为[后台服务](../application-models/background-services.md),后台服务通过IPC机制提供跨进程的服务调用能力。 +>- RPC典型使用场景为[多端协同](../application-models/hop-multi-device-collaboration.md),多端协同通过RPC机制提供远端接口调用与数据传递。 ## 实现原理 @@ -20,7 +20,7 @@ IPC和RPC通常采用客户端-服务器(Client-Server)模型,在使用时 ## 约束与限制 -- 单个设备上跨进程通信时,传输的数据量最大约为1MB,过大的数据量请使用[匿名共享内存](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-rpc.md#ashmem8)。 +- 单个设备上跨进程通信时,传输的数据量最大约为1MB,过大的数据量请使用[匿名共享内存](../reference/apis/js-apis-rpc.md#ashmem8)。 - 不支持在RPC中订阅匿名Stub对象(没有向SAMgr注册Stub对象)的死亡通知。 diff --git a/zh-cn/application-dev/database/data-persistence-by-preferences.md b/zh-cn/application-dev/database/data-persistence-by-preferences.md index 02b9d714f54943d2416baee18fa2446955f2f17c..6fb88b6cc57e3edb18b5aa14b1cec33e61a9cea7 100644 --- a/zh-cn/application-dev/database/data-persistence-by-preferences.md +++ b/zh-cn/application-dev/database/data-persistence-by-preferences.md @@ -21,7 +21,7 @@ - Key键为string类型,要求非空且长度不超过80个字节。 -- 如果Value值为string类型,可以为空,不为空时长度不超过8192个字节。 +- 如果Value值为string类型,请使用UTF-8编码格式,可以为空,不为空时长度不超过8192个字节。 - 内存会随着存储数据量的增大而增大,所以存储的数据量应该是轻量级的,建议存储的数据不超过一万条,否则会在内存方面产生较大的开销。 diff --git a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md index 4aaedf9a9f4180340f84c67cdaf91ac8ff6a2dcf..25644938494efeb3524e29381afab75d8ef5cfd4 100644 --- a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md +++ b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md @@ -1,4 +1,4 @@ -# 设备使用信息统计(API9) +# 设备使用信息统计开发指导 ## 场景介绍 diff --git a/zh-cn/application-dev/device/Readme-CN.md b/zh-cn/application-dev/device/Readme-CN.md index a544ccb901e4848a3c15156ee69566e5b53947eb..539afd28b058040e10e38b3262c7466f76e3878a 100644 --- a/zh-cn/application-dev/device/Readme-CN.md +++ b/zh-cn/application-dev/device/Readme-CN.md @@ -9,8 +9,8 @@ - [传感器开发概述](sensor-overview.md) - [传感器开发指导](sensor-guidelines.md) - 振动 - - [振动开发概述](vibrator-overview.md) - - [振动开发指导](vibrator-guidelines.md) + - [Vibrator开发概述](vibrator-overview.md) + - [Vibrator开发指导](vibrator-guidelines.md) - 多模输入 - [输入设备开发指导](inputdevice-guidelines.md) - [鼠标光标开发指导](pointerstyle-guidelines.md) @@ -18,4 +18,4 @@ - [示例服务器开发概述](sample-server-overview.md) - [示例服务器开发指导](sample-server-guidelines.md) - 设备状态 - - [设备状态开发指导](stationary-guidelines.md) + - [Stationary开发指导](stationary-guidelines.md) diff --git a/zh-cn/application-dev/dfx/hilog-guidelines.md b/zh-cn/application-dev/dfx/hilog-guidelines.md index 60e60a5fd3958952bca4859e70bcca440f174a55..201bff782abd9a9822d8ee877391a0c34fbd9546 100644 --- a/zh-cn/application-dev/dfx/hilog-guidelines.md +++ b/zh-cn/application-dev/dfx/hilog-guidelines.md @@ -1,4 +1,4 @@ -# HiLog开发指导 +# HiLog开发指导(Native) ## 概述 HiLog是OpenHarmony日志系统,提供给系统框架、服务、以及应用打印日志,记录用户操作、系统运行状态等。 > **说明:** diff --git a/zh-cn/application-dev/faqs/faqs-ability.md b/zh-cn/application-dev/faqs/faqs-ability.md index 64ed4c1c76cc823c4ec6269bd0db63740e278799..e69186419239818a9ba9a966899e71fadf1234d1 100644 --- a/zh-cn/application-dev/faqs/faqs-ability.md +++ b/zh-cn/application-dev/faqs/faqs-ability.md @@ -329,7 +329,7 @@ FA卡片的生命周期以及信息显示 **解决措施** -服务卡片在添加卡片后就触发了oncreat\(\)生命周期,在不启用app的情况下也可以显示相关的用户信息-静默登录,但服务卡片目前要在app安装之后手动添加。 +服务卡片在添加卡片后就触发了onCreate\(\)生命周期,在不启用app的情况下也可以显示相关的用户信息-静默登录,但服务卡片目前要在app安装之后手动添加。 ## JS/ArkTS跳转到其他应用时报错“\[c4d4d3492eb8531, 0, 0\] ContextDeal::startAbility fetchAbilities failed” diff --git a/zh-cn/application-dev/faqs/faqs-arkui-component.md b/zh-cn/application-dev/faqs/faqs-arkui-component.md index 0ca08bfcbe4f3883e05c0b559851044bfde40fd5..572d7b1cbe51472ffe64c4d148b10cf6610f50c8 100644 --- a/zh-cn/application-dev/faqs/faqs-arkui-component.md +++ b/zh-cn/application-dev/faqs/faqs-arkui-component.md @@ -256,7 +256,7 @@ controller: TextInputController = new TextInputController() 适用于:OpenHarmony 3.2 Beta5 API 9 -gridCount参数是指弹窗宽度占栅格列数的个数。系统把窗口宽等分,等分的份数即为栅格列数,不同设备栅格列数不同。比如手机屏幕密度值在320vp<=水平宽度<600vp,所以栅格列数是4,则gridCount的有效值在\[1, 4\]。 +gridCount参数是指弹窗宽度占栅格列数的个数。系统把窗口宽等分,等分的份数即为栅格列数,不同设备栅格列数不同。假设设备屏幕密度值在320vp<=水平宽度<600vp,所以栅格列数是4,则gridCount的有效值在\[1, 4\]。 注意:仅采用弹窗默认样式时设置有效。 @@ -391,7 +391,7 @@ Text组件当前文本排列方向固定为横向排列,要设置为竖向排 @Entry @Component struct Index15 { - private message: string = '本文档适用于HarmonyOS应用开发的初学者。通过构建一个简单的具有页面跳转/返回功能的应用,快速了解工程目录的主要文件,熟悉HarmonyOS应用开发流程。'; + private message: string = '本文档适用于应用开发的初学者。通过构建一个简单的具有页面跳转/返回功能的应用,快速了解工程目录的主要文件,熟悉应用开发流程。'; build() { Flex({ direction: FlexDirection.Column, wrap: FlexWrap.Wrap }) { ForEach(this.message.split(''), (item, index) => { @@ -468,18 +468,6 @@ Scroll组件在未设置高度情况下,默认为窗口高度,当滚动区 Scroll组件需要设置Scroll高度,或者使用Flex布局限制Scroll高度。 -## backgroundImage如何设置CenterCrop - -适用于:OpenHarmony 3.2 Beta5 API 9 Stage模型 - -**问题现象** - -CenterCrop是android中imageView,scaletype的设置,主要保证图片等比缩放裁剪,位置保持居中,要达到相同效果,应该怎么处理? - -**解决措施** - -可以使用通用属性backgroundImageSize\(ImageSize.cover\)和backgroundImagePosition\(Alignment.Center\)达到相同效果。 - ## 如何自定义Video组件控制栏样式 适用于:OpenHarmony 3.2 Beta5 API 9 Stage模型 diff --git a/zh-cn/application-dev/faqs/faqs-bundle-management.md b/zh-cn/application-dev/faqs/faqs-bundle-management.md index a3f3a969f8be8b20e440cd558814b6aa84517e19..cd191a86e5f60876b82846e2302b8558a5ba7838 100644 --- a/zh-cn/application-dev/faqs/faqs-bundle-management.md +++ b/zh-cn/application-dev/faqs/faqs-bundle-management.md @@ -6,7 +6,7 @@ **解决措施** -使用bundleManager模块的getApplicationInfo接口(仅系统应用可以使用)获取待检验应用的ApplicaitonInfo,根据ApplicaitonInfo中systemApp字段判断,若为true,则是系统应用,否则为非系统应用。 +使用bundleManager模块的getApplicationInfo接口(仅系统应用可以使用)获取待检验应用的ApplicationInfo,根据ApplicationInfo中systemApp字段判断,若为true,则是系统应用,否则为非系统应用。 **参考链接** diff --git a/zh-cn/application-dev/faqs/faqs-distributed-data-management.md b/zh-cn/application-dev/faqs/faqs-distributed-data-management.md index 990e948258281788f189a759b82832ef4c06493a..fd6227383e841702195f5aeffec3d5f6e5c2279f 100644 --- a/zh-cn/application-dev/faqs/faqs-distributed-data-management.md +++ b/zh-cn/application-dev/faqs/faqs-distributed-data-management.md @@ -77,7 +77,7 @@ PixelMap应该被转换成相应的ArrayBuffer再放进数据库。 **参考链接** -[readPixelsToBuffer](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-image.md#readpixelstobuffer7-1) +[readPixelsToBuffer](../reference/apis/js-apis-image.md#readpixelstobuffer7-1) ## 如何获取rdb关系型数据库文件 diff --git a/zh-cn/application-dev/faqs/faqs-network-management.md b/zh-cn/application-dev/faqs/faqs-network-management.md index 10f16b87af9246232c846b1b2a28f222dfeea38e..782fa86fd87c4c6aa6a8bb6a8860d7a73d21ae23 100644 --- a/zh-cn/application-dev/faqs/faqs-network-management.md +++ b/zh-cn/application-dev/faqs/faqs-network-management.md @@ -133,19 +133,19 @@ this.options = { **解决措施** -启动应用,获取权限后系统会访问远程服务器,将拍摄照片保存在本地,通过上传接口将文件从个人手机传送至远程服务器。 +启动应用,获取权限后系统会访问远程服务器,将拍摄照片保存在本地,通过上传接口将文件从个人设备传送至远程服务器。 **参考链接** [上传下载](../reference/apis/js-apis-request.md) -## 手机网络正常,调用connection.hasDefaultNet\(\)接口失败 +## 设备网络正常,调用connection.hasDefaultNet\(\)接口失败 适用于:OpenHarmony 3.2 Beta API 9 **问题现象** -手机可以上网,浏览器可以正常打开网页,但是hasDefaultNet这个方法调用失败,回调函数走到了失败的回调。 +设备可以上网,浏览器可以正常打开网页,但是hasDefaultNet这个方法调用失败,回调函数走到了失败的回调。 **解决措施** diff --git a/zh-cn/application-dev/faqs/faqs-window-manager.md b/zh-cn/application-dev/faqs/faqs-window-manager.md index be3ac7d14cfe79b8d64d58acda9eb840aeb8636a..f0f4f5644428281e1d4d1235e0cde4e4b7fabdd0 100644 --- a/zh-cn/application-dev/faqs/faqs-window-manager.md +++ b/zh-cn/application-dev/faqs/faqs-window-manager.md @@ -114,7 +114,7 @@ if (windowClass) { **参考链接** -[window.SystemBarProperties](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-window.md#systembarproperties) +[window.SystemBarProperties](../reference/apis/js-apis-window.md#systembarproperties) ## 如何保持屏幕常亮 @@ -124,7 +124,7 @@ if (windowClass) { 设置屏幕常亮,不熄屏。 -获取窗口实例对象后,调用[setWindowKeepScreenOn方法](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-window.md#setwindowkeepscreenon9)可设置屏幕是否常亮。 +获取窗口实例对象后,调用[setWindowKeepScreenOn方法](../reference/apis/js-apis-window.md#setwindowkeepscreenon9)可设置屏幕是否常亮。 ``` let isKeepScreenOn = true; diff --git a/zh-cn/application-dev/file-management/save-user-file.md b/zh-cn/application-dev/file-management/save-user-file.md index ea8bdb6a0dbbdd4f48ea607b12a048cf17cc4b60..8f8353651f769944283ef2e4d5a42649ca1df2f2 100644 --- a/zh-cn/application-dev/file-management/save-user-file.md +++ b/zh-cn/application-dev/file-management/save-user-file.md @@ -7,10 +7,11 @@ ## 保存图片或视频类文件 -1. 导入选择器模块。 +1. 导入选择器模块和文件管理模块。 ```ts import picker from '@ohos.file.picker'; + import fs from '@ohos.file.fs'; ``` 2. 创建图库保存选项实例。 @@ -20,23 +21,25 @@ photoSaveOptions.newFileNames = ["PhotoViewPicker01.jpg"]; // 保存文件名(可选) ``` -3. 创建图库选择器实例,调用[save()](../reference/apis/js-apis-file-picker.md#save)接口拉起FilePicker界面进行文件保存。 - 用户选择目标文件夹,用户选择与文件类型相对应的文件夹,即可完成文件保存操作。保存成功后,返回保存文档的URI。 +3. 创建图库选择器实例,调用[save()](../reference/apis/js-apis-file-picker.md#save)接口拉起FilePicker界面进行文件保存。用户选择目标文件夹,用户选择与文件类型相对应的文件夹,即可完成文件保存操作。保存成功后,返回保存文档的URI。 + +
save返回的URI权限是读写权限,可以根据结果集中URI进行文件读写等操作。注意不能在picker的回调里直接使用此URI进行打开文件操作,需要定义一个全局变量保存URI,使用类似一个按钮去触发打开文件。 ```ts - let uri = null; + let URI = null; const photoViewPicker = new picker.PhotoViewPicker(); photoViewPicker.save(photoSaveOptions).then((photoSaveResult) => { - uri = photoSaveResult[0]; + URI = photoSaveResult[0]; + console.info('photoViewPicker.save to file succeed and URI is:' + URI); }).catch((err) => { - console.error(`Invoke documentPicker.select failed, code is ${err.code}, message is ${err.message}`); + console.error(`Invoke photoViewPicker.save failed, code is ${err.code}, message is ${err.message}`); }) ``` -4. 待界面从FilePicker返回后,在其他函数中使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过uri打开这个文件得到fd。 +4. 待界面从FilePicker返回后,再通过类似一个按钮调用其他函数,使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过URI打开这个文件得到fd。这里需要注意接口权限参数是fs.OpenMode.READ_WRITE。 ```ts - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + let file = fs.openSync(URI, fs.OpenMode.READ_WRITE); console.info('file fd: ' + file.fd); ``` @@ -50,10 +53,11 @@ ## 保存文档类文件 -1. 导入选择器模块。 +1. 导入选择器模块和文件管理模块。 ```ts import picker from '@ohos.file.picker'; + import fs from '@ohos.file.fs'; ``` 2. 创建文档保存选项实例。 @@ -63,27 +67,25 @@ documentSaveOptions.newFileNames = ["DocumentViewPicker01.txt"]; // 保存文件名(可选) ``` -3. 创建文档选择器实例。调用[save()](../reference/apis/js-apis-file-picker.md#save-3)接口拉起FilePicker界面进行文件保存。 - 用户选择目标文件夹,用户选择与文件类型相对应的文件夹,即可完成文件保存操作。保存成功后,返回保存文档的URI。 - - > **说明:** - > - > 目前DocumentSelectOptions不支持参数配置,默认可以选择所有类型的用户文件。 +3. 创建文档选择器实例。调用[save()](../reference/apis/js-apis-file-picker.md#save-3)接口拉起FilePicker界面进行文件保存。用户选择目标文件夹,用户选择与文件类型相对应的文件夹,即可完成文件保存操作。保存成功后,返回保存文档的URI。 + +
save返回的URI权限是读写权限,可以根据结果集中URI进行文件读写等操作。注意不能在picker的回调里直接使用此URI进行打开文件操作,需要定义一个全局变量保存URI,使用类似一个按钮去触发打开文件。 ```ts - let uri = null; + let URI = null; const documentViewPicker = new picker.DocumentViewPicker(); // 创建文件选择器实例 documentViewPicker.save(documentSaveOptions).then((documentSaveResult) => { - uri = documentSaveResult[0]; + URI = documentSaveResult[0]; + console.info('documentViewPicker.save to file succeed and URI is:' + URI); }).catch((err) => { - console.error(`Invoke documentPicker.save failed, code is ${err.code}, message is ${err.message}`); + console.error(`Invoke documentViewPicker.save failed, code is ${err.code}, message is ${err.message}`); }) ``` -4. 待界面从FilePicker返回后,在其他函数中使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过uri打开这个文件得到fd。 +4. 待界面从FilePicker返回后,再通过类似一个按钮调用其他函数,使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过URI打开这个文件得到fd。这里需要注意接口权限参数是fs.OpenMode.READ_WRITE。 ```ts - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + let file = fs.openSync(URI, fs.OpenMode.READ_WRITE); console.info('file fd: ' + file.fd); ``` @@ -97,10 +99,11 @@ ## 保存音频类文件 -1. 导入选择器模块。 +1. 导入选择器模块和文件管理模块。 ```ts import picker from '@ohos.file.picker'; + import fs from '@ohos.file.fs'; ``` 2. 创建音频保存选项实例。 @@ -110,26 +113,25 @@ audioSaveOptions.newFileNames = ['AudioViewPicker01.mp3']; // 保存文件名(可选) ``` -3. 创建音频选择器实例。调用[save()](../reference/apis/js-apis-file-picker.md#save-6)接口拉起FilePicker界面进行文件保存。 - 用户选择目标文件夹,用户选择与文件类型相对应的文件夹,即可完成文件保存操作。保存成功后,返回保存文档的URI。 - > **说明:** - > - > 目前AudioSelectOptions不支持参数配置,默认可以选择所有类型的用户文件。 - +3. 创建音频选择器实例。调用[save()](../reference/apis/js-apis-file-picker.md#save-6)接口拉起FilePicker界面进行文件保存。用户选择目标文件夹,用户选择与文件类型相对应的文件夹,即可完成文件保存操作。保存成功后,返回保存文档的URI。 + +
save返回的URI权限是读写权限,可以根据结果集中URI进行文件读写等操作。注意不能在picker的回调里直接使用此URI进行打开文件操作,需要定义一个全局变量保存URI,使用类似一个按钮去触发打开文件。 + ```ts - let uri = null; + let URI = null; const audioViewPicker = new picker.AudioViewPicker(); audioViewPicker.save(audioSaveOptions).then((audioSelectResult) => { - uri = audioSelectResult[0]; + URI = audioSelectResult[0]; + console.info('audioViewPicker.save to file succeed and URI is:' + URI); }).catch((err) => { - console.error(`Invoke audioPicker.select failed, code is ${err.code}, message is ${err.message}`); + console.error(`Invoke audioViewPicker.save failed, code is ${err.code}, message is ${err.message}`); }) ``` -4. 待界面从FilePicker返回后,在其他函数中使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过uri打开这个文件得到fd。 +4. 待界面从FilePicker返回后,再通过类似一个按钮调用其他函数,使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过URI打开这个文件得到fd。这里需要注意接口权限参数是fs.OpenMode.READ_WRITE。 ```ts - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + let file = fs.openSync(URI, fs.OpenMode.READ_WRITE); console.info('file fd: ' + file.fd); ``` diff --git a/zh-cn/application-dev/file-management/select-user-file.md b/zh-cn/application-dev/file-management/select-user-file.md index 4e42bc7aa0824158eb5c31604e283f66d38568ed..97f507b6d0c5262a1eb0eac22713190fb7786a36 100644 --- a/zh-cn/application-dev/file-management/select-user-file.md +++ b/zh-cn/application-dev/file-management/select-user-file.md @@ -12,10 +12,11 @@ ## 选择图片或视频类文件 -1. 导入选择器模块。 +1. 导入选择器模块和文件管理模块。 ```ts import picker from '@ohos.file.picker'; + import fs from '@ohos.file.fs'; ``` 2. 创建图库选择选项实例。 @@ -32,41 +33,44 @@ photoSelectOptions.maxSelectNumber = 5; // 选择媒体文件的最大数目 ``` -4. 创建图库选择器实例,调用[select()](../reference/apis/js-apis-file-picker.md#select)接口拉起FilePicker界面进行文件选择。 - - 文件选择成功后,返回[PhotoSelectResult](../reference/apis/js-apis-file-picker.md#photoselectresult)结果集,可以根据结果集中URI进行文件读取等操作。 +4. 创建图库选择器实例,调用[select()](../reference/apis/js-apis-file-picker.md#select)接口拉起FilePicker界面进行文件选择。文件选择成功后,返回[PhotoSelectResult](../reference/apis/js-apis-file-picker.md#photoselectresult)结果集。 + +
select返回的URI权限是只读权限,可以根据结果集中URI进行读取文件数据操作。注意不能在picker的回调里直接使用此URI进行打开文件操作,需要定义一个全局变量保存URI,使用类似一个按钮去触发打开文件。 ```ts - let uri = null; - const photoPicker = new picker.PhotoViewPicker(); - photoPicker.select(photoSelectOptions).then((photoSelectResult) => { - uri = photoSelectResult.photoUris[0]; + let URI = null; + const photoViewPicker = new picker.PhotoViewPicker(); + photoViewPicker.select(photoSelectOptions).then((photoSelectResult) => { + URI = photoSelectResult.photoUris[0]; + console.info('photoViewPicker.select to file succeed and URI is:' + URI); }).catch((err) => { - console.error(`Invoke photoPicker.select failed, code is ${err.code}, message is ${err.message}`); + console.error(`Invoke photoViewPicker.select failed, code is ${err.code}, message is ${err.message}`); }) ``` -5. 待界面从FilePicker返回后,在其他函数中使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过uri打开这个文件得到fd。 +5. 待界面从FilePicker返回后,再通过类似一个按钮调用其他函数,使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过URI打开这个文件得到fd。这里需要注意接口权限参数是fs.OpenMode.READ_ONLY。 ```ts - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + let file = fs.openSync(URI, fs.OpenMode.READ_ONLY); console.info('file fd: ' + file.fd); ``` -6. 通过fd使用[fs.writeSync](../reference/apis/js-apis-file-fs.md#writesync)接口对这个文件进行编辑修改,编辑修改完成后关闭fd。 +6. 通过fd使用[fs.readSync](../reference/apis/js-apis-file-fs.md#readsync)接口读取这个文件内的数据,读取完成后关闭fd。 ```ts - let writeLen = fs.writeSync(file.fd, 'hello, world'); - console.info('write data to file succeed and size is:' + writeLen); + let buffer = new ArrayBuffer(4096); + let readLen = fs.readSync(file.fd, buffer); + console.info('readSync data to file succeed and buffer size is:' + readLen); fs.closeSync(file); ``` ## 选择文档类文件 -1. 导入选择器模块。 +1. 导入选择器模块和文件管理模块。 ```ts import picker from '@ohos.file.picker'; + import fs from '@ohos.file.fs'; ``` 2. 创建文档选择选项实例。 @@ -75,23 +79,24 @@ const documentSelectOptions = new picker.DocumentSelectOptions(); ``` -3. 创建文档选择器实例。调用[select()](../reference/apis/js-apis-file-picker.md#select-3)接口拉起FilePicker界面进行文件选择。 - - 文件选择成功后,返回被选中文档的URI结果集。开发者可以根据结果集中URI做进一步的处理。 - - 例如通过[文件管理接口](../reference/apis/js-apis-file-fs.md)根据URI获取部分文件属性信息,比如文件大小、访问时间、修改时间等。如有获取文件名称需求,请暂时使用[startAbilityForResult](../../application-dev/application-models/uiability-intra-device-interaction.md)获取。 +3. 创建文档选择器实例。调用[select()](../reference/apis/js-apis-file-picker.md#select-3)接口拉起FilePicker界面进行文件选择。文件选择成功后,返回被选中文档的URI结果集。 + +
select返回的URI权限是只读权限,开发者可以根据结果集中URI做进一步的处理。注意不能在picker的回调里直接使用此URI进行打开文件操作,需要定义一个全局变量保存URI,使用类似一个按钮去触发打开文件。 + +
例如通过[文件管理接口](../reference/apis/js-apis-file-fs.md)根据URI获取部分文件属性信息,比如文件大小、访问时间、修改时间等。如有获取文件名称需求,请暂时使用[startAbilityForResult](../../application-dev/application-models/uiability-intra-device-interaction.md)获取。 > **说明:** > > 目前DocumentSelectOptions不支持参数配置,默认可以选择所有类型的用户文件。 ```ts - let uri = null; + let URI = null; const documentViewPicker = new picker.DocumentViewPicker(); // 创建文件选择器实例 documentViewPicker.select(documentSelectOptions).then((documentSelectResult) => { - uri = documentSelectResult[0]; + URI = documentSelectResult[0]; + console.info('documentViewPicker.select to file succeed and URI is:' + URI); }).catch((err) => { - console.error(`Invoke documentPicker.select failed, code is ${err.code}, message is ${err.message}`); + console.error(`Invoke documentViewPicker.select failed, code is ${err.code}, message is ${err.message}`); }) ``` @@ -109,7 +114,7 @@ try { let result = await context.startAbilityForResult(config, {windowMode: 1}); if (result.resultCode !== 0) { - console.error(`DocumentPicker.select failed, code is ${result.resultCode}, message is ${result.want.parameters.message}`); + console.error(`documentViewPicker.select failed, code is ${result.resultCode}, message is ${result.want.parameters.message}`); return; } // 获取到文档文件的URI @@ -117,34 +122,34 @@ // 获取到文档文件的文件名称 let file_name_list = result.want.parameters.file_name_list; } catch (err) { - console.error(`Invoke documentPicker.select failed, code is ${err.code}, message is ${err.message}`); + console.error(`Invoke documentViewPicker.select failed, code is ${err.code}, message is ${err.message}`); } ``` -4. 待界面从FilePicker返回后,在其他函数中使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过uri打开这个文件得到fd。 +4. 待界面从FilePicker返回后,再通过类似一个按钮调用其他函数,使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过URI打开这个文件得到fd。这里需要注意接口权限参数是fs.OpenMode.READ_ONLY。 ```ts - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + let file = fs.openSync(URI, fs.OpenMode.READ_ONLY); console.info('file fd: ' + file.fd); ``` -5. 通过fd使用[fs.readSync](../reference/apis/js-apis-file-fs.md#readsync)接口对这个文件进行读取数据,读取完成后关闭fd。 +5. 通过fd使用[fs.readSync](../reference/apis/js-apis-file-fs.md#readsync)接口读取这个文件内的数据,读取完成后关闭fd。 ```ts - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); - let buf = new ArrayBuffer(4096); - let num = fs.readSync(file.fd, buf); - console.info('read data to file succeed and size is:' + num); + let buffer = new ArrayBuffer(4096); + let readLen = fs.readSync(file.fd, buffer); + console.info('readSync data to file succeed and buffer size is:' + readLen); fs.closeSync(file); ``` ## 选择音频类文件 -1. 导入选择器模块。 +1. 导入选择器模块和文件管理模块。 ```ts import picker from '@ohos.file.picker'; + import fs from '@ohos.file.fs'; ``` 2. 创建音频选择选项实例。 @@ -153,37 +158,39 @@ const audioSelectOptions = new picker.AudioSelectOptions(); ``` -3. 创建音频选择器实例。调用[select()](../reference/apis/js-apis-file-picker.md#select-6)接口拉起FilePicker界面进行文件选择。 - - 文件选择成功后,返回被选中音频的URI结果集。开发者可以根据结果集中URI做进一步的处理。 - - 例如通过[文件管理接口](../reference/apis/js-apis-file-fs.md)根据URI拿到音频资源的文件句柄(FD),再配合媒体服务实现音频播放的开发,具体请参考[音频播放开发指导](../media/audio-playback-overview.md)。 +3. 创建音频选择器实例。调用[select()](../reference/apis/js-apis-file-picker.md#select-6)接口拉起FilePicker界面进行文件选择。文件选择成功后,返回被选中音频的URI结果集。 + +
select返回的URI权限是只读权限,开发者可以根据结果集中URI做读取文件数据操作。注意不能在 picker的回调里直接使用此URI进行打开文件操作,需要定义一个全局变量保存URI,使用类似一个按钮去触发打开文件。 + +
例如通过[文件管理接口](../reference/apis/js-apis-file-fs.md)根据URI拿到音频资源的文件句柄(FD),再配合媒体服务实现音频播放的开发,具体请参考[音频播放开发指导](../media/audio-playback-overview.md)。 > **说明:** > > 目前AudioSelectOptions不支持参数配置,默认可以选择所有类型的用户文件。 ```ts - let uri = null; + let URI = null; const audioViewPicker = new picker.AudioViewPicker(); audioViewPicker.select(audioSelectOptions).then(audioSelectResult => { - uri = audioSelectOptions[0]; + URI = audioSelectOptions[0]; + console.info('audioViewPicker.select to file succeed and URI is:' + URI); }).catch((err) => { - console.error(`Invoke audioPicker.select failed, code is ${err.code}, message is ${err.message}`); + console.error(`Invoke audioViewPicker.select failed, code is ${err.code}, message is ${err.message}`); }) ``` -4. 待界面从FilePicker返回后,在其他函数中使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过uri打开这个文件得到fd。 +4. 待界面从FilePicker返回后,再通过类似一个按钮调用其他函数,使用[fs.openSync](../reference/apis/js-apis-file-fs.md#fsopensync)接口,通过URI打开这个文件得到fd。这里需要注意接口权限参数是fs.OpenMode.READ_ONLY。 ```ts - let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + let file = fs.openSync(URI, fs.OpenMode.READ_ONLY); console.info('file fd: ' + file.fd); ``` -5. 通过fd使用[fs.writeSync](../reference/apis/js-apis-file-fs.md#writesync)接口对这个文件进行编辑修改,编辑修改完成后关闭fd。 +5. 通过fd使用[fs.readSync](../reference/apis/js-apis-file-fs.md#readsync)接口读取这个文件内的数据,读取完成后关闭fd。 ```ts - let writeLen = fs.writeSync(file.fd, 'hello, world'); - console.info('write data to file succeed and size is:' + writeLen); + let buffer = new ArrayBuffer(4096); + let readLen = fs.readSync(file.fd, buffer); + console.info('readSync data to file succeed and buffer size is:' + readLen); fs.closeSync(file); ``` diff --git a/zh-cn/application-dev/key-features/multi-device-app-dev/music-album-page.md b/zh-cn/application-dev/key-features/multi-device-app-dev/music-album-page.md index 9662322e8d223b3840f6080d7ffb7c14477c9ca6..188506d6b9fd63c6b58f7a7f108db267e2674985 100644 --- a/zh-cn/application-dev/key-features/multi-device-app-dev/music-album-page.md +++ b/zh-cn/application-dev/key-features/multi-device-app-dev/music-album-page.md @@ -125,7 +125,7 @@ export default struct PlayListCover { ## 歌单列表 -不同断点下,歌单列表的样式基本一致,但sm和md断点下是歌单列表是单列显示,lg断点下是双列显示。可以通过[List组件](https://gitee.com/fanzhaonan/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md)的lanes属性实现这一效果。 +不同断点下,歌单列表的样式基本一致,但sm和md断点下是歌单列表是单列显示,lg断点下是双列显示。可以通过[List组件](../../reference/arkui-ts/ts-container-list.md)的lanes属性实现这一效果。 ``` diff --git a/zh-cn/application-dev/media/Readme-CN.md b/zh-cn/application-dev/media/Readme-CN.md index 1f2d6d43b8c3686432e4b428f11bc023092e8b62..2c02d655deb19ef6b0d2484281dabfd2774a094f 100755 --- a/zh-cn/application-dev/media/Readme-CN.md +++ b/zh-cn/application-dev/media/Readme-CN.md @@ -19,7 +19,7 @@ - [音频录制开发概述](audio-recording-overview.md) - [使用AVRecorder开发音频录制功能](using-avrecorder-for-recording.md) - [使用AudioCapturer开发音频录制功能](using-audiocapturer-for-recording.md) - - [使用OpenSLES开发音频录制功能](using-opensl-es-for-recording.md) + - [使用OpenSL ES开发音频录制功能](using-opensl-es-for-recording.md) - [管理麦克风](mic-management.md) - [音频录制流管理](audio-recording-stream-management.md) - [音频输入设备管理](audio-input-device-management.md) @@ -28,7 +28,7 @@ - [开发音频通话功能](audio-call-development.md) - [视频播放](video-playback.md) - [视频录制](video-recording.md) -- 媒体会话(仅对系统应用开放) +- 媒体会话 - [媒体会话概述](avsession-overview.md) - 本地媒体会话 - [本地媒体会话概述](local-avsession-overview.md) diff --git a/zh-cn/application-dev/media/using-avsession-controller.md b/zh-cn/application-dev/media/using-avsession-controller.md index 9842ff1d21cfba07a39278c158e0ca731beb4afc..9d9fd7d17c3fdb9487ba1cd4bb21047e919845ed 100644 --- a/zh-cn/application-dev/media/using-avsession-controller.md +++ b/zh-cn/application-dev/media/using-avsession-controller.md @@ -26,11 +26,7 @@ OpenHarmony系统预置的播控中心,作为媒体会话控制方与音视频 | -------- | -------- | | getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void | 获取系统中所有媒体会话的描述符。 | | createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void | 创建媒体会话控制器。 | -| getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void | 获取媒体会话支持的有效命令。
音视频应用在接入媒体会话时监听的播控命令,即为媒体会话支持的有效命令,相关信息请参见[媒体会话提供方监听播控命令事件](using-avsession-developer.md)。 | -| getLaunchAbility(callback: AsyncCallback<WantAgent>): void | 获取媒体会话中配置的可被拉起的UIAbility。
当用户在媒体会话控制方应用进行界面操作,例如点击了播控中心卡片后,可以拉起对应的应用。 | -| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | 通过会话对应的AVSessionController向会话发送按键命令。 | -| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | 向置顶会话发送按键命令。 | -| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | 通过会话对应的AVSessionController向会话发送播控命令。 | +| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | 向置顶会话发送按键命令。 | | sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | 向置顶会话发送播控命令。 | | getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback\>>): void10+ | 获取历史会话的描述符。 | @@ -38,15 +34,15 @@ OpenHarmony系统预置的播控中心,作为媒体会话控制方与音视频 | 接口名 | 说明 | | -------- | -------- | -| getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void | 获取当前会话播放状态相关信息。 | -| getAVMetadata(callback: AsyncCallback<AVMetadata>): void | 获取会话元数据。 | -| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void | 获取播放设备信息。 | -| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | 发送按键事件到会话。| -| getLaunchAbility(callback: AsyncCallback<WantAgent>): void | 获取应用在会话中保存的WantAgent对象。 | -| isActive(callback: AsyncCallback<boolean>): void | 判断会话是否被激活。 | -| destroy(callback: AsyncCallback<void>): void | 销毁当前控制器,销毁后当前控制器不再可用。 | -| getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void | 获取会话支持的有效命令。 | -| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | 通过会话控制器发送命令到其对应的会话。 | +| getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void10+ | 获取当前会话播放状态相关信息。 | +| getAVMetadata(callback: AsyncCallback<AVMetadata>): void10+ | 获取会话元数据。 | +| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void10+ | 获取播放设备信息。 | +| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void10+ | 发送按键事件到会话。| +| getLaunchAbility(callback: AsyncCallback<WantAgent>): void10+ | 获取应用在会话中保存的WantAgent对象。 | +| isActive(callback: AsyncCallback<boolean>): void10+ | 判断会话是否被激活。 | +| destroy(callback: AsyncCallback<void>): void10+ | 销毁当前控制器,销毁后当前控制器不再可用。 | +| getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void10+ | 获取会话支持的有效命令。 | +| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void10+ | 通过会话控制器发送命令到其对应的会话。 | | sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void10+ | 通过会话控制器发送自定义命令到其对应的会话。 | | getAVQueueItems(callback: AsyncCallback<Array<AVQueueItem>>): void10+ | 获取当前播放列表相关信息。 | | getAVQueueTitle(callback: AsyncCallback<string>): void10+ | 获取当前播放列表的名称。 | diff --git a/zh-cn/application-dev/media/using-avsession-developer.md b/zh-cn/application-dev/media/using-avsession-developer.md index bc2f22de68aacb7a922461f41753d423eded6338..8d398a9c1043c22f7a1ee21151295566eb57848b 100644 --- a/zh-cn/application-dev/media/using-avsession-developer.md +++ b/zh-cn/application-dev/media/using-avsession-developer.md @@ -16,15 +16,15 @@ | 接口名 | 说明 | | -------- | -------- | -| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession>): void | 创建媒体会话。
一个UIAbility只能存在一个媒体会话,重复创建会失败。 | -| setAVMetadata(data: AVMetadata, callback: AsyncCallback<void>): void | 设置媒体会话元数据。 | -| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void>): void | 设置媒体会话播放状态。 | -| setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void>): void | 设置启动UIAbility。 | -| getController(callback: AsyncCallback<AVSessionController>): void | 获取当前会话自身控制器。 | -| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void | 获取播放设备相关信息。 | -| activate(callback: AsyncCallback<void>): void | 激活媒体会话。 | -| deactivate(callback: AsyncCallback<void>): void | 禁用当前会话。 | -| destroy(callback: AsyncCallback<void>): void | 销毁媒体会话。 | +| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession>): void10+ | 创建媒体会话。
一个UIAbility只能存在一个媒体会话,重复创建会失败。 | +| setAVMetadata(data: AVMetadata, callback: AsyncCallback<void>): void10+ | 设置媒体会话元数据。 | +| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void>): void10+ | 设置媒体会话播放状态。 | +| setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void>): void10+ | 设置启动UIAbility。 | +| getController(callback: AsyncCallback<AVSessionController>): void10+ | 获取当前会话自身控制器。 | +| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void10+ | 获取播放设备相关信息。 | +| activate(callback: AsyncCallback<void>): void10+ | 激活媒体会话。 | +| deactivate(callback: AsyncCallback<void>): void10+ | 禁用当前会话。 | +| destroy(callback: AsyncCallback<void>): void10+ | 销毁媒体会话。 | | setAVQueueItems(items: Array<AVQueueItem>, callback: AsyncCallback<void>): void 10+ | 设置媒体播放列表。 | | setAVQueueTitle(title: string, callback: AsyncCallback<void>): void10+ | 设置媒体播放列表名称。 | | dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void10+ | 设置会话内自定义事件。 | diff --git a/zh-cn/application-dev/napi/introduction.md b/zh-cn/application-dev/napi/introduction.md index 9091080ad5b30e6617a2b5363127a41dbb95c69f..4603c8fd5896c0077a4733b7c504de3c6a00d195 100644 --- a/zh-cn/application-dev/napi/introduction.md +++ b/zh-cn/application-dev/napi/introduction.md @@ -1,4 +1,4 @@ -# Native API 介绍 +# Native API介绍 Native API是OHOS SDK上提供的一组native开发接口与工具集合,方便开发者使用C或者C++语言实现应用的关键功能。Native API只覆盖了OHOS基础的一些底层能力,如libc,图形库,窗口系统,多媒体,压缩库等,并没有完全提供类似于JS API上的完整的OHOS 平台能力。在应用中使用Native API会编译成动态库打包到应用中。 diff --git a/zh-cn/application-dev/napi/napi-guidelines.md b/zh-cn/application-dev/napi/napi-guidelines.md index e2788d6106d55f287f045f51a68841bc44e18b7d..2ffb79d552180b5e1d5b34cd869eaca1adf4eaf2 100644 --- a/zh-cn/application-dev/napi/napi-guidelines.md +++ b/zh-cn/application-dev/napi/napi-guidelines.md @@ -1,4 +1,4 @@ -# N-API在应用工程中的使用指导 +# Native API在应用工程中的使用指导 在OpenHarmony中,C API中的N-API接口可以实现ArkTS/TS/JS与C/C++之间的交互。N-API提供的接口名与三方Node.js一致,目前支持部分接口,支持列表见[链接](https://gitee.com/openharmony/arkui_napi/blob/master/libnapi.ndk.json)。 diff --git a/zh-cn/application-dev/napi/native-window-guidelines.md b/zh-cn/application-dev/napi/native-window-guidelines.md index 0bc953f8d2fb3bdd548feb1d7a5f186afb179e6d..b4ee38bccfb6c83e2dc82e6e25d6020439ca1bb9 100644 --- a/zh-cn/application-dev/napi/native-window-guidelines.md +++ b/zh-cn/application-dev/napi/native-window-guidelines.md @@ -1,4 +1,4 @@ -# NativeWindow 开发指导 +# NativeWindow开发指导 ## 场景介绍 diff --git a/zh-cn/application-dev/napi/rawfile-guidelines.md b/zh-cn/application-dev/napi/rawfile-guidelines.md index f0b38d25a80e23c1a113c5f606cada27efb9c47c..1dc38726a59975b29f52f7275e125176e7a88ff0 100644 --- a/zh-cn/application-dev/napi/rawfile-guidelines.md +++ b/zh-cn/application-dev/napi/rawfile-guidelines.md @@ -1,4 +1,4 @@ -# 资源管理Rawfile开发指导 +# Rawfile开发指导 ## 场景介绍 diff --git a/zh-cn/application-dev/notification/Readme-CN.md b/zh-cn/application-dev/notification/Readme-CN.md index fd7aa8a9aa58543d263d517283b892407a8a2068..c8bd5b0b6c51686eb4f04cb1cdb4979b6467993c 100644 --- a/zh-cn/application-dev/notification/Readme-CN.md +++ b/zh-cn/application-dev/notification/Readme-CN.md @@ -3,7 +3,7 @@ - [通知概述](notification-overview.md) - [订阅通知(仅对系统应用开放)](notification-subscription.md) - [使能通知开关](notification-enable.md) -- [设置通知角标](notification-badge.md) +- [管理通知角标](notification-badge.md) - 发布通知 - [发布基础类型通知](text-notification.md) - [发布进度条类型通知](progress-bar-notification.md) diff --git a/zh-cn/application-dev/notification/notification-badge.md b/zh-cn/application-dev/notification/notification-badge.md index d113365cf398d36863ba722739147a7c53bfc61e..a5b23055f2f75847836b0a927a9ab1f1cea60d77 100644 --- a/zh-cn/application-dev/notification/notification-badge.md +++ b/zh-cn/application-dev/notification/notification-badge.md @@ -1,4 +1,4 @@ -# 通知角标 +# 管理通知角标 应用未读的通知,OpenHarmony提供了角标设置接口,将未读通知个数显示在桌面图标的右上角角标上。 diff --git a/zh-cn/application-dev/quick-start/Readme-CN.md b/zh-cn/application-dev/quick-start/Readme-CN.md index 854bfcc68ab005c0a58b1dc540d6a22d5fc19c5a..341593b560e8a4a37286e041b0dfb8fd2c320a79 100755 --- a/zh-cn/application-dev/quick-start/Readme-CN.md +++ b/zh-cn/application-dev/quick-start/Readme-CN.md @@ -24,7 +24,7 @@ - [HAR](har-package.md) - HSP - [应用内HSP开发指导](in-app-hsp.md) - - [应用间HSP开发指导(仅对系统应用开放)](cross-app-hsp.md) + - [应用间HSP开发指导](cross-app-hsp.md) - 原子化服务 - [原子化服务开发指导](atomicService.md) - [原子化服务空间管理(仅对系统应用开放)](atomicService-aging.md) diff --git a/zh-cn/application-dev/quick-start/arkts-two-way-sync.md b/zh-cn/application-dev/quick-start/arkts-two-way-sync.md index c48a7a148efe5169278de9224faa8da0f84926df..0624026ebeaa42fe495ad5d26b9b81f5cdd30bb7 100644 --- a/zh-cn/application-dev/quick-start/arkts-two-way-sync.md +++ b/zh-cn/application-dev/quick-start/arkts-two-way-sync.md @@ -1,24 +1,24 @@ -# $语法:内置组件双向同步 +# $$语法:内置组件双向同步 $$运算符为系统内置组件提供TS变量的引用,使得TS变量和系统内置组件的内部状态保持同步。 -内部状态具体指什么取决于组件。例如,[bindPopup](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md)属性方法的show参数。 +内部状态具体指什么取决于组件。例如,[bindPopup](../reference/arkui-ts/ts-universal-attributes-popup.md)属性方法的show参数。 ## 使用规则 - 当前$$支持基础类型变量,以及\@State、\@Link和\@Prop装饰的变量。 -- 当前$$仅支持[bindPopup](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md)属性方法的show参数,[Radio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-radio.md)组件的checked属性,[Refresh](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-container-refresh.md)组件的refreshing参数。 +- 当前$$仅支持[bindPopup](../reference/arkui-ts/ts-universal-attributes-popup.md)属性方法的show参数,[Radio](../reference/arkui-ts/ts-basic-components-radio.md)组件的checked属性,[Refresh](../reference/arkui-ts/ts-container-refresh.md)组件的refreshing参数。 - $$绑定的变量变化时,会触发UI的同步刷新。 ## 使用示例 -以[bindPopup](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md)属性方法的show参数为例: +以[bindPopup](../reference/arkui-ts/ts-universal-attributes-popup.md)属性方法的show参数为例: ```ts diff --git a/zh-cn/application-dev/quick-start/cross-app-hsp.md b/zh-cn/application-dev/quick-start/cross-app-hsp.md index 4c3339447f1c10cd12d9ba90d521da0212789d87..02441588ba74b9a331d7ec5a64a26991068e2b07 100644 --- a/zh-cn/application-dev/quick-start/cross-app-hsp.md +++ b/zh-cn/application-dev/quick-start/cross-app-hsp.md @@ -170,7 +170,7 @@ struct Index { } ``` -## 应用间HSP的分发方式 +## 应用间HSP的分发方式(仅对系统应用开放) 应用间`HSP`由于并未直接完整的集成到开发者应用中去,所以需要提前预置在系统版本中或者随开发者应用同步安装到设备上,主要有以下两种形式: 1. 随系统发布,部分常用应用间`HSP`会预置在系统版本中。 2. 随应用发布,即用户在应用市场下载应用时,如果应用依赖了一个或者多个应用间`HSP`,同时设备上没有安装这个其依赖的应用间`HSP`时,应用市场会为用户同时下载普通应用以及其依赖的应用间`HSP`。从而保证普通应用能够正常使用共享库的功能。 diff --git a/zh-cn/application-dev/quick-start/module-structure.md b/zh-cn/application-dev/quick-start/module-structure.md index 43fcb6291a53377069b13798978ad01b4a6a7989..158a069aac21be897af26093d5d82d8b39cbfbd8 100644 --- a/zh-cn/application-dev/quick-start/module-structure.md +++ b/zh-cn/application-dev/quick-start/module-structure.md @@ -228,7 +228,7 @@ metadata对象示例: **OpenHarmony中不允许应用隐藏入口图标** -OpenHarmony系统对无图标应用严格管控,防止一些恶意应用故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户的手机安全。 +OpenHarmony系统对无图标应用严格管控,防止一些恶意应用故意配置无入口图标,导致用户找不到软件所在的位置,无法操作卸载应用,在一定程度上保证用户终端设备的安全。 **入口图标的设置:** 需要在配置文件(config.json)中abilities配置下设置icon,label以及skills,而且skills的配置下必须同时包含“ohos.want.action.home” 和 “entity.system.home”。 ``` diff --git a/zh-cn/application-dev/quick-start/multi-hap-principles.md b/zh-cn/application-dev/quick-start/multi-hap-principles.md index 78e9b228052f0ee54ec7217388bfc199bbba8cf0..147f409d987cf47a827382cd62507cc4f2972fd7 100644 --- a/zh-cn/application-dev/quick-start/multi-hap-principles.md +++ b/zh-cn/application-dev/quick-start/multi-hap-principles.md @@ -16,6 +16,6 @@ - 同一进程内的数据通信,请参见[线程间通信](../application-models/thread-model-stage.md)。 -- 跨进程的数据通信,请参见[进程间通信](../application-models/process-model-stage.md)。。 +- 跨进程的数据通信,请参见[进程间通信](../application-models/process-model-stage.md)。 - 多HAP如果运行在同一进程,则多HAP间组件的通信方式与同一HAP内组件的通信方式相同。 diff --git a/zh-cn/application-dev/quick-start/multi-hap-release-deployment.md b/zh-cn/application-dev/quick-start/multi-hap-release-deployment.md index d592140c8371f4a16346248d401cc3f39a91d303..7f4b1002886c97b67f64608d8e677729af527ef8 100644 --- a/zh-cn/application-dev/quick-start/multi-hap-release-deployment.md +++ b/zh-cn/application-dev/quick-start/multi-hap-release-deployment.md @@ -9,7 +9,9 @@ 开发者通过[DevEco Studio](https://developer.harmonyos.com/cn/develop/deveco-studio)工具按照业务的需要创建多个Module,在相应的Module中完成自身业务的开发。 ## 调试 -通过DevEco Studio编译打包,生成单个或者多个HAP,即可基于HAP进行调试。在调试前,需要先安装或更新HAP,以下介绍具体做法。 +通过DevEco Studio编译打包,生成单个或者多个HAP,即可基于HAP进行调试。如需根据不同的部署环境、目标人群、运行环境等,将同一个HAP定制编译为不同版本,请参见[定制编译指导](https://developer.harmonyos.com/cn/docs/documentation/doc-guides-V3/customized-multi-targets-and-products-0000001430013853-V3?catalogVersion=V3)。 + +在调试前,需要先安装或更新HAP,以下介绍具体做法。 * 使用DevEco Studio进行调试 使用指导可参考[应用程序包调试方法](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-debugging-and-running-0000001263040487#section10491183521520),其中包括了单HAP与多HAP通过DevEco Studio工具的安装调试方法。 @@ -49,7 +51,7 @@ // 执行结果 uninstall bundle successfully. ``` - 完成HAP安装或更新后,即可参考相关调试命令进行[调试](https://docs.openharmony.cn/pages/v3.2Beta/zh-cn/application-dev/tools/aa-tool.md/)。 + 完成HAP安装或更新后,即可参考相关调试命令进行[调试](../tools/aa-tool.md)。 ## 发布 当开发的程序包满足发布要求时,可以在工具中打包编译生成App包。将该App包上架到应用市场云端,应用市场会对上架的App包校验签名,校验签名通过后会将App包中的HAP拆分出来,同时对拆分出的HAP重新添加签名,然后对HAP进行分发。 diff --git a/zh-cn/application-dev/reference/apis/Readme-CN.md b/zh-cn/application-dev/reference/apis/Readme-CN.md old mode 100755 new mode 100644 index 553aa7ccb50ba51c7435e0484c2dd075093bd723..b090da5f4cc0d468f7312c481f2780832a2426bf --- a/zh-cn/application-dev/reference/apis/Readme-CN.md +++ b/zh-cn/application-dev/reference/apis/Readme-CN.md @@ -150,6 +150,7 @@ - [通知服务公共事件定义](common_event/commonEvent-ans.md) - [资源调度子系统公共事件定义](common_event/commonEvent-resourceschedule.md) - [电话服务子系统公共事件定义](common_event/commonEvent-telephony.md) + - [USB子系统公共事件定义](common_event/commonEvent-usb.md) - 包管理 - [@ohos.bundle.appControl (appControl模块)](js-apis-appControl.md) - [@ohos.bundle.bundleManager (bundleManager模块)](js-apis-bundleManager.md) @@ -182,18 +183,18 @@ - UI界面 - [@ohos.animator (动画)](js-apis-animator.md) - - [@ohos.arkui.componentSnapshot(组件截图)](js-apis-arkui-componentSnapshot.md) + - [@ohos.arkui.componentSnapshot (组件截图)](js-apis-arkui-componentSnapshot.md) - [@ohos.arkui.drawableDescriptor (DrawableDescriptor)](js-apis-arkui-drawableDescriptor.md) - [@ohos.curves (插值计算)](js-apis-curve.md) - - [@ohos.font(注册自定义字体)](js-apis-font.md) + - [@ohos.font (注册自定义字体)](js-apis-font.md) - [@ohos.matrix4 (矩阵变换)](js-apis-matrix4.md) - [@ohos.mediaquery (媒体查询)](js-apis-mediaquery.md) - - [@ohos.pluginComponent(PluginComponentManager)](js-apis-plugincomponent.md) + - [@ohos.pluginComponent (PluginComponentManager)](js-apis-plugincomponent.md) - [@ohos.promptAction (弹窗)](js-apis-promptAction.md) - [@ohos.router (页面路由)](js-apis-router.md) - [@ohos.measure (文本计算)](js-apis-measure.md) - - [@ohos.uiAppearance(用户界面外观)](js-apis-uiappearance.md) - + - [@ohos.uiAppearance (用户界面外观)](js-apis-uiappearance.md) + - 图形图像 - [@ohos.animation.windowAnimationManager (窗口动画管理)](js-apis-windowAnimationManager.md) - [@ohos.application.WindowExtensionAbility (窗口扩展能力)](js-apis-application-windowExtensionAbility.md) @@ -244,7 +245,7 @@ - [PermissionRequestResult](js-apis-permissionrequestresult.md) - 数据管理 - - [@ohos.data.cloudData(端云协同)](js-apis-data-cloudData.md) + - [@ohos.data.cloudData (端云协同)](js-apis-data-cloudData.md) - [@ohos.data.dataAbility (DataAbility谓词)](js-apis-data-ability.md) - [@ohos.data.dataShare (数据共享)](js-apis-data-dataShare.md) - [@ohos.data.dataSharePredicates (数据共享谓词)](js-apis-data-dataSharePredicates.md) @@ -253,6 +254,7 @@ - [@ohos.data.distributedKVStore (分布式键值数据库)](js-apis-distributedKVStore.md) - [@ohos.data.preferences (用户首选项)](js-apis-data-preferences.md) - [@ohos.data.relationalStore (关系型数据库)](js-apis-data-relationalStore.md) + - [@ohos.data.UDMF (统一数据管理框架)](js-apis-data-udmf.md) - [@ohos.data.ValuesBucket (数据集)](js-apis-data-valuesBucket.md) - 文件管理 @@ -335,6 +337,7 @@ - [@ohos.web.webview (Webview)](js-apis-webview.md) - [console (控制台)](js-apis-logs.md) - [Timer (定时器)](js-apis-timer.md) + - [syscap (系统能力)](js-apis-syscap.md) - application - [AccessibilityExtensionContext (辅助功能扩展上下文)](js-apis-inner-application-accessibilityExtensionContext.md) @@ -358,7 +361,7 @@ - [@ohos.multimodalInput.mouseEvent (鼠标输入事件)](js-apis-mouseevent.md) - [@ohos.multimodalInput.pointer (鼠标指针)](js-apis-pointer.md) - [@ohos.multimodalInput.touchEvent (触摸输入事件)](js-apis-touchevent.md) - - [@ohos.multimodalInput.shortKey (快捷键)](js-apis-shortKey.md) + - [@ohos.multimodalInput.shortKey(快捷键)](js-apis-shortKey.md) - [@ohos.power (系统电源管理)](js-apis-power.md) - [@ohos.runningLock (Runninglock锁)](js-apis-runninglock.md) - [@ohos.sensor (传感器)](js-apis-sensor.md) @@ -378,16 +381,16 @@ - 定制管理 - [@ohos.configPolicy (配置策略)](js-apis-configPolicy.md) - - [@ohos.enterprise.accountManager (帐户管理)](js-apis-enterprise-accountManager.md) + - [@ohos.enterprise.accountManager(帐户管理)](js-apis-enterprise-accountManager.md) - [@ohos.enterprise.adminManager (企业设备管理)](js-apis-enterprise-adminManager.md) - - [@ohos.enterprise.applicationManager (应用管理)](js-apis-enterprise-applicationManager.md) - - [@ohos.enterprise.bundleManager (包管理)](js-apis-enterprise-bundleManager.md) + - [@ohos.enterprise.applicationManager(应用管理)](js-apis-enterprise-applicationManager.md) + - [@ohos.enterprise.bundleManager(包管理)](js-apis-enterprise-bundleManager.md) - [@ohos.enterprise.dateTimeManager (系统时间管理)](js-apis-enterprise-dateTimeManager.md) - [@ohos.enterprise.deviceControl (设备控制管理)](js-apis-enterprise-deviceControl.md) - - [@ohos.enterprise.deviceInfo (设备信息管理)](js-apis-enterprise-deviceInfo.md) + - [@ohos.enterprise.deviceInfo(设备信息管理)](js-apis-enterprise-deviceInfo.md) - [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](js-apis-EnterpriseAdminExtensionAbility.md) - - [@ohos.enterprise.networkManager (网络管理)](js-apis-enterprise-networkManager.md) - - [@ohos.enterprise.wifiManager (WiFi管理)](js-apis-enterprise-wifiManager.md) + - [@ohos.enterprise.networkManager(网络管理)](js-apis-enterprise-networkManager.md) + - [@ohos.enterprise.wifiManager(WiFi管理)](js-apis-enterprise-wifiManager.md) - 语言基础类库 - [@ohos.buffer (Buffer)](js-apis-buffer.md) diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md index d0e077b11b74a387882eb8fc9b8e80a49e3bd805..e33b170620886c87350cd2da8a2a907d7e2c9c6d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md @@ -332,9 +332,9 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant'; class MyUIAbility extends UIAbility { onShare(wantParams) { console.log('onShare'); - wantParams['ohos.extra.param.key.contentTitle'] = {title: "W3"}; - wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for huawei employee"}; - wantParams['ohos.extra.param.key.shareUrl'] = {url: "w3.huawei.com"}; + wantParams['ohos.extra.param.key.contentTitle'] = {title: "OA"}; + wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for company employee"}; + wantParams['ohos.extra.param.key.shareUrl'] = {url: "oa.example.com"}; } } ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md b/zh-cn/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md index b5f78a92afe7450d5d9d7b6c19ddaf6c35889f02..9c4ee351f92055fd5c4b1245529a785905143861 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md +++ b/zh-cn/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md @@ -1,4 +1,4 @@ -# @ohos.arkui.componentSnapshot(组件截图) +# @ohos.arkui.componentSnapshot (组件截图) 本模块提供获取组件截图的能力,包括已加载的组件的截图和没有加载的组件的截图。组件截图只能够截取组件大小的区域,如果组件的绘制超出了它的区域,或子组件的绘制超出了父组件的区域,这些在组件区域外绘制的内容不会在截图中呈现。 @@ -29,10 +29,10 @@ get(id: string, callback: AsyncCallback): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ----------------------------------- | ---- | ------------------------------------------------------------------------------ | -| id | string | 是 | 目标组件的[ID 标识](../arkui-ts/ts-universal-attributes-component-id.md#组件标识) | -| callback | AsyncCallback<image.PixelMap> | 是 | 截图返回结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | ---------------------------------------- | +| id | string | 是 | 目标组件的[ID 标识](../arkui-ts/ts-universal-attributes-component-id.md#组件标识) | +| callback | AsyncCallback<image.PixelMap> | 是 | 截图返回结果的回调。 | **示例:** @@ -84,21 +84,21 @@ get(id: string): Promise **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------- | ---- | -------------------- | -| id | string | 是 | 目标组件的[ID 标识](../arkui-ts/ts-universal-attributes-component-id.md#组件标识) | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | ---------------------------------------- | +| id | string | 是 | 目标组件的[ID 标识](../arkui-ts/ts-universal-attributes-component-id.md#组件标识) | **返回值:** -| 类型 | 说明 | -| ----------------------------- | -------------- | +| 类型 | 说明 | +| ----------------------------- | -------- | | Promise<image.PixelMap> | 截图返回的结果。 | **错误码:** -| 错误码ID | 错误信息 | -| -------- | ------------------- | -| 100001 | if id is not valid. | +| 错误码ID | 错误信息 | +| ------ | ------------------- | +| 100001 | if id is not valid. | **示例:** @@ -154,10 +154,10 @@ createFromBuilder(builder: CustomBuilder, callback: AsyncCallback **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------- | ---- | -------------------- | -| builder | [CustomBuilder](../arkui-ts/ts-types.md#custombuilder8) | 是 | 自定义组件构建函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ---------------------------------------- | ---- | ---------- | +| builder | [CustomBuilder](../arkui-ts/ts-types.md#custombuilder8) | 是 | 自定义组件构建函数。 | **返回值:** -| 类型 | 说明 | -| ----------------------------- | -------------- | +| 类型 | 说明 | +| ----------------------------- | -------- | | Promise<image.PixelMap> | 截图返回的结果。 | **错误码:** -| 错误码ID | 错误信息 | -| -------- | ----------------------------------------- | -| 100001 | if builder is not a valid build function. | +| 错误码ID | 错误信息 | +| ------ | ---------------------------------------- | +| 100001 | if builder is not a valid build function. | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-avsession.md b/zh-cn/application-dev/reference/apis/js-apis-avsession.md index ae65d8ce84581984ba17bb741848aa85ecfab023..887bff759d8232ae3d8383012ff72209c3e3ee1b 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-avsession.md +++ b/zh-cn/application-dev/reference/apis/js-apis-avsession.md @@ -4,22 +4,20 @@ 该模块提供以下媒体会话相关的常用功能: -- [AVSession](#avsession) : 会话,可用于设置元数据、播放状态信息等操作。 -- [AVSessionController](#avsessioncontroller): 会话控制器,可用于查看会话ID,完成对会话发送命令及事件,获取会话元数据、播放状态信息等操作。 +- [AVSession](#avsession10) : 会话,可用于设置元数据、播放状态信息等操作。 +- [AVSessionController](#avsessioncontroller10): 会话控制器,可用于查看会话ID,完成对会话发送命令及事件,获取会话元数据、播放状态信息等操作。 > **说明:** > > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 -> 本模块的所有接口均为系统接口。 - ## 导入模块 ```js import avSession from '@ohos.multimedia.avsession'; ``` -## avSession.createAVSession +## avSession.createAVSession10+ createAVSession(context: Context, tag: string, type: AVSessionType): Promise\ @@ -27,21 +25,19 @@ createAVSession(context: Context, tag: string, type: AVSessionType): Promise\ | Promise对象。回调返回会话实例对象,可用于获取会话ID,以及设置元数据、播放状态,发送按键事件等操作。| +| Promise<[AVSession](#avsession10)\> | Promise对象。回调返回会话实例对象,可用于获取会话ID,以及设置元数据、播放状态,发送按键事件等操作。| **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -67,7 +63,7 @@ await avSession.createAVSession(context, tag, "audio").then((data) => { }); ``` -## avSession.createAVSession +## avSession.createAVSession10+ createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback\): void @@ -75,16 +71,14 @@ createAVSession(context: Context, tag: string, type: AVSessionType, callback: As **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ | | context| [Context](js-apis-inner-app-context.md) | 是| 应用上下文,提供获取应用程序环境信息的能力。 | | tag | string | 是 | 会话的自定义名称。 | -| type | [AVSessionType](#avsessiontype) | 是 | 会话类型,当前支持音频和视频。 | -| callback | AsyncCallback<[AVSession](#avsession)\> | 是 | 回调函数。回调返回会话实例对象,可用于获取会话ID,以及设置元数据、播放状态,发送按键事件等操作。 | +| type | [AVSessionType](#avsessiontype10) | 是 | 会话类型,当前支持音频和视频。 | +| callback | AsyncCallback<[AVSession](#avsession10)\> | 是 | 回调函数。回调返回会话实例对象,可用于获取会话ID,以及设置元数据、播放状态,发送按键事件等操作。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -309,7 +303,7 @@ createController(sessionId: string): Promise\ | 类型 | 说明 | | ----------------------------------------------------- | ------------------------------------------------------------ | -| Promise<[AVSessionController](#avsessioncontroller)\> | Promise对象。返回会话控制器实例,可查看会话ID,
并完成对会话发送命令及事件,获取元数据、播放状态信息等操作。| +| Promise<[AVSessionController](#avsessioncontroller10)\> | Promise对象。返回会话控制器实例,可查看会话ID,
并完成对会话发送命令及事件,获取元数据、播放状态信息等操作。| **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -361,7 +355,7 @@ createController(sessionId: string, callback: AsyncCallback\ | 是 | 回调函数。返回会话控制器实例,可查看会话ID,
并完成对会话发送命令及事件,获取元数据、播放状态信息等操作。 | +| callback | AsyncCallback<[AVSessionController](#avsessioncontroller10)\> | 是 | 回调函数。返回会话控制器实例,可查看会话ID,
并完成对会话发送命令及事件,获取元数据、播放状态信息等操作。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -760,7 +754,7 @@ sendSystemControlCommand(command: AVControlCommand): Promise\ | 参数名 | 类型 | 必填 | 说明 | | ------- | ------------------------------------- | ---- | ----------------------------------- | -| command | [AVControlCommand](#avcontrolcommand) | 是 | AVSession的相关命令和命令相关参数。 | +| command | [AVControlCommand](#avcontrolcommand10) | 是 | AVSession的相关命令和命令相关参数。 | **返回值:** @@ -819,7 +813,7 @@ sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback\ | 是 | 回调函数。当命令发送成功,err为undefined,否则返回错误对象。 | **错误码:** @@ -859,17 +853,14 @@ avSession.sendSystemControlCommand(avcommand, function (err) { }); ``` -## AVSession +## AVSession10+ -调用[avSession.createAVSession](#avsessioncreateavsession)后,返回会话的实例,可以获得会话ID,完成设置元数据,播放状态信息等操作。 +调用[avSession.createAVSession](#avsessioncreateavsession10)后,返回会话的实例,可以获得会话ID,完成设置元数据,播放状态信息等操作。 ### 属性 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - - | 名称 | 类型 | 可读 | 可写 | 说明 | | :-------- | :----- | :--- | :--- | :---------------------------- | | sessionId | string | 是 | 否 | AVSession对象唯一的会话标识。 | @@ -880,7 +871,7 @@ avSession.sendSystemControlCommand(avcommand, function (err) { let sessionId = session.sessionId; ``` -### setAVMetadata +### setAVMetadata10+ setAVMetadata(data: AVMetadata): Promise\ @@ -888,13 +879,11 @@ setAVMetadata(data: AVMetadata): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | ------ | ------------------------- | ---- | ------------ | -| data | [AVMetadata](#avmetadata) | 是 | 会话元数据。 | +| data | [AVMetadata](#avmetadata10) | 是 | 会话元数据。 | **返回值:** @@ -936,7 +925,7 @@ session.setAVMetadata(metadata).then(() => { }); ``` -### setAVMetadata +### setAVMetadata10+ setAVMetadata(data: AVMetadata, callback: AsyncCallback\): void @@ -944,13 +933,11 @@ setAVMetadata(data: AVMetadata, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ------------------------------------- | -| data | [AVMetadata](#avmetadata) | 是 | 会话元数据。 | +| data | [AVMetadata](#avmetadata10) | 是 | 会话元数据。 | | callback | AsyncCallback\ | 是 | 回调函数。当元数据设置成功,err为undefined,否则返回错误对象。 | **错误码:** @@ -989,7 +976,7 @@ session.setAVMetadata(metadata, function (err) { }); ``` -### setAVPlaybackState +### setAVPlaybackState10+ setAVPlaybackState(state: AVPlaybackState): Promise\ @@ -997,13 +984,11 @@ setAVPlaybackState(state: AVPlaybackState): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | ------ | ----------------------------------- | ---- | ---------------------------------------------- | -| data | [AVPlaybackState](#avplaybackstate) | 是 | 会话播放状态,包括状态、倍数、循环模式等信息。 | +| data | [AVPlaybackState](#avplaybackstate10) | 是 | 会话播放状态,包括状态、倍数、循环模式等信息。 | **返回值:** @@ -1037,7 +1022,7 @@ session.setAVPlaybackState(playbackState).then(() => { }); ``` -### setAVPlaybackState +### setAVPlaybackState10+ setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\): void @@ -1045,13 +1030,11 @@ setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------- | ---- | ---------------------------------------------- | -| data | [AVPlaybackState](#avplaybackstate) | 是 | 会话播放状态,包括状态、倍数、循环模式等信息。 | +| data | [AVPlaybackState](#avplaybackstate10) | 是 | 会话播放状态,包括状态、倍数、循环模式等信息。 | | callback | AsyncCallback\ | 是 | 回调函数。当播放状态设置成功,err为undefined,否则返回错误对象。 | **错误码:** @@ -1090,8 +1073,6 @@ setAVQueueItems(items: Array\): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1159,8 +1140,6 @@ setAVQueueItems(items: Array\, callback: AsyncCallback\): voi **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1225,8 +1204,6 @@ setAVQueueTitle(title: string): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1266,8 +1243,6 @@ setAVQueueTitle(title: string, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1296,7 +1271,7 @@ session.setAVQueueTitle(queueTitle, function (err) { }); ``` -### setLaunchAbility +### setLaunchAbility10+ setLaunchAbility(ability: WantAgent): Promise\ @@ -1304,8 +1279,6 @@ setLaunchAbility(ability: WantAgent): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1368,7 +1341,7 @@ wantAgent.getWantAgent(wantAgentInfo).then((agent) => { }); ``` -### setLaunchAbility +### setLaunchAbility10+ setLaunchAbility(ability: WantAgent, callback: AsyncCallback\): void @@ -1376,8 +1349,6 @@ setLaunchAbility(ability: WantAgent, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1445,8 +1416,6 @@ dispatchSessionEvent(event: string, args: {[key: string]: Object}): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1609,7 +1574,7 @@ await session.setExtras(extras, (err) => { }) ``` -### getController +### getController10+ getController(): Promise\ @@ -1617,13 +1582,11 @@ getController(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | | ---------------------------------------------------- | ----------------------------- | -| Promise<[AVSessionController](#avsessioncontroller)> | Promise对象。返回会话控制器。 | +| Promise<[AVSessionController](#avsessioncontroller10)> | Promise对象。返回会话控制器。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -1645,7 +1608,7 @@ session.getController().then((avcontroller) => { }); ``` -### getController +### getController10+ getController(callback: AsyncCallback\): void @@ -1653,13 +1616,11 @@ getController(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------------- | ---- | -------------------------- | -| callback | AsyncCallback<[AVSessionController](#avsessioncontroller)\> | 是 | 回调函数。返回会话控制器。 | +| callback | AsyncCallback<[AVSessionController](#avsessioncontroller10)\> | 是 | 回调函数。返回会话控制器。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -1683,7 +1644,7 @@ session.getController(function (err, avcontroller) { }); ``` -### getOutputDevice +### getOutputDevice10+ getOutputDevice(): Promise\ @@ -1691,13 +1652,11 @@ getOutputDevice(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | | ---------------------------------------------- | --------------------------------- | -| Promise<[OutputDeviceInfo](#outputdeviceinfo)> | Promise对象。返回播放设备信息。 | +| Promise<[OutputDeviceInfo](#outputdeviceinfo10)> | Promise对象。返回播放设备信息。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -1717,7 +1676,7 @@ session.getOutputDevice().then((outputDeviceInfo) => { }); ``` -### getOutputDevice +### getOutputDevice10+ getOutputDevice(callback: AsyncCallback\): void @@ -1725,13 +1684,11 @@ getOutputDevice(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------- | ---- | ------------------------------ | -| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo)\> | 是 | 回调函数,返回播放设备信息。 | +| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo10)\> | 是 | 回调函数,返回播放设备信息。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -1753,7 +1710,7 @@ session.getOutputDevice(function (err, outputDeviceInfo) { }); ``` -### activate +### activate10+ activate(): Promise\ @@ -1761,8 +1718,6 @@ activate(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -1787,7 +1742,7 @@ session.activate().then(() => { }); ``` -### activate +### activate10+ activate(callback: AsyncCallback\): void @@ -1795,8 +1750,6 @@ activate(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1823,16 +1776,14 @@ session.activate(function (err) { }); ``` -### deactivate +### deactivate10+ deactivate(): Promise\ -禁用当前会话的功能,可通过[activate](#activate)恢复。结果通过Promise异步回调方式返回。 +禁用当前会话的功能,可通过[activate](#activate10)恢复。结果通过Promise异步回调方式返回。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -1857,18 +1808,16 @@ session.deactivate().then(() => { }); ``` -### deactivate +### deactivate10+ deactivate(callback: AsyncCallback\): void 禁用当前会话。结果通过callback异步回调方式返回。 -禁用当前会话的功能,可通过[activate](#activate)恢复。 +禁用当前会话的功能,可通过[activate](#activate10)恢复。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1895,7 +1844,7 @@ session.deactivate(function (err) { }); ``` -### destroy +### destroy10+ destroy(): Promise\ @@ -1903,8 +1852,6 @@ destroy(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -1929,7 +1876,7 @@ session.destroy().then(() => { }); ``` -### destroy +### destroy10+ destroy(callback: AsyncCallback\): void @@ -1937,8 +1884,6 @@ destroy(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -1965,7 +1910,7 @@ session.destroy(function (err) { }); ``` -### on('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind') +### on('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')10+ on(type: 'play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind', callback: () => void): void @@ -1973,8 +1918,6 @@ on(type: 'play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind', **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2016,7 +1959,7 @@ session.on('rewind', () => { }); ``` -### on('seek') +### on('seek')10+ on(type: 'seek', callback: (time: number) => void): void @@ -2024,8 +1967,6 @@ on(type: 'seek', callback: (time: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2049,7 +1990,7 @@ session.on('seek', (time) => { }); ``` -### on('setSpeed') +### on('setSpeed')10+ on(type: 'setSpeed', callback: (speed: number) => void): void @@ -2057,8 +1998,6 @@ on(type: 'setSpeed', callback: (speed: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2082,7 +2021,7 @@ session.on('setSpeed', (speed) => { }); ``` -### on('setLoopMode') +### on('setLoopMode')10+ on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void @@ -2090,14 +2029,12 @@ on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------- | ---- | ---- | | type | string | 是 | 事件回调类型,支持事件`'setLoopMode'`:当设置循环模式的命令被发送到会话时,触发该事件。 | -| callback | (mode: [LoopMode](#loopmode)) => void | 是 | 回调函数。参数mode是循环模式。 | +| callback | (mode: [LoopMode](#loopmode10)) => void | 是 | 回调函数。参数mode是循环模式。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2115,7 +2052,7 @@ session.on('setLoopMode', (mode) => { }); ``` -### on('toggleFavorite') +### on('toggleFavorite')10+ on(type: 'toggleFavorite', callback: (assetId: string) => void): void @@ -2123,8 +2060,6 @@ on(type: 'toggleFavorite', callback: (assetId: string) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2156,8 +2091,6 @@ on(type: 'skipToQueueItem', callback: (itemId: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2181,7 +2114,7 @@ session.on('skipToQueueItem', (itemId) => { }); ``` -### on('handleKeyEvent') +### on('handleKeyEvent')10+ on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void @@ -2189,8 +2122,6 @@ on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2214,7 +2145,7 @@ session.on('handleKeyEvent', (event) => { }); ``` -### on('outputDeviceChange') +### on('outputDeviceChange')10+ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void @@ -2222,14 +2153,12 @@ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): vo **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | type | string | 是 | 事件回调类型,支持事件`'outputDeviceChange'`:当播放设备变化时,触发该事件。 | -| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | 是 | 回调函数。参数device是设备相关信息。 | +| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | 是 | 回调函数。参数device是设备相关信息。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2255,8 +2184,6 @@ on(type: 'commonCommand', callback: (command: string, args: {[key: string]: Obje **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2280,7 +2207,7 @@ session.on('commonCommand', (commonCommand, args) => { }); ``` -### off('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind') +### off('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')10+ off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind', callback?: () => void): void @@ -2288,8 +2215,6 @@ off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2317,7 +2242,7 @@ session.off('fastForward'); session.off('rewind'); ``` -### off('seek') +### off('seek')10+ off(type: 'seek', callback?: (time: number) => void): void @@ -2325,8 +2250,6 @@ off(type: 'seek', callback?: (time: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2348,7 +2271,7 @@ off(type: 'seek', callback?: (time: number) => void): void session.off('seek'); ``` -### off('setSpeed') +### off('setSpeed')10+ off(type: 'setSpeed', callback?: (speed: number) => void): void @@ -2356,8 +2279,6 @@ off(type: 'setSpeed', callback?: (speed: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2379,7 +2300,7 @@ off(type: 'setSpeed', callback?: (speed: number) => void): void session.off('setSpeed'); ``` -### off('setLoopMode') +### off('setLoopMode')10+ off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void @@ -2387,14 +2308,12 @@ off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------- | ---- | ----- | | type | string | 是 | 关闭对应的监听事件,支持关闭事件`'setLoopMode'`。| -| callback | (mode: [LoopMode](#loopmode)) => void | 否 | 回调函数,参数mode是循环模式。
当监听事件取消成功,err为undefined,否则返回错误对象。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | +| callback | (mode: [LoopMode](#loopmode10)) => void | 否 | 回调函数,参数mode是循环模式。
当监听事件取消成功,err为undefined,否则返回错误对象。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2410,7 +2329,7 @@ off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void session.off('setLoopMode'); ``` -### off('toggleFavorite') +### off('toggleFavorite')10+ off(type: 'toggleFavorite', callback?: (assetId: string) => void): void @@ -2418,8 +2337,6 @@ off(type: 'toggleFavorite', callback?: (assetId: string) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2449,8 +2366,6 @@ off(type: 'skipToQueueItem', callback?: (itemId: number) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2472,7 +2387,7 @@ off(type: 'skipToQueueItem', callback?: (itemId: number) => void): void session.off('skipToQueueItem'); ``` -### off('handleKeyEvent') +### off('handleKeyEvent')10+ off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void @@ -2480,8 +2395,6 @@ off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2503,7 +2416,7 @@ off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void session.off('handleKeyEvent'); ``` -### off('outputDeviceChange') +### off('outputDeviceChange')10+ off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void @@ -2511,14 +2424,12 @@ off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ | | type | string | 是 | 关闭对应的监听事件,支持关闭事件`'outputDeviceChange'`。 | -| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | 否 | 回调函数,参数device是设备相关信息。
当监听事件取消成功,err为undefined,否则返回错误对象。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | +| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | 否 | 回调函数,参数device是设备相关信息。
当监听事件取消成功,err为undefined,否则返回错误对象。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2543,8 +2454,6 @@ off(type: 'commonCommand', callback?: (command: string, args: {[key:string]: Obj **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2567,7 +2476,7 @@ session.off('commonCommand'); -## AVSessionController +## AVSessionController10+ 调用[avSession.createController](#avsessioncreatecontroller)后,返回会话控制器实例。控制器可查看会话ID,并可完成对会话发送命令及事件,获取会话元数据,播放状态信息等操作。 @@ -2575,9 +2484,6 @@ session.off('commonCommand'); **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - - | 名称 | 类型 | 可读 | 可写 | 说明 | | :-------- | :----- | :--- | :--- | :-------------------------------------- | | sessionId | string | 是 | 否 | AVSessionController对象唯一的会话标识。 | @@ -2593,7 +2499,7 @@ await avSession.createController(session.sessionId).then((controller) => { }); ``` -### getAVPlaybackState +### getAVPlaybackState10+ getAVPlaybackState(): Promise\ @@ -2601,13 +2507,11 @@ getAVPlaybackState(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | | --------------------------------------------- | --------------------------- | -| Promise<[AVPlaybackState](#avplaybackstate)\> | Promise对象。返回播放状态对象。 | +| Promise<[AVPlaybackState](#avplaybackstate10)\> | Promise对象。返回播放状态对象。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2627,7 +2531,7 @@ controller.getAVPlaybackState().then((playbackState) => { }); ``` -### getAVPlaybackState +### getAVPlaybackState10+ getAVPlaybackState(callback: AsyncCallback\): void @@ -2635,13 +2539,11 @@ getAVPlaybackState(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------------------------- | ---- | ---------------------------- | -| callback | AsyncCallback<[AVPlaybackState](#avplaybackstate)\> | 是 | 回调函数,返回当前播放状态对象。 | +| callback | AsyncCallback<[AVPlaybackState](#avplaybackstate10)\> | 是 | 回调函数,返回当前播放状态对象。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2671,8 +2573,6 @@ getAVQueueItems(): Promise\> **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -2705,8 +2605,6 @@ getAVQueueItems(callback: AsyncCallback\>): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2741,8 +2639,6 @@ getAVQueueTitle(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -2775,8 +2671,6 @@ getAVQueueTitle(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2811,8 +2705,6 @@ skipToQueueItem(itemId: number): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2852,8 +2744,6 @@ skipToQueueItem(itemId: number, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -2882,7 +2772,7 @@ controller.skipToQueueItem(queueItemId, function (err) { }); ``` -### getAVMetadata +### getAVMetadata10+ getAVMetadata(): Promise\ @@ -2890,13 +2780,11 @@ getAVMetadata(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | | ----------------------------------- | ----------------------------- | -| Promise<[AVMetadata](#avmetadata)\> | Promise对象,返回会话元数据。 | +| Promise<[AVMetadata](#avmetadata10)\> | Promise对象,返回会话元数据。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2916,7 +2804,7 @@ controller.getAVMetadata().then((metadata) => { }); ``` -### getAVMetadata +### getAVMetadata10+ getAVMetadata(callback: AsyncCallback\): void @@ -2924,13 +2812,11 @@ getAVMetadata(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------- | ---- | -------------------------- | -| callback | AsyncCallback<[AVMetadata](#avmetadata)\> | 是 | 回调函数,返回会话元数据。 | +| callback | AsyncCallback<[AVMetadata](#avmetadata10)\> | 是 | 回调函数,返回会话元数据。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2952,7 +2838,7 @@ controller.getAVMetadata(function (err, metadata) { }); ``` -### getOutputDevice +### getOutputDevice10+ getOutputDevice(): Promise\ @@ -2960,13 +2846,11 @@ getOutputDevice(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | | ----------------------------------------------- | --------------------------------- | -| Promise<[OutputDeviceInfo](#outputdeviceinfo)\> | Promise对象,返回播放设备信息。 | +| Promise<[OutputDeviceInfo](#outputdeviceinfo10)\> | Promise对象,返回播放设备信息。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -2985,7 +2869,7 @@ controller.getOutputDevice().then((deviceInfo) => { }); ``` -### getOutputDevice +### getOutputDevice10+ getOutputDevice(callback: AsyncCallback\): void @@ -2993,13 +2877,11 @@ getOutputDevice(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------------------------- | ---- | ------------------------------ | -| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo)\> | 是 | 回调函数,返回播放设备信息。 | +| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo10)\> | 是 | 回调函数,返回播放设备信息。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -3029,8 +2911,6 @@ getExtras(): Promise\<{[key: string]: Object}> **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -3061,8 +2941,6 @@ getExtras(callback: AsyncCallback\<{[key: string]: Object}>): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3105,7 +2983,7 @@ controller.getExtras(function (err, extras) { }); ``` -### sendAVKeyEvent +### sendAVKeyEvent10+ sendAVKeyEvent(event: KeyEvent): Promise\ @@ -3113,8 +2991,6 @@ sendAVKeyEvent(event: KeyEvent): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3151,7 +3027,7 @@ controller.sendAVKeyEvent(event).then(() => { }); ``` -### sendAVKeyEvent +### sendAVKeyEvent10+ sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\): void @@ -3159,8 +3035,6 @@ sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3194,7 +3068,7 @@ controller.sendAVKeyEvent(event, function (err) { }); ``` -### getLaunchAbility +### getLaunchAbility10+ getLaunchAbility(): Promise\ @@ -3202,13 +3076,11 @@ getLaunchAbility(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | | ------------------------------------------------------- | ------------------------------------------------------------ | -| Promise<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Promise对象,返回在[setLaunchAbility](#setlaunchability)保存的对象,包括应用的相关属性信息,如bundleName,abilityName,deviceId等。 | +| Promise<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Promise对象,返回在[setLaunchAbility](#setlaunchability10)保存的对象,包括应用的相关属性信息,如bundleName,abilityName,deviceId等。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -3231,7 +3103,7 @@ controller.getLaunchAbility().then((agent) => { }); ``` -### getLaunchAbility +### getLaunchAbility10+ getLaunchAbility(callback: AsyncCallback\): void @@ -3239,13 +3111,11 @@ getLaunchAbility(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| callback | AsyncCallback<[WantAgent](js-apis-app-ability-wantAgent.md)\> | 是 | 回调函数。返回在[setLaunchAbility](#setlaunchability)保存的对象,包括应用的相关属性信息,如bundleName,abilityName,deviceId等。 | +| callback | AsyncCallback<[WantAgent](js-apis-app-ability-wantAgent.md)\> | 是 | 回调函数。返回在[setLaunchAbility](#setlaunchability10)保存的对象,包括应用的相关属性信息,如bundleName,abilityName,deviceId等。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -3270,7 +3140,7 @@ controller.getLaunchAbility(function (err, agent) { }); ``` -### getRealPlaybackPositionSync +### getRealPlaybackPositionSync10+ getRealPlaybackPositionSync(): number @@ -3278,8 +3148,6 @@ getRealPlaybackPositionSync(): number **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -3300,7 +3168,7 @@ getRealPlaybackPositionSync(): number let time = controller.getRealPlaybackPositionSync(); ``` -### isActive +### isActive10+ isActive(): Promise\ @@ -3308,8 +3176,6 @@ isActive(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -3335,7 +3201,7 @@ controller.isActive().then((isActive) => { }); ``` -### isActive +### isActive10+ isActive(callback: AsyncCallback\): void @@ -3343,8 +3209,6 @@ isActive(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3372,7 +3236,7 @@ controller.isActive(function (err, isActive) { }); ``` -### destroy +### destroy10+ destroy(): Promise\ @@ -3380,8 +3244,6 @@ destroy(): Promise\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | @@ -3406,7 +3268,7 @@ controller.destroy().then(() => { }); ``` -### destroy +### destroy10+ destroy(callback: AsyncCallback\): void @@ -3414,8 +3276,6 @@ destroy(callback: AsyncCallback\): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3442,7 +3302,7 @@ controller.destroy(function (err) { }); ``` -### getValidCommands +### getValidCommands10+ getValidCommands(): Promise\> @@ -3450,13 +3310,11 @@ getValidCommands(): Promise\> **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **返回值:** | 类型 | 说明 | | ------------------------------------------------------------ | --------------------------------- | -| Promise\> | Promise对象。返回有效命令的集合。 | +| Promise\> | Promise对象。返回有效命令的集合。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -3477,7 +3335,7 @@ controller.getValidCommands.then((validCommands) => { }); ``` -### getValidCommands +### getValidCommands10+ getValidCommands(callback: AsyncCallback\>): void @@ -3485,13 +3343,11 @@ getValidCommands(callback: AsyncCallback\>): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------ | -| callback | AsyncCallback\\> | 是 | 回调函数,返回有效命令的集合。 | +| callback | AsyncCallback\\> | 是 | 回调函数,返回有效命令的集合。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -3514,7 +3370,7 @@ controller.getValidCommands(function (err, validCommands) { }); ``` -### sendControlCommand +### sendControlCommand10+ sendControlCommand(command: AVControlCommand): Promise\ @@ -3522,17 +3378,15 @@ sendControlCommand(command: AVControlCommand): Promise\ > **说明:** > -> 媒体控制方在使用sendControlCommand命令前,需要确保控制对应的媒体会话注册了对应的监听,注册媒体会话相关监听的方法请参见接口[注册媒体会话相关监听](#onplaypausestopplaynextplaypreviousfastforwardrewind)。 +> 媒体控制方在使用sendControlCommand命令前,需要确保控制对应的媒体会话注册了对应的监听,注册媒体会话相关监听的方法请参见接口[注册媒体会话相关监听](#onplaypausestopplaynextplaypreviousfastforwardrewind10)。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | ------- | ------------------------------------- | ---- | ------------------------------ | -| command | [AVControlCommand](#avcontrolcommand) | 是 | 会话的相关命令和命令相关参数。 | +| command | [AVControlCommand](#avcontrolcommand10) | 是 | 会话的相关命令和命令相关参数。 | **返回值:** @@ -3573,7 +3427,7 @@ controller.sendControlCommand(avCommand).then(() => { }); ``` -### sendControlCommand +### sendControlCommand10+ sendControlCommand(command: AVControlCommand, callback: AsyncCallback\): void @@ -3581,17 +3435,15 @@ sendControlCommand(command: AVControlCommand, callback: AsyncCallback\): v > **说明:** > -> 媒体控制方在使用sendControlCommand命令前,需要确保控制对应的媒体会话注册了对应的监听,注册媒体会话相关监听的方法请参见接口[注册媒体会话相关监听](#onplaypausestopplaynextplaypreviousfastforwardrewind)。 +> 媒体控制方在使用sendControlCommand命令前,需要确保控制对应的媒体会话注册了对应的监听,注册媒体会话相关监听的方法请参见接口[注册媒体会话相关监听](#onplaypausestopplaynextplaypreviousfastforwardrewind10)。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------- | ---- | ------------------------------ | -| command | [AVControlCommand](#avcontrolcommand) | 是 | 会话的相关命令和命令相关参数。 | +| command | [AVControlCommand](#avcontrolcommand10) | 是 | 会话的相关命令和命令相关参数。 | | callback | AsyncCallback\ | 是 | 回调函数。当命令发送成功,err为undefined,否则返回错误对象。 | **错误码:** @@ -3637,8 +3489,6 @@ sendCommonCommand(command: string, args: {[key: string]: Object}): Promise\ { }) ``` -### on('metadataChange') +### on('metadataChange')10+ on(type: 'metadataChange', filter: Array\ | 'all', callback: (data: AVMetadata) => void) @@ -3734,15 +3582,13 @@ on(type: 'metadataChange', filter: Array\ | 'all', callback: ( **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | type | string | 是 | 事件回调类型,支持事件`'metadataChange'`:当元数据变化时,触发该事件。 | -| filter | Array\ | 'all' | 是 | 'all' 表示关注元数据所有字段变化;Array 表示关注Array中的字段变化。 | -| callback | (data: [AVMetadata](#avmetadata)) => void | 是 | 回调函数,参数data是变化后的元数据。 | +| filter | Array\ | 'all' | 是 | 'all' 表示关注元数据所有字段变化;Array 表示关注Array中的字段变化。 | +| callback | (data: [AVMetadata](#avmetadata10)) => void | 是 | 回调函数,参数data是变化后的元数据。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -3765,7 +3611,7 @@ controller.on('metadataChange', metaFilter, (metadata) => { }); ``` -### on('playbackStateChange') +### on('playbackStateChange')10+ on(type: 'playbackStateChange', filter: Array\ | 'all', callback: (state: AVPlaybackState) => void) @@ -3773,15 +3619,13 @@ on(type: 'playbackStateChange', filter: Array\ | 'all', c **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | type | string | 是 | 事件回调类型,支持事件`'playbackStateChange'`:当播放状态变化时,触发该事件。 | -| filter | Array\ | 'all' | 是 | 'all' 表示关注播放状态所有字段变化;Array 表示关注Array中的字段变化。 | -| callback | (state: [AVPlaybackState](#avplaybackstate)) => void | 是 | 回调函数,参数state是变化后的播放状态。 | +| filter | Array\ | 'all' | 是 | 'all' 表示关注播放状态所有字段变化;Array 表示关注Array中的字段变化。 | +| callback | (state: [AVPlaybackState](#avplaybackstate10)) => void | 是 | 回调函数,参数state是变化后的播放状态。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -3812,8 +3656,6 @@ on(type: 'sessionEvent', callback: (sessionEvent: string, args: {[key:string]: O **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3845,8 +3687,6 @@ on(type: 'queueItemsChange', callback: (items: Array<[AVQueueItem](#avqueueitem1 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3878,8 +3718,6 @@ on(type: 'queueTitleChange', callback: (title: string) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3911,8 +3749,6 @@ on(type: 'extrasChange', callback: (extras: {[key:string]: Object}) => void): vo **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3937,7 +3773,7 @@ controller.on('extrasChange', (extras) => { }); ``` -### on('sessionDestroy') +### on('sessionDestroy')10+ on(type: 'sessionDestroy', callback: () => void) @@ -3945,8 +3781,6 @@ on(type: 'sessionDestroy', callback: () => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -3970,7 +3804,7 @@ controller.on('sessionDestroy', () => { }); ``` -### on('activeStateChange') +### on('activeStateChange')10+ on(type: 'activeStateChange', callback: (isActive: boolean) => void) @@ -3978,8 +3812,6 @@ on(type: 'activeStateChange', callback: (isActive: boolean) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -4003,7 +3835,7 @@ controller.on('activeStateChange', (isActive) => { }); ``` -### on('validCommandChange') +### on('validCommandChange')10+ on(type: 'validCommandChange', callback: (commands: Array\) => void) @@ -4011,14 +3843,12 @@ on(type: 'validCommandChange', callback: (commands: Array\ **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | type | string | 是 | 事件回调类型,支持事件`'validCommandChange'`:当检测到会话的合法命令发生改变时,触发该事件。 | -| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype)\>) => void | 是 | 回调函数。参数commands是有效命令的集合。 | +| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype10)\>) => void | 是 | 回调函数。参数commands是有效命令的集合。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -4037,7 +3867,7 @@ controller.on('validCommandChange', (validCommands) => { }); ``` -### on('outputDeviceChange') +### on('outputDeviceChange')10+ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void @@ -4045,14 +3875,12 @@ on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): vo **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ | | type | string | 是 | 事件回调类型,支持事件为`'outputDeviceChange'`:当播放设备变化时,触发该事件)。 | -| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | 是 | 回调函数,参数device是设备相关信息。 | +| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | 是 | 回调函数,参数device是设备相关信息。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -4070,7 +3898,7 @@ controller.on('outputDeviceChange', (device) => { }); ``` -### off('metadataChange') +### off('metadataChange')10+ off(type: 'metadataChange', callback?: (data: AVMetadata) => void) @@ -4078,14 +3906,12 @@ off(type: 'metadataChange', callback?: (data: AVMetadata) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------ | ---- | ------------------------------------------------------ | | type | string | 是 | 取消对应的监听事件,支持事件`'metadataChange'`。 | -| callback | (data: [AVMetadata](#avmetadata)) => void | 否 | 回调函数,参数data是变化后的元数据。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | +| callback | (data: [AVMetadata](#avmetadata10)) => void | 否 | 回调函数,参数data是变化后的元数据。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -4100,7 +3926,7 @@ off(type: 'metadataChange', callback?: (data: AVMetadata) => void) controller.off('metadataChange'); ``` -### off('playbackStateChange') +### off('playbackStateChange')10+ off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void) @@ -4108,14 +3934,12 @@ off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------- | | type | string | 是 | 取消对应的监听事件,支持事件`'playbackStateChange'`。 | -| callback | (state: [AVPlaybackState](#avplaybackstate)) => void | 否 | 回调函数,参数state是变化后的播放状态。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | +| callback | (state: [AVPlaybackState](#avplaybackstate10)) => void | 否 | 回调函数,参数state是变化后的播放状态。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -4138,8 +3962,6 @@ off(type: 'sessionEvent', callback?: (sessionEvent: string, args: {[key:string]: **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -4168,8 +3990,6 @@ off(type: 'queueItemsChange', callback?: (items: Array<[AVQueueItem](#avqueueite **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -4198,8 +4018,6 @@ off(type: 'queueTitleChange', callback?: (title: string) => void): void **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -4228,8 +4046,6 @@ off(type: 'extrasChange', callback?: (extras: {[key:string]: Object}) => void): **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -4252,7 +4068,7 @@ off(type: 'extrasChange', callback?: (extras: {[key:string]: Object}) => void): controller.off('extrasChange'); ``` -### off('sessionDestroy') +### off('sessionDestroy')10+ off(type: 'sessionDestroy', callback?: () => void) @@ -4260,8 +4076,6 @@ off(type: 'sessionDestroy', callback?: () => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -4282,7 +4096,7 @@ off(type: 'sessionDestroy', callback?: () => void) controller.off('sessionDestroy'); ``` -### off('activeStateChange') +### off('activeStateChange')10+ off(type: 'activeStateChange', callback?: (isActive: boolean) => void) @@ -4290,8 +4104,6 @@ off(type: 'activeStateChange', callback?: (isActive: boolean) => void) **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -4312,7 +4124,7 @@ off(type: 'activeStateChange', callback?: (isActive: boolean) => void) controller.off('activeStateChange'); ``` -### off('validCommandChange') +### off('validCommandChange')10+ off(type: 'validCommandChange', callback?: (commands: Array\) => void) @@ -4320,14 +4132,12 @@ off(type: 'validCommandChange', callback?: (commands: Array\) => void | 否 | 回调函数。参数commands是有效命令的集合。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | +| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype10)\>) => void | 否 | 回调函数。参数commands是有效命令的集合。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -4342,7 +4152,7 @@ off(type: 'validCommandChange', callback?: (commands: Array\10+
off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void @@ -4350,14 +4160,12 @@ off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ | | type | string | 是 | 取消对应的监听事件,支持事件`'outputDeviceChange'`。 | -| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | 否 | 回调函数,参数device是设备相关信息。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | +| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | 否 | 回调函数,参数device是设备相关信息。
该参数为可选参数,若不填写该参数,则认为取消所有相关会话的事件监听。 | **错误码:** 以下错误码的详细介绍请参见[媒体会话管理错误码](../errorcodes/errorcode-avsession.md)。 @@ -4388,13 +4196,11 @@ controller.off('outputDeviceChange'); | pid | number | 是 | 会话的进程ID | | uid | number | 是 | 用户ID | -## AVSessionType +## AVSessionType10+ 当前会话支持的会话类型。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口。 - | 名称 | 类型 | 说明 | | ----- | ------ | ---- | | audio | string | 音频 | @@ -4411,21 +4217,19 @@ controller.off('outputDeviceChange'); | 名称 | 类型 | 可读 | 可写 | 说明 | | ------------ | ------------------------------------------------------------ | ---- | --------------------------------------------------- | --------------------------------------------------- | | sessionId | string | 是 | 否 | 会话ID | -| type | [AVSessionType](#avsessiontype) | 是 | 否 | 会话类型 | +| type | [AVSessionType](#avsessiontype10) | 是 | 否 | 会话类型 | | sessionTag | string | 是 | 否 | 会话的自定义名称 | | elementName | [ElementName](js-apis-bundle-ElementName.md) | 是 | 否 | 会话所属应用的信息(包含bundleName、abilityName等) | | isActive | boolean | 是 | 否 | 会话是否被激活 | | isTopSession | boolean | 是 | 否 | 会话是否为最新的会话 | -| outputDevice | [OutputDeviceInfo](#outputdeviceinfo) | 是 | 否 | 分布式设备相关信息 | +| outputDevice | [OutputDeviceInfo](#outputdeviceinfo10) | 是 | 否 | 分布式设备相关信息 | -## AVControlCommandType +## AVControlCommandType10+ 会话可传递的命令。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 类型 | 说明 | | -------------- | ------ | ------------ | | play | string | 播放 | @@ -4440,27 +4244,23 @@ controller.off('outputDeviceChange'); | setLoopMode | string | 设置循环模式 | | toggleFavorite | string | 是否收藏 | -## AVControlCommand +## AVControlCommand10+ 会话接受的命令的对象描述。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 类型 | 必填 | 说明 | | --------- | ------------------------------------------------- | ---- | -------------- | -| command | [AVControlCommandType](#avcontrolcommandtype) | 是 | 命令 | -| parameter | [LoopMode](#loopmode) | string | number | 否 | 命令对应的参数 | +| command | [AVControlCommandType](#avcontrolcommandtype10) | 是 | 命令 | +| parameter | [LoopMode](#loopmode10) | string | number | 否 | 命令对应的参数 | -## AVMetadata +## AVMetadata10+ 媒体元数据的相关属性。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 类型 | 必填 | 说明 | | --------------- |-------------------------| ---- |---------------------------------------------------------------------| | assetId | string | 是 | 媒体ID。 | @@ -4507,60 +4307,52 @@ controller.off('outputDeviceChange'); | itemId | number | 是 | 播放列表中单项的ID。 | | description | [AVMediaDescription](#avmediadescription10) | 是 | 播放列表中单项的媒体元数据。 | -## AVPlaybackState +## AVPlaybackState10+ 媒体播放状态的相关属性。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 类型 | 必填 | 说明 | | ------------ | ------------------------------------- | ---- | ------- | | state | [PlaybackState](#playbackstate) | 否 | 播放状态 | | speed | number | 否 | 播放倍速 | | position | [PlaybackPosition](#playbackposition) | 否 | 播放位置 | | bufferedTime | number | 否 | 缓冲时间 | -| loopMode | [LoopMode](#loopmode) | 否 | 循环模式 | +| loopMode | [LoopMode](#loopmode10) | 否 | 循环模式 | | isFavorite | boolean | 否 | 是否收藏 | | activeItemId10+ | number | 否 | 正在播放的媒体Id | | extras10+ | {[key: string]: Object} | 否 | 自定义媒体数据 | -## PlaybackPosition +## PlaybackPosition10+ 媒体播放位置的相关属性。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 类型 | 必填 | 说明 | | ----------- | ------ | ---- | ------------------ | | elapsedTime | number | 是 | 已用时间,单位毫秒(ms)。 | | updateTime | number | 是 | 更新时间,单位毫秒(ms)。 | -## OutputDeviceInfo +## OutputDeviceInfo10+ 播放设备的相关信息。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 类型 | 必填 | 说明 | | ---------- | -------------- | ---- | ---------------------- | | isRemote | boolean | 是 | 设备是否连接。 | | audioDeviceId | Array | 是 | 播放设备的ID集合。 | | deviceName | Array | 是 | 播放设备的名称集合。 | -## PlaybackState +## PlaybackState10+ 表示媒体播放状态的枚举。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 值 | 说明 | | --------------------------- | ---- | ----------- | | PLAYBACK_STATE_INITIAL | 0 | 初始状态 | @@ -4572,14 +4364,12 @@ controller.off('outputDeviceChange'); | PLAYBACK_STATE_STOP | 6 | 停止 | -## LoopMode +## LoopMode10+ 表示媒体播放循环模式的枚举。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 值 | 说明 | | ------------------ | ---- | -------- | | LOOP_MODE_SEQUENCE | 0 | 顺序播放 | @@ -4587,14 +4377,12 @@ controller.off('outputDeviceChange'); | LOOP_MODE_LIST | 2 | 表单循环 | | LOOP_MODE_SHUFFLE | 3 | 随机播放 | -## AVSessionErrorCode +## AVSessionErrorCode10+ 会话发生错误时的错误码。 **系统能力:** SystemCapability.Multimedia.AVSession.Core -**系统接口:** 该接口为系统接口 - | 名称 | 值 | 说明 | | ------------------------------ | ------- | ------------------------------- | | ERR_CODE_SERVICE_EXCEPTION | 6600101 | Session service exception. | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md index bf0cbbb9a8716a44ddc1929e97dde91ac8949119..7f9c0a63ab135bd162e1eb3865b5068beba634bf 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md @@ -25,9 +25,9 @@ | removable | boolean | 是 | 否 | 应用程序是否可以被移除。 | | accessTokenId | number | 是 | 否 | 应用程序的accessTokenId。 | | uid | number | 是 | 否 | 应用程序的uid。 | -| iconResource | [Resource](js-apis-resource-manager.md#resource9) | 是 | 否 | 应用程序的图标资源信息,通过ApplicationInfo 获取的resource 包含了该资源的信息的bundleName、moduleName 和 id,可以调用全球化的接口[@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts)中的getMediaContent来获取详细的资源数据信息。 | -| labelResource | [Resource](js-apis-resource-manager.md#resource9) | 是 | 否 | 应用程序的标签资源信息,通过ApplicationInfo 获取的resource 包含了该资源的信息的bundleName、moduleName 和 id,可以调用全球化的接口[@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts)中的getMediaContent来获取详细的资源数据信息。 | -| descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | 是 | 否 | 应用程序的描述资源信息,通过ApplicationInfo 获取的resource 包含了该资源的信息的bundleName、moduleName 和 id,可以调用全球化的接口[@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts)中的getMediaContent来获取详细的资源数据信息。| +| iconResource | [Resource](js-apis-resource-manager.md#resource9) | 是 | 否 | 应用程序的图标资源信息,通过ApplicationInfo 获取的resource 包含了该资源的信息的bundleName、moduleName 和 id,可以调用全球化的接口[@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9)中的getMediaContent来获取详细的资源数据信息。 | +| labelResource | [Resource](js-apis-resource-manager.md#resource9) | 是 | 否 | 应用程序的标签资源信息,通过ApplicationInfo 获取的resource 包含了该资源的信息的bundleName、moduleName 和 id,可以调用全球化的接口[@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9)中的getMediaContent来获取详细的资源数据信息。 | +| descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | 是 | 否 | 应用程序的描述资源信息,通过ApplicationInfo 获取的resource 包含了该资源的信息的bundleName、moduleName 和 id,可以调用全球化的接口[@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9)中的getMediaContent来获取详细的资源数据信息。| | appDistributionType | string | 是 | 否 | 应用程序签名证书的分发类型,分为:app_gallery、enterprise、os_integration和crowdtesting。 | | appProvisionType | string | 是 | 否 | 应用程序签名证书文件的类型,分为debug和release两种类型。 | | systemApp | boolean | 是 | 否 | 标识应用是否为系统应用。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-camera.md b/zh-cn/application-dev/reference/apis/js-apis-camera.md index 875c370285080e7e3afaa4e2ee51bfdf7e70bbad..736d69c24c9eb9d5879b4dc02f1332280e32e10d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-camera.md +++ b/zh-cn/application-dev/reference/apis/js-apis-camera.md @@ -1755,7 +1755,7 @@ setExposureBias(exposureBias: number): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------------------| ---- | ------------------- | -| exposureBias | number | 是 | 曝光补偿,getExposureBiasRange查询支持的范围,接口调用失败会返回相应错误码,错误码类型[CameraErrorCode](#cameraerrorcode),如果设置超过支持范围的值,自动匹配到就近临界点。 | +| exposureBias | number | 是 | 曝光补偿,getExposureBiasRange查询支持的范围,如果设置超过支持范围的值,自动匹配到就近临界点。曝光补偿存在步长,如步长为0.5。则设置1.2时,获取到实际生效曝光补偿为1.0。接口调用失败会返回相应错误码,错误码类型[CameraErrorCode](#cameraerrorcode), | **错误码:** @@ -1789,7 +1789,7 @@ getExposureValue(): number | 类型 | 说明 | | ---------- | ----------------------------- | -| number | 获取曝光值。接口调用失败会返回相应错误码,错误码类型[CameraErrorCode](#cameraerrorcode) | +| number | 获取曝光值。曝光补偿存在步长,如步长为0.5。则设置1.2时,获取到实际生效曝光补偿为1.0。接口调用失败会返回相应错误码,错误码类型[CameraErrorCode](#cameraerrorcode) | **错误码:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-dataShare.md b/zh-cn/application-dev/reference/apis/js-apis-data-dataShare.md index c054dc17b8104720f529cc46c9961b59da782a8f..d27fd96d514743ed0665e9bb40ecbfb0b1fb2e97 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-dataShare.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-dataShare.md @@ -76,7 +76,7 @@ let uri = ("datashare:///com.samples.datasharetest.DataShare"); let dataShareHelper; try { dataShare.createDataShareHelper(this.context, uri, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.error(`createDataShareHelper error: code: ${err.code}, message: ${err.message} `); return; } @@ -88,9 +88,57 @@ try { }; ``` +## dataShare.createDataShareHelper10+ +createDataShareHelper(context: Context, uri: string, options: DataShareHelperOptions, callback: AsyncCallback<DataShareHelper>): void + +创建DataShareHelper实例。使用callback异步回调。 + +使用规则: + - 调用方应用位于后台时,使用该接口访问DataShareExtension需申请`ohos.permission.START_ABILITIES_FROM_BACKGROUND`权限 + - 跨应用场景下,目标DataShareExtension的exported属性若配置为false,调用方应用需申请`ohos.permission.START_INVISIBLE_ABILITY`权限 + - 组件启动规则详见:[组件启动规则(Stage模型)](../../application-models/component-startup-rules.md) + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| context | [Context](js-apis-inner-application-context.md#context) | 是 | 应用的上下文环境。 | +| uri | string | 是 | 指示要连接的服务端应用的路径。 | +| options | [DataShareHelperOptions](#datasharehelperoptions10)| 是 | 可选配置。指定[DataShareHelper](#datasharehelper)是否在代理模式下。| +| callback | AsyncCallback<[DataShareHelper](#datasharehelper)> | 是 | 回调函数。当创建DataShareHelper实例成功,err为undefined,data为获取到的DataShareHelper实例;否则为错误对象。 | + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | ---------------------------------------------------- | +| 15700010 | The DataShareHelper is not initialized successfully. | + +**示例:** + +```ts +import UIAbility from '@ohos.app.ability.UIAbility'; + +let uri = ("datashareproxy://com.samples.datasharetest.DataShare"); +let dataShareHelper; +try { + dataShare.createDataShareHelper(this.context, uri, {isProxy : true}, (err, data) => { + if (err !== undefined) { + console.error(`createDataShareHelper error: code: ${err.code}, message: ${err.message} `); + return; + } + console.info("createDataShareHelper succeed, data : " + data); + dataShareHelper = data; + }); +} catch (err) { + console.error(`createDataShareHelper error: code: ${err.code}, message: ${err.message} `); +}; +``` ## dataShare.createDataShareHelper -createDataShareHelper(context: Context, uri: string): Promise<DataShareHelper> +createDataShareHelper(context: Context, uri: string, options?: DataShareHelperOptions): Promise<DataShareHelper> 创建DataShareHelper实例。使用Promise异步回调。 @@ -107,6 +155,7 @@ createDataShareHelper(context: Context, uri: string): Promise<DataShareHelper | ------- | ------------------------------------------------- | ---- | ------------------------------ | | context | [Context](js-apis-inner-application-context.md#context) | 是 | 应用的上下文环境。 | | uri | string | 是 | 指示要连接的服务端应用的路径。 | +| options | [DataShareHelperOptions](#datasharehelperoptions10) | 否 | 可选配置。从API version 10开始支持此参数,如果不设置,则表示[DataShareHelper](#datasharehelper)不在代理模式下。| **返回值:** @@ -127,10 +176,10 @@ createDataShareHelper(context: Context, uri: string): Promise<DataShareHelper ```ts import UIAbility from '@ohos.app.ability.UIAbility'; -let uri = ("datashare:///com.samples.datasharetest.DataShare"); +let uri = ("datashareproxy://com.samples.datasharetest.DataShare"); let dataShareHelper; try { - dataShare.createDataShareHelper(this.context, uri).then((data) => { + dataShare.createDataShareHelper(this.context, uri, {isProxy : true}).then((data) => { console.info("createDataShareHelper succeed, data : " + data); dataShareHelper = data; }). catch((err) => { @@ -141,6 +190,83 @@ try { }; ``` +## DataShareHelperOptions10+ + +指定[DataShareHelper](#datasharehelper)是否在代理模式下。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| isProxy | boolean | 否 | 默认为false,如果为true,则要创建的[DataShareHelper](#datasharehelper)处于代理模式,所有操作都不会打开数据提供者APP,除非数据库不存在,当数据库不存在时,[createDataShareHelper](#datasharecreatedatasharehelper10)会拉起数据提供者创建数据库。 | + +## TemplateId10+ + +标记模板的数据结构,TemplateId是在[addTemplate](#addtemplate10)中自动生成的,在[addTemplate](#addtemplate10)后,可以使用模板id来标记模板。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| subscriberId | string | 是 | 指定处理回调的订阅者的id,与[addTemplate](#addtemplate10)中的subscriberId相同,每个订阅者的ID是唯一的。 | +| bundleNameOfOwner | string | 是 | 指定创建模板的模板所有者的bundleName,与[addTemplate](#addtemplate10)中的bundleName相同。 | + +## PublishedItem10+ + +指定发布的数据类型。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| key | string | 是 | 指定发布数据的键。 | +| data | string \| [Ashmem](js-apis-rpc.md#ashmem8) | 是 | 指定发布的数据。如果数据很大,请使用Ashmem。 | +| subscriberId | string | 是 | 指定订阅者id。 | + +## RdbDataChangeNode10+ + +订阅/取消订阅RDB数据变更的结果。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| uri | string | 是 | 指定回调的uri。 | +| templateId | [TemplateId](#templateid10) | 是 | 处理回调的templateId。 | +| data | Array<string> | 是 | 指定回调的数据。 | + +## PublishedDataChangeNode10+ + +订阅/取消订阅已发布数据变更的结果。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| bundleName | string | 是 | 指定回调的bundleName。 | +| data | Array<[PublishedItem](#publisheditem10)> | 是 | 指定回调的数据。 | + +## Template10+ + +指定订阅中的模板结构。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| predicates | { [key: string]: string } | 是 | 指定模板的谓词。当调用[on](#onrdbdatachange10)的回调时,谓词用于生成数据。仅适用于rdb存储数据。 | +| scheduler | string | 是 | 指定模板的调度程序sql。其中嵌入自定义函数处理,目前预置自定义函数remindTimer处理。remindTimer在指定场景触发一次订阅刷新。
触发场景:
1. 修改数据时且有订阅的情况下触发对应的调度程序sql语句。
2. 添加对应库第一个订阅的情况下触发对应的调度程序sql语句。 | + +## OperationResult10+ + +订阅/取消订阅数据变更和发布数据的操作结果。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | ----- | -------- | +| key | string | 是 | 指定运算结果的键。 | +| result | number | 是 | 指定运算结果。 | ## DataShareHelper DataShare管理工具实例,可使用此实例访问或管理服务端的数据。在调用DataShareHelper提供的方法前,需要先通过[createDataShareHelper](#datasharecreatedatasharehelper)构建一个实例。 @@ -164,8 +290,6 @@ on(type: 'dataChange', uri: string, callback: AsyncCallback<void>): void **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - function onCallback() { console.info("**** Observer on callback ****"); } @@ -192,8 +316,6 @@ off(type: 'dataChange', uri: string, callback?: AsyncCallback<void>): void **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - function callback() { console.info("**** Observer callback ****"); } @@ -202,6 +324,437 @@ dataShareHelper.on("dataChange", uri, callback); dataShareHelper.off("dataChange", uri, callback); ``` +### addTemplate10+ + +addTemplate(uri: string, subscriberId: string, template: Template): void + +添加一个指定订阅者的数据模板。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | -------------------------| +| uri | string | 是 | 指示要插入的数据的路径。 | +| subscriberId | string | 是 | 要添加模板的订阅者ID,每个订阅者的ID是唯一的。 | +| template | [Template](#template10) | 是 | 要添加的数据模板。 | + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | -------------------- | +| 15700011 | The uri is not exist.| + +**示例:** + +```ts +let uri = ("datashareproxy://com.samples.datasharetest.DataShare"); +let subscriberId = '11'; +let template = { + predicates : { + "p1" : "select cityColumn as city_1, visitedCilumn as visited_1 from citys where like = true", + "p2" : "select cityColumn as city_2, visitedCilumn as visited_2 from citys where like = false", + }, + scheduler : "select remindTimer(time) from TBL00" +} +dataShareHelper.addTemplate(uri, subscriberId, template); +``` + +### delTemplate10+ + +delTemplate(uri: string, subscriberId: string): void + +删除一个指定订阅者的数据模板。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------| ---- | ------------------------- | +| uri | string | 是 | 指示要插入的数据的路径。 | +| subscriberId | string | 是 | 订阅者ID,每个订阅者的ID是唯一的。 | + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | -------------------- | +| 15700011 | The uri is not exist.| + +**示例:** + +```ts +let uri = ("datashareproxy://com.samples.datasharetest.DataShare"); +let subscriberId = '11'; +let template = { + predicates : { + "p1" : "select cityColumn as city_1, visitedCilumn as visited_1 from citys where like = true", + "p2" : "select cityColumn as city_2, visitedCilumn as visited_2 from citys where like = false", + }, + scheduler : "select remindTimer(time) from TBL00" +} +dataShareHelper.addTemplate(uri, subscriberId, template); +dataShareHelper.delTemplate(uri, subscriberId); +``` + +### on('rdbDataChange')10+ + +on(type: 'rdbDataChange', uris: Array<string>, templateId: TemplateId, callback: AsyncCallback<RdbDataChangeNode>): Array<OperationResult> + +订阅指定URI和模板对应的数据变更事件。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------| ---- | ------------------------------------------------------------ | +| type | string | 是 | 订阅的事件类型,支持的事件为'rdbDataChange',表示rdb数据的变更事件。 | +| uris | Array<string> | 是 | 要操作的数据的路径。 | +| templateId | [TemplateId](#templateid10) | 是 | 处理回调的templateId。 | +| callback | AsyncCallback<[RdbDataChangeNode](#rdbdatachangenode10)> | 是 | 回调函数。当触发变更通知时调用,err为undefined,node为订阅数据变更结果;否则不被触发或为错误对象。 | + +**返回值:** + +| 类型 | 说明 | +| ---------------- | ------------------------------------------------------------ | +| Array<[OperationResult](#operationresult10)> | 返回操作结果。| + +**示例:** + +```ts +function onCallback(err, node:dataShare.RdbDataChangeNode) { + console.info("onCallback " + JSON.stringify(node.uri)); + console.info("onCallback " + JSON.stringify(node.templateId)); + console.info("onCallback " + node.data.length); + for (let i = 0; i < node.data.length; i++) { + console.info("onCallback " + typeof node.data[i] + " " + node.data[i]); + } +} + +let uri = ("datashareproxy://com.samples.datasharetest.DataShare"); +let templateId:dataShare.TemplateId = {subscriberId:"11", bundleNameOfOwner:"com.acts.ohos.data.datasharetest"}; +let result:Array = dataShareHelper.on("rdbDataChange", [uri], templateId, onCallback); +``` + +### off('rdbDataChange')10+ + +off(type: 'rdbDataChange', uris: Array<string>, templateId: TemplateId, callback?: AsyncCallback<RdbDataChangeNode>): Array<OperationResult> + +取消订阅指定URI和模板对应的数据变更事件。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | +| type | string | 是 | 取消订阅的事件类型,支持的事件为'rdbDataChange',表示rdb数据的变更事件。 | +| uris | Array<string> | 是 | 要操作的数据的路径。 | +| templateId | [TemplateId](#templateid10) | 是 | 处理回调的templateId。 | +| callback | AsyncCallback<[RdbDataChangeNode](#rdbdatachangenode10)> | 否 | 回调函数。表示指定取消订阅的callback通知,如果为空,则取消订阅该uri下所有的通知事件。 | + +**返回值:** + +| 类型 | 说明 | +| ---------------- | ------------------------------------------------------------ | +| Array<[OperationResult](#operationresult10)> | 返回操作结果。| + +**示例:** + +```ts +let uri = ("datashareproxy://com.samples.datasharetest.DataShare"); +let templateId:dataShare.TemplateId = {subscriberId:"11", bundleNameOfOwner:"com.acts.ohos.data.datasharetest"}; +let result:Array = dataShareHelper.off("rdbDataChange", [uri], templateId); +``` + +### on('publishedDataChange')10+ + +on(type: 'publishedDataChange', uris: Array<string>, subscriberId: string, callback: AsyncCallback<PublishedDataChangeNode>): Array<OperationResult> + +订阅已发布数据的数据变更通知。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------| ---- | ------------------------------------------------------------ | +| type | string | 是 | 订阅的事件类型,支持的事件为'publishedDataChange',表示已发布数据的变更事件。 | +| uris | Array<string> | 是 | 要操作的数据的路径。 | +| subscriberId | string | 是 | 指定处理回调的用户ID。 | +| callback | AsyncCallback<[PublishedDataChangeNode](#publisheddatachangenode10)> | 是 | 回调函数。当触发变更通知时调用,err为undefined,node为订阅数据变更结果;否则不被触发或为错误对象。 | + +**返回值:** + +| 类型 | 说明 | +| ---------------- | ------------------------------------------------------------ | +| Array<[OperationResult](#operationresult10)> | 返回操作结果。| + +**示例:** + +```ts +import rpc from '@ohos.rpc'; + +function onPublishCallback(err, node:dataShare.PublishedDataChangeNode) { + console.info("onPublishCallback node bundleName " + JSON.stringify(node.bundleName)); + console.info("onPublishCallback node data size" + node.data.length); + for (let i = 0; i < node.data.length; i++) { + console.info("onPublishCallback node " + typeof node.data[i].data); + if (typeof node.data[i].data != 'string') { + let ash:rpc.Ashmem = node.data[i].data; + ash.mapReadonlyAshmem(); + console.info("onPublishCallback " + JSON.stringify(ash.readAshmem(ash.getAshmemSize()/4, 0))); + ash.closeAshmem(); + } + console.info("onPublishCallback data " + i + " " + JSON.stringify(node.data[i])); + } +} +let uris:Array = ['city', 'datashareproxy://com.acts.ohos.data.datasharetest/appInfo', 'key2']; +let subscriberId = '11'; +let result: Array = dataShareHelper.on('publishedDataChange', uris, subscriberId, onPublishCallback); +``` + +### off('publishedDataChange')10+ + +off(type: 'publishedDataChange', uris: Array<string>, subscriberId: string, callback?: AsyncCallback<PublishedDataChangeNode>): Array<OperationResult> + +取消订阅已发布数据的数据变更通知。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | +| type | string | 是 | 取消订阅的事件类型,支持的事件为'publishedDataChange',表示已发布数据的变更事件。| +| uris | Array<string> | 是 | 要操作的数据的路径。 | +| subscriberId | string | 是 | 指定处理回调的用户ID。 | +| callback | AsyncCallback<[PublishedDataChangeNode](#publisheddatachangenode10)> | 否 | 回调函数。表示指定取消订阅的callback通知,如果为空,则取消订阅该uri下所有的通知事件。 | + +**返回值:** + +| 类型 | 说明 | +| ---------------- | ------------------------------------------------------------ | +| Array<[OperationResult](#operationresult10)> | 返回操作结果。| + +**示例:** + +```ts +function offCallback(err, node:dataShare.PublishedDataChangeNode) { + console.info("**** Observer off callback ****"); +} +let uris:Array = ["city", "datashareproxy://com.acts.ohos.data.datasharetest/appInfo", "key2"]; +let subscriberId = '11'; +let result: Array = dataShareHelper.off("publishedDataChange", uris, subscriberId, offCallback); +``` + +### publish10+ + +publish(data: Array<PublishedItem>, bundleName: string, version: number, callback: AsyncCallback<Array<OperationResult>>): void + +发布数据,将数据数据更新至数据库。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------- | -------------------------------------------------| ---- | ------------------- | +| data | Array<[PublishedItem](#publisheditem10)> | 是 | 指示要发布的数据。 | +| bundleName | string | 是 | 表示要发布数据所属的APP,对发布的私有数据生效,仅该app可以读取数据。 | +| version | number | 是 | 指示要发布的数据版本,越大表示数据版本越新。如果发布的版本号小于数据库中的记录,则更新失败。 | +| callback | AsyncCallback<Array<[OperationResult](#operationresult10)>> | 是 | 回调函数。当发布数据时调用,err为undefined,result为发布数据结果;否则不被触发或为错误对象。 | + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | -------------------------- | +| 15700012 | The data area is not exist.| + +**示例:** + +```ts +import rpc from '@ohos.rpc'; + +let ashmem = null; +let subscriberId = '11'; +let version = 1; +let data : Array = [ + {key:"city", subscriberId:"11", data:"xian"}, + {key:"datashareproxy://com.acts.ohos.data.datasharetest/appInfo", subscriberId:"11", data:"appinfo is just a test app"}, + {key:"empty", subscriberId:"11", data:"nobody sub"}]; +let nums:number[] = [1,2,3]; +function publishCallback(err, result: Array) { + console.log("publishCallback " + JSON.stringify(result)); + ashmem.closeAshmem(); +} +try { + ashmem = rpc.Ashmem.create("ashmem", (nums.length) * 4); + ashmem.mapReadWriteAshmem(); + ashmem.writeAshmem(nums, nums.length, 0); + data.push({ + "key" : "key2", + "data" : ashmem, + "subscriberId" : "11", + }); + console.log("data length is:", data.length); + dataShareHelper.publish(data, "com.acts.ohos.data.datasharetest", version, publishCallback); +} catch (e) { + console.log("publish error " + JSON.stringify(e)); +} +``` + +### publish10+ + +publish(data: Array<PublishedItem>, bundleName: string, callback: AsyncCallback<Array<OperationResult>>): void + +发布数据,将数据数据更新至数据库。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------------- | ---- | ---------------------------------- | +| data | Array<[PublishedItem](#publisheditem10)> | 是 | 指示要发布的数据。 | +| bundleName | string | 是 | 表示要发布数据所属的APP,对发布的私有数据生效,仅该app可以读取数据。 | +| callback | AsyncCallback<Array<[OperationResult](#operationresult10)>> | 是 | 回调函数。当发布数据时调用,err为undefined,result为发布数据结果;否则不被触发或为错误对象。 | + +**示例:** + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | -------------------------- | +| 15700012 | The data area is not exist.| + +```ts +function publishCallback(err, result: Array) { + console.log("publishCallback " + JSON.stringify(result)); +} +let data : Array = [ + {key:"city", subscriberId:"11", data:"xian"}, + {key:"datashareproxy://com.acts.ohos.data.datasharetest/appInfo", subscriberId:"11", data:"appinfo is just a test app"}, + {key:"empty", subscriberId:"11", data:"nobody sub"}]; +dataShareHelper.publish(data, "com.acts.ohos.data.datasharetest", publishCallback); +``` + +### publish10+ + +publish(data: Array<PublishedItem>, bundleName: string, version?: number): Promise<Array<OperationResult>> + +发布数据,将数据数据更新至数据库。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------- | ---- | ------------------------------ | +| data | Array<[PublishedItem](#publisheditem10)> | 是 | 指示要发布的数据。| +| bundleName | string | 是 | 表示要发布数据所属的APP,对发布的私有数据生效,仅该app可以读取数据。 | +| version | number | 否 | 指示要发布的数据版本,越大表示数据版本越新。如果发布的版本号小于数据库中的记录,则更新失败。
如果不检查要发布的数据版本,则不填。 | + +**返回值:** + +| 类型 | 说明 | +| ---------------- | ------------------------------------------------------------ | +| Promise<Array<[OperationResult](#operationresult10)>> | 发布数据结果。| + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | -------------------------- | +| 15700012 | The data area is not exist.| + +**示例:** + +```ts +let data : Array = [ + {key:"city", subscriberId:"11", data:"xian"}, + {key:"datashareproxy://com.acts.ohos.data.datasharetest/appInfo", subscriberId:"11", data:"appinfo is just a test app"}, + {key:"empty", subscriberId:"11", data:"nobody sub"}]; +let result: Array = dataShareHelper.publish(data, "com.acts.ohos.data.datasharetest"); +``` + +### getPublishedData10+ + +getPublishedData(bundleName: string, callback: AsyncCallback<Array<PublishedItem>>): void + +获取给定的APP和模板指定的数据。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -----------------| ---- | ----------------------------- | +| bundleName | string | 是 | 表示数据所属的APP。 | +| callback | AsyncCallback<Array<[PublishedItem](#publisheditem10)>> | 是 | 回调函数。 | + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | -------------------------- | +| 15700012 | The data area is not exist.| + +**示例:** + +```ts +function publishCallback(err, data: Array) { + console.info("**** Observer publish callback ****"); +} +dataShareHelper.getPublishedData("com.acts.ohos.data.datasharetest", publishCallback); +``` + +### getPublishedData10+ + +getPublishedData(bundleName: string): Promise<Array<PublishedItem>> + +获取给定的APP和模板指定的数据。 + +**系统能力:** SystemCapability.DistributedDataManager.DataShare.Consumer + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------| ---- | -------------------------------------- | +| bundleName | string | 是 | 表示数据所属的APP。 | + +**返回值:** + +| 类型 | 说明 | +| ---------------- | ------------------------------------------------------------ | +| Promise<Array<[PublishedItem](#publisheditem10)>> | Promise对象。返回给定的APP和模板指定的数据。| + +**错误码:** + +以下错误码的详细介绍请参见[数据共享错误码](../errorcodes/errorcode-datashare.md)。 + +| 错误码ID | 错误信息 | +| -------- | -------------------------- | +| 15700012 | The data area is not exist.| + +**示例:** + +```ts +let publishedData:Array = dataShareHelper.getPublishedData("com.acts.ohos.data.datasharetest"); +``` + ### insert insert(uri: string, value: ValuesBucket, callback: AsyncCallback<number>): void @@ -221,8 +774,6 @@ insert(uri: string, value: ValuesBucket, callback: AsyncCallback<number>): **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); const valueBucket = { "name": "rose", @@ -231,7 +782,7 @@ const valueBucket = { } try { dataShareHelper.insert(uri, valueBucket, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.error(`insert error: code: ${err.code}, message: ${err.message} `); return; } @@ -266,8 +817,6 @@ insert(uri: string, value: ValuesBucket): Promise<number> **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); const valueBucket = { "name": "rose1", @@ -304,7 +853,6 @@ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callbac **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; import dataSharePredicates from '@ohos.data.dataSharePredicates'; let uri = ("datashare:///com.samples.datasharetest.DataShare"); @@ -312,7 +860,7 @@ let da = new dataSharePredicates.DataSharePredicates(); da.equalTo("name", "ZhangSan"); try { dataShareHelper.delete(uri, da, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.error(`delete error: code: ${err.code}, message: ${err.message} `); return; } @@ -347,7 +895,6 @@ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promis **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; import dataSharePredicates from '@ohos.data.dataSharePredicates'; let uri = ("datashare:///com.samples.datasharetest.DataShare"); @@ -384,7 +931,6 @@ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; import dataSharePredicates from '@ohos.data.dataSharePredicates'; let uri = ("datashare:///com.samples.datasharetest.DataShare"); @@ -393,7 +939,7 @@ let da = new dataSharePredicates.DataSharePredicates(); da.equalTo("name", "ZhangSan"); try { dataShareHelper.query(uri, da, columns, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.error(`query error: code: ${err.code}, message: ${err.message} `); return; } @@ -429,7 +975,6 @@ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; import dataSharePredicates from '@ohos.data.dataSharePredicates'; let uri = ("datashare:///com.samples.datasharetest.DataShare"); @@ -467,7 +1012,6 @@ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; import dataSharePredicates from '@ohos.data.dataSharePredicates'; let uri = ("datashare:///com.samples.datasharetest.DataShare"); @@ -481,7 +1025,7 @@ const va = { } try { dataShareHelper.update(uri, da, va, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.error(`update error: code: ${err.code}, message: ${err.message} `); return; } @@ -517,7 +1061,6 @@ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; import dataSharePredicates from '@ohos.data.dataSharePredicates'; let uri = ("datashare:///com.samples.datasharetest.DataShare"); @@ -559,15 +1102,13 @@ batchInsert(uri: string, values: Array<ValuesBucket>, callback: AsyncCallb **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); let vbs = new Array({"name": "roe11", "age": 21, "salary": 20.5,}, {"name": "roe12", "age": 21, "salary": 20.5,}, {"name": "roe13", "age": 21, "salary": 20.5,}) try { dataShareHelper.batchInsert(uri, vbs, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.error(`batchInsert error: code: ${err.code}, message: ${err.message} `); return; } @@ -602,8 +1143,6 @@ batchInsert(uri: string, values: Array<ValuesBucket>): Promise<number&g **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); let vbs = new Array({"name": "roe11", "age": 21, "salary": 20.5,}, {"name": "roe12", "age": 21, "salary": 20.5,}, @@ -637,11 +1176,9 @@ normalizeUri(uri: string, callback: AsyncCallback<string>): void **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); dataShareHelper.normalizeUri(uri, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.log("normalizeUri failed, error message : " + err); }else{ console.log("normalizeUri = " + data); @@ -672,8 +1209,6 @@ normalizeUri(uri: string): Promise<string> **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); dataShareHelper.normalizeUri(uri).then((data) => { console.log("normalizeUri = " + data); @@ -700,11 +1235,9 @@ denormalizeUri(uri: string, callback: AsyncCallback<string>): void **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); dataShareHelper.denormalizeUri(uri, (err, data) => { - if (err != undefined) { + if (err !== undefined) { console.log("denormalizeUri failed, error message : " + err); }else{ console.log("denormalizeUri = " + data); @@ -735,8 +1268,6 @@ denormalizeUri(uri: string): Promise<string> **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); dataShareHelper.denormalizeUri(uri).then((data) => { console.log("denormalizeUri = " + data); @@ -763,8 +1294,6 @@ notifyChange(uri: string, callback: AsyncCallback<void>): void **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); dataShareHelper.notifyChange(uri, () => { console.log("***** notifyChange *****"); @@ -794,8 +1323,6 @@ notifyChange(uri: string): Promise<void> **示例:** ```ts -import UIAbility from '@ohos.app.ability.UIAbility'; - let uri = ("datashare:///com.samples.datasharetest.DataShare"); dataShareHelper.notifyChange(uri); ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-udmf.md b/zh-cn/application-dev/reference/apis/js-apis-data-udmf.md new file mode 100644 index 0000000000000000000000000000000000000000..74674bc05fac5195e2c371881775a84198bdfce0 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-data-udmf.md @@ -0,0 +1,465 @@ +# @ohos.data.UDMF(统一数据管理框架) + +本模块提供数据统一管理的能力,包括对文本、图片等数据类型的标准化定义。通过调用对应数据类型的接口,应用程序可将各种数据封装为统一数据对象。 + +> **说明:** +> +> 本模块首批接口从API version 10开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + +## 导入模块 + +```js +import UDMF from '@ohos.data.UDMF'; +``` + +## UnifiedDataType + +[统一数据对象](#unifieddata)中各[数据记录](#unifiedrecord)的数据类型。 + +**系统能力:** SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 值 | 说明 | +|----------------------------|------------------------------|-----------| +| TEXT | 'Text' | 文本类型。 | +| PLAIN_TEXT | 'Text.PlainText' | 纯文本类型。 | +| HYPERLINK | 'Text.Hyperlink' | 超链接类型。 | +| HTML | 'Text.HTML' | 富文本类型。 | +| FILE | 'File' | 文件类型。 | +| IMAGE | 'File.Media.Image' | 图片类型。 | +| VIDEO | 'File.Media.Video' | 视频类型。 | +| FOLDER | 'File.Folder' | 文件夹类型。 | +| SYSTEM_DEFINED_RECORD | 'SystemDefinedType' | 系统服务数据类型。 | +| SYSTEM_DEFINED_FORM | 'SystemDefinedType.Form' | 卡片类型。 | +| SYSTEM_DEFINED_APP_ITEM | 'SystemDefinedType.AppItem' | 图标类型。 | +| SYSTEM_DEFINED_PIXEL_MAP | 'SystemDefinedType.PixelMap' | 二进制图片类型。 | +| APPLICATION_DEFINED_RECORD | 'ApplicationDefinedType' | 应用自定义类型。 | + +## UnifiedData + +表示UDMF统一数据对象,提供封装一组数据记录的方法。 + +**系统能力:** SystemCapability.DistributedDataManager.UDMF.Core + +### constructor + +constructor(record: UnifiedRecord) + +用于创建带有一条数据记录的统一数据对象。 + +**系统能力:** SystemCapability.DistributedDataManager.UDMF.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------------------------------- | ---- |-----------------------------------------| +| record | [UnifiedRecord](#unifiedrecord) | 是 | 要添加到统一数据对象中的数据记录,该记录为UnifiedRecord子类对象。 | + +**示例:** + +```js +let text = new UDMF.PlainText(); +text.textContent = 'this is textContent of text'; +let unifiedData = new UDMF.UnifiedData(text); +``` + +### addRecord + +addRecord(record: UnifiedRecord): void + +在当前统一数据对象中添加一条数据记录。 + +**系统能力:** SystemCapability.DistributedDataManager.UDMF.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------------------------------- | ---- |---------------------------------------------| +| record | [UnifiedRecord](#unifiedrecord) | 是 | 要添加到统一数据对象中的数据记录,该记录为UnifiedRecord子类对象。| + +**示例:** + +```js +let text1 = new UDMF.PlainText(); +text1.textContent = 'this is textContent of text1'; +let unifiedData = new UDMF.UnifiedData(text1); + +let text2 = new UDMF.PlainText(); +text2.textContent = 'this is textContent of text2'; +unifiedData.addRecord(text2); +``` + +### getRecords + +getRecords(): Array\ + +将当前统一数据对象中的所有数据记录取出。通过本接口取出的数据为UnifiedRecord类型,需通过[getType](#gettype)获取数据类型后转为子类再使用。 + +**系统能力** :SystemCapability.DistributedDataManager.UDMF.Core + +**返回值:** + +| 类型 | 说明 | +| ---------------------------------------- |-------------------------| +| Array\<[UnifiedRecord](#unifiedrecord)\> | 当前统一数据对象内所添加的记录。 | + +**示例:** + +```js +let text = new UDMF.PlainText(); +text.textContent = 'this is textContent of text'; +let unifiedData = new UDMF.UnifiedData(text); + +let link = new UDMF.HyperLink(); +link.url = 'www.XXX.com'; +unifiedData.addRecord(link); + +let records = unifiedData.getRecords(); +for (let i = 0; i < records.length; i++) { + let record = records[i]; + if (record.getType() == UDMF.UnifiedDataType.PLAIN_TEXT) { + let plainText = (record); + console.info(`textContent: ${plainText.textContent}`); + } else if (record.getType() == UDMF.UnifiedDataType.HYPERLINK) { + let hyperLink = (record); + console.info(`linkUrl: ${hyperLink.url}`); + } +} +``` + +## Summary + +描述某一统一数据对象的数据摘要,包括所含数据类型及大小,当前暂不支持。 + +**系统能力:** SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | ------------------------- | ---- | ---- |-----------------------------------------------------------------------------------| +| summary | { [key: string]: number } | 是 | 否 | 是一个字典类型对象,key表示数据类型(见[UnifiedDataType](#unifieddatatype)),value为统一数据对象中该类型记录大小总和(单位:Byte)。 | +| totalSize | number | 是 | 否 | 统一数据对象内记录总大小(单位:Byte)。 | + +## UnifiedRecord + +对UDMF支持的数据内容的抽象定义,称为数据记录。一个统一数据对象内包含一条或多条数据记录,例如一条文本记录、一条图片记录、一条HTML记录等。 + +UnifiedRecord是一个抽象父类,无法保存具体数据内容,应用在使用时,不能将其添加到统一数据对象中,而应该创建带有数据内容的具体子类,如Text、Image等。 + +### getType + +getType(): string + +获取当前数据记录的类型。由于从统一数据对象中调用[getRecords](#getrecords)所取出的数据是UnifiedRecord对象,因此需要通过本接口查询此记录的具体类型,再将该UnifiedRecord对象转换为其子类,调用子类接口。 + +**系统能力** :SystemCapability.DistributedDataManager.UDMF.Core + +**返回值:** + +| 类型 | 说明 | +| ------ |------------------------------------------------------| +| string | 当前数据记录对应的具体数据类型,见[UnifiedDataType](#UnifiedDataType)。| + +**示例:** + +```js +let text = new UDMF.PlainText(); +text.textContent = 'this is textContent of text'; +let unifiedData = new UDMF.UnifiedData(text); + +let records = unifiedData.getRecords(); +if (records[0].getType() == UDMF.UnifiedDataType.PLAIN_TEXT) { + let plainText = (records[0]); + console.info(`textContent: ${plainText.textContent}`); +} +``` + +## Text + +文本类型数据,是[UnifiedRecord](#unifiedrecord)的子类,也是文本类型数据的基类,用于描述文本类数据,推荐开发者优先使用Text的子类描述数据,如[PlainText](#plaintext)、[HyperLink](#hyperlink)、[HTML](#html)等具体子类。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------- | ------------------------- | ---- | ---- |-----------------------------------------------------------------------------------------------------------------------------------------------------| +| details | { [key: string]: string } | 是 | 是 | 是一个字典类型对象,key和value都是string类型,用于描述文本内容。例如,可生成一个details内容为
{
"title":"标题",
"content":"内容"
}
的数据对象,用于描述一篇文章。非必填字段,默认值为空字典对象。 | + +**示例:** + +```js +let text = new UDMF.Text(); +text.details = { + title: 'MyTitle', + content: 'this is content', +}; +let unifiedData = new UDMF.UnifiedData(text); +``` + +## PlainText + +纯文本类型数据,是[Text](#text)的子类,用于描述纯文本类数据。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ----------- | ------ | ---- | ---- |-----------------------| +| textContent | string | 是 | 是 | 纯文本内容。 | +| abstract | string | 是 | 是 | 纯文本摘要,非必填字段,默认值为空字符串。 | + +**示例:** + +```js +let text = new UDMF.PlainText(); +text.textContent = 'this is textContent'; +text.abstract = 'this is abstract'; +``` + +## HyperLink + +超链接类型数据,是[Text](#text)的子类,用于描述超链接类型数据。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ----------- | ------ | ---- | ---- |--------------| +| url | string | 是 | 是 | 链接url。 | +| description | string | 是 | 是 | 链接内容描述,非必填字段,默认值为空字符串。 | + +**示例:** + +```js +let link = new UDMF.HyperLink(); +link.url = 'www.XXX.com'; +link.description = 'this is description'; +``` + +## HTML + +HTML类型数据,是[Text](#text)的子类,用于描述超文本标记语言数据。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------------ | ------ | ---- | ---- |-----------------------| +| htmlContent | string | 是 | 是 | html格式内容。 | +| plainContent | string | 是 | 是 | 去除html标签后的纯文本内容,非必填字段,默认值为空字符串。 | + +**示例:** + +```js +let html = new UDMF.HTML(); +html.htmlContent = '

标题

'; +html.plainContent = 'this is plainContent'; +``` + +## File + +File类型数据,是[UnifiedRecord](#unifiedrecord)的子类,也是文件类型数据的基类,用于描述文件类型数据,推荐开发者优先使用File的子类描述数据,如[Image](#image)、[Video](#video)、[Folder](#folder)等具体子类。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +|---------|---------------------------| ---- | ---- |------------------------------------------------------------------------------------------------------------------------------------------------------| +| details | { [key: string]: string } | 是 | 是 | 是一个字典类型对象,key和value都是string类型,用于描述文件相关信息。例如,可生成一个details内容为
{
"name":"文件名",
"type":"文件类型"
}
的数据对象,用于描述一个文件。非必填字段,默认值为空字典对象。 | +| uri | string | 是 | 是 | 文件数据uri。 | + +**示例:** + +```js +let file = new UDMF.File(); +file.details = { + name: 'test', + type: 'txt', +}; +file.uri = 'schema://com.samples.test/files/test.txt'; +``` + +## Image + +图片类型数据,是[File](#file)的子类,用于描述图片文件。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| -------- | ------ | ---- | ---- |----------| +| imageUri | string | 是 | 是 | 图片数据uri。 | + +**示例:** + +```js +let image = new UDMF.Image(); +image.imageUri = 'schema://com.samples.test/files/test.jpg'; +``` + +## Video + +视频类型数据,是[File](#file)的子类,用于描述视频文件。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| -------- | ------ | ---- | ---- |----------| +| videoUri | string | 是 | 是 | 视频数据uri。 | + +**示例:** + +```js +let video = new UDMF.Video(); +video.videoUri = 'schema://com.samples.test/files/test.mp4'; +``` + +## Folder + +文件夹类型数据,是[File](#file)的子类,用于描述文件夹。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| -------- | ------ | ---- | ---- |---------| +| folderUri | string | 是 | 是 | 文件夹uri。 | + +**示例:** + +```js +let folder = new UDMF.Folder(); +folder.folderUri = 'schema://com.samples.test/files/folder/'; +``` + +## SystemDefinedRecord + +SystemDefinedRecord是[UnifiedRecord](#unifiedrecord)的子类,也是OpenHarmony系统特有数据类型的基类,用于描述仅在OpenHarmony系统范围内流通的特有数据类型,推荐开发者优先使用SystemDefinedRecord的子类描述数据,如[SystemDefinedForm](#systemdefinedform)、[SystemDefinedAppItem](#systemdefinedappitem)、[SystemDefinedPixelMap](#systemdefinedpixelmap)等具体子类。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------- |--------------------------| ---- | ---- | ------------------------------------------------------------ | +| details | { [key: string]: number \| string \| Uint8Array } | 是 | 是 | 是一个字典类型对象,key是string类型,value可以写入number(数值类型)、string(字符串类型)、Uint8Array(二进制字节数组)类型数据。非必填字段,默认值为空字典对象。| + +**示例:** + +```js +let sdr = new UDMF.SystenDefinedReocrd(); +let u8Array = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +sdr.details = { + title: 'recordTitle', + version: 1, + content: u8Array, +}; +let unifiedData = new UDMF.UnifiedData(sdr); +``` + +## SystemDefinedForm + +卡片类型数据,是[SystemDefinedRecord](#systemdefinedrecord)的子类。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ----------- | ------ | ---- | ---- |----------------| +| formId | number | 是 | 是 | 卡片id。 | +| formName | string | 是 | 是 | 卡片名称。 | +| bundleName | string | 是 | 是 | 卡片所属的bundle名。 | +| abilityName | string | 是 | 是 | 卡片对应的ability名。 | +| module | string | 是 | 是 | 卡片所属的module名。 | + +**示例:** + +```js +let form = new UDMF.SystemDefinedForm(); +form.formId = 123456; +form.formName = 'MyFormName'; +form.bundleName = 'MyBundleName'; +form.abilityName = 'MyAbilityName'; +form.module = 'MyModule'; +let u8Array = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +form.details = { + formKey1: 123, + formKey2: 'formValue', + formKey3: u8Array, +}; +let unifiedData = new UDMF.UnifiedData(form); +``` + +## SystemDefinedAppItem + +图标类型数据,是[SystemDefinedRecord](#systemdefinedrecord)的子类。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ----------- | ------ | ---- | ---- |-----------------| +| appId | string | 是 | 是 | 图标对应的应用id。 | +| appName | string | 是 | 是 | 图标对应的应用名。 | +| appIconId | string | 是 | 是 | 图标的图片id。 | +| appLabelId | string | 是 | 是 | 图标名称对应的标签id。 | +| bundleName | string | 是 | 是 | 图标对应的应用bundle名。 | +| abilityName | string | 是 | 是 | 图标对应的应用ability名。 | + +**示例:** + +```js +let appItem = new UDMF.SystemDefinedAppItem(); +appItem.appId = 'MyAppId'; +appItem.appName = 'MyAppName'; +appItem.appIconId = 'MyAppIconId'; +appItem.appLabelId = 'MyAppLabelId'; +appItem.bundleName = 'MyBundleName'; +appItem.abilityName = 'MyAbilityName'; +let u8Array = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +appItem.details = { + appItemKey1: 123, + appItemKey2: 'appItemValue', + appItemKey3: u8Array, +}; +let unifiedData = new UDMF.UnifiedData(appItem); +``` + +## SystemDefinedPixelMap + +与系统侧定义的[PixelMap](js-apis-image.md#pixelmap7)数据类型对应的图片数据类型,是[SystemDefinedRecord](#systemdefinedrecord)的子类,仅保存PixelMap的二进制数据。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------- | ---------- | ---- | ---- |-------------------| +| rawData | Uint8Array | 是 | 是 | PixelMap对象的二进制数据。 | + +**示例:** + +```js +import image from '@ohos.multimedia.image'; // PixelMap类定义所在模块 + +const color = new ArrayBuffer(96); // 创建pixelmap对象 +let opts = { editable: true, pixelFormat: 3, size: { height: 4, width: 6 } } +image.createPixelMap(color, opts, (error, pixelmap) => { + if(error) { + console.log('Failed to create pixelmap.'); + } else { + console.log('Succeeded in creating pixelmap.'); + let arrayBuf = new ArrayBuffer(pixelmap.getPixelBytesNumber()); + pixelmap.readPixelsToBuffer(arrayBuf); + let u8Array = new Uint8Array(arrayBuf); + let sdpixel = new UDMF.SystemDefinedPixelMap(); + sdpixel.rawData = u8Array; + let unifiedData = new UDMF.UnifiedData(sdpixel); + } +}) +``` + +## ApplicationDefinedRecord + +ApplicationDefinedRecord是[UnifiedRecord](#unifiedrecord)的子类,也是应用自定义数据类型的基类,用于描述仅在应用生态内部流通的自定义数据类型,应用可基于此类进行自定义数据类型的扩展。 + +**系统能力**:SystemCapability.DistributedDataManager.UDMF.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +|------------------------|------------| ---- | ---- |---------------------------------------| +| applicationDefinedType | string | 是 | 是 | 应用自定义类型标识符,必须以'ApplicationDefined'开头。 | +| rawData | Uint8Array | 是 | 是 | 应用自定义数据类型的二进制数据。 | + +**示例:** + +```js +let record = new UDMF.ApplicationDefinedRecord(); +let u8Array = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +record.applicationDefinedType = 'ApplicationDefinedType'; +record.rawData = u8Array; +let unifiedData = new UDMF.UnifiedData(record); +``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md b/zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md new file mode 100644 index 0000000000000000000000000000000000000000..55f3b1e033b83d1dac3c6c37fbd7cfe8a34a3183 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md @@ -0,0 +1,149 @@ +# @ohos.deviceAttest (设备证明) + +为了证明设备是OpenHarmony生态中的合法设备,设备证明模块会把设备信息通过云端进行一致性合法校验。 +通过本模块接口,可查询设备在云端校验的结果。 + +> **说明:** +> +> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> +> - 本模块接口为系统接口。 + +## 导入模块 + +```js +import deviceAttest from '@ohos.deviceAttest'; +``` + +## deviceAttest.getAttestStatus + +getAttestStatus(callback: AsyncCallback<AttestResultInfo>) : void + +获取端云校验结果的详细信息。使用callback异步回调。 + +**系统能力:** SystemCapability.XTS.DeviceAttest + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | +| callback | AsyncCallback<[AttestResultInfo](#attestresultinfo)> | 是 | 回调函数。当获取端云校验结果的详细信息成功,error为undefined,result为获取到的[AttestResultInfo](#attestresultinfo);否则为错误对象。 | + +**错误码:** + +| 错误码ID | 错误信息 | +|----------|----------------------| +| 20000001 | system service exception | + +**示例:** + +```js +try { + deviceAttest.getAttestStatus((error, result) => { + if (typeof err === 'undefined') { + console.info("error code:" + error.code + " message:" + error.message); + } else { + console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); + console.info("versionIdResult:" + result.softwareResultDetail[0], + " patchlevelResult:" + result.softwareResultDetail[1], + " roothashResult:" + result.softwareResultDetail[2], + " PCIDResult:" + result.softwareResultDetail[3], + " reserver:" + result.softwareResultDetail[4]); + } + }) +} catch (error) { + console.info("error code:" + error.code + " message:" + error.message); +} +``` + +## deviceAttest.getAttestStatus + +getAttestStatus() : Promise<AttestResultInfo> + +获取端云校验结果的详细信息。使用Promise异步回调。 + +**系统能力:** SystemCapability.XTS.DeviceAttest + +**返回值:** + +| 类型 | 说明 | +| ----------------------------------------------------- | ------------------------------- | +| Promise<[AttestResultInfo](#attestresultinfo)> | Promise对象,返回端云校验结果的详细信息。 | + +**错误码:** + +| 错误码ID | 错误信息 | +|----------|----------------------| +| 20000001 | system service exception | + +**示例:** + +```js +try { + deviceAttest.getAttestStatus().then((value) => { + console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); + console.info("versionIdResult:" + result.softwareResultDetail[0], + " patchlevelResult:" + result.softwareResultDetail[1], + " roothashResult:" + result.softwareResultDetail[2], + " PCIDResult:" + result.softwareResultDetail[3], + " reserver:" + result.softwareResultDetail[4]); + }).catch((error) => { + console.info("error code:" + error.code + " message:" + error.message); + }); +} catch (error) { + console.info("error code:" + error.code + " message:" + error.message); +} +``` + +## deviceAttest.getAttestStatusSync + +getAttestStatusSync() : AttestResultInfo + +以同步方式获取端云校验结果的详细信息。 + +**系统能力:** SystemCapability.XTS.DeviceAttest + +**返回值:** + +| 类型 | 说明 | +| ----------------------------------------------------- | ------------------------------- | +| [AttestResultInfo](#attestresultinfo) | 返回端云校验结果的详细信息。 | + +**错误码:** + +| 错误码ID | 错误信息 | +|----------|----------------------| +| 20000001 | system service exception | + +**示例:** + +```js +try { + let attestResultInfo = deviceAttest.getAttestStatusSync(); + console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); + console.info("versionIdResult:" + result.softwareResultDetail[0], + " patchlevelResult:" + result.softwareResultDetail[1], + " roothashResult:" + result.softwareResultDetail[2], + " PCIDResult:" + result.softwareResultDetail[3], + " reserver:" + result.softwareResultDetail[4]); +} catch (error) { + console.info("error code:" + error.code + " message:" + error.message); +} +``` + +## AttestResultInfo + +端云校验结果的详细信息。 + +**系统能力:** SystemCapability.XTS.DeviceAttest + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------------------- | --------------------- | ---- | ---- | ---------------------- | +| authResult | number | 是 | 否 | 设备硬件信息校验结果。 | +| softwareResult | number | 是 | 否 | 设备软件信息校验结果。 | +| softwareResultDetail | Array<number> | 是 | 否 | 设备软件信息校验结果详细说明
- softwareResultDetail[0]:版本Id的校验结果;
- softwareResultDetail[1]:安全补丁标签的校验结果;
- softwareResultDetail[2]:版本Hash的校验结果;
- softwareResultDetail[3]:系统能力集合的校验结果;
- softwareResultDetail[4]:保留位。 | +| ticket | string | 是 | 否 | 云侧下发的软证书。
设备硬件信息校验结果通过后有值;校验结果失败,该值为空 | + +> **说明:** +> +> - 设备硬件信息和设备软件信息的校验结果返回值有-2、-1、0。-2表示未认证,-1表示认证失败,0表示认证通过。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributedKVStore.md b/zh-cn/application-dev/reference/apis/js-apis-distributedKVStore.md index c5bc7922dea9d9e6a1a2a4bcbc2ca9b59c2a0f94..23afabc1b9f5611e85e805f6c036d03a4de85bfa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-distributedKVStore.md +++ b/zh-cn/application-dev/reference/apis/js-apis-distributedKVStore.md @@ -457,7 +457,7 @@ try { kvStore = store; kvStore = null; store = null; - kvManager.closeKVStore('appId', 'storeId', function (err, data) { + kvManager.closeKVStore('appId', 'storeId', function (err) { if (err != undefined) { console.error(`Failed to close KVStore.code is ${err.code},message is ${err.message}`); return; @@ -568,7 +568,7 @@ try { kvStore = store; kvStore = null; store = null; - kvManager.deleteKVStore('appId', 'storeId', function (err, data) { + kvManager.deleteKVStore('appId', 'storeId', function (err) { if (err != undefined) { console.error(`Failed to delete KVStore.code is ${err.code},message is ${err.message}`); return; @@ -2128,7 +2128,7 @@ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncC const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) { if (err != undefined) { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); return; @@ -2182,8 +2182,8 @@ put(key: string, value: Uint8Array | string | number | boolean): Promise<void const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { - console.info(`Succeeded in putting.data=${data}`); + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => { + console.info(`Succeeded in putting data`); }).catch((err) => { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); }); @@ -2239,7 +2239,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); return; @@ -2311,7 +2311,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries).then(async (entries) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting Batch'); kvStore.getEntries('batch_test_string_key').then((entries) => { console.info('Succeeded in getting Entries'); @@ -2372,7 +2372,7 @@ try { v8Arr.push(vb1); v8Arr.push(vb2); v8Arr.push(vb3); - kvStore.putBatch(v8Arr, async function (err, data) { + kvStore.putBatch(v8Arr, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -2434,7 +2434,7 @@ try { v8Arr.push(vb1); v8Arr.push(vb2); v8Arr.push(vb3); - kvStore.putBatch(v8Arr).then(async (data) => { + kvStore.putBatch(v8Arr).then(async () => { console.info(`Succeeded in putting patch`); }).catch((err) => { console.error(`putBatch fail.code is ${err.code},message is ${err.message}`); @@ -2480,13 +2480,13 @@ delete(key: string, callback: AsyncCallback<void>): void const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) { if (err != undefined) { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); return; } console.info('Succeeded in putting'); - kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err, data) { + kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err) { if (err != undefined) { console.error(`Failed to delete.code is ${err.code},message is ${err.message}`); return; @@ -2540,9 +2540,9 @@ delete(key: string): Promise<void> const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { - console.info(`Succeeded in putting: ${data}`); - kvStore.delete(KEY_TEST_STRING_ELEMENT).then((data) => { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => { + console.info(`Succeeded in putting data`); + kvStore.delete(KEY_TEST_STRING_ELEMENT).then(() => { console.info('Succeeded in deleting'); }).catch((err) => { console.error(`Failed to delete.code is ${err.code},message is ${err.message}`); @@ -2595,13 +2595,13 @@ try { let predicates = new dataSharePredicates.DataSharePredicates(); let arr = ["name"]; predicates.inKeys(arr); - kvStore.put("name", "bob", function (err, data) { + kvStore.put("name", "bob", function (err) { if (err != undefined) { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); return; } console.info("Succeeded in putting"); - kvStore.delete(predicates, function (err, data) { + kvStore.delete(predicates, function (err) { if (err == undefined) { console.info('Succeeded in deleting'); } else { @@ -2660,9 +2660,9 @@ try { let predicates = new dataSharePredicates.DataSharePredicates(); let arr = ["name"]; predicates.inKeys(arr); - kvStore.put("name", "bob").then((data) => { - console.info(`Succeeded in putting: ${data}`); - kvStore.delete(predicates).then((data) => { + kvStore.put("name", "bob").then(() => { + console.info(`Succeeded in putting data`); + kvStore.delete(predicates).then(() => { console.info('Succeeded in deleting'); }).catch((err) => { console.error(`Failed to delete.code is ${err.code},message is ${err.message}`); @@ -2724,13 +2724,13 @@ try { keys.push(key + i); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); return; } console.info('Succeeded in putting Batch'); - kvStore.deleteBatch(keys, async function (err, data) { + kvStore.deleteBatch(keys, async function (err) { if (err != undefined) { console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`); return; @@ -2797,9 +2797,9 @@ try { keys.push(key + i); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries).then(async (data) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting Batch'); - kvStore.deleteBatch(keys).then((err) => { + kvStore.deleteBatch(keys).then(() => { console.info('Succeeded in deleting Batch'); }).catch((err) => { console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`); @@ -2845,10 +2845,10 @@ removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const VALUE_TEST_STRING_ELEMENT = 'value-string-002'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) { console.info('Succeeded in putting data'); const deviceid = 'no_exist_device_id'; - kvStore.removeDeviceData(deviceid, async function (err, data) { + kvStore.removeDeviceData(deviceid, async function (err) { if (err == undefined) { console.info('succeeded in removing device data'); } else { @@ -2902,13 +2902,13 @@ removeDeviceData(deviceId: string): Promise<void> const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const VALUE_TEST_STRING_ELEMENT = 'value-string-001'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((err) => { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => { console.info('Succeeded in putting data'); }).catch((err) => { console.error(`Failed to put data.code is ${err.code},message is ${err.message} `); }); const deviceid = 'no_exist_device_id'; - kvStore.removeDeviceData(deviceid).then((err) => { + kvStore.removeDeviceData(deviceid).then(() => { console.info('succeeded in removing device data'); }).catch((err) => { console.error(`Failed to remove device data.code is ${err.code},message is ${err.message} `); @@ -2954,7 +2954,7 @@ get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Arr const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) { if (err != undefined) { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); return; @@ -3009,8 +3009,8 @@ get(key: string): Promise<boolean | string | number | Uint8Array> const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { - console.info(`Succeeded in putting data.data=${data}`); + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => { + console.info(`Succeeded in putting data`); kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => { console.info(`Succeeded in getting data.data=${data}`); }).catch((err) => { @@ -3065,7 +3065,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); return; @@ -3132,7 +3132,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries).then(async (entries) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting Batch'); kvStore.getEntries('batch_test_string_key').then((entries) => { console.info('Succeeded in getting Entries'); @@ -3190,7 +3190,7 @@ try { entries.push(entry); } console.info(`entries: {entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { console.info('Succeeded in putting Batch'); const query = new distributedKVStore.Query(); query.prefixKey("batch_test"); @@ -3256,7 +3256,7 @@ try { entries.push(entry); } console.info(`entries: {entries}`); - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting Batch'); const query = new distributedKVStore.Query(); query.prefixKey("batch_test"); @@ -3317,7 +3317,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -3330,7 +3330,7 @@ try { } console.info('Succeeded in getting result set'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); return; @@ -3391,7 +3391,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); @@ -3402,7 +3402,7 @@ try { }).catch((err) => { console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); }); - kvStore.closeResultSet(resultSet).then((err) => { + kvStore.closeResultSet(resultSet).then(() => { console.info('Succeeded in closing result set'); }).catch((err) => { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); @@ -3454,7 +3454,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -3522,7 +3522,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); @@ -3583,7 +3583,7 @@ try { } console.info('Succeeded in getting result set'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); return; @@ -3643,7 +3643,7 @@ try { }).catch((err) => { console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); }); - kvStore.closeResultSet(resultSet).then((err) => { + kvStore.closeResultSet(resultSet).then(() => { console.info('Succeeded in closing result set'); }).catch((err) => { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); @@ -3673,7 +3673,7 @@ closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback<void>) ```js try { let resultSet = null; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err == undefined) { console.info('Succeeded in closing result set'); } else { @@ -3760,7 +3760,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { console.info('Succeeded in putting batch'); const query = new distributedKVStore.Query(); query.prefixKey("batch_test"); @@ -3822,7 +3822,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); @@ -3867,11 +3867,11 @@ backup(file:string, callback: AsyncCallback<void>):void ```js let file = "BK001"; try { - kvStore.backup(file, (err, data) => { + kvStore.backup(file, function(err) => { if (err) { console.error(`Failed to backup.code is ${err.code},message is ${err.message} `); } else { - console.info(`Succeeded in backupping data.data=${data}`); + console.info(`Succeeded in backupping data`); } }); } catch (e) { @@ -3912,8 +3912,8 @@ backup(file:string): Promise<void> ```js let file = "BK001"; try { - kvStore.backup(file).then((data) => { - console.info(`Succeeded in backupping data.data=${data}`); + kvStore.backup(file).then(() => { + console.info(`Succeeded in backupping data`); }).catch((err) => { console.error(`Failed to backup.code is ${err.code},message is ${err.message}`); }); @@ -3950,11 +3950,11 @@ restore(file:string, callback: AsyncCallback<void>):void ```js let file = "BK001"; try { - kvStore.restore(file, (err, data) => { + kvStore.restore(file, (err) => { if (err) { console.error(`Failed to restore.code is ${err.code},message is ${err.message}`); } else { - console.info(`Succeeded in restoring data.data=${data}`); + console.info(`Succeeded in restoring data`); } }); } catch (e) { @@ -3995,8 +3995,8 @@ restore(file:string): Promise<void> ```js let file = "BK001"; try { - kvStore.restore(file).then((data) => { - console.info(`Succeeded in restoring data.data=${data}`); + kvStore.restore(file).then(() => { + console.info(`Succeeded in restoring data`); }).catch((err) => { console.error(`Failed to restore.code is ${err.code},message is ${err.message}`); }); @@ -4124,7 +4124,7 @@ try { console.info(`startTransaction 0 ${data}`); count++; }); - kvStore.startTransaction(async function (err, data) { + kvStore.startTransaction(async function (err) { if (err != undefined) { console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`); return; @@ -4132,7 +4132,7 @@ try { console.info('Succeeded in starting Transaction'); let entries = putBatchString(10, 'batch_test_string_key'); console.info(`entries: ${entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -4182,7 +4182,7 @@ try { console.info(`startTransaction 0 ${data}`); count++; }); - kvStore.startTransaction().then(async (err) => { + kvStore.startTransaction().then(async () => { console.info('Succeeded in starting Transaction'); }).catch((err) => { console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`); @@ -4218,7 +4218,7 @@ commit(callback: AsyncCallback<void>): void ```js try { - kvStore.commit(function (err, data) { + kvStore.commit(function (err) { if (err == undefined) { console.info('Succeeded in committing'); } else { @@ -4256,7 +4256,7 @@ commit(): Promise<void> ```js try { - kvStore.commit().then(async (err) => { + kvStore.commit().then(async () => { console.info('Succeeded in committing'); }).catch((err) => { console.error(`Failed to commit.code is ${err.code},message is ${err.message}`); @@ -4292,7 +4292,7 @@ rollback(callback: AsyncCallback<void>): void ```js try { - kvStore.rollback(function (err,data) { + kvStore.rollback(function (err) { if (err == undefined) { console.info('Succeeded in rolling back'); } else { @@ -4330,7 +4330,7 @@ rollback(): Promise<void> ```js try { - kvStore.rollback().then(async (err) => { + kvStore.rollback().then(async () => { console.info('Succeeded in rolling back'); }).catch((err) => { console.error(`Failed to rollback.code is ${err.code},message is ${err.message}`); @@ -4359,7 +4359,7 @@ enableSync(enabled: boolean, callback: AsyncCallback<void>): void ```js try { - kvStore.enableSync(true, function (err, data) { + kvStore.enableSync(true, function (err) { if (err == undefined) { console.info('Succeeded in enabling sync'); } else { @@ -4395,7 +4395,7 @@ enableSync(enabled: boolean): Promise<void> ```js try { - kvStore.enableSync(true).then((err) => { + kvStore.enableSync(true).then(() => { console.info('Succeeded in enabling sync'); }).catch((err) => { console.error(`Failed to enable sync.code is ${err.code},message is ${err.message}`); @@ -4427,7 +4427,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: Asy try { const localLabels = ['A', 'B']; const remoteSupportLabels = ['C', 'D']; - kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err, data) { + kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err) { if (err != undefined) { console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`); return; @@ -4466,7 +4466,7 @@ setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise<v try { const localLabels = ['A', 'B']; const remoteSupportLabels = ['C', 'D']; - kvStore.setSyncRange(localLabels, remoteSupportLabels).then((err) => { + kvStore.setSyncRange(localLabels, remoteSupportLabels).then(() => { console.info('Succeeded in setting syncRange'); }).catch((err) => { console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`); @@ -4496,7 +4496,7 @@ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback<void>) ```js try { const defaultAllowedDelayMs = 500; - kvStore.setSyncParam(defaultAllowedDelayMs, function (err, data) { + kvStore.setSyncParam(defaultAllowedDelayMs, function (err) { if (err != undefined) { console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`); return; @@ -4533,7 +4533,7 @@ setSyncParam(defaultAllowedDelayMs: number): Promise<void> ```js try { const defaultAllowedDelayMs = 500; - kvStore.setSyncParam(defaultAllowedDelayMs).then((err) => { + kvStore.setSyncParam(defaultAllowedDelayMs).then(() => { console.info('Succeeded in setting syncParam'); }).catch((err) => { console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`); @@ -4596,7 +4596,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => { kvStore.on('syncComplete', function (data) { console.info('Sync dataChange'); }); - kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) { + kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) { if (err != undefined) { console.error(`Failed to sync.code is ${err.code},message is ${err.message}`); return; @@ -4666,7 +4666,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => { kvStore.on('syncComplete', function (data) { console.info('Sync dataChange'); }); - kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) { + kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) { if (err != undefined) { console.error(`Failed to sync.code is ${err.code},message is ${err.message}`); return; @@ -4746,7 +4746,7 @@ try { kvStore.on('syncComplete', function (data) { console.info(`syncComplete ${data}`); }); - kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then((data) => { + kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then(() => { console.info('succeeded in putting'); }).catch((err) => { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); @@ -4969,7 +4969,7 @@ get(key: string, callback: AsyncCallback<boolean | string | number | Uint8Arr const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) { if (err != undefined) { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); return; @@ -5024,8 +5024,8 @@ get(key: string): Promise<boolean | string | number | Uint8Array> const KEY_TEST_STRING_ELEMENT = 'key_test_string'; const VALUE_TEST_STRING_ELEMENT = 'value-test-string'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => { - console.info(`Succeeded in putting data.data=${data}`); + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => { + console.info(`Succeeded in putting data`); kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => { console.info(`Succeeded in getting data.data=${data}`); }).catch((err) => { @@ -5075,7 +5075,7 @@ get(deviceId: string, key: string, callback: AsyncCallback<boolean | string | const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const VALUE_TEST_STRING_ELEMENT = 'value-string-002'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) { if (err != undefined) { console.error(`Failed to put.code is ${err.code},message is ${err.message}`); return; @@ -5135,7 +5135,7 @@ get(deviceId: string, key: string): Promise<boolean | string | number | Uint8 const KEY_TEST_STRING_ELEMENT = 'key_test_string_2'; const VALUE_TEST_STRING_ELEMENT = 'value-string-002'; try { - kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async (data) => { + kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async () => { console.info('Succeeded in putting'); kvStore.get('localDeviceId', KEY_TEST_STRING_ELEMENT).then((data) => { console.info('Succeeded in getting'); @@ -5191,7 +5191,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`); return; @@ -5258,7 +5258,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries).then(async (entries) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting Batch'); kvStore.getEntries('batch_test_string_key').then((entries) => { console.info('Succeeded in getting Entries'); @@ -5320,7 +5320,7 @@ try { entries.push(entry); } console.info(`entries : ${entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -5392,7 +5392,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); kvStore.getEntries('localDeviceId', 'batch_test_string_key').then((entries) => { console.info('Succeeded in getting entries'); @@ -5453,7 +5453,7 @@ try { entries.push(entry); } console.info(`entries: {entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { console.info('Succeeded in putting Batch'); const query = new distributedKVStore.Query(); query.prefixKey("batch_test"); @@ -5519,7 +5519,7 @@ try { entries.push(entry); } console.info(`entries: {entries}`); - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting Batch'); const query = new distributedKVStore.Query(); query.prefixKey("batch_test"); @@ -5584,7 +5584,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -5661,7 +5661,7 @@ try { entries.push(entry); } console.info(`entries: ${entries}`); - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); var query = new distributedKVStore.Query(); query.deviceId('localDeviceId'); @@ -5722,7 +5722,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -5735,7 +5735,7 @@ try { } console.info('Succeeded in getting result set'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); return; @@ -5796,7 +5796,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); @@ -5807,7 +5807,7 @@ try { }).catch((err) => { console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); }); - kvStore.closeResultSet(resultSet).then((err) => { + kvStore.closeResultSet(resultSet).then(() => { console.info('Succeeded in closing result set'); }).catch((err) => { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); @@ -5859,7 +5859,7 @@ try { } console.info('Succeeded in getting resultSet'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); return; @@ -5918,7 +5918,7 @@ try { }).catch((err) => { console.error(`Failed to get resultSet.code is ${err.code},message is ${err.message}`); }); - kvStore.closeResultSet(resultSet).then((err) => { + kvStore.closeResultSet(resultSet).then(() => { console.info('Succeeded in closing resultSet'); }).catch((err) => { console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); @@ -5975,7 +5975,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -5990,7 +5990,7 @@ try { } console.info('Succeeded in getting resultSet'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); return; @@ -6056,7 +6056,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); @@ -6071,7 +6071,7 @@ try { }); query.deviceId('localDeviceId'); console.info("GetResultSet " + query.getSqlLike()); - kvStore.closeResultSet(resultSet).then((err) => { + kvStore.closeResultSet(resultSet).then(() => { console.info('Succeeded in closing resultSet'); }).catch((err) => { console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); @@ -6129,7 +6129,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); @@ -6194,7 +6194,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -6209,7 +6209,7 @@ try { } console.info('Succeeded in getting resultSet'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`); return; @@ -6266,7 +6266,7 @@ try { } console.info('Succeeded in getting result set'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); return; @@ -6326,7 +6326,7 @@ try { }).catch((err) => { console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); }); - kvStore.closeResultSet(resultSet).then((err) => { + kvStore.closeResultSet(resultSet).then(() => { console.info('Succeeded in closing result set'); }).catch((err) => { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); @@ -6384,7 +6384,7 @@ try { } console.info('Succeeded in getting result set'); resultSet = result; - kvStore.closeResultSet(resultSet, function (err, data) { + kvStore.closeResultSet(resultSet, function (err) { if (err != undefined) { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); return; @@ -6449,7 +6449,7 @@ try { }).catch((err) => { console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`); }); - kvStore.closeResultSet(resultSet).then((err) => { + kvStore.closeResultSet(resultSet).then(() => { console.info('Succeeded in closing result set'); }).catch((err) => { console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`); @@ -6499,7 +6499,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { console.info('Succeeded in putting batch'); const query = new distributedKVStore.Query(); query.prefixKey("batch_test"); @@ -6561,7 +6561,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); @@ -6623,7 +6623,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries, async function (err, data) { + kvStore.putBatch(entries, async function (err) { if (err != undefined) { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); return; @@ -6695,7 +6695,7 @@ try { } entries.push(entry); } - kvStore.putBatch(entries).then(async (err) => { + kvStore.putBatch(entries).then(async () => { console.info('Succeeded in putting batch'); }).catch((err) => { console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`); diff --git a/zh-cn/application-dev/reference/apis/js-apis-enterprise-applicationManager.md b/zh-cn/application-dev/reference/apis/js-apis-enterprise-applicationManager.md index 58e878092cce57306a64218be9453ede4ff2d41e..2a97cd1ea3daeea613da560b9865752772eba7cf 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-enterprise-applicationManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-enterprise-applicationManager.md @@ -17,7 +17,7 @@ import applicationManager from '@ohos.enterprise.applicationManager'; addDisallowedRunningBundles(admin: Want, appIds: Array\, callback: AsyncCallback<void>): void; -指定设备管理员应用添加应用运行黑名单接口,使用callback形式返回是否添加成功。添加至黑名单的应用不允许在管理员用户下运行,否则允许运行。 +指定设备管理员应用添加应用运行黑名单接口,使用callback形式返回是否添加成功。添加至黑名单的应用不允许在当前用户下运行,否则允许运行。 **需要权限:** ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY @@ -302,7 +302,7 @@ applicationManager.removeDisallowedRunningBundles(wantTemp, appIds, 100).then(() getDisallowedRunningBundles(admin: Want, callback: AsyncCallback<Array<string>>): void; -指定管理员应用获取管理员用户下的应用运行黑名单接口,使用callback形式返回获取应用运行黑名单。 +指定管理员应用获取当前用户下的应用运行黑名单接口,使用callback形式返回获取应用运行黑名单。 **需要权限:** ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY @@ -389,7 +389,7 @@ applicationManager.getDisallowedRunningBundles(wantTemp, 100, (error) => { getDisallowedRunningBundles(admin: Want, userId?: number): Promise<Array<string>>; -如果调用接口时传入参数userId,指定管理员应用获取指定用户下应用运行黑名单接口,如果调用接口时没有传入参数userId,指定管理员应用获取当前用户下应用运行黑名单接口,使用promise形式返回获取应用运行黑名单。 +指定管理员应用获取指定用户或当前用户下应用运行黑名单接口,使用promise形式返回获取应用运行黑名单。如果调用接口时传入参数userId,表示获取指定用户下应用运行黑名单,如果调用接口没有传入参数userId,表示获取当前用户下应用运行黑名单。 **需要权限:** ohos.permission.ENTERPRISE_MANAGE_SET_APP_RUNNING_POLICY @@ -408,7 +408,7 @@ getDisallowedRunningBundles(admin: Want, userId?: number): Promise<Array<s | 类型 | 说明 | | --------------------- | ------------------------- | -| Promise<Array<string>> | Promise对象,返回管理员用户下的应用运行黑名单。 | +| Promise<Array<string>> | Promise对象,返回当前用户下的应用运行黑名单。 | **错误码**: diff --git a/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md b/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md index fd67acd688993624dfac366381a95d99215642c0..54fbe16a28809223ffc5608c0e392f7ed1578307 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md @@ -17,7 +17,7 @@ import bundleManager from '@ohos.enterprise.bundleManager'; addAllowedInstallBundles(admin: Want, appIds: Array\, callback: AsyncCallback<void>): void; -指定设备管理员应用添加包安装白名单接口,添加至白名单的应用允许在管理员用户下安装,否则不允许安装,使用callback形式返回是否添加成功。 +指定设备管理员应用添加包安装白名单接口,添加至白名单的应用允许在当前用户下安装,否则不允许安装,使用callback形式返回是否添加成功。 **需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -301,7 +301,7 @@ bundleManager.removeAllowedInstallBundles(wantTemp, appIds, 100).then(() => { getAllowedInstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void; -指定管理员应用获取管理员用户下的包安装白名单接口,使用callback形式返回获取包安装白名单。 +指定管理员应用获取当前用户下的包安装白名单接口,使用callback形式返回获取包安装白名单。 **需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -388,7 +388,7 @@ bundleManager.getAllowedInstallBundles(wantTemp, 100, (error) => { getAllowedInstallBundles(admin: Want, userId?: number): Promise<Array<string>>; -如果调用接口时传入参数userId,指定管理员应用获取指定用户下包安装白名单接口,如果调用接口时没有传入参数userId,指定管理员应用获取当前用户下包安装白名单接口,使用promise形式返回获取包安装白名单。 +指定管理员应用获取指定用户或当前用户下包安装白名单接口,使用promise形式返回获取包安装白名单。如果调用接口时传入参数userId,表示获取指定用户下包安装白名单,如果调用接口没有传入参数userId,表示获取当前用户下包安装白名单。 **需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -407,7 +407,7 @@ getAllowedInstallBundles(admin: Want, userId?: number): Promise<Array<stri | 类型 | 说明 | | --------------------- | ------------------------- | -| Promise<Array<string>> | Promise对象,返回管理员用户下的包安装白名单。 | +| Promise<Array<string>> | Promise对象,返回当前用户下的包安装白名单。 | **错误码**: @@ -436,7 +436,7 @@ bundleManager.getAllowedInstallBundles(wantTemp, 100).then(() => { addDisallowedInstallBundles(admin: Want, appIds: Array\, callback: AsyncCallback<void>): void; -指定设备管理员应用添加包安装黑名单接口,添加至黑名单的应用不允许安装,使用callback形式返回是否添加成功。 +指定设备管理员应用添加包安装黑名单接口,添加至黑名单的应用不允许在当前用户下安装,使用callback形式返回是否添加成功。 **需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -720,7 +720,7 @@ bundleManager.removeDisallowedInstallBundles(wantTemp, appIds, 100).then(() => { getDisallowedInstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void; -指定管理员应用获取管理员用户下的包安装黑名单接口,使用callback形式返回获取包安装黑名单。 +指定管理员应用获取当前用户下的包安装黑名单接口,使用callback形式返回获取包安装黑名单。 **需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -807,7 +807,7 @@ bundleManager.getDisallowedInstallBundles(wantTemp, 100, (error) => { getDisallowedInstallBundles(admin: Want, userId?: number): Promise<Array<string>>; -如果调用接口时传入参数userId,指定管理员应用获取指定用户下包安装黑名单接口。如果调用接口时没有传入参数userId,指定管理员应用获取当前用户下包安装黑名单接口,使用promise形式返回获取包安装黑名单。 +指定管理员应用获取指定用户或当前用户下包安装黑名单接口,使用promise形式返回获取包安装黑名单。如果调用接口时传入参数userId,表示获取指定用户下包安装黑名单,如果调用接口没有传入参数userId,表示获取当前用户下包安装黑名单。 **需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY @@ -826,7 +826,7 @@ getDisallowedInstallBundles(admin: Want, userId?: number): Promise<Array<s | 类型 | 说明 | | --------------------- | ------------------------- | -| Promise<Array<string>> | Promise对象,返回管理员用户下的包安装白名单。 | +| Promise<Array<string>> | Promise对象,返回当前用户下的包安装白名单。 | **错误码**: @@ -849,3 +849,425 @@ bundleManager.getDisallowedInstallBundles(wantTemp, 100).then(() => { }).catch(error => { console.log("error code:" + error.code + " error message:" + error.message); }); + +## bundleManager.addDisallowedUninstallBundles + +addDisallowedUninstallBundles(admin: Want, appIds: Array\, callback: AsyncCallback<void>): void + +指定设备管理员应用添加包卸载黑名单接口,添加至黑名单的应用不允许在当前用户下卸载,使用callback形式返回是否添加成功。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| appIds | Array<string> | 是 | 应用ID数组。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当接口调用成功,err为null,否则为错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +bundleManager.addDisallowedUninstallBundles(wantTemp, appIds, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## bundleManager.addDisallowedUninstallBundles + +addDisallowedUninstallBundles(admin: Want, appIds: Array\, userId: number, callback: AsyncCallback<void>): void + +指定设备管理员应用添加包卸载黑名单接口,添加至黑名单的应用不允许在指定用户(通过userId指定)下卸载,使用callback形式返回是否添加成功。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| appIds | Array<string> | 是 | 应用ID数组。 | +| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback<void> | 是 | 回调函数,当接口调用成功,err为null,否则为错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +bundleManager.addDisallowedUninstallBundles(wantTemp, appIds, 100, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## bundleManager.addDisallowedUninstallBundles + +addDisallowedUninstallBundles(admin: Want, appIds: Array\, userId?: number): Promise<void> + +指定设备管理员应用添加包卸载黑名单接口。如果调用接口时传入了可选参数userId,则添加至黑名单的应用不允许在指定用户下卸载;如果调用接口时没有传入参数userId,则添加至黑名单的应用不允许在当前用户下卸载,使用promise形式返回是否添加成功。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| appIds | Array<string> | 是 | 应用ID数组。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | ------------------------- | +| Promise<void> | 无返回结果的Promise对象。当指定设备管理员应用添加包卸载黑名单失败时会抛出错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +bundleManager.addDisallowedUninstallBundles(wantTemp, appIds, 100).then(() => { + console.log("success"); +}).catch(error => { + console.log("error code:" + error.code + " error message:" + error.message); +}); +``` + +## bundleManager.removeDisallowedUninstallBundles + +removeDisallowedUninstallBundles(admin: Want, appIds: Array\, callback: AsyncCallback<void>): void + +指定设备管理员应用移除包卸载黑名单接口,在黑名单存在的情况下,在包卸载黑名单中的应用不允许在当前用户下卸载,使用callback形式返回移除结果。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| appIds | Array<string> | 是 | 应用ID数组。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当接口调用成功,err为null,否则为错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +bundleManager.removeDisallowedUninstallBundles(wantTemp, appIds, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## bundleManager.removeDisallowedUninstallBundles + +removeDisallowedUninstallBundles(admin: Want, appIds: Array\, userId: number, callback: AsyncCallback<void>): void + +指定设备管理员应用移除包卸载黑名单接口,在黑名单存在的情况下,在包卸载黑名单中的应用不允许在指定用户(通过userId指定)下卸载,使用callback形式返回移除结果。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| appIds | Array<string> | 是 | 应用ID数组。 | +| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback<void> | 是 | 回调函数。当接口调用成功,err为null,否则为错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +bundleManager.removeDisallowedUninstallBundles(wantTemp, appIds, 100, (error) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}); +``` + +## bundleManager.removeDisallowedUninstallBundles + +removeDisallowedUninstallBundles(admin: Want, appIds: Array\, userId?: number): Promise<void> + +指定设备管理员应用移除包卸载黑名单接口。在黑名单存在的情况下,如果调用接口时传入参数userId,则在包卸载黑名单中的应用不允许在指定用户下卸载;如果调用接口时没有传入参数userId,则在包卸载黑名单中的应用不允许在当前用户下卸载,使用promise形式返回移除结果。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| appIds | Array\<string> | 是 | 应用ID数组。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | ------------------------- | +| Promise<void> | 无返回结果的Promise对象。当指定设备管理员应用移除包卸载黑名单失败时会抛出错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +let appIds = ["com.example.myapplication"]; + +bundleManager.removeDisallowedUninstallBundles(wantTemp, appIds, 100).then(() => { + console.log("success"); +}).catch(error => { + console.log("error code:" + error.code + " error message:" + error.message); +}); +``` + +## bundleManager.getDisallowedUninstallBundles + +getDisallowedUninstallBundles(admin: Want, callback: AsyncCallback<Array<string>>): void + +指定管理员应用获取当前用户下的包卸载黑名单接口,使用callback形式返回获取包卸载黑名单。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| callback | AsyncCallback<Array<string>> | 是 | 回调函数,当接口调用成功,err为null,否则为错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; + +bundleManager.getDisallowedUninstallBundles(wantTemp, (error, data) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } else { + console.log("success: " + data); + } +}); +``` + +## bundleManager.getDisallowedUninstallBundles + +getDisallowedUninstallBundles(admin: Want, userId: number, callback: AsyncCallback<Array<string>>): void + +指定管理员应用获取指定用户(通过userId指定)下的包卸载黑名单接口,使用callback形式返回获取包卸载黑名单。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback<Array<string>> | 是 | 回调函数,当接口调用成功,err为null,否则为错误对象。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; + +bundleManager.getDisallowedUninstallBundles(wantTemp, 100, (error, data) => { + if (error != null) { + console.log("error code:" + error.code + " error message:" + error.message); + } else { + console.log("success: " + data); + } +}); +``` + +## bundleManager.getDisallowedUninstallBundles + +getDisallowedUninstallBundles(admin: Want, userId?: number): Promise<Array<string>> + +指定管理员应用获取指定用户或当前用户下包卸载黑名单接口,使用promise形式返回获取包卸载黑名单。如果调用接口时传入参数userId,表示获取指定用户下包卸载黑名单,如果调用接口没有传入参数userId,表示获取当前用户下包卸载黑名单。 + +**需要权限:** ohos.permission.ENTERPRISE_SET_BUNDLE_INSTALL_POLICY + +**系统能力:** SystemCapability.Customization.EnterpriseDeviceManager + +**系统API**: 此接口为系统接口。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ----------------------------------- | ---- | ------- | +| admin | [Want](js-apis-app-ability-want.md) | 是 | 设备管理员应用。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | ------------------------- | +| Promise<Array<string>> | Promise对象,返回当前用户下的包卸载白名单。 | + +**错误码**: + +以下的错误码的详细介绍请参见[企业设备管理错误码](../errorcodes/errorcode-enterpriseDeviceManager.md) + +| 错误码ID | 错误信息 | +| ------- | ---------------------------------------------------------------------------- | +| 9200001 | the application is not an administrator of the device. | +| 9200002 | the administrator application does not have permission to manage the device. | + +**示例:** + +```js +let wantTemp = { + bundleName: "com.example.myapplication", + abilityName: "EntryAbility", +}; +bundleManager.getDisallowedUninstallBundles(wantTemp, 100).then((data) => { + console.log("success: " + data); +}).catch(error => { + console.log("error code:" + error.code + " error message:" + error.message); +}); diff --git a/zh-cn/application-dev/reference/apis/js-apis-file-backup.md b/zh-cn/application-dev/reference/apis/js-apis-file-backup.md index 7bd4e7512bff6bcaeaf953515c3d5da34f9048ee..62a1902faf944e082ec2e07221328f396009a770 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-file-backup.md +++ b/zh-cn/application-dev/reference/apis/js-apis-file-backup.md @@ -263,7 +263,7 @@ getLocalCapabilities(callback: AsyncCallback<FileData>): void "versionCode" : 1000000, "versionName" : "1.0.0" }], - "deviceType" : "phone", + "deviceType" : "default", "systemFullName" : "OpenHarmony-4.0.0.0" } ``` @@ -324,7 +324,7 @@ getLocalCapabilities(): Promise<FileData> "versionCode" : 1000000, "versionName" : "1.0.0" }], - "deviceType" : "phone", + "deviceType" : "default", "systemFullName" : "OpenHarmony-4.0.0.0" } ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-font.md b/zh-cn/application-dev/reference/apis/js-apis-font.md index 2a4d2cd856307f1273d7d5c978a72864c9dab6b2..f6ae982eb13e4261083ea2210256057db4e8d354 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-font.md +++ b/zh-cn/application-dev/reference/apis/js-apis-font.md @@ -1,4 +1,4 @@ -# @ohos.font(注册自定义字体) +# @ohos.font (注册自定义字体) 本模块提供注册自定义字体。 @@ -22,16 +22,16 @@ registerFont(options: FontOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------- | --------------------------- | ---- | ---------------------- | -| options | [FontOptions](#fontoptions) | 是 | 注册的自定义字体信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | --------------------------- | ---- | ----------- | +| options | [FontOptions](#fontoptions) | 是 | 注册的自定义字体信息。 | ## FontOptions -| 名称 | 类型 | 必填 | 说明 | -| ---------- | ------ | ---- | ------------------------ | -| familyName | string | 是 | 设置注册的字体名称。 | -| familySrc | string | 是 | 设置注册字体文件的路径。 | +| 名称 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | ------------ | +| familyName | string | 是 | 设置注册的字体名称。 | +| familySrc | string | 是 | 设置注册字体文件的路径。 | ## 示例 diff --git a/zh-cn/application-dev/reference/apis/js-apis-http.md b/zh-cn/application-dev/reference/apis/js-apis-http.md index bf34a19c164df7be8f46b16ccb2d098e7d6be575..516f58d1977bce818c3d0987cf1b5deff8650c7e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-http.md +++ b/zh-cn/application-dev/reference/apis/js-apis-http.md @@ -55,6 +55,8 @@ httpRequest.request( // data.header为HTTP响应头,可根据业务需要进行解析 console.info('header:' + JSON.stringify(data.header)); console.info('cookies:' + JSON.stringify(data.cookies)); // 8+ + // 当该请求使用完毕时,调用destroy方法主动销毁 + httpRequest.destroy(); } else { console.info('error:' + JSON.stringify(err)); // 取消订阅HTTP响应头事件 diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md index f26db7ba6695bd6f97a3c9abc4be306b52f97cac..dc49d568e50613a19cf36428932e51871a9fde1a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-applicationStateObserver.md @@ -43,5 +43,5 @@ let applicationStateObserver = { console.log('onProcessStateChanged onProcessStateChanged: ${JSON.stringify(processData)}'); } }; -let observerCode = appManager.registerApplicationStateObserver(applicationStateObserver); +let observerCode = appManager.on('applicationState', applicationStateObserver); ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md b/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md index 21a1a1b7c0f3e295e1103253faaf4558779b88f5..7520784617e7d482f965b82b715808b61fcd802b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmethodengine.md @@ -494,7 +494,7 @@ createPanel(ctx: BaseContext, info: PanelInfo, callback: AsyncCallback\): | 参数名 | 类型 | 必填 | 说明 | | ------- | ----------- | ---- | ------------------------ | -| ctx | [BaseContext](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inner-application-baseContext.md) | 是 | 当前输入法应用上下文信息。 | +| ctx | [BaseContext](js-apis-inner-application-baseContext.md) | 是 | 当前输入法应用上下文信息。 | | info | [PanelInfo](#panelinfo10) | 是 | 输入法面板信息。 | | callback | AsyncCallback\<[Panel](#panel10)> | 是 | 回调函数。当输入法面板创建成功,返回当前创建的输入法面板对象。 | @@ -538,7 +538,7 @@ createPanel(ctx: BaseContext, info: PanelInfo): Promise\ | 参数名 | 类型 | 必填 | 说明 | | ------- | ----------- | ---- | ------------------------ | -| ctx | [BaseContext](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-inner-application-baseContext.md) | 是 | 当前输入法应用上下文信息。 | +| ctx | [BaseContext](js-apis-inner-application-baseContext.md) | 是 | 当前输入法应用上下文信息。 | | info | [PanelInfo](#panelinfo10) | 是 | 输入法面板信息。 | **返回值:** @@ -2521,8 +2521,8 @@ try { | 名称 | 类型 | 可读 | 可写 | 说明 | | --------- | -------- | ---- | ---- | ------------ | -| keyCode | number | 是 | 否 | 按键的键值。 | -| keyAction | number | 是 | 否 | 按键的状态。 | +| keyCode | number | 是 | 否 | 按键的键值。键码值说明参考[KeyCode](js-apis-keycode.md#keycode)。 | +| keyAction | number | 是 | 否 | 按键事件类型。
- 当值为2时,表示按下事件;
- 当值为3时,表示抬起事件。 | ## PanelFlag10+ diff --git a/zh-cn/application-dev/reference/apis/js-apis-installer.md b/zh-cn/application-dev/reference/apis/js-apis-installer.md index a42897bcb27dde426ab7734dc8e694e84077054c..a7a8e000760c564b4c9cc8b09c7023ceafa7b7d1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-installer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-installer.md @@ -773,7 +773,7 @@ try { | installFlag | number | 否 | 指示安装标志,枚举值:0:应用初次安装,1:应用覆盖安装,默认值为应用初次安装 | | isKeepData | boolean | 否 | 卸载时是否保留数据目录,默认值为false。 | | hashParams | Array<[HashParam](#hashparam)> | 否 | 哈希值参数,默认值为空。 | -| crowdtestDeadline| number | 否 |[众测](https://developer.huawei.com/consumer/cn/agconnect/crowd-test/)截止日期,默认值为-1。 | +| crowdtestDeadline| number | 否 | 众测活动的截止日期,默认值为-1,表示无截止日期约束。 | | sharedBundleDirPaths10+ | Array\ | 否 |共享包文件所在路径,默认值为空。 | ## UninstallParam10+ diff --git a/zh-cn/application-dev/reference/apis/js-apis-logs.md b/zh-cn/application-dev/reference/apis/js-apis-logs.md index 8dea3732ed6db1e3bdc49af9232c15e7089d8b37..9282f0f4ffc6ec5389acf205131f26ab9850e3ca 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-logs.md +++ b/zh-cn/application-dev/reference/apis/js-apis-logs.md @@ -1,4 +1,4 @@ -# console (控制台) +# console (控制台) 本模块提供了一个简单的调试控制台,类似于浏览器提供的JavaScript控制台机制。 @@ -19,9 +19,10 @@ debug(message: string, ...arguments: any[]): void | 参数名 | 类型 | 必填 | 说明 | | ------- | ------ | ---- | ----------- | | message | string | 是 | 表示要打印的文本信息。 | -| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 | +| arguments | any[] | 否 | 表示其余要打印的信息或message的替换值。 | **示例:** + ```js const number = 5; console.debug('count: %d', number); // 格式化输出替换message中的文本。 @@ -45,9 +46,10 @@ log(message: string, ...arguments: any[]): void | 参数名 | 类型 | 必填 | 说明 | | ------- | ------ | ---- | ----------- | | message | string | 是 | 表示要打印的文本信息。 | -| arguments | any | 否 |表示其余要打印的信息或message的替换值。 | +| arguments | any[] | 否 |表示其余要打印的信息或message的替换值。 | **示例:** + ```js const number = 5; console.log('count: %d', number); // 格式化输出替换message中的文本。 @@ -71,9 +73,10 @@ info(message: string, ...arguments: any[]): void | 参数名 | 类型 | 必填 | 说明 | | ------- | ------ | ---- | ----------- | | message | string | 是 | 表示要打印的文本信息。 | -| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 | +| arguments | any[] | 否 | 表示其余要打印的信息或message的替换值。 | **示例:** + ```js const number = 5; console.info('count: %d', number); // 格式化输出替换message中的文本。 @@ -97,9 +100,10 @@ warn(message: string, ...arguments: any[]): void | 参数名 | 类型 | 必填 | 说明 | | ------- | ------ | ---- | ----------- | | message | string | 是 | 表示要打印的警告信息。 | -| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 | +| arguments | any[] | 否 | 表示其余要打印的信息或message的替换值。 | **示例:** + ```js const str = "name should be string"; console.warn('warn: %d', str); // 格式化输出替换message中的文本。 @@ -123,10 +127,11 @@ error(message: string, ...arguments: any[]): void | 参数名 | 类型 | 必填 | 说明 | | ------- | ------ | ---- | ----------- | | message | string | 是 | 表示要打印的错误信息。 | -| arguments | any | 否 | 表示其余要打印的信息或message的替换值。 | +| arguments | any[] | 否 | 表示其余要打印的信息或message的替换值。 | **示例:** + ```js const str = "value is not defined"; console.error('error: %d', str); // 格式化输出替换message中的文本。 @@ -153,6 +158,7 @@ assert(value?: Object, ...arguments: Object[]): void | arguments | Object | 否 | value为假(false)的后续错误消息打印。省略则不打印。| **示例:** + ```js console.assert(true, 'does nothing'); // 表达式结果值为true, 无打印。 console.assert(2 % 1 == 0, 'does nothing'); // 表达式结果值为true, 无打印。 @@ -180,6 +186,7 @@ count(label?: string): void **示例:** + ```js console.count() // default: 1 @@ -210,6 +217,7 @@ countReset(label?: string): void | label | string | 否 | 计数器标签名。默认值为'default'。| **示例:** + ```js console.count('abc'); // abc: 1 @@ -234,6 +242,7 @@ dir(dir?: Object): void **示例:** + ```js let a = { foo: { bar: { baz: true } }}; console.dir(a); @@ -258,6 +267,7 @@ dirxml(...arguments: Object[]): void | arguments | Object | 是 | 要打印的信息。 | **示例:** + ```js const number = 5; console.dirxml('count: %d', number); @@ -284,6 +294,7 @@ group(...arguments: Object[]): void | arguments | Object | 否 | 要打印的信息。 | **示例:** + ```js console.log("outter"); // outter @@ -313,6 +324,7 @@ groupCollapsed(...arguments: Object[]): void **示例:** + ```js console.groupCollapsed("outter"); // outter @@ -335,6 +347,7 @@ groupEnd(): void **示例:** + ```js console.log("outter"); // outter @@ -362,6 +375,7 @@ table(tableData?: Object): void | tableData | Object | 否 | 要打印为表格形式的对象。省略则无任何打印。 | **示例:** + ```js console.table([1, 2, 3]); // ┌─────────┬────────┐ @@ -382,6 +396,7 @@ console.table({ a: [1, 2, 3, 4, 5], b: 5, c: { e: 5 } }); // │ c │ │ │ │ │ │ 5 │ │ // └─────────┴───┴───┴───┴───┴───┴───┴────────┘ ``` + ## console.time10+ time(label?: string): void @@ -397,6 +412,7 @@ time(label?: string): void | label | string | 否 | 计时器标识。默认值为'default'。 | **示例:** + ```js console.time('abc'); ``` @@ -416,6 +432,7 @@ timeEnd(label?: string): void | label | string | 否 | 计时器标识。默认值为'default' | **示例:** + ```js console.time('abc'); console.timeEnd('abc'); @@ -438,6 +455,7 @@ timeLog(label?: string, ...arguments: Object[]): void | arguments | Object | 否 | 需要打印的其他日志。 | **示例:** + ```js console.time('timer1'); console.timeLog('timer1', 17); @@ -461,6 +479,7 @@ trace(...arguments: Object[]): void | arguments | Object | 否 | 需要打印的其他日志。省略则仅打印堆栈信息。| **示例:** + ```js console.trace(); // Trace: diff --git a/zh-cn/application-dev/reference/apis/js-apis-media.md b/zh-cn/application-dev/reference/apis/js-apis-media.md index c4e780a4596dcda7249993f943a084b354760290..a0464c42c0ff9a00722a388d8e93f6780caa6206 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-media.md +++ b/zh-cn/application-dev/reference/apis/js-apis-media.md @@ -318,7 +318,7 @@ Codec MIME类型枚举。 | MD_KEY_BITRATE | 'bitrate' | 表示比特率,其对应键值类型为number,单位为比特率(bps)。 | | MD_KEY_WIDTH | 'width' | 表示视频宽度,其对应键值类型为number,单位为像素(px)。 | | MD_KEY_HEIGHT | 'height' | 表示视频高度,其对应键值类型为number,单位为像素(px)。 | -| MD_KEY_FRAME_RATE | 'frame_rate' | 表示视频帧率,其对应键值类型为number,单位为帧每秒(fps)。 | +| MD_KEY_FRAME_RATE | 'frame_rate' | 表示视频帧率,其对应键值类型为number,单位为100帧每秒(100fps)。 | | MD_KEY_AUD_CHANNEL_COUNT | 'channel_count' | 表示声道数,其对应键值类型为number。 | | MD_KEY_AUD_SAMPLE_RATE | 'sample_rate' | 表示采样率,其对应键值类型为number,单位为赫兹(Hz)。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-plugincomponent.md b/zh-cn/application-dev/reference/apis/js-apis-plugincomponent.md index ada7897303b8676a5c80336a3d4a761674240deb..995ce9d9331bb7093f757544aa9d251f5cbe39eb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-plugincomponent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-plugincomponent.md @@ -4,7 +4,7 @@ > **说明:** > -> - 本模块首批接口从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 +> - 本模块首批接口从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 ## 导入模块 @@ -18,10 +18,10 @@ Plugin组件模板参数。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 参数 | 类型 | 必填 | 描述 | -| ---------- | ------ | ---- | --------------------------- | -| source | string | 是 | 组件模板名。 | -| bundleName | string | 是 | 提供者Ability的bundleName。 | +| 参数 | 类型 | 必填 | 描述 | +| ---------- | ------ | ---- | ---------------------- | +| source | string | 是 | 组件模板名。 | +| bundleName | string | 是 | 提供者Ability的bundleName。 | ## PluginComponentManager @@ -33,14 +33,14 @@ Plugin组件模板参数。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 取值范围 | 说明 | -| --------------------- | ---------------------------------------- | +| 取值范围 | 说明 | +| --------------------- | -------------------- | | [key: string] | 关键字,数据类型为字符串,可取空字符串。 | -| number | 键值,表示值类型为数字。 | +| number | 键值,表示值类型为数字。 | | string | 键值,表示值类型为字符串,可取空字符串。 | -| boolean | 键值,表示值类型为布尔值。 | -| [] | 键值,可取值为[]。 | -| [KVObject](#kvobject) | 键值,表示值类型为KVObject。 | +| boolean | 键值,表示值类型为布尔值。 | +| [] | 键值,可取值为[]。 | +| [KVObject](#kvobject) | 键值,表示值类型为KVObject。 | ### PushParameters @@ -51,13 +51,13 @@ Plugin组件模板参数。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 类型 | 必填 | 说明 | -| --------- | ----------------------------------- | ---- | -------------------------------------------------------------- | -| want | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 | -| name | string | 是 | 组件名称。 | -| data | [KVObject](#kvobject) | 是 | 组件数据值。 | -| extraData | [KVObject](#kvobject) | 是 | 附加数据值。 | -| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)件的路径。 | +| 名称 | 类型 | 必填 | 说明 | +| --------- | ----------------------------------- | ---- | ---------------------------------------- | +| want | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 | +| name | string | 是 | 组件名称。 | +| data | [KVObject](#kvobject) | 是 | 组件数据值。 | +| extraData | [KVObject](#kvobject) | 是 | 附加数据值。 | +| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)件的路径。 | ### PushParameterForStage @@ -69,14 +69,14 @@ Plugin组件模板参数。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 类型 | 必填 | 说明 | -| --------- | ----------------------------------- | ---- | ---------------------------------------------------------------- | -| owner | [Want](js-apis-application-want.md) | 是 | 组件提供方Ability信息。 | -| target | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 | -| name | string | 是 | 组件名称。 | -| data | [KVObject](#kvobject) | 是 | 组件数据值。 | -| extraData | [KVObject](#kvobject) | 是 | 附加数据值。 | -| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)文件的路径。 | +| 名称 | 类型 | 必填 | 说明 | +| --------- | ----------------------------------- | ---- | ---------------------------------------- | +| owner | [Want](js-apis-application-want.md) | 是 | 组件提供方Ability信息。 | +| target | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 | +| name | string | 是 | 组件名称。 | +| data | [KVObject](#kvobject) | 是 | 组件数据值。 | +| extraData | [KVObject](#kvobject) | 是 | 附加数据值。 | +| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)文件的路径。 | ### RequestParameters @@ -86,12 +86,12 @@ Plugin组件模板参数。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 类型 | 必填 | 说明 | -| -------- | ----------------------------------- | ---- | --------------------------------------------------------------------------------------------------------------------- | -| want | [Want](js-apis-application-want.md) | 是 | 组件提供者Ability信息。 | -| name | string | 是 | 请求组件名称。 | -| data | [KVObject](#kvobject) | 是 | 附加数据。 | -| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)文件的路径。jsonPath字段不为空或者未设置的时候不触发Request通信。 | +| 名称 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | ---------------------------------------- | +| want | [Want](js-apis-application-want.md) | 是 | 组件提供者Ability信息。 | +| name | string | 是 | 请求组件名称。 | +| data | [KVObject](#kvobject) | 是 | 附加数据。 | +| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)文件的路径。jsonPath字段不为空或者未设置的时候不触发Request通信。 | ### RequestParameterForStage @@ -103,13 +103,13 @@ Plugin组件模板参数。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 类型 | 必填 | 说明 | -| -------- | ----------------------------------- | ---- | --------------------------------------------------------------------------------------------------------------------- | -| owner | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 | -| target | [Want](js-apis-application-want.md) | 是 | 组件提供者Ability信息。 | -| name | string | 是 | 请求组件名称。 | -| data | [KVObject](#kvobject) | 是 | 附加数据。 | -| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)文件的路径。jsonPath字段不为空或者未设置的时候不触发Request通信。 | +| 名称 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | ---------------------------------------- | +| owner | [Want](js-apis-application-want.md) | 是 | 组件使用者Ability信息。 | +| target | [Want](js-apis-application-want.md) | 是 | 组件提供者Ability信息。 | +| name | string | 是 | 请求组件名称。 | +| data | [KVObject](#kvobject) | 是 | 附加数据。 | +| jsonPath | string | 否 | 存放模板路径的[external.json](#externaljson文件说明)文件的路径。jsonPath字段不为空或者未设置的时候不触发Request通信。 | ### RequestCallbackParameters @@ -117,11 +117,11 @@ PluginManager.Request方法时候接收到的回调结果。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 类型 | 必填 | 说明 | -| ----------------- | --------------------------------------------------- | ---- | ---------- | -| componentTemplate | [PluginComponentTemplate](#plugincomponenttemplate) | 是 | 组件模板。 | -| data | [KVObject](#kvobject) | 是 | 组件数据。 | -| extraData | [KVObject](#kvobject) | 是 | 附加数据。 | +| 名称 | 类型 | 必填 | 说明 | +| ----------------- | ---------------------------------------- | ---- | ----- | +| componentTemplate | [PluginComponentTemplate](#plugincomponenttemplate) | 是 | 组件模板。 | +| data | [KVObject](#kvobject) | 是 | 组件数据。 | +| extraData | [KVObject](#kvobject) | 是 | 附加数据。 | ### RequestEventResult @@ -129,11 +129,11 @@ PluginManager.Request方法时候接收到的回调结果。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full -| 名称 | 类型 | 必填 | 说明 | -| --------- | --------------------- | ---- | ---------- | -| template | string | 否 | 组件模板。 | -| data | [KVObject](#kvobject) | 否 | 组件数据。 | -| extraData | [KVObject](#kvobject) | 否 | 附加数据。 | +| 名称 | 类型 | 必填 | 说明 | +| --------- | --------------------- | ---- | ----- | +| template | string | 否 | 组件模板。 | +| data | [KVObject](#kvobject) | 否 | 组件数据。 | +| extraData | [KVObject](#kvobject) | 否 | 附加数据。 | ### OnPushEventCallback @@ -144,12 +144,12 @@ OnPushEventCallback = (source: Want, template: PluginComponentTemplate, data: KV **参数:** -| 参数 | 类型 | 必填 | 说明 | -| --------- | --------------------------------------------------- | ---- | ---------------------------------------- | -| source | [Want](js-apis-application-want.md) | 是 | Push请求发送方相关信息。 | -| template | [PluginComponentTemplate](#plugincomponenttemplate) | 是 | Push请求发送方相关信息请求组件模板名称。 | -| data | [KVObject](#kvobject) | 是 | 数据。 | -| extraData | [KVObject](#kvobject) | 是 | 附加数据。 | +| 参数 | 类型 | 必填 | 说明 | +| --------- | ---------------------------------------- | ---- | ---------------------- | +| source | [Want](js-apis-application-want.md) | 是 | Push请求发送方相关信息。 | +| template | [PluginComponentTemplate](#plugincomponenttemplate) | 是 | Push请求发送方相关信息请求组件模板名称。 | +| data | [KVObject](#kvobject) | 是 | 数据。 | +| extraData | [KVObject](#kvobject) | 是 | 附加数据。 | **示例:** @@ -172,11 +172,11 @@ OnRequestEventCallback = (source: Want, name: string, data: KVObject) => Request **参数:** -| 参数 | 类型 | 必填 | 说明 | -| --------- | ----------------------------------- | ---- | --------------------------- | -| source | [Want](js-apis-application-want.md) | 是 | request请求发送方相关信息。 | -| name | string | 是 | 模板名称。 | -| extraData | [KVObject](#kvobject) | 是 | 附加数据。 | +| 参数 | 类型 | 必填 | 说明 | +| --------- | ----------------------------------- | ---- | ----------------- | +| source | [Want](js-apis-application-want.md) | 是 | request请求发送方相关信息。 | +| name | string | 是 | 模板名称。 | +| extraData | [KVObject](#kvobject) | 是 | 附加数据。 | **示例:** @@ -200,10 +200,10 @@ push(param: PushParameters , callback: AsyncCallback<void>): void **模型约束:** 此接口仅适用于FA模型。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------------------- | ---- | ------------------------ | -| param | [PushParameters](#pushparameters) | 是 | 组件使用者的详细信息。 | -| callback | AsyncCallback<void> | 是 | 此次接口调用的异步回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------- | ---- | ------------ | +| param | [PushParameters](#pushparameters) | 是 | 组件使用者的详细信息。 | +| callback | AsyncCallback<void> | 是 | 此次接口调用的异步回调。 | **示例:** @@ -241,10 +241,10 @@ push(param: PushParameterForStage, callback: AsyncCallback<void>): void **模型约束:** 此接口仅适用于Stage模型。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ----------------------------------------------- | ---- | ------------------------ | -| param | [PushParameterForStage](#pushparameterforstage) | 是 | 组件使用者的详细信息。 | -| callback | AsyncCallback<void> | 是 | 此次接口调用的异步回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------ | +| param | [PushParameterForStage](#pushparameterforstage) | 是 | 组件使用者的详细信息。 | +| callback | AsyncCallback<void> | 是 | 此次接口调用的异步回调。 | **示例:** @@ -289,10 +289,10 @@ request(param: RequestParameters, callback: AsyncCallback<RequestCallbackPara **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------- | -| param | [RequestParameters](#requestparameters) | 是 | 组件模板的详细请求信息。 | -| callback | AsyncCallback<[RequestCallbackParameters](#requestcallbackparameters) \| void> | 是 | 此次请求的异步回调, 通过回调接口的参数返回接受请求的数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ----------------------------------- | +| param | [RequestParameters](#requestparameters) | 是 | 组件模板的详细请求信息。 | +| callback | AsyncCallback<[RequestCallbackParameters](#requestcallbackparameters) \| void> | 是 | 此次请求的异步回调, 通过回调接口的参数返回接受请求的数据。 | **示例:** @@ -332,10 +332,10 @@ request(param: RequestParameterForStage, callback: AsyncCallback<RequestCallb **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------------------------------------------------------------- | ---- | ---------------------------------------------------------------- | -| param | [RequestParameterForStage](#requestparameterforstage) | 是 | 组件模板的详细请求信息。 | -| callback | AsyncCallback<[RequestCallbackParameters](#requestcallbackparameters) \| void> | 是 | 此次请求的异步回调, 通过回调接口的参数返回接受请求的数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ----------------------------------- | +| param | [RequestParameterForStage](#requestparameterforstage) | 是 | 组件模板的详细请求信息。 | +| callback | AsyncCallback<[RequestCallbackParameters](#requestcallbackparameters) \| void> | 是 | 此次请求的异步回调, 通过回调接口的参数返回接受请求的数据。 | **示例:** @@ -371,10 +371,10 @@ on(eventType: string, callback: OnPushEventCallback | OnRequestEventCallback ): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ---------------------------------------------------------------------------------------------------------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| eventType | string | 是 | 监听的事件类型, 可选值为:"push" 、"request"。
"push”:指组件提供者向使用者主动推送数据。
"request”:指组件使用者向提供者主动请求数据。 | -| callback | [OnPushEventCallback](#onpusheventcallback) \| [OnRequestEventCallback](#onrequesteventcallback) | 是 | 对应监听回调,push事件对应回调类型为[OnPushEventCallback](#onpusheventcallback),request事件对应回调类型为[OnRequestEventCallback](#onrequesteventcallback) 。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ---------------------------------------- | ---- | ---------------------------------------- | +| eventType | string | 是 | 监听的事件类型, 可选值为:"push" 、"request"。
"push”:指组件提供者向使用者主动推送数据。
"request”:指组件使用者向提供者主动请求数据。 | +| callback | [OnPushEventCallback](#onpusheventcallback) \| [OnRequestEventCallback](#onrequesteventcallback) | 是 | 对应监听回调,push事件对应回调类型为[OnPushEventCallback](#onpusheventcallback),request事件对应回调类型为[OnRequestEventCallback](#onrequesteventcallback) 。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md index 8a4cd0b5111672f6bb0790ad98ee05d4204d132e..aff26fccbdebbf790a49c8498e4cf18f29d8a9d4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-reminderAgent.md @@ -20,25 +20,23 @@ import reminderAgent from'@ohos.reminderAgent'; ## reminderAgent.publishReminder(deprecated) -```ts publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\): void -``` 发布一个后台代理提醒,使用回调的方式实现异步调用,该方法需要申请通知弹窗权限[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)后才能调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder)替代。 -**需要权限**: `ohos.permission.PUBLISH_AGENT_REMINDER` +**需要权限**: ohos.permission.PUBLISH_AGENT_REMINDER -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | reminderReq | [ReminderRequest](#reminderrequest) | 是 | 需要发布的提醒实例。 | - | callback | AsyncCallback\ | 是 | 异步回调,返回当前发布的提醒的id。 | + | callback | AsyncCallback\ | 是 | 异步回调,返回当前发布的提醒的id。 | **示例**: ```ts @@ -55,18 +53,16 @@ publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\): ## reminderAgent.publishReminder(deprecated) -```ts publishReminder(reminderReq: ReminderRequest): Promise\ -``` 发布一个后台代理提醒,使用Promise方式实现异步调用,该方法需要申请通知弹窗权限[Notification.requestEnableNotification](js-apis-notification.md#notificationrequestenablenotification8)后才能调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.publishReminder](js-apis-reminderAgentManager.md#reminderagentmanagerpublishreminder-1)替代。 -**需要权限**: `ohos.permission.PUBLISH_AGENT_REMINDER` +**需要权限**: ohos.permission.PUBLISH_AGENT_REMINDER -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: | 参数名 | 类型 | 必填 | 说明 | @@ -76,7 +72,7 @@ publishReminder(reminderReq: ReminderRequest): Promise\ **返回值**: | 类型 | 说明 | | -------- | -------- | - | Promise\ | 返回提醒的Id。 | + | Promise\ | 返回提醒的Id。 | **示例**: ```ts @@ -93,23 +89,21 @@ publishReminder(reminderReq: ReminderRequest): Promise\ ## reminderAgent.cancelReminder(deprecated) -```ts cancelReminder(reminderId: number, callback: AsyncCallback\): void -``` 取消指定id的提醒,使用回调的方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | reminderId | number | 是 | 目标reminder的id号,[publishReminder](#reminderagentpublishreminder)方法调用成功后获得。 | -| callback | AsyncCallback\ | 是 | 异步回调。 | +| callback | AsyncCallback\ | 是 | 异步回调。 | **示例**: @@ -122,16 +116,14 @@ reminderAgent.cancelReminder(1, (err, data) => { ## reminderAgent.cancelReminder(deprecated) -```ts cancelReminder(reminderId: number): Promise\ -``` 取消指定id的提醒,使用Promise方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelReminder](js-apis-reminderAgentManager.md#reminderagentmanagercancelreminder-1)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: @@ -143,7 +135,7 @@ cancelReminder(reminderId: number): Promise\ | 类型 | 说明 | | -------- | -------- | -| Promise\ | Promise类型异步回调。 | +| Promise\ | Promise类型异步回调。 | **示例**: @@ -155,22 +147,20 @@ reminderAgent.cancelReminder(1).then(() => { ## reminderAgent.getValidReminders(deprecated) -```ts getValidReminders(callback: AsyncCallback\>): void -``` 获取当前应用已设置的所有有效(未过期)的提醒,使用回调的方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\\> | 是 | 异步回调,返回当前应用已设置的所有有效(未过期)的提醒。 | +| callback | AsyncCallback\> | 是 | 异步回调,返回当前应用已设置的所有有效(未过期)的提醒。 | **示例**: @@ -204,22 +194,20 @@ reminderAgent.getValidReminders((err, reminders) => { ## reminderAgent.getValidReminders(deprecated) -```ts getValidReminders(): Promise\> -``` 获取当前应用已设置的所有有效(未过期)的提醒,使用Promise方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.getValidReminders](js-apis-reminderAgentManager.md#reminderagentmanagergetvalidreminders-1)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **返回值**: | 类型 | 说明 | | -------- | -------- | -| Promise\\> | 返回当前应用已设置的所有有效(未过期)的提醒。 | +| Promise\> | 返回当前应用已设置的所有有效(未过期)的提醒。 | **示例**: @@ -253,22 +241,20 @@ reminderAgent.getValidReminders().then((reminders) => { ## reminderAgent.cancelAllReminders(deprecated) -```ts cancelAllReminders(callback: AsyncCallback\): void -``` 取消当前应用所有的提醒,使用回调的方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\ | 是 | 异步回调。 | +| callback | AsyncCallback\ | 是 | 异步回调。 | **示例**: @@ -281,22 +267,20 @@ reminderAgent.cancelAllReminders((err, data) =>{ ## reminderAgent.cancelAllReminders(deprecated) -```ts cancelAllReminders(): Promise\ -``` 取消当前应用所有的提醒,使用Promise方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.cancelAllReminders](js-apis-reminderAgentManager.md#reminderagentmanagercancelallreminders-1)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **返回值**: | 类型 | 说明 | | -------- | -------- | -| Promise\ | Promise类型异步回调。 | +| Promise\ | Promise类型异步回调。 | **示例**: @@ -308,23 +292,21 @@ reminderAgent.cancelAllReminders().then(() => { ## reminderAgent.addNotificationSlot(deprecated) -```ts addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback\): void -``` 添加一个NotificationSlot,使用回调的方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | slot | [NotificationSlot](js-apis-notification.md#notificationslot) | 是 | notification\.slot实例,仅支持设置其type属性。 | -| callback | AsyncCallback\ | 是 | 异步回调。 | +| callback | AsyncCallback\ | 是 | 异步回调。 | **示例**: @@ -342,16 +324,14 @@ reminderAgent.addNotificationSlot(mySlot, (err, data) => { ## reminderAgent.addNotificationSlot(deprecated) -```ts addNotificationSlot(slot: NotificationSlot): Promise\ -``` 添加一个NotificationSlot,使用Promise方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.addNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanageraddnotificationslot-1)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: @@ -363,7 +343,7 @@ addNotificationSlot(slot: NotificationSlot): Promise\ | 类型 | 说明 | | -------- | -------- | -| Promise\ | Promise类型异步回调。 | +| Promise\ | Promise类型异步回调。 | **示例**: @@ -381,23 +361,21 @@ reminderAgent.addNotificationSlot(mySlot).then(() => { ## reminderAgent.removeNotificationSlot(deprecated) -```ts removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void -``` 删除目标NotificationSlot,使用callback方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | slotType | [notification.SlotType](js-apis-notification.md#slottype) | 是 | 目标notification\.slot的类型。 | -| callback | AsyncCallback\ | 是 | 异步回调。 | +| callback | AsyncCallback\ | 是 | 异步回调。 | **示例**: @@ -412,16 +390,14 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION, ## reminderAgent.removeNotificationSlot(deprecated) -```ts removeNotificationSlot(slotType: notification.SlotType): Promise -``` 删除目标NotificationSlot,使用Promise方式实现异步调用。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.removeNotificationSlot](js-apis-reminderAgentManager.md#reminderagentmanagerremovenotificationslot-1)替代。 -**系统能力**: `SystemCapability.Notification.ReminderAgent` +**系统能力**: SystemCapability.Notification.ReminderAgent **参数**: @@ -433,7 +409,7 @@ removeNotificationSlot(slotType: notification.SlotType): Promise | 类型 | 说明 | | -------- | -------- | -| Promise\ | Promise类型异步回调。 | +| Promise\ | Promise类型异步回调。 | **示例**: @@ -453,7 +429,7 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ActionButtonType](js-apis-reminderAgentManager.md#ActionButtonType)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 值 | 说明 | | -------- | -------- | -------- | @@ -468,7 +444,7 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderType](js-apis-reminderAgentManager.md#ReminderType)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 值 | 说明 | | -------- | -------- | -------- | @@ -484,7 +460,7 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ActionButton](js-apis-reminderAgentManager.md#ActionButton)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -499,7 +475,7 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.WantAgent](js-apis-reminderAgentManager.md#WantAgent)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -514,7 +490,7 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.MaxScreenWantAgent](js-apis-reminderAgentManager.md#MaxScreenWantAgent)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -529,7 +505,7 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequest](js-apis-reminderAgentManager.md#ReminderRequest)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**`SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -550,50 +526,46 @@ reminderAgent.removeNotificationSlot(notification.SlotType.CONTENT_INFORMATION). ## ReminderRequestCalendar(deprecated) -ReminderRequestCalendar extends ReminderRequest 日历实例对象,用于设置提醒的时间。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestCalendar](js-apis-reminderAgentManager.md#ReminderRequestCalendar)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | dateTime | [LocalDateTime](#localdatetime) | 是 | 指明提醒的目标时间。 | -| repeatMonths | Array\ | 否 | 指明重复提醒的月份。 | -| repeatDays | Array\ | 否 | 指明重复提醒的日期。 | +| repeatMonths | Array\ | 否 | 指明重复提醒的月份。 | +| repeatDays | Array\ | 否 | 指明重复提醒的日期。 | ## ReminderRequestAlarm(deprecated) -ReminderRequestAlarm extends ReminderRequest 闹钟实例对象,用于设置提醒的时间。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestAlarm](js-apis-reminderAgentManager.md#ReminderRequestAlarm)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | hour | number | 是 | 指明提醒的目标时刻。 | | minute | number | 是 | 指明提醒的目标分钟。 | -| daysOfWeek | Array\ | 否 | 指明每周哪几天需要重复提醒。范围为周一到周末,对应数字为1到7。 | +| daysOfWeek | Array\ | 否 | 指明每周哪几天需要重复提醒。范围为周一到周末,对应数字为1到7。 | ## ReminderRequestTimer(deprecated) -ReminderRequestTimer extends ReminderRequest - 倒计时实例对象,用于设置提醒的时间。 > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.ReminderRequestTimer](js-apis-reminderAgentManager.md#ReminderRequestTimer)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -607,7 +579,7 @@ ReminderRequestTimer extends ReminderRequest > **说明:** > 从 API version 7开始支持,从API version 9开始废弃。建议使用[reminderAgentManager.LocalDateTime](js-apis-reminderAgentManager.md#LocalDateTime)替代。 -**系统能力**:`SystemCapability.Notification.ReminderAgent` +**系统能力**:SystemCapability.Notification.ReminderAgent | 名称 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | diff --git a/zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md b/zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md index 8a06421c1de1b3fe0df129fc464bafad636dd50e..72124f105bfbd151c0d8d2af68305b94fbecd2dd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md @@ -170,7 +170,7 @@ cancelReminder(reminderId: number): Promise\ | 类型 | 说明 | | -------- | -------- | -| PPromise\ | Promise类型异步回调。 | +| Promise\ | Promise类型异步回调。 | **错误码:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-socket.md b/zh-cn/application-dev/reference/apis/js-apis-socket.md index b0bf07ffeedfeb74fd1e1017168215b802ee1974..cd0818c7e6334706fff0e267312881430de96a0e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-socket.md +++ b/zh-cn/application-dev/reference/apis/js-apis-socket.md @@ -681,10 +681,10 @@ UDPSocket连接的其他属性。 | 名称 | 类型 | 必填 | 说明 | | ----------------- | ------- | ---- | -------------------------------- | | broadcast | boolean | 否 | 是否可以发送广播。默认为false。 | -| receiveBufferSize | number | 否 | 接收缓冲区大小(单位:Byte)。 | -| sendBufferSize | number | 否 | 发送缓冲区大小(单位:Byte)。 | +| receiveBufferSize | number | 否 | 接收缓冲区大小(单位:Byte),默认为0。 | +| sendBufferSize | number | 否 | 发送缓冲区大小(单位:Byte),默认为0。 | | reuseAddress | boolean | 否 | 是否重用地址。默认为false。 | -| socketTimeout | number | 否 | 套接字超时时间,单位毫秒(ms)。 | +| socketTimeout | number | 否 | 套接字超时时间,单位毫秒(ms),默认为0。 | ## SocketStateBase7+ @@ -1569,10 +1569,10 @@ TCPSocket连接的其他属性。 | OOBInline | boolean | 否 | 是否为OOB内联。默认为false。 | | TCPNoDelay | boolean | 否 | TCPSocket连接是否无时延。默认为false。 | | socketLinger | Object | 是 | socket是否继续逗留。
- on:是否逗留(true:逗留;false:不逗留)。
- linger:逗留时长,单位毫秒(ms),取值范围为0~65535。
当入参on设置为true时,才需要设置。 | -| receiveBufferSize | number | 否 | 接收缓冲区大小(单位:Byte)。 | -| sendBufferSize | number | 否 | 发送缓冲区大小(单位:Byte)。 | +| receiveBufferSize | number | 否 | 接收缓冲区大小(单位:Byte),默认为0。 | +| sendBufferSize | number | 否 | 发送缓冲区大小(单位:Byte),默认为0。 | | reuseAddress | boolean | 否 | 是否重用地址。默认为false。 | -| socketTimeout | number | 否 | 套接字超时时间,单位毫秒(ms)。 | +| socketTimeout | number | 否 | 套接字超时时间,单位毫秒(ms),默认为0。 | ## TCP 错误码说明 @@ -2799,7 +2799,7 @@ TLS连接的操作。 | -------------- | ------------------------------------- | --- |-------------- | | address | [NetAddress](#netaddress) | 是 | 网关地址。 | | secureOptions | [TLSSecureOptions](#tlssecureoptions9) | 是 | TLS安全相关操作。| -| ALPNProtocols | Array\ | 否 | ALPN协议。 | +| ALPNProtocols | Array\ | 否 | ALPN协议,支持["spdy/1", "http/1.1"],默认为[]。 | ## TLSSecureOptions9+ @@ -2813,10 +2813,10 @@ TLS安全相关操作,其中ca证书为必选参数,其他参数为可选参 | cert | string | 否 | 本地客户端的数字证书。 | | key | string | 否 | 本地数字证书的私钥。 | | password | string | 否 | 读取私钥的密码。 | -| protocols | [Protocol](#protocol9) \|Array\<[Protocol](#protocol9)\> | 否 | TLS的协议版本。 | -| useRemoteCipherPrefer | boolean | 否 | 优先使用对等方的密码套件。 | -| signatureAlgorithms | string | 否 | 通信过程中的签名算法。 | -| cipherSuite | string | 否 | 通信过程中的加密套件。 | +| protocols | [Protocol](#protocol9) \|Array\<[Protocol](#protocol9)\> | 否 | TLS的协议版本,默认为"TLSv1.2"。 | +| useRemoteCipherPrefer | boolean | 否 | 优先使用对等方的密码套件。 | +| signatureAlgorithms | string | 否 | 通信过程中的签名算法,默认为"" 。 | +| cipherSuite | string | 否 | 通信过程中的加密套件,默认为"" 。 | ## Protocol9+ diff --git a/zh-cn/application-dev/reference/apis/js-apis-syscap.md b/zh-cn/application-dev/reference/apis/js-apis-syscap.md new file mode 100644 index 0000000000000000000000000000000000000000..18d5bd486c8d35ffd0eac4f31dc95bbb5e7aed32 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-syscap.md @@ -0,0 +1,42 @@ +# SysCap (系统能力) + +系统能力(SystemCapability,简称SysCap),指操作系统中每一个相对独立的特性。不同的设备对应不同的系统能力集,每个系统能力对应一个或多个API。开发者可根据系统能力来判断是否可以使用某接口。 + +> **说明:** +> +> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + +## canIUse + +canIUse(syscap: string): boolean + +查询系统是否具备某个系统能力。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| syscap | string | 是 | 待查询的系统能力名称。 | + +**返回值:** + +| 类型 | 说明 | +| -------- | -------- | +| boolean | 系统能力查询结果,true表示系统具备该能力,false表示系统不具备。 | + +**示例:** + + ```js +import geolocation from '@ohos.geolocation' + +const isLocationAvailable = canIUse('SystemCapability.Location.Location'); +if (isLocationAvailable) { + geolocation.getCurrentLocation((location) => { + console.log(location.latitude, location.longitue); + }); +} else { + console.log('Location not by this device.'); +} + ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-date-time.md b/zh-cn/application-dev/reference/apis/js-apis-system-date-time.md old mode 100644 new mode 100755 index 42ea974f6325622c1b44fb1b9f4b5a469cc022f7..e2fe390eef26ca29d90b2a04229b64f43b16d6ae --- a/zh-cn/application-dev/reference/apis/js-apis-system-date-time.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-date-time.md @@ -158,7 +158,7 @@ getCurrentTime(isNano?: boolean): Promise<number> | 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ---- | ------------------------- | -| isNano | boolean | 否 | 返回结果是否为纳秒数。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | +| isNano | boolean | 否 | 返回结果是否为纳秒数。
默认值为false。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | **返回值:** @@ -253,7 +253,7 @@ getRealActiveTime(isNano?: boolean): Promise<number> | 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ---- | ----------------------------------- | -| isNano | boolean | 否 | 返回结果是否为纳秒数。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | +| isNano | boolean | 否 | 返回结果是否为纳秒数。
默认值为false。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | **返回值:** @@ -348,7 +348,7 @@ getRealTime(isNano?: boolean): Promise<number> | 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ---- | ------------------------------- | -| isNano | boolean | 否 | 返回结果是否为纳秒数。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | +| isNano | boolean | 否 | 返回结果是否为纳秒数。
默认值为false。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-time.md b/zh-cn/application-dev/reference/apis/js-apis-system-time.md old mode 100644 new mode 100755 index 04383c4b5596704dffda9318f89a357ac69cd565..f2259063030ba2c82b0dc451c4e05fe74deebe23 --- a/zh-cn/application-dev/reference/apis/js-apis-system-time.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-time.md @@ -191,7 +191,7 @@ getCurrentTime(isNano?: boolean): Promise<number> | 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ---- | ------------------------- | -| isNano | boolean | 否 | 返回结果是否为纳秒数。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | +| isNano | boolean | 否 | 返回结果是否为纳秒数。
默认值为false。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | **返回值:** @@ -310,7 +310,7 @@ getRealActiveTime(isNano?: boolean): Promise<number> | 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ---- | ----------------------------------- | -| isNano | boolean | 否 | 返回结果是否为纳秒数。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | +| isNano | boolean | 否 | 返回结果是否为纳秒数。
默认值为false。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | **返回值:** @@ -429,7 +429,7 @@ getRealTime(isNano?: boolean): Promise<number> | 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ---- | ------------------------------- | -| isNano | boolean | 否 | 返回结果是否为纳秒数。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | +| isNano | boolean | 否 | 返回结果是否为纳秒数。
默认值为false。
- true:表示返回结果为纳秒数(ns)。
- false:表示返回结果为毫秒数(ms)。 | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-taskpool.md b/zh-cn/application-dev/reference/apis/js-apis-taskpool.md index 5c1e76e9c42c58ac845df4cdc16264eb238aa6c1..a67b484f61b77df887e2942115cea0277ea7a8e5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-taskpool.md +++ b/zh-cn/application-dev/reference/apis/js-apis-taskpool.md @@ -1,10 +1,10 @@ -# @ohos.taskpool(使用任务池) +# @ohos.taskpool(启动任务池) 任务池(taskpool)作用是为应用程序提供一个多线程的运行环境,降低整体资源的消耗、提高系统的整体性能,且您无需关心线程实例的生命周期。您可以使用任务池API创建后台任务(Task),并对所创建的任务进行如任务执行、任务取消的操作。理论上您可以使用任务池API创建数量不受限制的任务,但是出于内存因素不建议您这样做。此外,不建议您在任务中执行阻塞操作,特别是无限期阻塞操作,长时间的阻塞操作占据工作线程,可能会阻塞其他任务调度,影响您的应用性能。 -您所创建的同一优先级任务的执行顺序可以由您决定,任务真实执行的顺序与您调用任务池API提供的任务执行接口顺序一致。任务默认优先级是MEDIUM。(任务优先级机制暂未支持) +您所创建的同一优先级任务的执行顺序可以由您决定,任务真实执行的顺序与您调用任务池API提供的任务执行接口顺序一致。任务默认优先级是MEDIUM。 -当同一时间待执行的任务数量大于任务池工作线程数量,任务池会根据负载均衡机制进行扩容,增加工作线程数量,减少整体等待时长。同样,当执行的任务数量减少,工作线程数量大于执行任务数量,部分工作线程处于空闲状态,任务池会根据负载均衡机制进行缩容,减少工作线程数量。(负载均衡机制暂未支持) +当同一时间待执行的任务数量大于任务池工作线程数量,任务池会根据负载均衡机制进行扩容,增加工作线程数量,减少整体等待时长。同样,当执行的任务数量减少,工作线程数量大于执行任务数量,部分工作线程处于空闲状态,任务池会根据负载均衡机制进行缩容,减少工作线程数量。 任务池API以数字形式返回错误码。有关各个错误码的更多信息,请参阅文档[语言基础类库错误码](../errorcodes/errorcode-utils.md)。 @@ -32,13 +32,13 @@ import taskpool from '@ohos.taskpool'; **示例:** ```ts -function func(args) { - "use concurrent"; - console.log("func: " + args); +@Concurrent +function printArgs(args) { + console.log("printArgs: " + args); return args; } -async function taskpoolTest() { - let task = new taskpool.Task(func, 100); +async function taskpoolPriority() { + let task = new taskpool.Task(printArgs, 100); let highCount = 0; let mediumCount = 0; @@ -65,7 +65,7 @@ async function taskpoolTest() { }) } } -taskpoolTest(); +taskpoolPriority(); ``` ## Task @@ -99,12 +99,12 @@ Task的构造函数。 ```ts @Concurrent -function func(args) { - console.log("func: " + args); +function printArgs(args) { + console.log("printArgs: " + args); return args; } -let task = new taskpool.Task(func, "this is my first Task"); +let task = new taskpool.Task(printArgs, "this is my first Task"); ``` ### 属性 @@ -151,17 +151,17 @@ execute(func: Function, ...args: unknown[]): Promise\ ```ts @Concurrent -function func(args) { - console.log("func: " + args); +function printArgs(args) { + console.log("printArgs: " + args); return args; } -async function taskpoolTest() { - let value = await taskpool.execute(func, 100); +async function taskpoolExecute() { + let value = await taskpool.execute(printArgs, 100); console.log("taskpool result: " + value); } -taskpoolTest(); +taskpoolExecute(); ``` ## taskpool.execute @@ -199,18 +199,18 @@ execute(task: Task, priority?: Priority): Promise\ ```ts @Concurrent -function func(args) { - console.log("func: " + args); +function printArgs(args) { + console.log("printArgs: " + args); return args; } -async function taskpoolTest() { - let task = new taskpool.Task(func, 100); +async function taskpoolExecute() { + let task = new taskpool.Task(printArgs, 100); let value = await taskpool.execute(task); console.log("taskpool result: " + value); } -taskpoolTest(); +taskpoolExecute(); ``` ## taskpool.cancel @@ -239,14 +239,14 @@ cancel(task: Task): void **任务取消成功示例:** ```ts -function func(args) { - "use concurrent"; - console.log("func: " + args); +@Concurrent +function printArgs(args) { + console.log("printArgs: " + args); return args; } -async function taskpoolTest() { - let task = new taskpool.Task(func, 100); +async function taskpoolCancel() { + let task = new taskpool.Task(printArgs, 100); taskpool.execute(task); try { taskpool.cancel(task); @@ -255,20 +255,20 @@ async function taskpoolTest() { } } -taskpoolTest(); +taskpoolCancel(); ``` **已执行的任务取消失败示例:** ```ts -function func(args) { - "use concurrent"; - console.log("func: " + args); +@Concurrent +function printArgs(args) { + console.log("printArgs: " + args); return args; } -async function taskpoolTest() { - let task = new taskpool.Task(func, 100); +async function taskpoolCancel() { + let task = new taskpool.Task(printArgs, 100); let value = taskpool.execute(task); let start = new Date().getTime(); while (new Date().getTime() - start < 1000) { // 延时1s,确保任务已执行 @@ -282,25 +282,25 @@ async function taskpoolTest() { } } -taskpoolTest(); +taskpoolCancel(); ``` **正在执行的任务取消失败示例:** ```ts -function func(args) { - "use concurrent"; - console.log("func: " + args); +@Concurrent +function printArgs(args) { + console.log("printArgs: " + args); return args; } -async function taskpoolTest() { - let task1 = new taskpool.Task(func, 100); - let task2 = new taskpool.Task(func, 200); - let task3 = new taskpool.Task(func, 300); - let task4 = new taskpool.Task(func, 400); - let task5 = new taskpool.Task(func, 500); - let task6 = new taskpool.Task(func, 600); +async function taskpoolCancel() { + let task1 = new taskpool.Task(printArgs, 100); + let task2 = new taskpool.Task(printArgs, 200); + let task3 = new taskpool.Task(printArgs, 300); + let task4 = new taskpool.Task(printArgs, 400); + let task5 = new taskpool.Task(printArgs, 500); + let task6 = new taskpool.Task(printArgs, 600); let res1 = taskpool.execute(task1); let res2 = taskpool.execute(task2); @@ -315,7 +315,7 @@ async function taskpoolTest() { } } -taskpoolTest(); +taskpoolCancel(); ``` ## 其他说明 @@ -327,7 +327,7 @@ taskpoolTest(); - 仅支持在Stage模型且module的compileMode为esmodule的project中使用taskpool api。确认module的compileMode方法:查看当前module的build-profile.json5,在buildOption中补充"compileMode": "esmodule"。 - taskpool任务只支持引用入参传递或者import的变量,不支持使用闭包变量,使用装饰器@Concurrent进行拦截。 - taskpool任务只支持普通函数或者async函数,不支持类成员函数或者匿名函数,使用装饰器@Concurrent进行拦截。 -- 装饰器@Concurrent仅支持在ets文件使用,在ts文件中创建taskpool任务需使用"use concurrent"。 +- 装饰器@Concurrent仅支持在ets文件使用。 ### 简单使用 @@ -336,23 +336,23 @@ taskpoolTest(); ```ts // 支持普通函数、引用入参传递 @Concurrent -function func(args) { +function printArgs(args) { console.log("func: " + args); return args; } -async function taskpoolTest() { +async function taskpoolExecute() { // taskpool.execute(task) - let task = new taskpool.Task(func, "create task, then execute"); + let task = new taskpool.Task(printArgs, "create task, then execute"); let val1 = await taskpool.execute(task); console.log("taskpool.execute(task) result: " + val1); // taskpool.execute(function) - let val2 = await taskpool.execute(func, "execute task by func"); + let val2 = await taskpool.execute(printArgs, "execute task by func"); console.log("taskpool.execute(function) result: " + val2); } -taskpoolTest(); +taskpoolExecute(); ``` **示例二** @@ -367,24 +367,24 @@ export var c = 2000; import { c } from "./b"; @Concurrent -function test(a) { +function printArgs(a) { console.log(a); console.log(c); return a; } -async function taskpoolTest() { +async function taskpoolExecute() { // taskpool.execute(task) - let task = new taskpool.Task(test, "create task, then execute"); + let task = new taskpool.Task(printArgs, "create task, then execute"); let val1 = await taskpool.execute(task); console.log("taskpool.execute(task) result: " + val1); // taskpool.execute(function) - let val2 = await taskpool.execute(test, "execute task by func"); + let val2 = await taskpool.execute(printArgs, "execute task by func"); console.log("taskpool.execute(function) result: " + val2); } -taskpoolTest(); +taskpoolExecute(); ``` **示例三** @@ -392,57 +392,52 @@ taskpoolTest(); ```ts // 支持async函数 @Concurrent -async function task() { +async function delayExcute() { let ret = await Promise.all([ new Promise(resolve => setTimeout(resolve, 1000, "resolved")) ]); return ret; } -async function taskpoolTest() { - taskpool.execute(task).then((result) => { +async function taskpoolExecute() { + taskpool.execute(delayExcute).then((result) => { console.log("TaskPoolTest task result: " + result); }); } -taskpoolTest(); +taskpoolExecute(); ``` **示例四** ```ts -// 在ts文件中创建taskpool任务需使用"use concurrent" -// c.ts -function test1(n) { - "use concurrent" - return n; +// c.ets +@Concurrent +function strSort(inPutArr) { + let newArr = inPutArr.sort(); + return newArr; } -export async function taskpoolTest1() { - console.log("taskpoolTest1 start"); - var task = new taskpool.Task(test1, 100); +export async function func1() { + console.log("taskpoolTest start"); + let strArray = ['c test string', 'b test string', 'a test string']; + var task = new taskpool.Task(strSort, strArray); var result = await taskpool.execute(task); - console.log("taskpoolTest1 result:" + result); + console.log("func1 result:" + result); } -async function test2() { - "use concurrent" - var ret = await Promise.all([ - new Promise(resolve => setTimeout(resolve, 1000, "resolved")) - ]); - return ret; -} -export async function taskpoolTest2() { +export async function func2() { console.log("taskpoolTest2 start"); - taskpool.execute(test2).then((result) => { - console.log("TaskPoolTest2 result: " + result); + let strArray = ['c test string', 'b test string', 'a test string']; + taskpool.execute(strSort, strArray).then((result) => { + console.log("func2 result: " + result); }); } ``` ```ts -// a.ets(与c.ts在同一目录中) +// a.ets(与c.ets在同一目录中) import { taskpoolTest1, taskpoolTest2 } from "./c"; -taskpoolTest1(); -taskpoolTest2(); +func1(); +func2(); ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-timer.md b/zh-cn/application-dev/reference/apis/js-apis-timer.md index 669a26623435c1d03bf87456c31506d0df8699e4..bdf2ef921ee4b63d3218d82ed1a47efaa2ac2065 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-timer.md +++ b/zh-cn/application-dev/reference/apis/js-apis-timer.md @@ -20,7 +20,7 @@ setTimeout(handler: Function | string, delay?: number, ...arguments: any[]): num | -------- | -------- | -------- | -------- | | handler | Function \| string | 是 | 定时器到期后执行函数。类型为string则打印Error信息,不进行其他处理。 | | delay | number | 否 | 延迟的毫秒数,函数的调用会在该延迟之后发生。如果省略该参数,delay取默认值0,意味着“马上”执行,或尽快执行。 | -| ...arguments | Array<any> | 否 | 附加参数,一旦定时器到期,它们会作为参数传递给handler。 | +| ...arguments | any[] | 否 | 附加参数,一旦定时器到期,它们会作为参数传递给handler。 | **返回值:** @@ -41,7 +41,7 @@ setTimeout(handler: Function | string, delay?: number, ...arguments: any[]): num clearTimeout(timeoutID?: number): void -取消了先前通过调用setTimeout()建立的定时器。 +可取消通过调用setTimeout()建立的定时器。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full @@ -75,7 +75,7 @@ setInterval(handler: Function | string, delay: number, ...arguments: any[]): num | -------- | -------- | -------- | -------- | | handler | Function \| string | 是 | 要重复调用的函数。类型为string则打印Error信息,不进行其他处理。| | delay | number | 是 | 延迟的毫秒数,函数的调用会在该延迟之后发生。 | -| ...arguments | Array<any> | 否 | 附加参数,一旦定时器到期,他们会作为参数传递给handler。 | +| ...arguments | any[] | 否 | 附加参数,一旦定时器到期,他们会作为参数传递给handler。 | **返回值:** @@ -96,7 +96,7 @@ setInterval(handler: Function | string, delay: number, ...arguments: any[]): num clearInterval(intervalID?: number): void -可取消先前通过setInterval()设置的重复定时任务。 +可取消通过setInterval()设置的重复定时任务。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full diff --git a/zh-cn/application-dev/reference/apis/js-apis-userFileManager.md b/zh-cn/application-dev/reference/apis/js-apis-userFileManager.md index d4630b1829c4d6ca578ea92d806b9a92e118c534..b37505664f301282571431399563d1d432604f2b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-userFileManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-userFileManager.md @@ -19,7 +19,7 @@ getUserFileMgr(context: Context): UserFileManager 获取用户数据管理模块的实例,用于访问和修改用户等用户公共媒体数据信息(如音频、视频、图片、文档等)。 -**模型约束:** 此接口仅可在Stage模型下使用。 +**模型约束**: 此接口仅可在Stage模型下使用。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core @@ -27,13 +27,13 @@ getUserFileMgr(context: Context): UserFileManager | 参数名 | 类型 | 必填 | 说明 | | ------- | ------- | ---- | -------------------------- | -| context | [Context](js-apis-inner-app-context.md) | 是 | 传入Ability实例的Context | +| context | [Context](js-apis-inner-app-context.md) | 是 | 传入Ability实例的Context。 | **返回值:** | 类型 | 说明 | | ----------------------------- | :---- | -| [UserFileManager](#userfilemanager) | 媒体库实例 | +| [UserFileManager](#userfilemanager) | 媒体库实例。 | **示例:** @@ -59,8 +59,8 @@ getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult< | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| options | [FetchOptions](#fetchoptions) | 是 | 图片和视频检索选项 | -| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback 返回图片和视频检索结果集 | +| options | [FetchOptions](#fetchoptions) | 是 | 图片和视频检索选项。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback返回图片和视频检索结果集。 | **示例:** @@ -80,7 +80,7 @@ async function example() { console.info('fetchResult success'); let fileAsset = await fetchResult.getFirstObject(); if (fileAsset != undefined) { - console.info("fileAsset.displayName : " + fileAsset.displayName); + console.info('fileAsset.displayName : ' + fileAsset.displayName); } } else { console.error('fetchResult fail' + err); @@ -103,13 +103,13 @@ getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>&g | 参数名 | 类型 | 必填 | 说明 | | ------- | ------------------- | ---- | ---------------- | -| options | [FetchOptions](#fetchoptions) | 是 | 图片和视频检索选项 | +| options | [FetchOptions](#fetchoptions) | 是 | 图片和视频检索选项。 | **返回值:** | 类型 | 说明 | | --------------------------- | -------------- | -| Promise<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 图片和视频数据结果集 | +| Promise<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | Promise对象,返回图片和视频数据结果集。 | **示例:** @@ -129,7 +129,7 @@ async function example() { console.info('fetchResult success'); let fileAsset = await fetchResult.getFirstObject(); if (fileAsset != undefined) { - console.info("fileAsset.displayName :" + fileAsset.displayName); + console.info('fileAsset.displayName :' + fileAsset.displayName); } } } catch (err) { @@ -137,12 +137,11 @@ async function example() { } } ``` - ### createPhotoAsset createPhotoAsset(displayName: string, albumUri: string, callback: AsyncCallback<FileAsset>): void; -创建图片或视频资源,使用callback方式返回结果。 +指定待创建的图片或者视频的文件名和所在相册的uri,创建图片或视频资源,使用callback方式返回结果。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core @@ -152,9 +151,9 @@ createPhotoAsset(displayName: string, albumUri: string, callback: AsyncCallback& | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| displayName | string | 是 | 创建的图片或者视频文件名 | -| albumUri | string | 是 | 创建的图片或者视频所在相册的uri | -| callback | AsyncCallback<[FileAsset](#fileasset)> | 是 | callback 返回创建的图片和视频结果 | +| displayName | string | 是 | 创建的图片或者视频文件名。 | +| albumUri | string | 是 | 创建的图片或者视频所在相册的uri。 | +| callback | AsyncCallback<[FileAsset](#fileasset)> | 是 | callback返回创建的图片和视频结果。 | **示例:** @@ -169,7 +168,7 @@ async function example() { }; let albums = await mgr.getPhotoAlbums(fetchOptions); let album = await albums.getFirstObject(); - let testFileName = "testFile" + Date.now() + ".jpg"; + let testFileName = 'testFile' + Date.now() + '.jpg'; mgr.createPhotoAsset(testFileName, album.albumUri, (err, fileAsset) => { if (fileAsset != undefined) { console.info('createPhotoAsset file displayName' + fileAsset.displayName); @@ -185,7 +184,7 @@ async function example() { createPhotoAsset(displayName: string, callback: AsyncCallback<FileAsset>): void; -创建图片或视频资源,使用callback方式返回结果。 +指定待创建的图片或者视频的文件名,创建图片或视频资源,使用callback方式返回结果。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core @@ -195,15 +194,15 @@ createPhotoAsset(displayName: string, callback: AsyncCallback<FileAsset>): | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| displayName | string | 是 | 创建的图片或者视频文件名 | -| callback | AsyncCallback<[FileAsset](#fileasset)> | 是 | callback 返回创建的图片和视频结果 | +| displayName | string | 是 | 创建的图片或者视频文件名。 | +| callback | AsyncCallback<[FileAsset](#fileasset)> | 是 | callback返回创建的图片和视频结果。 | **示例:** ```ts async function example() { console.info('createPhotoAssetDemo'); - let testFileName = "testFile" + Date.now() + ".jpg"; + let testFileName = 'testFile' + Date.now() + '.jpg'; mgr.createPhotoAsset(testFileName, (err, fileAsset) => { if (fileAsset != undefined) { console.info('createPhotoAsset file displayName' + fileAsset.displayName); @@ -219,7 +218,7 @@ async function example() { createPhotoAsset(displayName: string, albumUri?: string): Promise<FileAsset>; -创建图片或视频资源,使用Promise方式返回结果。 +指定待创建的图片或者视频的文件名和所在相册的uri,创建图片或视频资源,使用Promise方式返回结果。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core @@ -229,14 +228,14 @@ createPhotoAsset(displayName: string, albumUri?: string): Promise<FileAsset&g | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| displayName | string | 是 | 创建的图片或者视频文件名 | -| albumUri | string | 否 | 创建的图片或者视频所在相册的uri | +| displayName | string | 是 | 创建的图片或者视频文件名。 | +| albumUri | string | 否 | 创建的图片或者视频所在相册的uri。 | **返回值:** | 类型 | 说明 | | --------------------------- | -------------- | -| Promise<[FileAsset](#fileasset)> | 返回创建的图片和视频结果 | +| Promise<[FileAsset](#fileasset)> | Promise对象,返回创建的图片和视频结果。 | **示例:** @@ -244,7 +243,7 @@ createPhotoAsset(displayName: string, albumUri?: string): Promise<FileAsset&g async function example() { console.info('createPhotoAssetDemo'); try { - let testFileName = "testFile" + Date.now() + ".jpg"; + let testFileName = 'testFile' + Date.now() + '.jpg'; let fileAsset = await mgr.createPhotoAsset(testFileName); console.info('createPhotoAsset file displayName' + fileAsset.displayName); console.info('createPhotoAsset successfully'); @@ -254,10 +253,163 @@ async function example() { } ``` +### createPhotoAsset + +createPhotoAsset(displayName: string, createOption: PhotoCreateOptions, callback: AsyncCallback<FileAsset>): void; + +指定待创建的图片或者视频的文件名和创建选项,创建图片或视频资源,使用callback方式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| displayName | string | 是 | 创建的图片或者视频文件名。 | +| createOption | [PhotoCreateOptions](#photocreateoptions10) | 是 | 图片或视频的创建选项。 | +| callback | AsyncCallback<[FileAsset](#fileasset)> | 是 | callback返回创建的图片和视频结果。 | + +**示例:** + +```ts +async function example() { + console.info('createPhotoAssetDemo'); + let testFileName = 'testFile' + Date.now() + '.jpg'; + let createOption = { + subType: userFileManager.PhotoSubType.DEFAULT + } + mgr.createPhotoAsset(testFileName, createOption, (err, fileAsset) => { + if (fileAsset != undefined) { + console.info('createPhotoAsset file displayName' + fileAsset.displayName); + console.info('createPhotoAsset successfully'); + } else { + console.error('createPhotoAsset failed, message = ', err); + } + }); +} +``` + +### createPhotoAsset + +createPhotoAsset(displayName: string, createOption: PhotoCreateOptions): Promise<FileAsset>; + +指定待创建的图片或者视频的文件名和创建选项,创建图片或视频资源,使用Promise方式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| displayName | string | 是 | 创建的图片或者视频文件名。 | +| createOption | [PhotoCreateOptions](#photocreateoptions10) | 是 | 图片或视频的创建选项。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------- | -------------- | +| Promise<[FileAsset](#fileasset)> | Promise对象,返回创建的图片和视频结果。 | + +**示例:** + +```ts +async function example() { + console.info('createPhotoAssetDemo'); + try { + let testFileName = 'testFile' + Date.now() + '.jpg'; + let createOption = { + subType: userFileManager.PhotoSubType.DEFAULT + } + let fileAsset = await mgr.createPhotoAsset(testFileName, createOption); + console.info('createPhotoAsset file displayName' + fileAsset.displayName); + console.info('createPhotoAsset successfully'); + } catch (err) { + console.error('createPhotoAsset failed, message = ', err); + } +} +``` + +### createAudioAsset10+ + +createAudioAsset(displayName: string, callback: AsyncCallback<FileAsset>): void; + +创建音频文件资源,使用callback方式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| displayName | string | 是 | 创建的音频文件名。 | +| callback | AsyncCallback<[FileAsset](#fileasset)> | 是 | callback返回创建的音频资源结果。 | + +**示例:** + +```ts +async function example() { + console.info('createAudioAssetDemo'); + let testFileName = 'testFile' + Date.now() + '.mp3'; + mgr.createAudioAsset(testFileName, (err, fileAsset) => { + if (fileAsset != undefined) { + console.info('createAudioAsset file displayName' + fileAsset.displayName); + console.info('createAudioAsset successfully'); + } else { + console.error('createAudioAsset failed, message = ', err); + } + }); +} +``` + +### createAudioAsset10+ + +createAudioAsset(displayName: string): Promise<FileAsset>; + +创建音频文件资源,使用Promise方式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| displayName | string | 是 | 创建的音频文件名。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------- | -------------- | +| Promise<[FileAsset](#fileasset)> | Promise对象,返回创建的音频资源结果。 | + +**示例:** + +```ts +async function example() { + console.info('createAudioAssetDemo'); + try { + let testFileName = 'testFile' + Date.now() + '.mp3'; + let fileAsset = await mgr.createAudioAsset(testFileName); + console.info('createAudioAsset file displayName' + fileAsset.displayName); + console.info('createAudioAsset successfully'); + } catch (err) { + console.error('createAudioAsset failed, message = ', err); + } +} +``` + ### getPhotoAlbums getPhotoAlbums(options: AlbumFetchOptions, callback: AsyncCallback<FetchResult<Album>>): void; + 获取相册,使用callback方式返回结果。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core @@ -268,8 +420,8 @@ getPhotoAlbums(options: AlbumFetchOptions, callback: AsyncCallback<FetchResul | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| options | [AlbumFetchOptions](#albumfetchoptions) | 是 | 相册检索选项 | -| callback | AsyncCallback<[FetchResult](#fetchresult)<[Album](#album)>> | 是 | callback 返回相册检索结果 | +| options | [AlbumFetchOptions](#albumfetchoptions) | 是 | 相册检索选项。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[Album](#album)>> | 是 | callback返回相册检索结果。 | **示例:** @@ -314,13 +466,13 @@ getPhotoAlbums(options: AlbumFetchOptions): Promise<FetchResult<Album>& | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| options | [AlbumFetchOptions](#albumfetchoptions) | 是 | 相册检索选项 | +| options | [AlbumFetchOptions](#albumfetchoptions) | 是 | 相册检索选项。 | **返回值:** | 类型 | 说明 | | --------------------------- | -------------- | -| Promise<[FetchResult](#fetchresult)<[Album](#album)>> | Promise 返回相册检索结果 | +| Promise<[FetchResult](#fetchresult)<[Album](#album)>> | Promise对象,返回相册检索结果。 | **示例:** @@ -344,259 +496,574 @@ async function example() { } ``` -### getPrivateAlbum +### createAlbum10+ -getPrivateAlbum(type: PrivateAlbumType, callback: AsyncCallback<FetchResult<PrivateAlbum>>): void; +createAlbum(name: string, callback: AsyncCallback<Album>): void; -获取系统相册,使用 callback 方式返回系统相册的数组。 +创建相册,使用callback方式返回结果。 + +待创建的相册名参数规格为: +- 相册名字符串长度为1~255。 +- 不允许出现的非法英文字符,包括:
. .. \ / : * ? " ' ` < > | { } [ ] +- 英文字符大小写不敏感。 +- 相册名不允许重名。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**需要权限**:ohos.permission.READ_IMAGEVIDEO +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| type | [PrivateAlbumType](#privatealbumtype) | 是 | 系统相册类型 | -| callback | AsyncCallback<[FetchResult](#fetchresult)<[PrivateAlbum](#privatealbum)>> | 是 | callback 返回相册检索结果 | +| name | string | 是 | 待创建相册的相册名。 | +| callback | AsyncCallback<[Album](#album)> | 是 | callback返回创建的相册实例。 | **示例:** ```ts async function example() { - console.info('getPrivateAlbumDemo'); - mgr.getPrivateAlbum(userFileManager.PrivateAlbumType.TYPE_TRASH, async (err, fetchResult) => { - if (fetchResult != undefined) { - let trashAlbum = await fetchResult.getFirstObject(); - console.info('first album.albumName = ' + trashAlbum.albumName); - } else { - console.error('getPrivateAlbum failed. message = ', err); + console.info('createAlbumDemo'); + let albumName = 'newAlbumName' + new Date().getTime(); + mgr.createAlbum(albumName, (err, album) => { + if (err) { + console.error('createAlbumCallback failed with err: ' + err); + return; } + console.info('createAlbumCallback successfully, album: ' + album.albumName + ' album uri: ' + album.albumUri); }); } ``` -### getPrivateAlbum +### createAlbum10+ -getPrivateAlbum(type: PrivateAlbumType): Promise<FetchResult<PrivateAlbum>>; +createAlbum(name: string): Promise<Album>; +创建相册,使用Promise方式返回结果。 -获取系统相册,使用Promise方式返回结果。 +待创建的相册名参数规格为: +- 相册名字符串长度为1~255。 +- 不允许出现的非法英文字符,包括:
. .. \ / : * ? " ' ` < > | { } [ ] +- 英文字符大小写不敏感。 +- 相册名不允许重名。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**需要权限**:ohos.permission.READ_IMAGEVIDEO +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| type | [PrivateAlbumType](#privatealbumtype) | 是 | 系统相册类型 | +| name | string | 是 | 待创建相册的相册名。 | **返回值:** | 类型 | 说明 | | --------------------------- | -------------- | -| Promise<[FetchResult](#fetchresult)<[PrivateAlbum](#privatealbum)>> | Promise 返回相册检索结果 | +| Promise<[Album](#album)> | Promise对象,返回创建的相册实例。 | **示例:** ```ts async function example() { - console.info('getPrivateAlbumDemo'); - try { - let fetchResult = await mgr.getPrivateAlbum(userFileManager.PrivateAlbumType.TYPE_TRASH); - let trashAlbum = await fetchResult.getFirstObject(); - console.info('first album.albumName = ' + trashAlbum.albumName); - } catch (err) { - console.error('getPrivateAlbum failed. message = ', err); - } + console.info('createAlbumDemo'); + let albumName = 'newAlbumName' + new Date().getTime(); + mgr.createAlbum(albumName).then((album) => { + console.info('createAlbumPromise successfully, album: ' + album.albumName + ' album uri: ' + album.albumUri); + }).catch((err) => { + console.error('createAlbumPromise failed with err: ' + err); + }); } ``` -### getAudioAssets +### deleteAlbums10+ -getAudioAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<FileAsset>>): void; +deleteAlbums(albums: Array<Album>, callback: AsyncCallback<void>): void; -获取音频文件,使用callback方式返回结果。 +删除相册,使用callback方式返回结果。 + +删除相册前需先确保相册存在,只能删除用户相册。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**需要权限**:ohos.permission.READ_AUDIO +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| options | [FetchOptions](#fetchoptions) | 是 | 检索选项 | -| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback 返回音频检索结果 | +| albums | Array<[Album](#album)> | 是 | 待删除相册的数组。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | **示例:** ```ts -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - async function example() { - console.info('getAudioAssets'); + // 示例代码为删除名称包含newAlbumName的第一个相册。 + console.info('deleteAlbumsDemo'); let predicates = new dataSharePredicates.DataSharePredicates(); + predicates.like('album_name', '%newAlbumName%'); let fetchOptions = { fetchColumns: [], predicates: predicates }; - - mgr.getAudioAssets(fetchOptions, async (err, fetchResult) => { - if (fetchResult != undefined) { - console.info('fetchFileResult success'); - let fileAsset = await fetchResult.getFirstObject(); - if (fileAsset != undefined) { - console.info("fileAsset.displayName :" + fileAsset.displayName); - } - } else { - console.error('fetchFileResult fail' + err); + let fetchResult = await mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC, fetchOptions); + let album = await fetchResult.getFirstObject(); + mgr.deleteAlbums([album], (err) => { + if (err) { + console.error('deletePhotoAlbumsCallback failed with err: ' + err); + return; } + console.info('deletePhotoAlbumsCallback successfully'); }); + fetchResult.close(); } ``` -### getAudioAssets +### deleteAlbums10+ -getAudioAssets(options: FetchOptions): Promise<FetchResult<FileAsset>>; +deleteAlbums(albums: Array<Album>): Promise<void>; -获取音频文件,使用callback方式返回结果。 +删除相册,使用Promise方式返回结果。 + +删除相册前需先确保相册存在,只能删除用户相册。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**需要权限**:ohos.permission.READ_AUDIO +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------ | ---- | ------------------------- | -| options | [FetchOptions](#fetchoptions) | 是 | 检索选项 | +| albums | Array<[Album](#album)> | 是 | 待删除相册的数组。 | **返回值:** | 类型 | 说明 | | --------------------------- | -------------- | -| Promise<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | Promise 返回音频检索结果 | +| Promise<void> | Promise对象,返回void。 | **示例:** ```ts -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - async function example() { - console.info('getAudioAssets'); + // 示例代码为删除名称包含newAlbumName的第一个相册。 + console.info('deleteAlbumsDemo'); let predicates = new dataSharePredicates.DataSharePredicates(); + predicates.like('album_name', '%newAlbumName%'); let fetchOptions = { fetchColumns: [], predicates: predicates }; - try { - var fetchResult = await mgr.getAudioAssets(fetchOptions); - } catch (err) { - console.error('getAudioAssets failed, message = ', err); - } - - if (fetchResult != undefined) { - console.info('fetchFileResult success'); - let fileAsset = await fetchResult.getFirstObject(); - if (fileAsset != undefined) { - console.info("fileAsset.displayName :" + fileAsset.displayName); - } - } + let fetchResult = await mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC, fetchOptions); + let album = await fetchResult.getFirstObject(); + mgr.deleteAlbums([album]).then(() => { + console.info('deletePhotoAlbumsPromise successfully'); + }).catch((err) => { + console.error('deletePhotoAlbumsPromise failed with err: ' + err); + }); + fetchResult.close(); } ``` -### delete +### getAlbums10+ -delete(uri: string, callback: AsyncCallback<void>): void; +getAlbums(type: AlbumType, subType: AlbumSubType, options: FetchOptions, callback: AsyncCallback<FetchResult<Album>>): void; -删除媒体文件,删除的文件进入到回收站。 +根据检索选项和相册类型获取相册,使用callback方式返回结果。 -**需要权限**:ohos.permission.READ_IMAGEVIDEO 和 ohos.permission.WRITE_IMAGEVIDEO 或 ohos.permission.READ_AUDIO 和 ohos.permission.WRITE_AUDIO +获取相册前需先保证相册存在。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**需要权限**:ohos.permission.READ_IMAGEVIDEO -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ---------- | -| uri | string | 是 | 媒体文件uri | -| callback | AsyncCallback<void> | 是 | 回调返回空 | +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| type | [AlbumType](#albumtype10) | 是 | 相册类型。 | +| subType | [AlbumSubType](#albumsubtype10) | 是 | 相册子类型。 | +| options | [FetchOptions](#fetchoptions) | 是 | 检索选项。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[Album](#album)>> | 是 | callback返回获取相册的结果集。 | -**示例**: +**示例:** ```ts -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - async function example() { - console.info('deleteAssetDemo'); + // 示例代码中为获取相册名中包含newAlbumName的第一个相册。 + console.info('getAlbumsDemo'); let predicates = new dataSharePredicates.DataSharePredicates(); + predicates.like('album_name', '%newAlbumName%'); let fetchOptions = { fetchColumns: [], predicates: predicates }; - try { - const fetchResult = await mgr.getPhotoAssets(fetchOptions); - var asset = await fetchResult.getFirstObject(); - } catch (err) { - console.info('fetch failed, message =', err); - } + mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC, fetchOptions, async (err, fetchResult) => { + if (err) { + console.error('getAlbumsCallback failed with err: ' + err); + return; + } + if (fetchResult == undefined) { + console.error('getAlbumsCallback fetchResult is undefined'); + return; + } + let album = await fetchResult.getFirstObject(); + console.info('getAlbumsCallback successfully, albumName: ' + album.albumName); + fetchResult.close(); + }); +} +``` - if (asset == undefined) { - console.error('asset not exist'); - return; - } - mgr.delete(asset.uri, (err) => { - if (err == undefined) { - console.info("delete successfully"); - } else { - console.error("delete failed with error: " + err); +### getAlbums10+ + +getAlbums(type: AlbumType, subType: AlbumSubType, callback: AsyncCallback<FetchResult<Album>>): void; + +根据相册类型获取相册,使用callback方式返回结果。 + +获取相册前需先保证相册存在。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.READ_IMAGEVIDEO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| type | [AlbumType](#albumtype10) | 是 | 相册类型。 | +| subType | [AlbumSubType](#albumsubtype10) | 是 | 相册子类型。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[Album](#album)>> | 是 | callback返回获取相册的结果集。 | + +**示例:** + +```ts +async function example() { + // 示例代码中为获取统相册VIDEO,默认已预置。 + console.info('getAlbumsDemo'); + mgr.getAlbums(userFileManager.AlbumType.SYSTEM, userFileManager.AlbumSubType.VIDEO, async (err, fetchResult) => { + if (err) { + console.error('getAlbumsCallback failed with err: ' + err); + return; } + if (fetchResult == undefined) { + console.error('getAlbumsCallback fetchResult is undefined'); + return; + } + let album = await fetchResult.getFirstObject(); + console.info('getAlbumsCallback successfully, albumUri: ' + album.albumUri); + fetchResult.close(); }); } ``` -### delete +### getAlbums10+ -delete(uri: string): Promise<void>; +getAlbums(type: AlbumType, subType: AlbumSubType, options?: FetchOptions): Promise<FetchResult<Album>>; -删除媒体文件,删除的文件进入到回收站。 +根据检索选项和相册类型获取相册,使用Promise方式返回结果。 -**需要权限**:ohos.permission.READ_IMAGEVIDEO 和 ohos.permission.WRITE_IMAGEVIDEO 或 ohos.permission.READ_AUDIO 和 ohos.permission.WRITE_AUDIO +获取相册前需先保证相册存在。 **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**需要权限**:ohos.permission.READ_IMAGEVIDEO -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ---------- | -| uri | string | 是 | 媒体文件uri | +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| type | [AlbumType](#albumtype10) | 是 | 相册类型。 | +| subType | [AlbumSubType](#albumsubtype10) | 是 | 相册子类型。 | +| options | [FetchOptions](#fetchoptions) | 否 | 检索选项,不填时默认根据相册类型检索。 | **返回值:** -| 类型 | 说明 | -| --------------------------------------- | ----------------- | -| Promise<void>| 回调返回空 | +| 类型 | 说明 | +| --------------------------- | -------------- | +| Promise<[FetchResult](#fetchresult)<[Album](#album)>> | Promise对象,返回获取相册的结果集。 | -**示例**: +**示例:** ```ts -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - async function example() { - console.info('deleteDemo'); + // 示例代码中为获取相册名中包含newAlbumName的第一个相册。 + console.info('getAlbumsDemo'); let predicates = new dataSharePredicates.DataSharePredicates(); + predicates.like('album_name', '%newAlbumName%'); let fetchOptions = { fetchColumns: [], predicates: predicates }; - try { - const fetchResult = await mgr.getPhotoAssets(fetchOptions); - var asset = await fetchResult.getFirstObject(); - } catch (err) { + mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC, fetchOptions).then( async (fetchResult) => { + if (fetchResult == undefined) { + console.error('getAlbumsPromise fetchResult is undefined'); + return; + } + let album = await fetchResult.getFirstObject(); + console.info('getAlbumsPromise successfully, albumName: ' + album.albumName); + fetchResult.close(); + }).catch((err) => { + console.error('getAlbumsPromise failed with err: ' + err); + }); +} +``` + +### getPrivateAlbum + +getPrivateAlbum(type: PrivateAlbumType, callback: AsyncCallback<FetchResult<PrivateAlbum>>): void; + +获取系统相册,使用 callback 方式返回系统相册的数组。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.READ_IMAGEVIDEO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| type | [PrivateAlbumType](#privatealbumtype) | 是 | 系统相册类型。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[PrivateAlbum](#privatealbum)>> | 是 | callback返回相册检索结果。 | + +**示例:** + +```ts +async function example() { + console.info('getPrivateAlbumDemo'); + mgr.getPrivateAlbum(userFileManager.PrivateAlbumType.TYPE_TRASH, async (err, fetchResult) => { + if (fetchResult != undefined) { + let trashAlbum = await fetchResult.getFirstObject(); + console.info('first album.albumName = ' + trashAlbum.albumName); + } else { + console.error('getPrivateAlbum failed. message = ', err); + } + }); +} +``` + +### getPrivateAlbum + +getPrivateAlbum(type: PrivateAlbumType): Promise<FetchResult<PrivateAlbum>>; + +获取系统相册,使用Promise方式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.READ_IMAGEVIDEO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| type | [PrivateAlbumType](#privatealbumtype) | 是 | 系统相册类型。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------- | -------------- | +| Promise<[FetchResult](#fetchresult)<[PrivateAlbum](#privatealbum)>> | Promise对象,返回相册检索结果。 | + +**示例:** + +```ts +async function example() { + console.info('getPrivateAlbumDemo'); + try { + let fetchResult = await mgr.getPrivateAlbum(userFileManager.PrivateAlbumType.TYPE_TRASH); + let trashAlbum = await fetchResult.getFirstObject(); + console.info('first album.albumName = ' + trashAlbum.albumName); + } catch (err) { + console.error('getPrivateAlbum failed. message = ', err); + } +} +``` + +### getAudioAssets + +getAudioAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<FileAsset>>): void; + +获取音频文件,使用callback方式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.READ_AUDIO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| options | [FetchOptions](#fetchoptions) | 是 | 检索选项。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback返回音频检索结果。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('getAudioAssets'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOptions = { + fetchColumns: [], + predicates: predicates + }; + + mgr.getAudioAssets(fetchOptions, async (err, fetchResult) => { + if (fetchResult != undefined) { + console.info('fetchFileResult success'); + let fileAsset = await fetchResult.getFirstObject(); + if (fileAsset != undefined) { + console.info('fileAsset.displayName :' + fileAsset.displayName); + } + } else { + console.error('fetchFileResult fail' + err); + } + }); +} +``` + +### getAudioAssets + +getAudioAssets(options: FetchOptions): Promise<FetchResult<FileAsset>>; + + +获取音频文件,使用callback方式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**需要权限**:ohos.permission.READ_AUDIO + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------ | ---- | ------------------------- | +| options | [FetchOptions](#fetchoptions) | 是 | 检索选项。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------- | -------------- | +| Promise<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | Promise对象,返回音频检索结果。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('getAudioAssets'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOptions = { + fetchColumns: [], + predicates: predicates + }; + try { + var fetchResult = await mgr.getAudioAssets(fetchOptions); + } catch (err) { + console.error('getAudioAssets failed, message = ', err); + } + + if (fetchResult != undefined) { + console.info('fetchFileResult success'); + let fileAsset = await fetchResult.getFirstObject(); + if (fileAsset != undefined) { + console.info('fileAsset.displayName :' + fileAsset.displayName); + } + } +} +``` + +### delete + +delete(uri: string, callback: AsyncCallback<void>): void; + +删除媒体文件,删除的文件进入到回收站。 + +**需要权限**:ohos.permission.READ_IMAGEVIDEO 和 ohos.permission.WRITE_IMAGEVIDEO 或 ohos.permission.READ_AUDIO 和 ohos.permission.WRITE_AUDIO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| uri | string | 是 | 媒体文件uri。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('deleteAssetDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOptions = { + fetchColumns: [], + predicates: predicates + }; + try { + const fetchResult = await mgr.getPhotoAssets(fetchOptions); + var asset = await fetchResult.getFirstObject(); + } catch (err) { + console.info('fetch failed, message =', err); + } + + if (asset == undefined) { + console.error('asset not exist'); + return; + } + mgr.delete(asset.uri, (err) => { + if (err == undefined) { + console.info('delete successfully'); + } else { + console.error('delete failed with error: ' + err); + } + }); +} +``` + +### delete + +delete(uri: string): Promise<void>; + +删除媒体文件,删除的文件进入到回收站。 + +**需要权限**:ohos.permission.READ_IMAGEVIDEO 和 ohos.permission.WRITE_IMAGEVIDEO 或 ohos.permission.READ_AUDIO 和 ohos.permission.WRITE_AUDIO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| uri | string | 是 | 媒体文件uri。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------------- | ----------------- | +| Promise<void>| Promise对象,返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('deleteDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOptions = { + fetchColumns: [], + predicates: predicates + }; + try { + const fetchResult = await mgr.getPhotoAssets(fetchOptions); + var asset = await fetchResult.getFirstObject(); + } catch (err) { console.info('fetch failed, message =', err); } @@ -606,9 +1073,9 @@ async function example() { } try { await mgr.delete(asset.uri); - console.info("delete successfully"); + console.info('delete successfully'); } catch (err) { - console.error("delete failed with error: " + err); + console.error('delete failed with error: ' + err); } } ``` @@ -619,6 +1086,8 @@ on(type: ChangeEvent, callback: Callback<void>): void 打开文件管理库变更通知,使用callback方式返回异步结果。 +此接口即将废弃,请使用[on10+](#on10)的新接口 + **系统能力**:SystemCapability.FileManagement.UserFileManager.Core **参数:** @@ -626,7 +1095,7 @@ on(type: ChangeEvent, callback: Callback<void>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------- | ---- | ------------------------------------------------------------ | | type | [ChangeEvent](#changeevent) | 是 | 媒体类型
'deviceChange': 注册设备变更
'albumChange': 相册变更
'imageChange': 图片文件变更
'audioChange':  音频文件变更
'videoChange':  视频文件变更
'remoteFileChange': 注册设备上文件变更 | -| callback | Callback<void> | 是 | 回调返回空 | +| callback | Callback<void> | 是 | callback返回void | **示例:** @@ -639,7 +1108,7 @@ async function example() { // image file had changed, do something }); try { - let testFileName = "testFile" + Date.now() + ".jpg"; + let testFileName = 'testFile' + Date.now() + '.jpg'; let fileAsset = await mgr.createPhotoAsset(testFileName); console.info('createPhotoAsset file displayName' + fileAsset.displayName); console.info('createPhotoAsset successfully'); @@ -648,9 +1117,9 @@ async function example() { } //sleep 1s if (count > 0) { - console.info("onDemo success"); + console.info('onDemo success'); } else { - console.error("onDemo fail"); + console.error('onDemo fail'); } mgr.off('imageChange', () => { // stop listening success @@ -664,14 +1133,16 @@ off(type: ChangeEvent, callback?: Callback<void>): void 关闭文件管理库变更通知,使用callback方式返回异步结果。 +此接口即将废弃,请使用[off10+](#off10)的新接口 + **系统能力**:SystemCapability.FileManagement.UserFileManager.Core **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| type | [ChangeEvent](#changeevent) | 是 | 媒体类型
'deviceChange': 注册设备变更
'albumChange': 相册变更
'imageChange': 图片文件变更
'audioChange':  音频文件变更
'videoChange':  视频文件变更
'remoteFileChange': 注册设备上文件变更 | -| callback | Callback<void> | 否 | 回调返回空 | +| type | [ChangeEvent](#changeevent) | 是 | 媒体类型
'deviceChange': 注册设备变更
'albumChange': 相册变更
'imageChange': 图片文件变更
'audioChange':  音频文件变更
'videoChange':  视频文件变更
'remoteFileChange': 注册设备上文件变更。 | +| callback | Callback<void> | 否 | callback返回void。 | **示例:** @@ -689,7 +1160,7 @@ async function example() { }); try { - let testFileName = "testFile" + Date.now() + ".jpg"; + let testFileName = 'testFile' + Date.now() + '.jpg'; let fileAsset = await mgr.createPhotoAsset(testFileName); console.info('createPhotoAsset file displayName' + fileAsset.displayName); console.info('createPhotoAsset successfully'); @@ -698,9 +1169,9 @@ async function example() { } //sleep 1s if (count == 0) { - console.info("offDemo success"); + console.info('offDemo success'); } else { - console.error("offDemo fail"); + console.error('offDemo fail'); } } ``` @@ -717,7 +1188,7 @@ getActivePeers(callback: AsyncCallback<Array<PeerInfo>>): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------- | ---- | ------------ | -| callback | AsyncCallback<Array<[PeerInfo](#peerinfo)>> | 是 | 返回在线设备列表 | +| callback | AsyncCallback<Array<[PeerInfo](#peerinfo)>> | 是 | 返回在线设备列表。 | **示例:** @@ -749,7 +1220,7 @@ getActivePeers(): Promise<Array<PeerInfo>>; | 类型 | 说明 | | --------------------------- | ----------------------------- | -| Promise<Array<[PeerInfo](#peerinfo)>> | Promise实例,返回在线设备列表 | +| Promise<Array<[PeerInfo](#peerinfo)>> | Promise对象,返回在线设备列表。 | **示例:** @@ -784,7 +1255,7 @@ getAllPeers(callback: AsyncCallback<Array<PeerInfo>>): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------- | ---- | ------------ | -| callback | AsyncCallback<Array<[PeerInfo](#peerinfo)>> | 是 | 返回在线设备列表 | +| callback | AsyncCallback<Array<[PeerInfo](#peerinfo)>> | 是 | 返回在线设备列表。 | **示例:** @@ -816,7 +1287,7 @@ getAllPeers(): Promise<Array<PeerInfo>>; | 类型 | 说明 | | --------------------------- | ----------------------------- | -| Promise<Array<[PeerInfo](#peerinfo)>> | Promise实例,返回所有设备列表 | +| Promise<Array<[PeerInfo](#peerinfo)>> | Promise对象,返回所有设备列表。 | **示例:** @@ -852,7 +1323,7 @@ release(callback: AsyncCallback<void>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | -------------------- | -| callback | AsyncCallback<void> | 是 | 回调表示成功还是失败 | +| callback | AsyncCallback<void> | 是 | 回调表示成功还是失败。 | **示例:** @@ -882,7 +1353,7 @@ release(): Promise<void> | 类型 | 说明 | | ------------------- | --------------------------------- | -| Promise<void> | Promise实例,用于获取异步返回结果 | +| Promise<void> | Promise对象,返回void。 | **示例:** @@ -898,22 +1369,127 @@ async function example() { } ``` -## FileAsset +### on10+ -提供封装文件属性的方法。 +on(uri: string, forSubUri: boolean, callback: Callback<ChangeData>) : void -### 属性 +打开对指定uri的监听,使用callback方式返回异步结果。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------------------------- | ------------------------ | ---- | ---- | ------------------------------------------------------ | -| uri | string | 是 | 否 | 文件资源uri(如:dataability:///media/image/2) | -| fileType | [FileType](#filetype) | 是 | 否 | 媒体文件类型 | -| displayName | string | 是 | 是 | 显示文件名,包含后缀名 | +**参数:** +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------------------------- | ---- | ------------------------------------------------------------ | +| uri | string | 是 | FileAsset的uri, Album的uri或[DefaultChangeUri](#defaultchangeuri10)的值。 | +| forSubUri | boolean | 是 | 是否模糊监听,uri为相册uri时,forSubUri 为true能监听到相册中文件的变化,如果是false只能监听相册本身变化。uri为fileAsset时,forSubUri 为true、false没有区别,uri为DefaultChangeUri时,forSubUri必须为true,如果为false将找不到该uri,收不到任何消息。 | +| callback | Callback<[ChangeData](#changedata10)> | 是 | 返回要监听的[ChangeData](#changedata10)。注:uri可以注册多个不同的callback监听,[off10+](#off10)可以关闭该uri所有监听,也可以关闭指定callback的监听。 | -### get +**示例:** + +```ts +async function example() { + console.info('onDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOptions = { + fetchColumns: [], + predicates: predicates + }; + let fetchResult = await mgr.getPhotoAssets(fetchOptions); + let fileAsset = await fetchResult.getFirstObject(); + if (fileAsset != undefined) { + console.info('fileAsset.displayName : ' + fileAsset.displayName); + } + let onCallback1 = (changeData) => { + console.info('onCallback1 success, changData: ' + JSON.stringify(changeData)); + //file had changed, do something + } + let onCallback2 = (changeData) => { + console.info('onCallback2 success, changData: ' + JSON.stringify(changeData)); + //file had changed, do something + } + // 注册onCallback1监听 + mgr.on(fileAsset.uri, false, onCallback1); + // 注册onCallback2监听 + mgr.on(fileAsset.uri, false, onCallback2); + + fileAsset.favorite(true, (err) => { + if (err == undefined) { + console.info('favorite successfully'); + } else { + console.error('favorite failed with error:' + err); + } + }); +} +``` + +### off10+ + + off(uri: string, callback?: Callback<ChangeData>): void + +关闭指定uri的监听,一个uri可以注册多个监听,存在多个callback监听时,可以取消指定注册的callback的监听;不指定callback时解除该uri的所有监听。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------- | ---- | ------------------------------------------------------------ | +| uri | string | 是 | FileAsset的uri, Album的uri或[DefaultChangeUri](#defaultchangeuri10)的值。 | +| callback | Callback<[ChangeData](#changedata10)> | 否 | 解除[on10+](#on10)注册时的callback的监听,不填时,解除该uri的所有监听。注:off指定注册的callback后不会进入此回调。 | + +**示例:** + +```ts +async function example() { + console.info('offDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOptions = { + fetchColumns: [], + predicates: predicates + }; + let fetchResult = await mgr.getPhotoAssets(fetchOptions); + let fileAsset = await fetchResult.getFirstObject(); + if (fileAsset != undefined) { + console.info('fileAsset.displayName : ' + fileAsset.displayName); + } + let onCallback1 = (changeData) => { + console.info('onCallback1 on'); + } + let onCallback2 = (changeData) => { + console.info('onCallback2 on'); + } + // 注册onCallback1监听 + mgr.on(fileAsset.uri, false, onCallback1); + // 注册onCallback2监听 + mgr.on(fileAsset.uri, false, onCallback2); + // 关闭onCallback1监听,onCallback2 继续监听 + mgr.off(fileAsset.uri, onCallback1); + fileAsset.favorite(true, (err) => { + if (err == undefined) { + console.info('favorite successfully'); + } else { + console.error('favorite failed with error:' + err); + } + }); +} +``` + +## FileAsset + +提供封装文件属性的方法。 + +### 属性 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------------------------- | ------------------------ | ---- | ---- | ------------------------------------------------------ | +| uri | string | 是 | 否 | 文件资源uri(如:file://media/image/2)。 | +| fileType | [FileType](#filetype) | 是 | 否 | 媒体文件类型 | +| displayName | string | 是 | 是 | 显示文件名,包含后缀名。 | + +### get get(member: string): MemberType; @@ -925,7 +1501,7 @@ get(member: string): MemberType; | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ----- | -| member | string | 是 | 成员参数名称例如:ImageVideoKey.URI | +| member | string | 是 | 成员参数名称例如:ImageVideoKey.URI。 | **示例:** @@ -937,7 +1513,7 @@ async function example() { try { let predicates = new dataSharePredicates.DataSharePredicates(); let fetchOption = { - fetchColumns: [], + fetchColumns: ['title'], predicates: predicates }; let fetchResult = await mgr.getPhotoAssets(fetchOption); @@ -963,8 +1539,8 @@ set(member: string, value: string): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ----- | -| member | string | 是 | 成员参数名称例如:ImageVideoKey.URI | -| value | string | 是 | 设置成员参数名称,只能修改ImageVideoKey.TITLE的值 | +| member | string | 是 | 成员参数名称例如:ImageVideoKey.URI。 | +| value | string | 是 | 设置成员参数名称,只能修改ImageVideoKey.DISPLAY_NAME的值。 | **示例:** @@ -981,8 +1557,8 @@ async function example() { }; let fetchResult = await mgr.getPhotoAssets(fetchOption); let fileAsset = await fetchResult.getFirstObject(); - let title = userFileManager.ImageVideoKey.TITLE; - fileAsset.set(title.toString(), "newTitle"); + let displayName = userFileManager.ImageVideoKey.DISPLAY_NAME; + fileAsset.set(displayName, 'newDisplayName1'); } catch (err) { console.error('release failed. message = ', err); } @@ -1003,7 +1579,7 @@ commitModify(callback: AsyncCallback<void>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ----- | -| callback | AsyncCallback<void> | 是 | 回调返回空 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | **示例:** @@ -1019,14 +1595,14 @@ async function example() { }; let fetchResult = await mgr.getPhotoAssets(fetchOption); let fileAsset = await fetchResult.getFirstObject(); - let title = userFileManager.ImageVideoKey.TITLE; - let fileAssetTitle = fileAsset.get(title.toString()); - console.info('fileAsset Get fileAssetTitle = ', fileAssetTitle); - fileAsset.set(title.toString(), "newTitle"); + let displayName = userFileManager.ImageVideoKey.DISPLAY_NAME; + let fileAssetDisplayName = fileAsset.get(displayName); + console.info('fileAsset get fileAssetDisplayName = ', fileAssetDisplayName); + fileAsset.set(displayName, 'newDisplayName2'); fileAsset.commitModify((err) => { if (err == undefined) { - let newFileAssetTitle = fileAsset.get(title.toString()); - console.info('fileAsset Get newFileAssetTitle = ', newFileAssetTitle); + let newFileAssetDisplayName = fileAsset.get(displayName); + console.info('fileAsset get newFileAssetDisplayName = ', newFileAssetDisplayName); } else { console.error('commitModify failed, message =', err); } @@ -1048,7 +1624,7 @@ commitModify(): Promise<void> | 类型 | 说明 | | ------------------- | ---------- | -| Promise<void> | Promise返回空 | +| Promise<void> | Promise对象,返回void。 | **示例:** @@ -1064,14 +1640,14 @@ async function example() { }; let fetchResult = await mgr.getPhotoAssets(fetchOption); let fileAsset = await fetchResult.getFirstObject(); - let title = userFileManager.ImageVideoKey.TITLE; - let fileAssetTitle = fileAsset.get(title.toString()); - console.info('fileAsset Get fileAssetTitle = ', fileAssetTitle); - fileAsset.set(title.toString(), "newTitle"); + let displayName = userFileManager.ImageVideoKey.DISPLAY_NAME; + let fileAssetDisplayName = fileAsset.get(displayName); + console.info('fileAsset get fileAssetDisplayName = ', fileAssetDisplayName); + fileAsset.set(displayName, 'newDisplayName3'); try { await fileAsset.commitModify(); - let newFileAssetTitle = fileAsset.get(title.toString()); - console.info('fileAsset Get newFileAssetTitle = ', newFileAssetTitle); + let newFileAssetDisplayName = fileAsset.get(displayName); + console.info('fileAsset get newFileAssetDisplayName = ', newFileAssetDisplayName); } catch (err) { console.error('release failed. message = ', err); } @@ -1090,19 +1666,19 @@ open(mode: string, callback: AsyncCallback<number>): void **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数** +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------- | ---- | ----------------------------------- | -| mode | string | 是 | 打开文件方式,如:'r'(只读), 'w'(只写), 'rw'(读写) | -| callback | AsyncCallback<number> | 是 | 回调返回文件描述符 | +| mode | string | 是 | 打开文件方式,如:'r'(只读), 'w'(只写), 'rw'(读写)。 | +| callback | AsyncCallback<number> | 是 | callback返回文件描述符。 | **示例:** ```ts async function example() { console.info('openDemo'); - let testFileName = "testFile" + Date.now() + ".jpg"; + let testFileName = 'testFile' + Date.now() + '.jpg'; const fileAsset = await mgr.createPhotoAsset(testFileName); fileAsset.open('rw', (err, fd) => { if (fd != undefined) { @@ -1131,13 +1707,13 @@ open(mode: string): Promise<number> | 参数名 | 类型 | 必填 | 说明 | | ---- | ------ | ---- | ----------------------------------- | -| mode | string | 是 | 打开文件方式,如:'r'(只读), 'w'(只写), 'rw'(读写) | +| mode | string | 是 | 打开文件方式,如:'r'(只读), 'w'(只写), 'rw'(读写)。 | **返回值:** | 类型 | 说明 | | --------------------- | ------------- | -| Promise<number> | Promise返回文件描述符 | +| Promise<number> | Promise对象,返回文件描述符。 | **示例:** @@ -1145,7 +1721,7 @@ open(mode: string): Promise<number> async function example() { console.info('openDemo'); try { - let testFileName = "testFile" + Date.now() + ".jpg"; + let testFileName = 'testFile' + Date.now() + '.jpg'; const fileAsset = await mgr.createPhotoAsset(testFileName); let fd = await fileAsset.open('rw'); if (fd != undefined) { @@ -1172,8 +1748,8 @@ close(fd: number, callback: AsyncCallback<void>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ----- | -| fd | number | 是 | 文件描述符 | -| callback | AsyncCallback<void> | 是 | 回调返回空 | +| fd | number | 是 | 文件描述符。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | **示例:** @@ -1217,13 +1793,13 @@ close(fd: number): Promise<void> | 参数名 | 类型 | 必填 | 说明 | | ---- | ------ | ---- | ----- | -| fd | number | 是 | 文件描述符 | +| fd | number | 是 | 文件描述符。 | **返回值:** | 类型 | 说明 | | ------------------- | ---------- | -| Promise<void> | Promise返回空 | +| Promise<void> | Promise对象,返回void。 | **示例:** @@ -1264,7 +1840,7 @@ getThumbnail(callback: AsyncCallback<image.PixelMap>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------- | ---- | ---------------- | -| callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | 是 | 回调返回缩略图的PixelMap | +| callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | 是 | callback返回缩略图的PixelMap。 | **示例:** @@ -1305,8 +1881,8 @@ getThumbnail(size: image.Size, callback: AsyncCallback<image.PixelMap>): v | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------------- | ---- | ---------------- | -| size | [image.Size](js-apis-image.md#size) | 是 | 缩略图尺寸 | -| callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | 是 | 回调返回缩略图的PixelMap | +| size | [image.Size](js-apis-image.md#size) | 是 | 缩略图尺寸。 | +| callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | 是 | callback返回缩略图的PixelMap。 | **示例:** @@ -1348,13 +1924,13 @@ getThumbnail(size?: image.Size): Promise<image.PixelMap> | 参数名 | 类型 | 必填 | 说明 | | ---- | -------------- | ---- | ----- | -| size | [image.Size](js-apis-image.md#size) | 否 | 缩略图尺寸 | +| size | [image.Size](js-apis-image.md#size) | 否 | 缩略图尺寸。 | **返回值:** | 类型 | 说明 | | ----------------------------- | --------------------- | -| Promise<[image.PixelMap](js-apis-image.md#pixelmap7)> | Promise返回缩略图的PixelMap | +| Promise<[image.PixelMap](js-apis-image.md#pixelmap7)> | Promise对象,返回缩略图的PixelMap。 | **示例:** @@ -1394,8 +1970,8 @@ favorite(isFavorite: boolean, callback: AsyncCallback<void>): void | 参数名 | 类型 | 必填 | 说明 | | ---------- | ------------------------- | ---- | ---------------------------------- | -| isFavorite | boolean | 是 | 是否设置为收藏文件, true:设置为收藏文件,false:取消收藏 | -| callback | AsyncCallback<void> | 是 | 回调返回空 | +| isFavorite | boolean | 是 | 是否设置为收藏文件, true:设置为收藏文件,false:取消收藏。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | **示例:** @@ -1413,9 +1989,9 @@ async function example() { const asset = await fetchResult.getFirstObject(); asset.favorite(true, (err) => { if (err == undefined) { - console.info("favorite successfully"); + console.info('favorite successfully'); } else { - console.error("favorite failed with error:" + err); + console.error('favorite failed with error:' + err); } }); } @@ -1435,13 +2011,13 @@ favorite(isFavorite: boolean): Promise<void> | 参数名 | 类型 | 必填 | 说明 | | ---------- | ------- | ---- | ---------------------------------- | -| isFavorite | boolean | 是 | 是否设置为收藏文件, true:设置为收藏文件,false:取消收藏 | +| isFavorite | boolean | 是 | 是否设置为收藏文件, true:设置为收藏文件,false:取消收藏。 | **返回值:** | 类型 | 说明 | | ------------------- | ---------- | -| Promise<void> | Promise返回空 | +| Promise<void> | Promise对象,返回void。 | **示例:** @@ -1458,9 +2034,101 @@ async function example() { let fetchResult = await mgr.getPhotoAssets(fetchOption); const asset = await fetchResult.getFirstObject(); asset.favorite(true).then(function () { - console.info("favorite successfully"); + console.info('favorite successfully'); }).catch(function (err) { - console.error("favorite failed with error:" + err); + console.error('favorite failed with error:' + err); + }); +} +``` + +### setHidden10+ + +setHidden(hiddenState: boolean, callback: AsyncCallback<void>): void + +将文件设置为隐私文件,使用callback方式返回异步结果。 + +隐私文件存在隐私相册中,对三方应用不开放,用户通过隐私相册去获取隐私文件后可以通过设置hiddenState为false来从隐私相册中移除。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ---------------------------------- | +| hiddenState | boolean | 是 | 是否设置为隐藏文件,true:将文件资产放入隐藏相册;false:从隐藏相册中恢复。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('setHiddenDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let fetchResult = await mgr.getPhotoAssets(fetchOption); + const asset = await fetchResult.getFirstObject(); + asset.setHidden(true, (err) => { + if (err == undefined) { + console.info('setHidden successfully'); + } else { + console.error('setHidden failed with error:' + err); + } + }); +} +``` + +### setHidden10+ + +setHidden(hiddenState: boolean): Promise<void> + +将文件设置为隐私文件,使用promise方式返回异步结果。 + +隐私文件存在隐私相册中,对三方应用不开放,用户通过隐私相册去获取隐私文件后可以通过设置hiddenState为false来从隐私相册中移除。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------- | ---- | ---------------------------------- | +| hiddenState | boolean | 是 | 是否设置为隐藏文件,true:将文件资产放入隐藏相册;false:从隐藏相册中恢复。 | + +**返回值:** + +| 类型 | 说明 | +| ------------------- | ---------- | +| Promise<void> | Promise对象,返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + // 示例代码为将文件从隐藏相册中恢复,需要先在隐藏相册预置资源 + console.info('setHiddenDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumList = await mgr.getAlbums(userFileManager.AlbumType.SYSTEM, userFileManager.AlbumSubType.HIDDEN); + const album = await albumList.getFirstObject(); + let fetchResult = await album.getPhotoAssets(fetchOption); + const asset = await fetchResult.getFirstObject(); + asset.setHidden(false).then(() => { + console.info('setHidden successfully'); + }).catch((err) => { + console.error('setHidden failed with error:' + err); }); } ``` @@ -1481,9 +2149,9 @@ getCount(): number | 类型 | 说明 | | ------ | -------- | -| number | 检索到的文件总数 | +| number | 检索到的文件总数。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1515,7 +2183,7 @@ isAfterLast(): boolean | ------- | ---------------------------------- | | boolean | 当读到最后一条记录后,后续没有记录返回true,否则返回false。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1546,7 +2214,7 @@ close(): void **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1576,13 +2244,13 @@ getFirstObject(callback: AsyncCallback<T>): void **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------------------- | ---- | ------------------------------------------- | -| callback | AsyncCallback<T> | 是 | 异步获取结果集中的第一个完成后的回调 | +| callback | AsyncCallback<T> | 是 | 异步获取结果集中的第一个完成后的回调。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1599,7 +2267,7 @@ async function example() { if (fileAsset != undefined) { console.info('fileAsset displayName: ', fileAsset.displayName); } else { - console.error("fileAsset failed with err:" + err); + console.error('fileAsset failed with err:' + err); } }); } @@ -1617,9 +2285,9 @@ getFirstObject(): Promise<T> | 类型 | 说明 | | --------------------------------------- | -------------------------- | -| Promise<T> | Promise方式返回 | +| Promise<T> | Promise对象,返回结果集中第一个对象。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1645,13 +2313,13 @@ async function example() { **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | --------- | --------------------------------------------- | ---- | ----------------------------------------- | -| callbacke | AsyncCallback<T> | 是 | 异步返回结果集中下一个之后的回调 | +| callbacke | AsyncCallback<T> | 是 | 异步返回结果集中下一个之后的回调。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1670,7 +2338,7 @@ async function example() { if (fileAsset != undefined) { console.info('fileAsset displayName: ', fileAsset.displayName); } else { - console.error("fileAsset failed with err: " + err); + console.error('fileAsset failed with err: ' + err); } }); } @@ -1689,9 +2357,9 @@ async function example() { | 类型 | 说明 | | --------------------------------------- | ----------------- | -| Promise<T> | 返回结果集中下一个对象 | +| Promise<T> | Promise对象,返回结果集中下一个对象。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1720,13 +2388,13 @@ getLastObject(callback: AsyncCallback<T>): void **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------------------------- | ---- | --------------------------- | -| callback | AsyncCallback<T> | 是 | 异步返回结果集中最后一个的回调 | +| callback | AsyncCallback<T> | 是 | 异步返回结果集中最后一个的回调。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1743,7 +2411,7 @@ async function example() { if (fileAsset != undefined) { console.info('fileAsset displayName: ', fileAsset.displayName); } else { - console.error("fileAsset failed with err: " + err); + console.error('fileAsset failed with err: ' + err); } }); } @@ -1761,9 +2429,9 @@ getLastObject(): Promise<T> | 类型 | 说明 | | --------------------------------------- | ----------------- | -| Promise<T> | 返回结果集中最后一个对象 | +| Promise<T> | Promise对象,返回结果集中最后一个对象。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1789,14 +2457,14 @@ getPositionObject(index: number, callback: AsyncCallback<T>): void **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ------------------ | -| index | number | 是 | 要获取的文件的索引,从0开始 | -| callback | AsyncCallback<T> | 是 | 异步返回指定索引的文件资产的回调 | +| index | number | 是 | 要获取的文件的索引,从0开始。 | +| callback | AsyncCallback<T> | 是 | 异步返回指定索引的文件资产的回调。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -1813,233 +2481,700 @@ async function example() { if (fileAsset != undefined) { console.info('fileAsset displayName: ', fileAsset.displayName); } else { - console.error("fileAsset failed with err: " + err); + console.error('fileAsset failed with err: ' + err); + } + }); +} +``` + +### getPositionObject + +getPositionObject(index: number): Promise<T> + +获取文件检索结果中具有指定索引的文件资产。此方法使用Promise形式返回文件Asset。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | -------------- | +| index | number | 是 | 要获取的文件的索引,从0开始。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------------- | ----------------- | +| Promise<T> | Promise对象,返回结果集中指定索引的一个对象。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('getPositionObjectDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let fetchResult = await mgr.getPhotoAssets(fetchOption); + let fileAsset = await fetchResult.getPositionObject(0); + console.info('fileAsset displayName: ', fileAsset.displayName); +} +``` + +### getAllObject10+ + +getAllObject(callback: AsyncCallback<Array<T>>): void + +获取文件检索结果中的所有文件资产。此方法使用callback形式返回结果。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------------- | ---- | ------------------------------------------- | +| callback | AsyncCallback<Array<T>> | 是 | 异步获取结果集中的所有文件资产完成后的回调。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('getAllObjectDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let fetchResult = await mgr.getPhotoAssets(fetchOption); + fetchResult.getAllObject((err, fileAssetList) => { + if (fileAssetList != undefined) { + console.info('fileAssetList length: ', fileAssetList.length); + } else { + console.error('fileAssetList failed with err:' + err); + } + }); +} +``` + +### getAllObject10+ + +getAllObject(): Promise<Array<T>> + +获取文件检索结果中的所有文件资产。此方法使用promise方式来异步返回。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**返回值:** + +| 类型 | 说明 | +| --------------------------------------- | -------------------------- | +| Promise<Array<T>> | Promise对象,返回结果集中所有文件资产数组。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('getAllObjectDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let fetchResult = await mgr.getPhotoAssets(fetchOption); + let fileAssetList = await fetchResult.getAllObject(); + console.info('fileAssetList length: ', fileAssetList.length); +} +``` + +## Album + +实体相册 + +### 属性 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------------ | ------ | ---- | ---- | ------- | +| albumType8+ | [AlbumType]( #albumtype10) | 是 | 否 | 相册类型。 | +| albumSubType8+ | [AlbumSubType]( #albumsubtype10) | 是 | 否 | 相册子类型。 | +| albumName | string | 是 | 用户相册可写,预置相册不可写 | 相册名称。 | +| albumUri | string | 是 | 否 | 相册Uri。 | +| count | number | 是 | 否 | 相册中文件数量。 | +| coverUri | string | 是 | 用户相册可写,预置相册不可写 | 封面文件Uri。 | + +### getPhotoAssets + +getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<FileAsset>>): void; + +获取相册中的文件。该方法使用callback形式来返回文件。 + +**需要权限**:ohos.permission.READ_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| options | [FetchOptions](#fetchoptions) | 是 | 检索选项。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback返回图片和视频数据结果集。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('albumGetFileAssetsDemoCallback'); + + let predicates = new dataSharePredicates.DataSharePredicates(); + let albumFetchOptions = { + predicates: predicates + }; + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + const albumList = await mgr.getPhotoAlbums(albumFetchOptions); + const album = await albumList.getFirstObject(); + album.getPhotoAssets(fetchOption, (err, albumFetchResult) => { + if (albumFetchResult != undefined) { + console.info('album getPhotoAssets successfully, getCount: ' + albumFetchResult.getCount()); + } else { + console.error('album getPhotoAssets failed with error: ' + err); + } + }); +} +``` + +### getPhotoAssets + +getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>>; + +获取相册中的文件。该方法使用Promise来返回文件。 + +**需要权限**:ohos.permission.READ_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| options | [FetchOptions](#fetchoptions) | 是 | 检索选项。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------------- | ----------------- | +| Promise<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | Promise对象,返回图片和视频数据结果集。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('albumGetFileAssetsDemoPromise'); + + let predicates = new dataSharePredicates.DataSharePredicates(); + let albumFetchOptions = { + predicates: predicates + }; + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + const albumList = await mgr.getPhotoAlbums(albumFetchOptions); + const album = await albumList.getFirstObject(); + album.getPhotoAssets(fetchOption).then((albumFetchResult) => { + console.info('album getFileAssets successfully, getCount: ' + albumFetchResult.getCount()); + }).catch((err) => { + console.error('album getFileAssets failed with error: ' + err); + }); +} +``` + +### commitModify + +commitModify(callback: AsyncCallback<void>): void; + +更新相册属性修改到数据库中。该方法使用callback形式来返回结果。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| callback | AsyncCallback<void> | 是 | callback返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('albumCommitModifyDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let albumFetchOptions = { + predicates: predicates + }; + const albumList = await mgr.getPhotoAlbums(albumFetchOptions); + const album = await albumList.getFirstObject(); + album.albumName = 'hello'; + album.commitModify((err) => { + if (err != undefined) { + console.error('commitModify failed with error: ' + err); + } else { + console.info('commitModify successfully'); } }); } ``` -### getPositionObject +### commitModify + +commitModify(): Promise<void>; + +更新相册属性修改到数据库中。该方法使用Promise来返回结果。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**返回值:** + +| 类型 | 说明 | +| ------------------- | ------------ | +| Promise<void> | Promise对象,返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + console.info('albumCommitModifyDemo'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let albumFetchOptions = { + predicates: predicates + }; + try { + var albumList = await mgr.getPhotoAlbums(albumFetchOptions); + } catch (err) { + console.error('getPhotoAlbums failed. message = ', err); + } + const album = await albumList.getFirstObject(); + album.albumName = 'hello'; + album.commitModify().then(() => { + console.info('commitModify successfully'); + }).catch((err) => { + console.error('commitModify failed with error: ' + err); + }); +} +``` + +### addPhotoAssets10+ + +addPhotoAssets(assets: Array<FileAsset>, callback: AsyncCallback<void>): void; + +往相册中添加图片或者视频,需要先预置相册和文件资源。该方法使用callback形式来返回结果。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| assets | Array<[FileAsset](#fileasset)> | 是 | 待添加到相册中的图片或视频数组。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + try { + console.info('addPhotoAssetsDemoCallback'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await mgr.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.addPhotoAssets([asset], (err) => { + if (err === undefined) { + console.info('album addPhotoAssets successfully'); + } else { + console.error('album addPhotoAssets failed with error: ' + err); + } + }); + } catch (err) { + console.error('addPhotoAssetsDemoCallback failed with error: ' + err); + } +} +``` + +### addPhotoAssets10+ + +addPhotoAssets(assets: Array<FileAsset>): Promise<void>; + +往相册中添加图片或者视频,需要先预置相册和文件资源。该方法使用Promise来返回结果。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| assets | Array<[FileAsset](#fileasset)> | 是 | 待添加到相册中的图片或视频数组。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------------------------- | ----------------- | +|Promise<void> | Promise对象,返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + try { + console.info('addPhotoAssetsDemoPromise'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await mgr.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.addPhotoAssets([asset]).then(() => { + console.info('album addPhotoAssets successfully'); + }).catch((err) => { + console.error('album addPhotoAssets failed with error: ' + err); + }); + } catch (err) { + console.error('addPhotoAssetsDemoPromise failed with error: ' + err); + } +} +``` + +### removePhotoAssets10+ + +removePhotoAssets(assets: Array<FileAsset>, callback: AsyncCallback<void>): void; + +从相册中移除图片或者视频,需要先预置相册和文件资源。该方法使用callback形式来返回结果。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| assets | Array<[FileAsset](#fileasset)> | 是 | 相册中待移除的图片或视频数组。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | + +**示例:** + +```ts +import dataSharePredicates from '@ohos.data.dataSharePredicates'; + +async function example() { + try { + console.info('removePhotoAssetsDemoCallback'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await album.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.removePhotoAssets([asset], (err) => { + if (err === undefined) { + console.info('album removePhotoAssets successfully'); + } else { + console.error('album removePhotoAssets failed with error: ' + err); + } + }); + } catch (err) { + console.error('removePhotoAssetsDemoCallback failed with error: ' + err); + } +} +``` + +### removePhotoAssets10+ -getPositionObject(index: number): Promise<T> +removePhotoAssets(assets: Array<FileAsset>): Promise<void>; -获取文件检索结果中具有指定索引的文件资产。此方法使用Promise形式返回文件Asset。 +从相册中移除图片或者视频,需要先预置相册和文件资源。该方法使用Promise来返回结果。 + +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ------ | ---- | -------------- | -| index | number | 是 | 要获取的文件的索引,从0开始 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| assets | Array<[FileAsset](#fileasset)> | 是 | 相册中待移除的图片或视频数组。 | **返回值:** | 类型 | 说明 | | --------------------------------------- | ----------------- | -| Promise<T> | 返回指定索引的文件资产的对象 | +|Promise<void> | Promise对象,返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; async function example() { - console.info('getPositionObjectDemo'); - let predicates = new dataSharePredicates.DataSharePredicates(); - let fetchOption = { - fetchColumns: [], - predicates: predicates - }; - let fetchResult = await mgr.getPhotoAssets(fetchOption); - let fileAsset = await fetchResult.getPositionObject(0); - console.info('fileAsset displayName: ', fileAsset.displayName); + try { + console.info('removePhotoAssetsDemoPromise'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.USER, userFileManager.AlbumSubType.USER_GENERIC); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await album.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.removePhotoAssets([asset]).then(() => { + console.info('album removePhotoAssets successfully'); + }).catch((err) => { + console.error('album removePhotoAssets failed with error: ' + err); + }); + } catch (err) { + console.error('removePhotoAssetsDemoPromise failed with error: ' + err); + } } ``` -## Album - -实体相册 - -### 属性 - -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core - -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------------ | ------ | ---- | ---- | ------- | -| albumName | string | 是 | 是 | 相册名称 | -| albumUri | string | 是 | 否 | 相册Uri | -| dateModified | number | 是 | 否 | 修改日期 | -| count | number | 是 | 否 | 相册中文件数量 | -| coverUri | string | 是 | 否 | 封面文件Uri - -### getPhotoAssets +### recoverPhotoAssets10+ -getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult<FileAsset>>): void; +recoverPhotoAssets(assets: Array<FileAsset>, callback: AsyncCallback<void>): void; -获取相册中的文件。该方法使用callback形式来返回文件。 +从回收站中恢复图片或者视频,需要先在回收站中预置文件资源。该方法使用callback形式来返回结果。 -**需要权限**:ohos.permission.READ_IMAGEVIDEO +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| options | [FetchOptions](#fetchoptions) | 是 | 检索选项 | -| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback 返回图片和视频数据结果集| +| assets | Array<[FileAsset](#fileasset)> | 是 | 回收站中待恢复图片或者视频数组。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; async function example() { - console.info('albumGetFileAssetsDemoCallback'); - - let predicates = new dataSharePredicates.DataSharePredicates(); - let albumFetchOptions = { - predicates: predicates - }; - let fetchOption = { - fetchColumns: [], - predicates: predicates - }; - const albumList = await mgr.getPhotoAlbums(albumFetchOptions); - const album = await albumList.getFirstObject(); - album.getPhotoAssets(fetchOption, (err, albumFetchResult) => { - if (albumFetchResult != undefined) { - console.info("album getPhotoAssets successfully, getCount: " + albumFetchResult.getCount()); - } else { - console.error("album getPhotoAssets failed with error: " + err); - } - }); + try { + console.info('recoverPhotoAssetsDemoCallback'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.SYSTEM, userFileManager.AlbumSubType.TRASH); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await album.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.recoverPhotoAssets([asset], (err) => { + if (err === undefined) { + console.info('album recoverPhotoAssets successfully'); + } else { + console.error('album recoverPhotoAssets failed with error: ' + err); + } + }); + } catch (err) { + console.error('recoverPhotoAssetsDemoCallback failed with error: ' + err); + } } ``` -### getPhotoAssets +### recoverPhotoAssets10+ -getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>>; +recoverPhotoAssets(assets: Array<FileAsset>): Promise<void>; -获取相册中的文件。该方法使用Promise来返回文件。 +从回收站中恢复图片或者视频,需要先在回收站中预置文件资源。该方法使用Promise来返回结果。 -**需要权限**:ohos.permission.READ_IMAGEVIDEO +**需要权限**:ohos.permission.WRITE_IMAGEVIDEO **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| options | [FetchOptions](#fetchoptions) | 是 | 检索选项 | -| Promise | [FetchResult](#fetchresult)<[FileAsset](#fileasset)> | 是 | 图片和视频数据结果集 | +| assets | Array<[FileAsset](#fileasset)> | 是 | 回收站中待恢复图片或者视频数组。 | + +**返回值:** -**示例**: +| 类型 | 说明 | +| --------------------------------------- | ----------------- | +|Promise<void> | Promise对象,返回void。 | + +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; async function example() { - console.info('albumGetFileAssetsDemoPromise'); - - let predicates = new dataSharePredicates.DataSharePredicates(); - let albumFetchOptions = { - predicates: predicates - }; - let fetchOption = { - fetchColumns: [], - predicates: predicates - }; - const albumList = await mgr.getPhotoAlbums(albumFetchOptions); - const album = await albumList.getFirstObject(); - album.getPhotoAssets(fetchOption).then((albumFetchResult) => { - console.info("album getFileAssets successfully, getCount: " + albumFetchResult.getCount()); - }).catch((err) => { - console.error("album getFileAssets failed with error: " + err); - }); + try { + console.info('recoverPhotoAssetsDemoPromise'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.SYSTEM, userFileManager.AlbumSubType.TRASH); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await album.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.recoverPhotoAssets([asset]).then(() => { + console.info('album recoverPhotoAssets successfully'); + }).catch((err) => { + console.error('album recoverPhotoAssets failed with error: ' + err); + }); + } catch (err) { + console.error('recoverPhotoAssetsDemoPromise failed with error: ' + err); + } } ``` -### commitModify +### deletePhotoAssets10+ -commitModify(callback: AsyncCallback<void>): void; +deletePhotoAssets(assets: Array<FileAsset>, callback: AsyncCallback<void>): void; -更新相册属性修改到数据库中。 +从回收站中彻底删除图片或者视频,需要先在回收站中预置文件资源。该方法使用callback形式来返回结果。 + +**注意**:此操作不可逆,执行此操作后文件资源将彻底删除,请谨慎操作。 **需要权限**:ohos.permission.WRITE_IMAGEVIDEO **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| callback | AsyncCallback<void> | 是 | 回调返回空 | +| assets | Array<[FileAsset](#fileasset)> | 是 | 回收站中待彻底删除图片或者视频数组。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; async function example() { - console.info('albumCommitModifyDemo'); - let predicates = new dataSharePredicates.DataSharePredicates(); - let albumFetchOptions = { - predicates: predicates - }; - const albumList = await mgr.getPhotoAlbums(albumFetchOptions); - const album = await albumList.getFirstObject(); - album.albumName = 'hello'; - album.commitModify((err) => { - if (err != undefined) { - console.error("commitModify failed with error: " + err); - } else { - console.info("commitModify successfully"); - } - }); + try { + console.info('deletePhotoAssetsDemoCallback'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.SYSTEM, userFileManager.AlbumSubType.TRASH); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await album.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.deletePhotoAssets([asset], (err) => { + if (err === undefined) { + console.info('album deletePhotoAssets successfully'); + } else { + console.error('album deletePhotoAssets failed with error: ' + err); + } + }); + } catch (err) { + console.error('deletePhotoAssetsDemoCallback failed with error: ' + err); + } } ``` -### commitModify +### deletePhotoAssets10+ -commitModify(): Promise<void>; +deletePhotoAssets(assets: Array<FileAsset>): Promise<void>; + +从回收站中彻底删除图片或者视频,需要先在回收站中预置文件资源。该方法使用Promise来返回结果。 -更新相册属性修改到数据库中。 +**注意**:此操作不可逆,执行此操作后文件资源将彻底删除,请谨慎操作。 **需要权限**:ohos.permission.WRITE_IMAGEVIDEO **系统能力**:SystemCapability.FileManagement.UserFileManager.Core +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------- | +| assets | Array<[FileAsset](#fileasset)> | 是 | 回收站中待彻底删除图片或者视频数组。 | + **返回值:** -| 类型 | 说明 | -| ------------------- | ------------ | -| Promise<void> | Promise调用返回空 | +| 类型 | 说明 | +| --------------------------------------- | ----------------- | +|Promise<void> | Promise对象,返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; async function example() { - console.info('albumCommitModifyDemo'); - let predicates = new dataSharePredicates.DataSharePredicates(); - let albumFetchOptions = { - predicates: predicates - }; try { - var albumList = await mgr.getPhotoAlbums(albumFetchOptions); + console.info('deletePhotoAssetsDemoPromise'); + let predicates = new dataSharePredicates.DataSharePredicates(); + let fetchOption = { + fetchColumns: [], + predicates: predicates + }; + let albumFetchResult = await mgr.getAlbums(userFileManager.AlbumType.SYSTEM, userFileManager.AlbumSubType.TRASH); + let album = await albumFetchResult.getFirstObject(); + let fetchResult = await album.getPhotoAssets(fetchOption); + let asset = await fetchResult.getFirstObject(); + album.deletePhotoAssets([asset]).then(() => { + console.info('album deletePhotoAssets successfully'); + }).catch((err) => { + console.error('album deletePhotoAssets failed with error: ' + err); + }); } catch (err) { - console.error('getPhotoAlbums failed. message = ', err); + console.error('deletePhotoAssetsDemoPromise failed with error: ' + err); } - const album = await albumList.getFirstObject(); - album.albumName = 'hello'; - album.commitModify().then(() => { - console.info("commitModify successfully"); - }).catch((err) => { - console.error("commitModify failed with error: " + err); - }); } ``` @@ -2049,15 +3184,15 @@ async function example() { ### 属性 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 类型 | 可读 | 可写 | 说明 | | ------------ | ------ | ---- | ---- | ------- | -| albumName | string | 是 | 是 | 相册名称 | -| albumUri | string | 是 | 否 | 相册Uri | -| dateModified | number | 是 | 否 | 修改日期 | -| count | number | 是 | 否 | 相册中文件数量 | -| coverUri | string | 是 | 否 | 封面文件Uri +| albumName | string | 是 | 是 | 相册名称。 | +| albumUri | string | 是 | 否 | 相册Uri。 | +| dateModified | number | 是 | 否 | 修改日期。 | +| count | number | 是 | 否 | 相册中文件数量。 | +| coverUri | string | 是 | 否 | 封面文件Uri。 | ### getPhotoAssets @@ -2069,14 +3204,14 @@ getPhotoAssets(options: FetchOptions, callback: AsyncCallback<FetchResult< **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| options | [FetchOptions](#fetchoptions) | 是 | 检索选项 | -| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback返回图片和视频数据结果集 | +| options | [FetchOptions](#fetchoptions) | 是 | 检索选项。 | +| callback | AsyncCallback<[FetchResult](#fetchresult)<[FileAsset](#fileasset)>> | 是 | callback返回图片和视频数据结果集。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -2112,19 +3247,19 @@ getPhotoAssets(options: FetchOptions): Promise<FetchResult<FileAsset>&g **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| options | [FetchOptions](#fetchoptions) | 是 | 检索选项 | +| options | [FetchOptions](#fetchoptions) | 是 | 检索选项。 | **返回值:** | 类型 | 说明 | | --------------------------------------- | ----------------- | -| Promise:[FetchResult](#fetchresult)<[FileAsset](#fileasset)>| 图片和视频数据结果集 | +| Promise:[FetchResult](#fetchresult)<[FileAsset](#fileasset)>| Promise对象,返回图片和视频数据结果集。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -2154,14 +3289,14 @@ delete(uri: string, callback: AsyncCallback<void>): void; **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| uri | string | 是 | 相册uri | -| callback | AsyncCallback<void> | 是 | 回调返回空 | +| uri | string | 是 | 相册uri。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -2198,19 +3333,19 @@ delete(uri: string): Promise<void>; **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| uri | string | 是 | 相册uri | +| uri | string | 是 | 相册uri。 | **返回值:** | 类型 | 说明 | | --------------------------------------- | ----------------- | -| Promise<void>| 回调返回空 | +| Promise<void>| Promise对象,返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -2245,14 +3380,14 @@ recover(uri: string, callback: AsyncCallback<void>): void; **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| uri | string | 是 | 相册uri | -| callback | AsyncCallback<void> | 是 | 回调返回空 | +| uri | string | 是 | 相册uri。 | +| callback | AsyncCallback<void> | 是 | callback返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -2289,19 +3424,19 @@ recover(uri: string): Promise<void>; **系统能力**:SystemCapability.FileManagement.UserFileManager.Core -**参数**: +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------- | ---- | ---------- | -| uri | string | 是 | 相册uri | +| uri | string | 是 | 相册uri。 | **返回值:** | 类型 | 说明 | | --------------------------------------- | ----------------- | -| Promise<void>| 回调返回空 | +| Promise<void>| Promise对象,返回void。 | -**示例**: +**示例:** ```ts import dataSharePredicates from '@ohos.data.dataSharePredicates'; @@ -2330,134 +3465,238 @@ async function example() { 成员类型。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 类型 | 可读 | 可写 | 说明 | | ----- | ---- | ---- | ---- | ---- | -| number | number | 是 | 是 | number类型 | -| string | string | 是 | 是 | string类型 | -| boolean | boolean | 是 | 是 | boolean类型 | +| number | number | 是 | 是 | number类型。 | +| string | string | 是 | 是 | string类型。| +| boolean | boolean | 是 | 是 | boolean类型。 | ## ChangeEvent 变更监听的媒体文件类型。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 类型 | 可读 | 可写 | 说明 | | ----- | ---- | ---- | ---- | ---- | -| deviceChange | string | 是 | 是 | 设备 | -| albumChange | string | 是 | 是 | 相册 | -| imageChange | string | 是 | 是 | 图片 | -| audioChange | string | 是 | 是 | 音频 | -| videoChange | string | 是 | 是 | 视频 | -| remoteFileChange | string | 是 | 是 | 远程文件 | +| deviceChange | string | 是 | 是 | 设备。 | +| albumChange | string | 是 | 是 | 相册。 | +| imageChange | string | 是 | 是 | 图片。 | +| audioChange | string | 是 | 是 | 音频。 | +| videoChange | string | 是 | 是 | 视频。 | +| remoteFileChange | string | 是 | 是 | 远程文件。 | ## PeerInfo 注册设备的信息。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.DistributedCore +**系统能力**:SystemCapability.FileManagement.UserFileManager.DistributedCore | 名称 | 类型 | 可读 | 可写 | 说明 | | ---------- | -------------------------- | ---- | ---- | ---------------- | -| deviceName | string | 是 | 否 | 注册设备的名称 | -| networkId | string | 是 | 否 | 注册设备的网络ID | -| isOnline | boolean | 是 | 否 | 是否在线 | +| deviceName | string | 是 | 否 | 注册设备的名称。 | +| networkId | string | 是 | 否 | 注册设备的网络ID。 | +| isOnline | boolean | 是 | 否 | 是否在线。 | ## FileType 枚举,媒体文件类型。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 值 | 说明 | +| ----- | ---- | ---- | +| IMAGE | 1 | 图片。 | +| VIDEO | 2 | 视频。 | +| AUDIO | 3 | 音频。 | + +## PhotoSubType10+ + +枚举,不同[FileAsset](#fileasset)的类型。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 值 | 说明 | +| ----- | ---- | ---- | +| DEFAULT | 0 | 默认照片类型。 | +| SCREENSHOT | 1 | 截屏录屏文件类型。 | +| CAMERA | 2 | 相机拍摄的照片和视频类型。 | + +## PositionType10+ + +枚举,文件位置,表示文件在本地或云端。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 值 | 说明 | +| ----- | ---- | ---- | +| LOCAL | 1 | 文件只存在于本端设备。 | +| CLOUD | 2 | 文件只存在于云端。 | +| BOTH | 3 | 文件在本地和云中都存在。 | + +## AlbumType10+ + +枚举,相册类型,表示是用户相册还是系统预置相册。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 值 | 说明 | +| ----- | ---- | ---- | +| USER | 0 | 用户相册。 | +| SYSTEM | 1024 | 系统预置相册。 | + +## AlbumSubType10+ + +枚举,相册子类型,表示具体的相册类型。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 值 | 说明 | | ----- | ---- | ---- | -| IMAGE | 1 | 图片 | -| VIDEO | 2 | 视频 | -| AUDIO | 3 | 音频 | +| USER_GENERIC | 1 | 用户相册。 | +| FAVORITE | 1025 | 收藏夹。 | +| VIDEO | 1026 | 视频相册。 | +| HIDDEN | 1027 | 隐藏相册。 | +| TRASH | 1028 | 回收站。 | +| SCREENSHOT | 1029 | 截屏和录屏相册。 | +| CAMERA | 1030 | 相机拍摄的照片和视频相册。 | +| ANY | 2147483647 | 任意相册。 | ## PrivateAlbumType 枚举,系统相册类型。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 值 | 说明 | | ----- | ---- | ---- | -| TYPE_FAVORITE | 0 | 收藏夹相册 | -| TYPE_TRASH | 1 | 回收站相册 | +| TYPE_FAVORITE | 0 | 收藏夹相册。 | +| TYPE_TRASH | 1 | 回收站相册。 | ## AudioKey 枚举,音频文件关键信息。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 值 | 说明 | | ------------- | ------------------- | ---------------------------------------------------------- | -| URI | uri | 文件uri | -| DISPLAY_NAME | display_name | 显示名字 | -| DATE_ADDED | date_added | 添加日期(添加文件时间到1970年1月1日的秒数值) | -| DATE_MODIFIED | date_modified | 修改日期(修改文件时间到1970年1月1日的秒数值,修改文件名不会改变此值,当文件内容发生修改时才会更新) | -| TITLE | title | 文件标题 | -| ARTIST | artist | 作者 | -| AUDIOALBUM | audio_album | 专辑 | -| DURATION | duration | 持续时间(单位:毫秒) | -| FAVORITE | favorite | 收藏 | +| URI | uri | 文件uri。 | +| DISPLAY_NAME | display_name | 显示名字。 | +| DATE_ADDED | date_added | 添加日期(添加文件时间距1970年1月1日的秒数值)。 | +| DATE_MODIFIED | date_modified | 修改日期(修改文件时间距1970年1月1日的秒数值,修改文件名不会改变此值,当文件内容发生修改时才会更新)。 | +| TITLE | title | 文件标题。 | +| ARTIST | artist | 作者。 | +| AUDIOALBUM | audio_album | 专辑。 | +| DURATION | duration | 持续时间(单位:毫秒)。 | +| FAVORITE | favorite | 收藏。 | ## ImageVideoKey 枚举,图片和视频文件关键信息。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 值 | 说明 | | ------------- | ------------------- | ---------------------------------------------------------- | -| URI | uri | 文件uri | -| FILE_TYPE | file_type | 媒体文件类型 | -| DISPLAY_NAME | display_name | 显示名字 | -| DATE_ADDED | date_added | 添加日期(添加文件时间到1970年1月1日的秒数值) | -| DATE_MODIFIED | date_modified | 修改日期(修改文件时间到1970年1月1日的秒数值,修改文件名不会改变此值,当文件内容发生修改时才会更新) | -| TITLE | title | 文件标题 | -| DURATION | duration | 持续时间(单位:毫秒) | -| WIDTH | width | 图片宽度(单位:像素) | -| HEIGHT | height | 图片高度(单位:像素) | -| DATE_TAKEN | date_taken | 拍摄日期(文件拍照时间到1970年1月1日的秒数值) | -| ORIENTATION | orientation | 图片文件的方向 | -| FAVORITE | favorite | 收藏 | +| URI | uri | 文件uri。 | +| FILE_TYPE | file_type | 媒体文件类型。 | +| DISPLAY_NAME | display_name | 显示名字。 | +| DATE_ADDED | date_added | 添加日期(添加文件时间距1970年1月1日的秒数值)。 | +| DATE_MODIFIED | date_modified | 修改日期(修改文件时间距1970年1月1日的秒数值,修改文件名不会改变此值,当文件内容发生修改时才会更新)。 | +| TITLE | title | 文件标题。 | +| DURATION | duration | 持续时间(单位:毫秒)。 | +| WIDTH | width | 图片宽度(单位:像素)。 | +| HEIGHT | height | 图片高度(单位:像素)。 | +| DATE_TAKEN | date_taken | 拍摄日期(文件拍照时间距1970年1月1日的秒数值)。 | +| ORIENTATION | orientation | 图片文件的方向。 | +| FAVORITE | favorite | 收藏。 | +| POSITION10+ | position | 文件位置类型。 | +| DATE_TRASHED10+ | date_trashed | 删除日期(删除文件时间距1970年1月1日的秒数值)。 | +| HIDDEN10+ | hidden | 文件的隐藏状态。 | ## AlbumKey 枚举,相册关键信息。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 值 | 说明 | | ------------- | ------------------- | ---------------------------------------------------------- | -| URI | uri | 相册uri | -| FILE_TYPE | file_type | 媒体文件类型 | -| ALBUM_NAME | album_name | 相册名字 | -| DATE_ADDED | date_added | 添加日期(添加文件时间到1970年1月1日的秒数值) | -| DATE_MODIFIED | date_modified | 修改日期(修改文件时间到1970年1月1日的秒数值,修改文件名不会改变此值,当文件内容发生修改时才会更新) | +| URI | uri | 相册uri。 | +| FILE_TYPE | file_type | 媒体文件类型。 | +| ALBUM_NAME | album_name | 相册名字。 | +| DATE_ADDED | date_added | 添加日期(添加文件时间距1970年1月1日的秒数值)。 | +| DATE_MODIFIED | date_modified | 修改日期(修改文件时间距1970年1月1日的秒数值,修改文件名不会改变此值,当文件内容发生修改时才会更新)。 | + +## PhotoCreateOptions10+ + +图片或视频的创建选项。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 类型 | 必填 | 说明 | +| ---------------------- | ------------------- | ---- | ------------------------------------------------ | +| subType | [PhotoSubType](#photosubtype10) | 否 | 图片或者视频的子类型。 | ## FetchOptions 检索条件。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 类型 | 可读 | 可写 | 说明 | | ---------------------- | ------------------- | ---- |---- | ------------------------------------------------ | -| fetchColumns | Array<string> | 是 | 是 | 检索条件,指定列名查询,如果该参数为空时默认查询uri、name、fileType。示例:
fetchColumns: "uri"| -| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md) | 是 | 是 | 谓词查询,显示过滤条件 | +| fetchColumns | Array<string> | 是 | 是 | 检索条件,指定列名查询,如果该参数为空时默认查询uri、name、fileType(具体字段名称以检索对象定义为准)。示例:
fetchColumns: ['uri', 'title']。 | +| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md) | 是 | 是 | 谓词查询,显示过滤条件。 | ## AlbumFetchOptions 相册检索条件。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.FileManagement.UserFileManager.Core +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core | 名称 | 类型 | 可读 | 可写 | 说明 | | ---------------------- | ------------------- | ---- |---- | ------------------------------------------------ | -| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md) | 是 | 是 | 谓词查询,显示过滤条件 | +| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md) | 是 | 是 | 谓词查询,显示过滤条件。 | + +## ChangeData10+ + +监听器回调函数的值。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------- | --------------------------- | ---- | ---- | ------------------------------------------------------------ | +| type | [NotifyType](#notifytype10) | 是 | 否 | ChangeData的通知类型。 | +| uris | Array<string> | 是 | 否 | 相同[NotifyType](#notifytype10)的所有uri,可以是FileAsset或Album。 | +| subUris | Array<string> | 是 | 否 | 相册中变动文件的uri数组。 | + +## NotifyType10+ + +枚举,通知事件的类型。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 值 | 说明 | +| ------------------------- | ---- | -------------------------------- | +| NOTIFY_ADD | 0 | 添加文件集或相册通知的类型。 | +| NOTIFY_UPDATE | 1 | 文件集或相册的更新通知类型。 | +| NOTIFY_REMOVE | 2 | 删除文件集或相册的通知类型。 | +| NOTIFY_ALBUM_ADD_ASSET | 3 | 在相册中添加的文件集的通知类型。 | +| NOTIFY_ALBUM_REMOVE_ASSET | 4 | 在相册中删除的文件集的通知类型。 | + +## DefaultChangeUri10+ + +枚举,DefaultChangeUri子类型。 + +**系统能力**:SystemCapability.FileManagement.UserFileManager.Core + +| 名称 | 值 | 说明 | +| ----------------- | ----------------------- | ------------------------------------------------------------ | +| DEFAULT_PHOTO_URI | file://media/Photo | 默认PhotoAsset的Uri,与forSubUri{true}一起使用,将接收所有PhotoAsset的更改通知。 | +| DEFAULT_ALBUM_URI | file://media/PhotoAlbum | 默认相册的Uri,与forSubUri{true}一起使用,将接收所有相册的更改通知。 | +| DEFAULT_AUDIO_URI | file://media/Audio | 默认AudioAsset的Uri,与forSubUri{true}一起使用,将接收所有AudioAsset的更改通知。 | + diff --git a/zh-cn/application-dev/reference/apis/js-apis-worker.md b/zh-cn/application-dev/reference/apis/js-apis-worker.md index cd01523cbc9fb15c490ddc3e66249f2b633acc94..bc9fdee8551c7a500f1214b8a45b106d22ee08db 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-worker.md +++ b/zh-cn/application-dev/reference/apis/js-apis-worker.md @@ -82,9 +82,9 @@ import worker from '@ohos.worker'; // worker线程创建 // FA模型-目录同级(entry模块下,workers目录与pages目录同级) -const workerFAModel01 = new worker.ThreadWorker("workers/worker.js", {name:"first worker in FA model"}); +const workerFAModel01 = new worker.ThreadWorker("workers/worker.ts", {name:"first worker in FA model"}); // FA模型-目录不同级(entry模块下,workers目录与pages目录的父目录同级) -const workerFAModel02 = new worker.ThreadWorker("../workers/worker.js"); +const workerFAModel02 = new worker.ThreadWorker("../workers/worker.ts"); // Stage模型-目录同级(entry模块下,workers目录与pages目录同级) const workerStageModel01 = new worker.ThreadWorker('entry/ets/workers/worker.ts', {name:"first worker in Stage model"}); @@ -383,10 +383,10 @@ workerInstance.onexit = function(e) { } //onexit被执行两种方式: -//主线程: +// main thread: workerInstance.terminate(); -//worker线程: +// worker线程: //parentPort.close() ``` @@ -871,13 +871,13 @@ Worker线程向宿主线程发送消息。 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts"); workerInstance.postMessage("hello world"); workerInstance.onmessage = function(e) { // let data = e.data; - console.log("receive data from worker.js"); + console.log("receive data from worker.ts"); } ``` @@ -919,13 +919,13 @@ Worker线程向宿主线程发送消息。 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts"); workerInstance.postMessage("hello world"); workerInstance.onmessage = function(e) { // let data = e.data; - console.log("receive data from worker.js"); + console.log("receive data from worker.ts"); } ``` @@ -935,7 +935,7 @@ import worker from '@ohos.worker'; const workerPort = worker.workerPort; workerPort.onmessage = function(e){ // let data = e.data; - workerPort.postMessage("receive data from main.js"); + workerPort.postMessage("receive data from main thread"); } ``` @@ -959,7 +959,7 @@ close(): void **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts"); ``` @@ -1001,7 +1001,7 @@ DedicatedWorkerGlobalScope的onmessage属性表示Worker线程收到来自其宿 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts"); workerInstance.postMessage("hello world"); @@ -1012,7 +1012,7 @@ workerInstance.postMessage("hello world"); import worker from '@ohos.worker'; const workerPort = worker.workerPort; workerPort.onmessage = function(e) { - console.log("receive main.js message"); + console.log("receive main thread message"); } ``` @@ -1044,7 +1044,7 @@ DedicatedWorkerGlobalScope的onmessageerror属性表示当Worker对象接收到 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts"); ``` @@ -1054,7 +1054,7 @@ const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts"); import worker from '@ohos.worker'; const parentPort = worker.workerPort; parentPort.onmessageerror = function(e) { - console.log("worker.js onmessageerror") + console.log("worker.ts onmessageerror") } ``` @@ -1129,7 +1129,7 @@ GlobalScope的onerror属性表示Worker在执行过程中发生异常被调用 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts") ``` @@ -1139,7 +1139,7 @@ const workerInstance = new worker.ThreadWorker("entry/ets/workers/worker.ts") import worker from '@ohos.worker'; const workerPort = worker.workerPort workerPort.onerror = function(e){ - console.log("worker.js onerror") + console.log("worker.ts onerror") } ``` @@ -1192,9 +1192,9 @@ import worker from '@ohos.worker'; // worker线程创建 // FA模型-目录同级 -const workerFAModel01 = new worker.Worker("workers/worker.js", {name:"first worker in FA model"}); +const workerFAModel01 = new worker.Worker("workers/worker.ts", {name:"first worker in FA model"}); // FA模型-目录不同级(以workers目录放置pages目录前一级为例) -const workerFAModel02 = new worker.Worker("../workers/worker.js"); +const workerFAModel02 = new worker.Worker("../workers/worker.ts"); // Stage模型-目录同级 const workerStageModel01 = new worker.Worker('entry/ets/workers/worker.ts', {name:"first worker in Stage model"}); @@ -1274,7 +1274,7 @@ postMessage(message: Object, transfer: ArrayBuffer[]): void; **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); var buffer = new ArrayBuffer(8); workerInstance.postMessage(buffer, [buffer]); @@ -1301,7 +1301,7 @@ postMessage(message: Object, options?: PostMessageOptions): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.postMessage("hello world"); @@ -1331,7 +1331,7 @@ on(type: string, listener: EventListener): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.on("alert", (e)=>{ console.log("alert listener callback"); }) @@ -1359,7 +1359,7 @@ once(type: string, listener: EventListener): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.once("alert", (e)=>{ console.log("alert listener callback"); }) @@ -1387,7 +1387,7 @@ off(type: string, listener?: EventListener): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); //使用on接口、once接口或addEventListener接口创建“alert”事件,使用off接口删除事件。 workerInstance.off("alert"); ``` @@ -1407,7 +1407,7 @@ terminate(): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.terminate(); ``` @@ -1432,13 +1432,13 @@ Worker对象的onexit属性表示Worker销毁时被调用的事件处理程序 **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.onexit = function(e) { console.log("onexit"); } //onexit被执行两种方式: -//主线程: +//main thread: workerInstance.terminate(); //worker线程: @@ -1466,7 +1466,7 @@ Worker对象的onerror属性表示Worker在执行过程中发生异常被调用 **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.onerror = function(e) { console.log("onerror"); } @@ -1493,7 +1493,7 @@ Worker对象的onmessage属性表示宿主线程接收到来自其创建的Worke **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.onmessage = function(e) { // e : MessageEvent, 用法如下: // let data = e.data; @@ -1522,7 +1522,7 @@ Worker对象的onmessageerror属性表示当Worker对象接收到一条无法被 **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.onmessageerror= function(e) { console.log("onmessageerror"); } @@ -1554,7 +1554,7 @@ addEventListener(type: string, listener: EventListener): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.addEventListener("alert", (e)=>{ console.log("alert listener callback"); }) @@ -1582,7 +1582,7 @@ removeEventListener(type: string, callback?: EventListener): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.addEventListener("alert", (e)=>{ console.log("alert listener callback"); }) @@ -1616,7 +1616,7 @@ dispatchEvent(event: Event): boolean **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.dispatchEvent({type:"eventType", timeStamp:0}); //timeStamp暂未支持。 ``` @@ -1624,7 +1624,7 @@ workerInstance.dispatchEvent({type:"eventType", timeStamp:0}); //timeStamp暂未 分发事件(dispatchEvent)可与监听接口(on、once、addEventListener)搭配使用,示例如下: ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); //用法一: workerInstance.on("alert_on", (e)=>{ @@ -1676,7 +1676,7 @@ removeAllListener(): void **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.addEventListener("alert", (e)=>{ console.log("alert listener callback"); }) @@ -1730,17 +1730,17 @@ Worker线程向宿主线程发送消息。 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.postMessage("hello world"); workerInstance.onmessage = function(e) { // let data = e.data; - console.log("receive data from worker.js"); + console.log("receive data from worker.ts"); } ``` ```js -// worker.js +// worker.ts import worker from '@ohos.worker'; const parentPort = worker.parentPort; parentPort.onmessage = function(e){ @@ -1771,22 +1771,22 @@ Worker线程向宿主线程发送消息。 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.postMessage("hello world"); workerInstance.onmessage = function(e) { // let data = e.data; - console.log("receive data from worker.js"); + console.log("receive data from worker.ts"); } ``` ```js -// worker.js +// worker.ts import worker from '@ohos.worker'; const parentPort = worker.parentPort; parentPort.onmessage = function(e){ // let data = e.data; - parentPort.postMessage("receive data from main.js"); + parentPort.postMessage("receive data from main thread"); } ``` @@ -1804,12 +1804,12 @@ close(): void **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); ``` ```js -// worker.js +// worker.ts import worker from '@ohos.worker'; const parentPort = worker.parentPort; parentPort.onmessage = function(e) { @@ -1839,17 +1839,17 @@ DedicatedWorkerGlobalScope的onmessage属性表示Worker线程收到来自其宿 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.postMessage("hello world"); ``` ```js -// worker.js +// worker.ts import worker from '@ohos.worker'; const parentPort = worker.parentPort; parentPort.onmessage = function(e) { - console.log("receive main.js message"); + console.log("receive main thread message"); } ``` @@ -1875,16 +1875,16 @@ DedicatedWorkerGlobalScope的onmessageerror属性表示当Worker对象接收到 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); ``` ```js -// worker.js +// worker.ts import worker from '@ohos.worker'; const parentPort = worker.parentPort; parentPort.onmessageerror = function(e) { - console.log("worker.js onmessageerror") + console.log("worker.ts onmessageerror") } ``` @@ -1938,7 +1938,7 @@ parentPort.onmessageerror = function(e) { **示例:** ```js -const workerInstance = new worker.Worker("workers/worker.js"); +const workerInstance = new worker.Worker("workers/worker.ts"); workerInstance.addEventListener("alert", (e)=>{ console.log("alert listener callback"); }) @@ -2008,16 +2008,16 @@ WorkerGlobalScope的onerror属性表示Worker在执行过程中发生异常被 **示例:** ```js -// main.js +// main thread import worker from '@ohos.worker'; -const workerInstance = new worker.Worker("workers/worker.js") +const workerInstance = new worker.Worker("workers/worker.ts") ``` ```js -// worker.js +// worker.ts import worker from '@ohos.worker'; const parentPort = worker.parentPort parentPort.onerror = function(e){ - console.log("worker.js onerror") + console.log("worker.ts onerror") } ``` @@ -2043,17 +2043,17 @@ parentPort.onerror = function(e){ > 以API version 9的FA工程为例。 ```js -// main.js +// main thread import worker from '@ohos.worker'; -const workerInstance = new worker.ThreadWorker("workers/worker.js"); -workerInstance.postMessage("message from main to worker"); +const workerInstance = new worker.ThreadWorker("workers/worker.ts"); +workerInstance.postMessage("message from main thread to worker"); workerInstance.onmessage = function(d) { // 当worker线程传递obj2时,data即为obj2。data没有Init、SetName的方法 let data = d.data; } ``` ```js -// worker.js +// worker.ts import worker from '@ohos.worker'; const workerPort = worker.workerPort; class MyModel { @@ -2063,7 +2063,7 @@ class MyModel { } } workerPort.onmessage = function(d) { - console.log("worker.js onmessage"); + console.log("worker.ts onmessage"); let data = d.data; let func1 = function() { console.log("post message is function"); @@ -2081,10 +2081,10 @@ workerPort.onmessage = function(d) { workerPort.postMessage(obj2); // 传递obj2不会发生序列化错误 } workerPort.onmessageerror = function(e) { - console.log("worker.js onmessageerror"); + console.log("worker.ts onmessageerror"); } workerPort.onerror = function(e) { - console.log("worker.js onerror"); + console.log("worker.ts onerror"); } ``` @@ -2101,7 +2101,7 @@ Actor并发模型的交互原理:各个Actor并发地处理主线程任务, - 自API version 9版本开始,若Worker处于已经销毁或正在销毁等非运行状态时,调用其功能接口,会抛出相应的BusinessError。 - Worker的创建和销毁耗费性能,建议管理已创建的Worker并重复使用。 - 创建Worker工程时,new worker.Worker构造函数和new worker.ThreadWorker构造函数不能同时使用,否则将导致工程中Worker的功能异常。自API version 9版本开始,建议使用[new worker.ThreadWorker](#constructor9)构造函数,在API version 8及之前的版本,建议使用[new worker.Worker](#constructordeprecated)构造函数。 -- 创建Worker工程时,在Worker线程的文件中(比如本文中worker.ts)不能导入任何有关构建UI的方法(比如ETS文件等),否则会导致Worker的功能失效。排查方式:解压生成的Hap包,在创建Worker线程的文件目录中找到"worker.js",全局搜索"View"关键字。如果存在该关键字,说明在worker.js中打包进去了构建UI的方法,会导致Worker的功能失效,建议在创建Worker线程的文件中修改 "import “xxx” from src"中src的目录层级。 +- 创建Worker工程时,在Worker线程的文件中(比如本文中worker.ts)不能导入任何有关构建UI的方法(比如ets文件等),否则会导致Worker的功能失效。排查方式:解压生成的Hap包,在创建Worker线程的文件目录中找到"worker.js",全局搜索"View"关键字。如果存在该关键字,说明在worker.js中打包进去了构建UI的方法,会导致Worker的功能失效,建议在创建Worker线程的文件中修改 "import “xxx” from src"中src的目录层级。 ## 完整示例 > **说明:**
@@ -2109,15 +2109,10 @@ Actor并发模型的交互原理:各个Actor并发地处理主线程任务, ### FA模型 ```js -// main.js(同级目录为例) +// main thread(同级目录为例) import worker from '@ohos.worker'; // 主线程中创建Worker对象 const workerInstance = new worker.ThreadWorker("workers/worker.ts"); -// 创建js和ts文件都可以 -// const workerInstance = new worker.ThreadWorker("workers/worker.js"); - -// API version 9之前版本,worker对象的构造方法 -// const workerInstance = new worker.Worker("workers/worker.js"); // 主线程向worker线程传递信息 workerInstance.postMessage("123"); @@ -2126,7 +2121,7 @@ workerInstance.postMessage("123"); workerInstance.onmessage = function(e) { // data:worker线程发送的信息 let data = e.data; - console.log("main.js onmessage"); + console.log("main thread onmessage"); // 销毁Worker对象 workerInstance.terminate(); @@ -2134,7 +2129,7 @@ workerInstance.onmessage = function(e) { // 在调用terminate后,执行回调onexit workerInstance.onexit = function() { - console.log("main.js terminate"); + console.log("main thread terminate"); } ``` ```js @@ -2144,9 +2139,6 @@ import worker from '@ohos.worker'; // 创建worker线程中与主线程通信的对象 const workerPort = worker.workerPort -// API version 9之前版本,创建worker线程中与主线程通信的对象 -// const parentPort = worker.parentPort - // worker线程接收主线程信息 workerPort.onmessage = function(e) { // data:主线程发送的信息 @@ -2174,13 +2166,11 @@ build-profile.json5 配置 : ``` ### Stage模型 ```js -// main.js(以不同目录为例) +// main thread(以不同目录为例) import worker from '@ohos.worker'; // 主线程中创建Worker对象 const workerInstance = new worker.ThreadWorker("entry/ets/pages/workers/worker.ts"); -// 创建js和ts文件都可以 -// const workerInstance = new worker.ThreadWorker("entry/ets/pages/workers/worker.js"); // 主线程向worker线程传递信息 workerInstance.postMessage("123"); @@ -2189,14 +2179,14 @@ workerInstance.postMessage("123"); workerInstance.onmessage = function(e) { // data:worker线程发送的信息 let data = e.data; - console.log("main.js onmessage"); + console.log("main thread onmessage"); // 销毁Worker对象 workerInstance.terminate(); } // 在调用terminate后,执行onexit workerInstance.onexit = function() { - console.log("main.js terminate"); + console.log("main thread terminate"); } ``` ```js diff --git a/zh-cn/application-dev/reference/arkui-js-lite/js-framework-js-tag.md b/zh-cn/application-dev/reference/arkui-js-lite/js-framework-js-tag.md index c6347aae68d63c9f6a91de893f03efffaf378264..0bb530bfcfcf056902a81571a131055f5f11d6a2 100644 --- a/zh-cn/application-dev/reference/arkui-js-lite/js-framework-js-tag.md +++ b/zh-cn/application-dev/reference/arkui-js-lite/js-framework-js-tag.md @@ -7,7 +7,7 @@ js标签中包含了实例名称、页面路由信息。 | 标签 | 类型 | 默认值 | 必填 | 描述 | | ----- | ------ | ------- | ---- | ----------------------------- | | name | string | default | 是 | 标识JS实例的名字。 | -| pages | Array | - | 是 | 路由信息,详见“**[pages](#pages)**”。 | +| pages | Array | - | 是 | 路由信息,详见“[pages](#pages)”。 | > **说明:** @@ -46,7 +46,7 @@ js标签中包含了实例名称、页面路由信息。 ``` { "app": { - "bundleName": "com.huawei.player", + "bundleName": "com.example.player", "version": { "code": 1, "name": "1.0" diff --git a/zh-cn/application-dev/reference/arkui-js/Readme-CN.md b/zh-cn/application-dev/reference/arkui-js/Readme-CN.md index b4f136fbe25313fbb7925f96d35bed69c8511219..34fbb5e70ccfbb2910b3edc2bfeaee56139a3b12 100644 --- a/zh-cn/application-dev/reference/arkui-js/Readme-CN.md +++ b/zh-cn/application-dev/reference/arkui-js/Readme-CN.md @@ -93,7 +93,7 @@ - [animateMotion](js-components-svg-animatemotion.md) - [animateTransform](js-components-svg-animatetransform.md) - 自定义组件 - - [基本用法](js-components-custom-basic-usage.md) + - [自定义组件的基本用法](js-components-custom-basic-usage.md) - [数据传递与处理](js-components-custom-props.md) - [继承样式](js-components-custom-style.md) - [slot插槽](js-components-custom-slot.md) diff --git a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md index 7e9b4a568d5b0b16fb7f757802133a2f710dfa73..187881a92ce1c274d5018b8f133ca193b41c897e 100644 --- a/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md +++ b/zh-cn/application-dev/reference/arkui-ts/Readme-CN.md @@ -40,12 +40,12 @@ - [触摸热区设置](ts-universal-attributes-touch-target.md) - [多态样式](ts-universal-attributes-polymorphic-style.md) - [触摸测试控制](ts-universal-attributes-hit-test-behavior.md) - - [背景模糊设置](ts-universal-attributes-backgroundBlurStyle.md) + - [组件背景模糊](ts-universal-attributes-backgroundBlurStyle.md) - [分布式迁移标识](ts-universal-attributes-restoreId.md) - [前景色设置](ts-universal-attributes-foreground-color.md) - - [图像球面效果设置](ts-universal-attributes-sphericalEffect.md) - - [图像渐亮效果设置](ts-universal-attributes-lightUpEffect.md) - - [图像像素扩展效果设置](ts-universal-attributes-pixelStretchEffect.md) + - [图像球面效果](ts-universal-attributes-sphericalEffect.md) + - [图像渐亮效果](ts-universal-attributes-lightUpEffect.md) + - [图像边缘像素扩展效果](ts-universal-attributes-pixelStretchEffect.md) - 模态转场设置 - [全屏模态转场](ts-universal-attributes-modal-transition.md) - [半模态转场](ts-universal-attributes-sheet-transition.md) @@ -69,7 +69,7 @@ - [DataPanel](ts-basic-components-datapanel.md) - [DatePicker](ts-basic-components-datepicker.md) - [Divider](ts-basic-components-divider.md) - - [Formcomponent](ts-basic-components-formcomponent.md) + - [FormComponent](ts-basic-components-formcomponent.md) - [Gauge](ts-basic-components-gauge.md) - [Image](ts-basic-components-image.md) - [ImageAnimator](ts-basic-components-imageanimator.md) @@ -148,10 +148,12 @@ - [Shape](ts-drawing-components-shape.md) - 画布组件 - [Canvas](ts-components-canvas-canvas.md) - - [CanvasRenderingContext2D对象](ts-canvasrenderingcontext2d.md) - [CanvasGradient对象](ts-components-canvas-canvasgradient.md) + - [CanvasPattern](ts-components-canvas-canvaspattern.md) + - [CanvasRenderingContext2D对象](ts-canvasrenderingcontext2d.md) - [ImageBitmap对象](ts-components-canvas-imagebitmap.md) - [ImageData对象](ts-components-canvas-imagedata.md) + - [Matrix2D](ts-components-canvas-matrix2d.md) - [OffscreenCanvasRenderingContext2D对象](ts-offscreencanvasrenderingcontext2d.md) - [Path2D对象](ts-components-canvas-path2d.md) - [Lottie](ts-components-canvas-lottie.md) @@ -168,14 +170,14 @@ - [警告弹窗](ts-methods-alert-dialog-box.md) - [列表选择弹窗](ts-methods-action-sheet.md) - [自定义弹窗](ts-methods-custom-dialog-box.md) - - [日期选择弹窗](ts-methods-datepicker-dialog.md) - - [时间选择弹窗](ts-methods-timepicker-dialog.md) - - [文本选择弹窗](ts-methods-textpicker-dialog.md) + - [日期滑动选择器弹窗](ts-methods-datepicker-dialog.md) + - [时间滑动选择器弹窗](ts-methods-timepicker-dialog.md) + - [文本滑动选择器弹窗](ts-methods-textpicker-dialog.md) - [菜单](ts-methods-menu.md) - [自定义组件的生命周期](ts-custom-component-lifecycle.md) - [应用级变量的状态管理](ts-state-management.md) - [像素单位](ts-pixel-units.md) - [枚举说明](ts-appendix-enums.md) -- [类型说明](ts-types.md) +- [类型定义](ts-types.md) - 已停止维护的组件 - [GridContainer](ts-container-gridcontainer.md) diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/canvas_pattern.gif b/zh-cn/application-dev/reference/arkui-ts/figures/canvas_pattern.gif new file mode 100644 index 0000000000000000000000000000000000000000..98acc8dbefc1e6e93a7679e0787d2be007943668 Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/canvas_pattern.gif differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/size.jpeg b/zh-cn/application-dev/reference/arkui-ts/figures/size.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..b89a721447db8981ebe3fb34bccbfd939dd1f91e Binary files /dev/null and b/zh-cn/application-dev/reference/arkui-ts/figures/size.jpeg differ diff --git a/zh-cn/application-dev/reference/arkui-ts/figures/size.png b/zh-cn/application-dev/reference/arkui-ts/figures/size.png deleted file mode 100644 index 5170abe9fb68747018cecc57e27df68806bafac4..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/reference/arkui-ts/figures/size.png and /dev/null differ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md index d6018523f80ac752cc688cde2a30916eca818040..0ae90d5fe8561306dfe4c58de39b92b8ab103548 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-appendix-enums.md @@ -293,12 +293,12 @@ | 名称 | 描述 | | -------- | ------------------------------------------------------------ | -| Auto | 使用Flex、GridRow容器中默认配置。 | -| Start | 元素在Flex、GridRow容器中,交叉轴方向首部对齐。 | -| Center | 元素在Flex、GridRow容器中,交叉轴方向居中对齐。 | -| End | 元素在Flex、GridRow容器中,交叉轴方向底部对齐。 | -| Stretch | 元素在Flex、GridRow容器中,交叉轴方向拉伸填充。容器为Flex且设置Wrap为FlexWrap.Wrap或FlexWrap.WrapReverse时,元素拉伸到与当前行/列交叉轴长度最长的元素尺寸。其余情况在元素未设置尺寸时,拉伸到容器尺寸。 | -| Baseline | 元素在Flex、GridRow容器中,交叉轴方向文本基线对齐。 | +| Auto | 使用Flex容器中默认配置。 | +| Start | 元素在Flex容器中,交叉轴方向首部对齐。 | +| Center | 元素在Flex容器中,交叉轴方向居中对齐。 | +| End | 元素在Flex容器中,交叉轴方向底部对齐。 | +| Stretch | 元素在Flex容器中,交叉轴方向拉伸填充。容器为Flex且设置Wrap为FlexWrap.Wrap或FlexWrap.WrapReverse时,元素拉伸到与当前行/列交叉轴长度最长的元素尺寸。其余情况在元素未设置尺寸时,拉伸到容器尺寸。 | +| Baseline | 元素在Flex容器中,交叉轴方向文本基线对齐。 | ## FlexDirection diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md index b56ae7462ea262d96d87f4b30ab7111bc5748dca..b199a59a9fb33a1c13b61ffd7a1a50d8bcc287ca 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-datapanel.md @@ -46,18 +46,18 @@ DataPanel(options:{values: number[], max?: number, type?: DataPanelType}) | 名称 | 参数类型 | 必填 | 描述 | | ------------- | ------- | ---- | -------- | -| closeEffect | boolean | 是 | 关闭数据占比图表旋转动效。
默认值:false | +| closeEffect | boolean | 是 | 关闭数据占比图表旋转动效和投影效果。
默认值:false
**说明:**
若未设置trackShadow属性,则该属性控制投影效果的开关,开启投影的效果为投影的默认效果。
若设置trackShadow属性,则由trackShadow属性值控制投影效果的开关。| | valueColors10+ | Array<[ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient](#lineargradient10对象说明)> | 是 | 各数据段颜色,ResourceColor为纯色,LinearGradient为渐变色。| | trackBackgroundColor10+ | [ResourceColor](ts-types.md#resourcecolor) | 是 | 底板颜色。
默认值:'#081824' | | strokeWidth10+ | [Length](ts-types.md#Length) | 是 | 圆环粗细。
默认值:24
单位:vp
**说明:**
设置小于0的值时,按默认值显示。
数据面板的类型为DataPanelType.Line时该属性不生效。 | -| trackShadow10+ | [DataPanelShadowOption](#datapanelshadowoption10对象说明) | 是 | 投影样式,不设置为不开启投影。| +| trackShadow10+ | [DataPanelShadowOption](#datapanelshadowoption10对象说明) | 是 | 投影样式。
**说明:**
设置null为不开启投影。| ## DataPanelShadowOption10+对象说明 | 名称 | 参数类型 | 必填 | 描述 | | ------------- | ------- | ---- | -------- | -| radius | number \| [Resource](ts-types.md#resource类型) | 否 | 阴影模糊半径。
默认值:5
单位:vp | -| colors | Array<[ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient](#lineargradient10对象说明)> | 否 | 各数据段阴影的颜色。
默认值:与valueColors值相同 | +| radius | number \| [Resource](ts-types.md#resource类型) | 否 | 投影模糊半径。
默认值:5
单位:vp
**说明:**
设置小于等于0的值时,按默认值显示。| +| colors | Array<[ResourceColor](ts-types.md#resourcecolor) \| [LinearGradient](#lineargradient10对象说明)> | 否 | 各数据段投影的颜色。
默认值:与valueColors值相同
**说明:**
若设置的投影颜色的个数少于数据段个数时,则显示的投影颜色的个数和设置的投影颜色个数一致。
若设置的投影颜色的个数多于数据段个数时,则显示的投影颜色的个数和数据段个数一致。| | offsetX | number \| [Resource](ts-types.md#resource类型) | 否 | X轴的偏移量。
默认值:5
单位:vp | | offsetY | number \| [Resource](ts-types.md#resource类型) | 否 | Y轴的偏移量。
默认值:5
单位:vp | @@ -79,7 +79,7 @@ LinearGradient(colorStops: ColorStop[]) | 名称 | 参数类型 | 必填 | 描述 | | ------------- | ------- | ---- | -------- | | color | [ResourceColor](ts-types.md#resourcecolor) | 是 | 颜色值。| -| offset | [Length](ts-types.md#Length) | 是 | 渐变色断点(0~1之间的比例值)。| +| offset | [Length](ts-types.md#Length) | 是 | 渐变色断点(0~1之间的比例值,若数据值小于0则置为0,若数据值大于1则置为1)。| diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md index 8f2609ef6a4828d2703f7066e08036266a107ca9..186fc08864a5b5a8da793bd3f3b1fed536f940a0 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-gauge.md @@ -23,9 +23,9 @@ Gauge(options:{value: number, min?: number, max?: number}) | 参数名 | 参数类型 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -| value | number | 是 | 量规图的当前数据值,即图中指针指向位置。用于组件创建时量规图初始值的预置。 | +| value | number | 是 | 量规图的当前数据值,即图中指针指向位置。用于组件创建时量规图初始值的预置。
**说明:**
value不在min和max范围内时使用min作为默认值。 | | min | number | 否 | 当前数据段最小值。
默认值:0 | -| max | number | 否 | 当前数据段最大值。
默认值:100 | +| max | number | 否 | 当前数据段最大值。
默认值:100
**说明:**
max小于min时使用默认值0和100。
max和min支持负数。 | ## 属性 @@ -36,8 +36,8 @@ Gauge(options:{value: number, min?: number, max?: number}) | value | number | 设置量规图的数据值,可用于动态修改量规图的数据值。
默认值:0
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | startAngle | number | 设置起始角度位置,时钟0点为0度,顺时针方向为正角度。
默认值:0
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | endAngle | number | 设置终止角度位置,时钟0点为0度,顺时针方向为正角度。
默认值:360
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| colors | Array<[ColorStop](#colorstop)> | 设置量规图的颜色,支持分段颜色设置。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| strokeWidth | Length | 设置环形量规图的环形厚度。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| colors | Array<[ColorStop](#colorstop)> | 设置量规图的颜色,支持分段颜色设置。
默认值:Color.Black
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| strokeWidth | Length | 设置环形量规图的环形厚度。
默认值:4
单位:vp
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
设置小于0的值时,按默认值显示。
不支持百分比。 | ## ColorStop @@ -47,7 +47,7 @@ Gauge(options:{value: number, min?: number, max?: number}) | 名称 | 类型定义 | 描述 | | --------- | -------------------- | ------------------------------------------------------------ | -| ColorStop | [[ResourceColor](ts-types.md#resourcecolor), number] | 描述渐进色颜色断点类型,第一个参数为颜色值,若设置为非颜色类型,则置为黑色。第二个参数为颜色所占比重,若设置为负数或是非数值类型,则将比重置为0,该颜色不显示。 | +| ColorStop | [[ResourceColor](ts-types.md#resourcecolor), number] | 描述渐进色颜色断点类型,第一个参数为颜色值,若设置为非颜色类型,则置为黑色。第二个参数为颜色所占比重,若设置为负数或是非数值类型,则将比重置为0。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md index 178c95ff9f2f3515d59ae425d5b1a8dfaa131ffa..164d8612e63633f14b0fc749c1d6ce400b5d16d2 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md @@ -17,31 +17,33 @@ ImageAnimator() +从API version 10开始,该接口支持在ArkTS卡片中使用。 + ## 属性 除支持[通用属性](ts-universal-attributes-size.md)外,还支持以下属性: | 参数名称 | 参数类型 |参数描述 | | ---------- | ----------------------- |-------- | -| images | Array<[ImageFrameInfo](#imageframeinfo对象说明)> | 设置图片帧信息集合。每一帧的帧信息(ImageFrameInfo)包含图片路径、图片大小、图片位置和图片播放时长信息,详见ImageFrameInfo属性说明。
默认值:[]
**说明:**
不支持动态更新。 | -| state | [AnimationStatus](ts-appendix-enums.md#animationstatus) | 默认为初始状态,用于控制播放状态。
默认值:AnimationStatus.Initial | -| duration | number | 单位为毫秒,默认时长为1000ms;duration为0时,不播放图片;值的改变只会在下一次循环开始时生效;当images中任意一帧图片设置了单独的duration后,该属性设置无效。
默认值:1000 | -| reverse | boolean | 设置播放顺序。false表示从第1张图片播放到最后1张图片; true表示从最后1张图片播放到第1张图片。
默认值:false | -| fixedSize | boolean | 设置图片大小是否固定为组件大小。 true表示图片大小与组件大小一致,此时设置图片的width 、height 、top 和left属性是无效的。false表示每一张图片的width 、height 、top和left属性都要单独设置。
默认值:true | -| preDecode(deprecated) | number | 预解码的图片数量。例如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。
从API version9开始废弃。
默认值:0 | -| fillMode | [FillMode](ts-appendix-enums.md#fillmode) | 设置动画开始前和结束后的状态,可选值参见FillMode说明。
默认值:FillMode.Forwards | -| iterations | number | 默认播放一次,设置为-1时表示无限次播放。
默认值:1 | +| images | Array<[ImageFrameInfo](#imageframeinfo对象说明)> | 设置图片帧信息集合。每一帧的帧信息(ImageFrameInfo)包含图片路径、图片大小、图片位置和图片播放时长信息,详见ImageFrameInfo属性说明。
默认值:[]
**说明:**
不支持动态更新。
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| state | [AnimationStatus](ts-appendix-enums.md#animationstatus) | 默认为初始状态,用于控制播放状态。
默认值:AnimationStatus.Initial
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| duration | number | 单位为毫秒,默认时长为1000ms;duration为0时,不播放图片;值的改变只会在下一次循环开始时生效;当images中任意一帧图片设置了单独的duration后,该属性设置无效。
默认值:1000
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| reverse | boolean | 设置播放顺序。false表示从第1张图片播放到最后1张图片; true表示从最后1张图片播放到第1张图片。
默认值:false
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| fixedSize | boolean | 设置图片大小是否固定为组件大小。 true表示图片大小与组件大小一致,此时设置图片的width 、height 、top 和left属性是无效的。false表示每一张图片的width 、height 、top和left属性都要单独设置。
默认值:true
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| preDecode(deprecated) | number | 预解码的图片数量。例如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。
从API version9开始废弃。
默认值:0 | +| fillMode | [FillMode](ts-appendix-enums.md#fillmode) | 设置动画开始前和结束后的状态,可选值参见FillMode说明。
默认值:FillMode.Forwards
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| iterations | number | 默认播放一次,设置为-1时表示无限次播放。
默认值:1 | ## ImageFrameInfo对象说明 | 参数名称 | 参数类型 | 必填 | 参数描述 | | -------- | -------------- | -------- | -------- | -| src | string \| [Resource](ts-types.md#resource)9+ | 是 | 图片路径,图片格式为svg,png和jpg,从API Version9开始支持[Resource](ts-types.md#resource)类型的路径。| -| width | number \| string | 否 | 图片宽度。
默认值:0 | -| height | number \| string | 否 | 图片高度。
默认值:0 | -| top | number \| string | 否 | 图片相对于组件左上角的纵向坐标。
默认值:0 | -| left | number \| string | 否 | 图片相对于组件左上角的横向坐标。
默认值:0 | -| duration | number | 否 | 每一帧图片的播放时长,单位毫秒。
默认值:0 | +| src | string \| [Resource](ts-types.md#resource)9+ | 是 | 图片路径,图片格式为svg,png和jpg,从API Version9开始支持[Resource](ts-types.md#resource)类型的路径。
从API version 10开始,该接口支持在ArkTS卡片中使用。| +| width | number \| string | 否 | 图片宽度。
默认值:0
从API version 10开始,该接口支持在ArkTS卡片中使用 | +| height | number \| string | 否 | 图片高度。
默认值:0
从API version 10开始,该接口支持在ArkTS卡片中使用 | +| top | number \| string | 否 | 图片相对于组件左上角的纵向坐标。
默认值:0
从API version 10开始,该接口支持在ArkTS卡片中使用 | +| left | number \| string | 否 | 图片相对于组件左上角的横向坐标。
默认值:0
从API version 10开始,该接口支持在ArkTS卡片中使用 | +| duration | number | 否 | 每一帧图片的播放时长,单位毫秒。
默认值:0 | ## 事件 @@ -49,11 +51,11 @@ ImageAnimator() | 名称 | 功能描述 | | -------- | -------- | -| onStart(event: () => void) | 状态回调,动画开始播放时触发。 | -| onPause(event: () => void) | 状态回调,动画暂停播放时触发。 | -| onRepeat(event: () => void) | 状态回调,动画重复播放时触发。 | -| onCancel(event: () => void) | 状态回调,动画取消播放时触发。 | -| onFinish(event: () => void) | 状态回调,动画播放完成时触发。 | +| onStart(event: () => void) | 状态回调,动画开始播放时触发。
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| onPause(event: () => void) | 状态回调,动画暂停播放时触发。
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| onRepeat(event: () => void) | 状态回调,动画重复播放时触发。 | +| onCancel(event: () => void) | 状态回调,动画取消播放时触发。
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| onFinish(event: () => void) | 状态回调,动画播放完成时触发。
从API version 10开始,该接口支持在ArkTS卡片中使用。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md index fb9a962a564af2c5cf963a16d996e0d1b457270d..b187df205a98398277c003fb42f1f2fbbc3d21db 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-span.md @@ -6,7 +6,7 @@ > > 该组件从API Version 7开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 > -> 该组件从API Version 10开始支持继承父组件Text的属性,即如果子组件未设置属性且父组件设置属性,则继承父组件设置的属性。支持继承的属性仅包括:fontColor、fontSize、fontStyle、fontWeight、decoration、letterSpacing、textCase、lineHeight、fontfamily。 +> 该组件从API Version 10开始支持继承父组件Text的属性,即如果子组件未设置属性且父组件设置属性,则继承父组件设置的属性。支持继承的属性仅包括:fontColor、fontSize、fontStyle、fontWeight、decoration、letterSpacing、textCase、fontfamily。 ## 子组件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-stepperitem.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-stepperitem.md index 2dcd381ba8e505f7525ec7a4c7ba38838046aae6..b044077108773c9cdaf2f3623ebd1b78f6fa7131 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-stepperitem.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-stepperitem.md @@ -24,7 +24,7 @@ StepperItem() | -------- | -------- | -------- | | prevLabel | string | 设置左侧文本按钮内容,第一页没有左侧文本按钮,当步骤导航器大于一页时,除第一页外默认值都为“返回”。 | | nextLabel | string | 设置右侧文本按钮内容,最后一页默认值为“开始”,其余页默认值为“下一步”。 | -| status | ItemState | 步骤导航器nextLabel的显示状态。
默认值:ItemState.Normal | +| status | [ItemState](#itemstate枚举说明) | 步骤导航器nextLabel的显示状态,参数可选。
默认值:ItemState.Normal | ## ItemState枚举说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md b/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md index 8064fe0a391ca043834bcee421be7345bd626188..1e4a0f358d76a285de40d13f7ee59bbcc366b28f 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-canvasrenderingcontext2d.md @@ -40,9 +40,9 @@ RenderingContextSettings(antialias?: boolean) | 名称 | 类型 | 描述 | | ----------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| [fillStyle](#fillstyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](#canvaspattern) | 指定绘制的填充色。
- 类型为string时,表示设置填充区域的颜色。
- 类型为number时,表示设置填充区域的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [fillStyle](#fillstyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](ts-components-canvas-canvaspattern.md#canvaspattern) | 指定绘制的填充色。
- 类型为string时,表示设置填充区域的颜色。
- 类型为number时,表示设置填充区域的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [lineWidth](#linewidth) | number | 设置绘制线条的宽度。 | -| [strokeStyle](#strokestyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](#canvaspattern) | 设置描边的颜色。
- 类型为string时,表示设置描边使用的颜色。
- 类型为number时,表示设置描边使用的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [strokeStyle](#strokestyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](ts-components-canvas-canvaspattern.md#canvaspattern) | 设置描边的颜色。
- 类型为string时,表示设置描边使用的颜色。
- 类型为number时,表示设置描边使用的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [lineCap](#linecap) | CanvasLineCap | 指定线端点的样式,可选值为:
- 'butt':线端点以方形结束。
- 'round':线端点以圆形结束。
- 'square':线端点以方形结束,该样式下会增加一个长度和线段厚度相同,宽度是线段厚度一半的矩形。
默认值:'butt'
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [lineJoin](#linejoin) | CanvasLineJoin | 指定线段间相交的交点样式,可选值为:
- 'round':在线段相连处绘制一个扇形,扇形的圆角半径是线段的宽度。
- 'bevel':在线段相连处使用三角形为底填充, 每个部分矩形拐角独立。
- 'miter':在相连部分的外边缘处进行延伸,使其相交于一点,形成一个菱形区域,该属性可以通过设置miterLimit属性展现效果。
默认值:'miter'
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [miterLimit](#miterlimit) | number | 设置斜接面限制值,该值指定了线条相交处内角和外角的距离。
默认值:10
从API version 9开始,该接口支持在ArkTS卡片中使用。 | @@ -1269,11 +1269,11 @@ createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | nu | image | [ImageBitmap](ts-components-canvas-imagebitmap.md) | 是 | 图源对象,具体参考ImageBitmap对象。 | | repetition | string | 是 | 设置图像重复的方式,取值为:'repeat'、'repeat-x'、 'repeat-y'、'no-repeat'、'clamp'、'mirror'。
默认值:'' | -**返回值:**: +**返回值:** | 类型 | 说明 | | ------------------------------- | ----------------------- | -| [CanvasPattern](#canvaspattern) | 通过指定图像和重复方式创建图片填充的模板对象。 | +| [CanvasPattern](ts-components-canvas-canvaspattern.md#canvaspattern) | 通过指定图像和重复方式创建图片填充的模板对象。 | **示例:** @@ -1886,6 +1886,12 @@ getTransform(): Matrix2D 从API version 9开始,该接口支持在ArkTS卡片中使用。 +**返回值:** + +| 类型 | 说明 | +| ----------------------------------------------------- | ---------- | +| [Matrix2D](ts-components-canvas-matrix2d.md#Matrix2D) | 矩阵对象。 | + ### resetTransform @@ -2141,6 +2147,7 @@ setTransform方法使用的参数和transform()方法相同,但setTransform() ![zh-cn_image_0000001238712421](figures/zh-cn_image_0000001238712421.png) +### setTransform setTransform(transform?: Matrix2D): void @@ -2148,6 +2155,11 @@ setTransform(transform?: Matrix2D): void 从API version 9开始,该接口支持在ArkTS卡片中使用。 +**参数:** + +| 参数 | 类型 | 必填 | 默认值 | 描述 | +| --------- | ----------------------------------------------------- | ---- | ------ | ---------- | +| transform | [Matrix2D](ts-components-canvas-matrix2d.md#Matrix2D) | 否 | null | 变换矩阵。 | ### translate @@ -2899,9 +2911,3 @@ struct CanvasExample { ``` ![zh-cn_image_0000001239032419](figures/zh-cn_image_0000001239032420.png) - -## CanvasPattern - -一个Object对象, 通过[createPattern](#createpattern)方法创建。 - -从API version 9开始,该接口支持在ArkTS卡片中使用。 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvaspattern.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvaspattern.md new file mode 100644 index 0000000000000000000000000000000000000000..5563ac5a2a58a0d56efa788346642b8651c76677 --- /dev/null +++ b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-canvaspattern.md @@ -0,0 +1,73 @@ +# CanvasPattern + +一个Object对象,使用[createPattern](ts-canvasrenderingcontext2d.md#createpattern)方法创建,通过指定图像和重复方式创建图片填充的模板。 + +> **说明:** +> +> 从 API Version 8 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + +## 方法 + +### setTransform + +setTransform(transform?: Matrix2D): void + +使用Matrix2D对象作为参数、对当前CanvasPattern进行矩阵变换。 + +从API version 9开始,该接口支持在ArkTS卡片中使用。 + +**参数:** + +| 参数 | 类型 | 必填 | 默认值 | 描述 | +| --------- | ----------------------------------------------------- | ---- | ------ | ---------- | +| transform | [Matrix2D](ts-components-canvas-matrix2d.md#Matrix2D) | 否 | null | 转换矩阵。 | + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct CanvasPatternPage { + private settings: RenderingContextSettings = new RenderingContextSettings(true) + private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) + private matrix: Matrix2D = new Matrix2D() + private img: ImageBitmap = new ImageBitmap("common/pattern.jpg") + private pattern : CanvasPattern + + build() { + Column() { + Button("Click to set transform") + .onClick(() => { + this.matrix.scaleY = 1 + this.matrix.scaleX = 1 + this.matrix.translateX = 50 + this.matrix.translateY = 200 + this.pattern.setTransform(this.matrix) + this.context.fillRect(0, 0, 480, 720) + }) + .width("45%") + .margin("5px") + Canvas(this.context) + .width('100%') + .height('80%') + .backgroundColor('#FFFFFF') + .onReady(() => { + this.pattern = this.context.createPattern(this.img, 'no-repeat') + this.context.fillStyle = this.pattern + this.matrix.scaleY = 0.5 + this.matrix.scaleX = 0.5 + this.matrix.translateX = 50 + this.matrix.translateY = 50 + this.pattern.setTransform(this.matrix) + this.context.fillRect(0, 0, 480, 720) + }) + } + .width('100%') + .height('100%') + } +} +``` + +![CanvasPattern](./figures/canvas_pattern.gif) + diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-matrix2d.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-matrix2d.md new file mode 100644 index 0000000000000000000000000000000000000000..a6169aedd540447bcd7e435f82feb179b25498d9 --- /dev/null +++ b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-matrix2d.md @@ -0,0 +1,601 @@ +# Matrix2D + +矩阵对象,可以对矩阵进行缩放、旋转、平移等变换。 + +> **说明:** +> +> 从 API Version 8 开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 + +## 接口 + +Matrix2D() + +从API version 9开始,该接口支持在ArkTS卡片中使用。 + +## 属性 + +| 属性 | 类型 | 描述 | +| ------------------------- | ------ | ------------------------------------------------------------ | +| [scaleX](#scalex) | number | 水平缩放系数。 从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [scaleY](#scaley) | number | 垂直缩放系数。 从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [rotateX](#rotatex) | number | 水平倾斜系数。从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [rotateY](#rotatey) | number | 垂直倾斜系数。从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [translateX](#translatex) | number | 水平平移距离,单位为vp。 从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [translateY](#translatey) | number | 垂直平移距离,单位为vp。 从API version 9开始,该接口支持在ArkTS卡片中使用。 | + +> **说明:** +> +> 可使用[px2vp](ts-pixel-units.md)接口进行单位转换。 + +### scaleX + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DScaleX { + @State message: string = 'Matrix2D ScaleX' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("Set scaleX") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.scaleX = 1 + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### scaleY + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DScaleY { + @State message: string = 'Matrix2D ScaleY' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("Set scaleY") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.scaleY = 1 + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### rotateX + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DRotateX { + @State message: string = 'Matrix2D RotateX' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("Set rotateX") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.rotateX = Math.sin(45 / Math.PI) + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### rotateY + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DRotateY { + @State message: string = 'Matrix2D RotateY' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("Set rotateY") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.rotateY = Math.cos(45 / Math.PI) + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### translateX + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DTranslateX { + @State message: string = 'Matrix2D TranslateX' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("Set translateX") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.translateX = 10 + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### translateY + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DTranslateY { + @State message: string = 'Matrix2D TranslateY' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("Set translateY") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.translateY = 10 + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +## 方法 + +### identity + +identity(): Matrix2D + +创建一个单位矩阵。 + +从API version 9开始,该接口支持在ArkTS卡片中使用。 + +**返回值:** + +| 类型 | 说明 | +| --------------------- | ---------- | +| [Matrix2D](#matrix2d) | 单位矩阵。 | + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DIdentity { + @State message: string = 'Matrix2D Identity' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("matrix identity") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix = matrix.identity() + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### invert + +invert(): Matrix2D + +得到当前矩阵的逆矩阵。 + +从API version 9开始,该接口支持在ArkTS卡片中使用。 + +**返回值:** + +| 类型 | 说明 | +| --------------------- | ------------ | +| [Matrix2D](#matrix2d) | 逆矩阵结果。 | + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DInvert { + @State message: string = 'Matrix2D Invert' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("matrix invert") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.scaleX = 2 + matrix.scaleY = 1 + matrix.rotateX = 0 + matrix.rotateY = 0 + matrix.translateX = 10 + matrix.translateY = 20 + matrix.invert() + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### multiply(deprecated) + +multiply(other?: Matrix2D): Matrix2D + +当前矩阵与目标矩阵相乘。 + +从API version 9开始,该接口支持在ArkTS卡片中使用。该接口为空接口。 + +该接口从API version 10开始废弃。 + +**参数:** + +| 参数 | 类型 | 必填 | 默认值 | 描述 | +| ----- | -------- | ---- | ------ | ---------- | +| other | Matrix2D | 否 | null | 目标矩阵。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | -------------- | +| [Matrix2D](#matrix2d) | 相乘结果矩阵。 | + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DMultiply { + @State message: string = 'Matrix2D Multiply' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("matrix multiply") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.scaleX = 1 + matrix.scaleY = 1 + matrix.rotateX = 0 + matrix.rotateY = 0 + matrix.translateX = 0 + matrix.translateY = 0 + var other: Matrix2D = new Matrix2D() + other.scaleX = 2 + other.scaleY = 2 + other.rotateX = 0 + other.rotateY = 0 + other.translateX = 10 + other.translateY = 10 + other.multiply(other) + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### rotate10+ + +rotate(degree: number, rx?: number, ry?: number): Matrix2D + +以旋转点为中心、对当前矩阵进行右乘旋转运算。 + +从API version 10开始,该接口支持在ArkTS卡片中使用。 + +**参数:** + +| 参数 | 类型 | 必填 | 默认值 | 描述 | +| ------ | ------ | ---- | ------ | ------------------------------------------------------------ | +| degree | number | 是 | 0 | 旋转角度,单位为弧度。顺时针方向为正角度,可以通过Math.PI / 180将角度转换为弧度值。 | +| rx | number | 否 | 0 | 旋转点的水平方向坐标,单位为vp。 | +| ry | number | 否 | 0 | 旋转点的垂直方向坐标,单位为vp。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | -------------------- | +| [Matrix2D](#matrix2d) | 旋转后结果矩阵对象。 | + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DRotate { + @State message: string = 'Matrix2D Rotate' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("matrix rotate") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.scaleX = 1 + matrix.scaleY = 1 + matrix.rotateX = 0 + matrix.rotateY = 0 + matrix.translateX = 0 + matrix.translateY = 0 + matrix.rotate(90 / Math.PI, 10, 10) + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### translate + +translate(tx?: number, ty?: number): Matrix2D + +对当前矩阵进行左乘平移运算。 + +从API version 9开始,该接口支持在ArkTS卡片中使用。 + +**参数:** + +| 参数 | 类型 | 必填 | 默认值 | 描述 | +| ---- | ------ | ---- | ------ | ---------------------------- | +| tx | number | 否 | 0 | 水平方向平移距离,单位为vp。 | +| ty | number | 否 | 0 | 垂直方向平移距离,单位为vp。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | -------------------- | +| [Matrix2D](#matrix2d) | 平移后结果矩阵对象。 | + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DTranslate { + @State message: string = 'Matrix2D Translate' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("matrix translate") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.scaleX = 1 + matrix.scaleY = 1 + matrix.rotateX = 0 + matrix.rotateY = 0 + matrix.translateX = 0 + matrix.translateY = 0 + matrix.translate(100, 100) + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` + +### scale + +scale(sx?: number, sy?: number): Matrix2D + +对当前矩阵进行右乘缩放运算。 + +从API version 9开始,该接口支持在ArkTS卡片中使用。 + +**参数:** + +| 参数 | 类型 | 必填 | 默认值 | 描述 | +| ---- | ------ | ---- | ------ | ------------------ | +| sx | number | 否 | 1 | 水平缩放比例系数。 | +| sy | number | 否 | 1 | 垂直缩放比例系数。 | + +**返回值:** + +| 类型 | 说明 | +| --------------------- | ------------------ | +| [Matrix2D](#matrix2d) | 缩放结果矩阵对象。 | + +**示例:** + +```ts +// xxx.ets +@Entry +@Component +struct Matrix2DScale { + @State message: string = 'Matrix2D Scale' + + printMatrix(title, matrix) { + console.log(title) + console.log("Matrix [scaleX = " + matrix.scaleX + ", scaleY = " + matrix.scaleY + + ", rotateX = " + matrix.rotateX + ", rotateY = " + matrix.rotateY + + ", translateX = " + matrix.translateX + ", translateY = " + matrix.translateY + "]") + } + build() { + Row() { + Column() { + Text(this.message) + .fontSize(20) + .fontWeight(FontWeight.Bold) + Button("matrix scale") + .onClick(() => { + var matrix : Matrix2D = new Matrix2D() + matrix.scaleX = 1 + matrix.scaleY = 1 + matrix.rotateX = 0 + matrix.rotateY = 0 + matrix.translateX = 0 + matrix.translateY = 0 + matrix.scale(0.5, 0.5) + this.printMatrix(this.message, matrix) + }) + } + .width('100%') + } + .height('100%') + } +} +``` diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md index 83f518f5d2488421e9c17ca7db240ccfee297721..3d7c072f312e48c4a668fe51a1be5ebe2f0213cf 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-gridrow.md @@ -130,7 +130,7 @@ GridRow(option?: {columns?: number | GridRowColumnOption, gutter?: Length | Gutt | 名称 | 参数类型 | 描述 | | ----------------------- | ----------------------------------- | ------------------------------------------- | -| alignItems10+ | [ItemAlign](ts-appendix-enums.md#itemalign) | 设置GridRow中的GridCol垂直主轴方向对齐方式,默认值:ItemAlign.Start
说明:
在ItemAlign中,实际支持的参数枚举值仅为Start、Center、End、Stretch。
GridCol本身也可通过alignSelf([ItemAlign](ts-appendix-enums.md#itemalign))设置自身对齐方式。当上述两种对齐方式都设置时,以GridCol自身设置为准。
从API version 10开始,该接口支持在ArkTS卡片中使用。 | +| alignItems10+ | ItemAlign | 设置GridRow中的GridCol垂直主轴方向对齐方式,默认值:ItemAlign.Start
**说明**:
ItemAlign支持的枚举:ItemAlign.Start、ItemAlign.Center、ItemAlign.End、ItemAlign.Stretch。
GridCol本身也可通过alignSelf([ItemAlign](ts-appendix-enums.md#itemalign))设置自身对齐方式。当上述两种对齐方式都设置时,以GridCol自身设置为准。
从API version 10开始,该接口支持在ArkTS卡片中使用。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md index ca470aa1214056fcd8070adb15955a907ea0ef31..dc2cfc788d3d07d9ea67d829bd480e61a307d5d2 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-list.md @@ -52,7 +52,7 @@ List(value?:{space?: number | string, initialIndex?: number, scroller? | 名称 | 参数类型 | 描述 | | -------- | -------- | -------- | | listDirection | [Axis](ts-appendix-enums.md#axis) | 设置List组件排列方向。
默认值:Axis.Vertical
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| divider | {
strokeWidth: [Length](ts-types.md#length),
color?:[ResourceColor](ts-types.md#resourcecolor),
startMargin?: Length,
endMargin?: Length
} \| null | 设置ListItem分割线样式,不支持设置百分比,默认无分割线。
- strokeWidth: 分割线的线宽。
- color: 分割线的颜色。
- startMargin: 分割线与列表侧边起始端的距离。
- endMargin: 分割线与列表侧边结束端的距离。
从API version 9开始,该接口支持在ArkTS卡片中使用。
endMargin +startMargin 不能超过列宽度。
startMargin和endMargin不支持设置百分比。
List的分割线画在主轴方向两个子组件之间,第一个子组件上方和最后一个子组件下方不会绘制分割线。
多列模式下,ListItem与ListItem之间的分割线起始边距从每一列的交叉轴方向起始边开始计算,其他情况从List交叉轴方向起始边开始计算。 | +| divider | {
strokeWidth: [Length](ts-types.md#length),
color?:[ResourceColor](ts-types.md#resourcecolor),
startMargin?: Length,
endMargin?: Length
} \| null | 设置ListItem分割线样式,默认无分割线。
- strokeWidth: 分割线的线宽。
- color: 分割线的颜色。
- startMargin: 分割线与列表侧边起始端的距离。
- endMargin: 分割线与列表侧边结束端的距离。
从API version 9开始,该接口支持在ArkTS卡片中使用。
endMargin +startMargin 不能超过列宽度。
startMargin和endMargin不支持设置百分比。
List的分割线画在主轴方向两个子组件之间,第一个子组件上方和最后一个子组件下方不会绘制分割线。
多列模式下,ListItem与ListItem之间的分割线起始边距从每一列的交叉轴方向起始边开始计算,其他情况从List交叉轴方向起始边开始计算。 | | scrollBar | [BarState](ts-appendix-enums.md#barstate) | 设置滚动条状态。
默认值:BarState.Off
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
API version 9及以下版本默认值为BarState.Off,API version 10的默认值为BarState.Auto。 | | cachedCount | number | 设置列表中ListItem/ListItemGroup的预加载数量,只在[LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md)中生效,其中ListItemGroup将作为一个整体进行计算,ListItemGroup中的所有ListItem会一次性全部加载出来。具体使用可参考[减少应用白块说明](../../ui/arkts-performance-improvement-recommendation.md#减少应用滑动白块)。
默认值:1
从API version 9开始,该接口支持在ArkTS卡片中使用。
**说明:**
单列模式下,会在List显示的ListItem前后各缓存cachedCount个ListItem。
多列模式下, 会在List显示的ListItem前后各缓存cachedCount*列数个ListItem。 | | editMode(deprecated) | boolean | 声明当前List组件是否处于可编辑模式。
从API version9开始废弃。
默认值:false | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-relativecontainer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-relativecontainer.md index 6390be6bf5545188807777190731bc67143aab6b..4672911bae011d0b55618299a5b85ddeec577bc1 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-relativecontainer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-relativecontainer.md @@ -15,7 +15,7 @@ * 垂直方向为top, center, bottom,对应容器的VerticalAlign.Top, VerticalAlign.Center, VerticalAlign.Bottom。 * 子组件可以将容器或者其他子组件设为锚点: * 参与相对布局的容器内组件必须设置id,不设置id的组件不显示,容器id固定为__container__。 - * 此子组件某一方向上的三个位置可以将容器或其他子组件的同方向三个位置为锚点,同方向上两个以上位置设置锚点以后会跳过第三个。 + * 此子组件某一方向上的三个位置可以将容器或其他子组件的同方向三个位置为锚点,同方向上设置两个以上锚点的优先级。水平方向Start和Center优先,垂直方向Top和Center优先。 * 前端页面设置的子组件尺寸大小不会受到相对布局规则的影响。子组件某个方向上设置两个或以上alignRules时不建议设置此方向尺寸大小。 * 对齐后需要额外偏移可设置offset。 * 特殊情况 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md index 1f86949d0ec12e39742e9fa6ed74fefed8191fcd..087958ef8610100ccf6ec0ffdfd9687e55134a5a 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-scroll.md @@ -131,11 +131,12 @@ currentOffset(): { xOffset: number, yOffset: number } ### scrollToIndex -scrollToIndex(value: number): void - +scrollToIndex(value: number, smooth?:boolean): void 滑动到指定Index。 +开启smooth动效时,会对经过的所有item进行加载和布局计算,当大量加载item时会导致性能问题。 + > **说明:** > @@ -143,10 +144,10 @@ scrollToIndex(value: number): void **参数:** -| 参数名 | 参数类型 | 必填 | 参数描述 | -| ------ | -------- | ---- | ---------------------------------- | -| value | number | 是 | 要滑动到的列表项在列表中的索引值。 | - +| 参数名 | 参数类型 | 必填 | 参数描述 | +| --------------------- | -------- | ---- | ------------------------------------------------------------ | +| value | number | 是 | 要滑动到的列表项在列表中的索引值。 | +| smooth10+  | boolean | 否 | 设置滑动到列表项在列表中的索引值时是否有动效,true表示有动效,false表示没有动效。
默认值:false。
**说明:**
当前仅List组件支持该参数。 | ### scrollBy9+ diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md index e60e94a82d5f1560ea01ce7e5cf63da05904ada7..69e27a5c31e9e04165f4c9d0deff391db5edf648 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-sidebarcontainer.md @@ -34,6 +34,7 @@ SideBarContainer( type?: SideBarContainerType ) | -------- | -------- | | Embed | 侧边栏嵌入到组件内,和内容区并列显示。 | | Overlay | 侧边栏浮在内容区上面。 | +| AUTO | 组件尺寸大于等于minSideBarWidth+minContentWidth时,采用Embed模式显示。
组件尺寸小于minSideBarWidth+minContentWidth时,采用Overlay模式显示。| ## 属性 @@ -50,6 +51,7 @@ SideBarContainer( type?: SideBarContainerType ) | autoHide9+ | boolean | 设置当侧边栏拖拽到小于最小宽度后,是否自动隐藏。
默认值:true
**说明:**
受minSideBarWidth属性方法影响,minSideBarWidth属性方法未设置值使用默认值。
拖拽过程中判断是否要自动隐藏。小于最小宽度时需要阻尼效果触发隐藏(越界一段距离) | | sideBarPosition9+ | [SideBarPosition](#sidebarposition9枚举说明) | 设置侧边栏显示位置。
默认值:SideBarPosition.Start | | divider10+ | [DividerStyle](#dividerstyle10对象说明) \| null | 设置分割线的样式。
- 默认为DividerStyle:显示分割线。
- null:不显示分割线。 | +| minContentWidth10+ | Dimension | SideBarContainer组件内容区的最小宽度。
默认值:360
单位:vp | ## ButtonStyle对象说明 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md index 5c0b0b53bffdb6ef76d7ae4a007410ca9382fdb7..129851a67c806ea1bd52c3574cedf07e5f72e171 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-swiper.md @@ -45,11 +45,9 @@ Swiper(controller?: SwiperController) | cachedCount8+ | number | 设置预加载子组件个数。
默认值:1
**说明:**
cachedCount已经做了预加载的优化,不建议与[LazyForEach](../../quick-start/arkts-rendering-control-lazyforeach.md)一起使用。 | | disableSwipe8+ | boolean | 禁用组件滑动切换功能。
默认值:false | | curve8+ | [Curve](ts-appendix-enums.md#curve) \| string | 设置Swiper的动画曲线,默认为淡入淡出曲线,常用曲线参考[Curve枚举说明](ts-appendix-enums.md#curve),也可以通过[插值计算](../apis/js-apis-curve.md)模块提供的接口创建自定义的插值曲线对象。
默认值:Curve.Linear | -| indicatorStyle8+ | {
left?: [Length](ts-types.md#length),
top?: [Length](ts-types.md#length),
right?: [Length](ts-types.md#length),
bottom?: [Length](ts-types.md#length),
size?: [Length](ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](ts-types.md),
selectedColor?: [ResourceColor](ts-types.md)
} | 设置导航点样式:
\- left: 设置导航点距离Swiper组件左边的距离。
\- top: 设置导航点距离Swiper组件顶部的距离。
\- right: 设置导航点距离Swiper组件右边的距离。
\- bottom: 设置导航点距离Swiper组件底部的距离。
\- size: 设置导航点的直径。
\- mask: 设置是否显示导航点蒙层样式。
\- color: 设置导航点的颜色。
\- selectedColor: 设置选中的导航点的颜色。 | +| indicatorStyle8+ | {
left?: [Length](ts-types.md#length),
top?: [Length](ts-types.md#length),
right?: [Length](ts-types.md#length),
bottom?: [Length](ts-types.md#length),
size?: [Length](ts-types.md#length),
mask?: boolean,
color?: [ResourceColor](ts-types.md),
selectedColor?: [ResourceColor](ts-types.md)
} | 设置导航点样式:
\- left: 设置导航点距离Swiper组件左边的距离。
\- top: 设置导航点距离Swiper组件顶部的距离。
\- right: 设置导航点距离Swiper组件右边的距离。
\- bottom: 设置导航点距离Swiper组件底部的距离。
\- size: 设置导航点的直径,不支持设置百分比。默认值:6vp。
\- mask: 设置是否显示导航点蒙层样式。
\- color: 设置导航点的颜色。
\- selectedColor: 设置选中的导航点的颜色。 | | displayCount8+ | number\|string | 设置一页内元素显示个数。
默认值:1
**说明:**
字符串类型仅支持设置为'auto',显示效果同SwiperDisplayMode.AutoLinear。
使用number类型时,子组件按照主轴均分Swiper宽度(减去displayCount-1的itemSpace)的方式进行主轴拉伸(收缩)布局。 | | effectMode8+ | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。
默认值:EdgeEffect.Spring
**说明:**
控制器接口调用时不生效回弹。 | -| nextMargin10+ |
[Length](ts-types.md#length)
| 后边距,用于露出后一项的一小部分。
默认值:0
**说明:**
仅当SwiperDisplayMode为STRETCH模式时生效。当cachedCount设置值小于等于0时,此时会露出后一项的一小部分,但无法加载子组件。 | -| prevMargin10+ |
[Length](ts-types.md#length)
| 前边距,用于露出前一项的一小部分。
默认值:0
**说明:**
仅当SwiperDisplayMode为STRETCH模式时生效。当cachedCount设置值小于等于0时,此时会露出前一项的一小部分,但无法加载子组件。 | ## SwiperDisplayMode枚举说明 @@ -92,10 +90,10 @@ finishAnimation(callback?: () => void): void | 参数名 | 参数类型 | 必填项 | 参数描述 | | ------ | -------- | ------ | ------------------------------------ | -| left | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件左边的距离。 | -| top | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件顶部的距离。 | -| right | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件右边的距离。 | -| bottom | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件底部的距离。 | +| left | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件左边的距离。
默认值:0
单位:vp | +| top | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件顶部的距离。
默认值:0
单位:vp | +| right | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件右边的距离。
默认值:0
单位:vp | +| bottom | [Length](ts-types.md#length) | 否 | 设置导航点距离Swiper组件底部的距离。
默认值:0
单位:vp | ### DotIndicator diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-tabs.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-tabs.md index 04cc1ad48cf426210993e10d55a6fb19409426fa..d2bb8b9d77395d72396a1428c3688d1909644add 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-tabs.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-tabs.md @@ -41,8 +41,8 @@ Tabs(value?: {barPosition?: BarPosition, index?: number, controller?: [TabsContr | vertical | boolean | 设置为false是为横向Tabs,设置为true时为纵向Tabs。
默认值:false | | scrollable | boolean | 设置为true时可以通过滑动页面进行页面切换,为false时不可滑动切换页面。
默认值:true | | barMode | BarMode | TabBar布局模式,具体描述见BarMode枚举说明。
默认值:BarMode.Fixed | -| barWidth | number \| Length8+ | TabBar的宽度值。
**说明:**
设置为小于0或大于Tabs宽度值时,按默认值显示。 | -| barHeight | number \| Length8+ | TabBar的高度值。
**说明:**
设置为小于0或大于Tabs宽度值时,按默认值显示。 | +| barWidth | number \| Length8+ | TabBar的宽度值。
默认值:
未设置带样式的TabBar且vertical属性为false时,默认值为Tabs的宽度。
未设置带样式的TabBar且vertical属性为true时,默认值为56vp。
设置SubTabbarStyle样式且vertical属性为false时,默认值为Tabs的宽度。
设置SubTabbarStyle样式且vertical属性为true时,默认值为56vp。
设置BottomTabbarStyle样式且vertical属性为true时,默认值为96vp。
设置BottomTabbarStyle样式且vertical属性为false时,默认值为Tabs的宽度。
**说明:**
设置为小于0或大于Tabs宽度值时,按默认值显示。 | +| barHeight | number \| Length8+ | TabBar的高度值。
默认值:
未设置带样式的TabBar且vertical属性为false时,默认值为56vp。
未设置带样式的TabBar且vertical属性为true时,默认值为Tabs的高度。
设置SubTabbarStyle样式且vertical属性为false时,默认值为56vp。
设置SubTabbarStyle样式且vertical属性为true时,默认值为Tabs的高度。
设置BottomTabbarStyle样式且vertical属性为true时,默认值为Tabs的高度。
设置BottomTabbarStyle样式且vertical属性为false时,默认值为56vp。
**说明:**
设置为小于0或大于Tabs高度值时,按默认值显示。| | animationDuration | number | TabContent滑动动画时长。不设置时,点击切换页签无动画,滑动切换有动画;设置时,点击切换和滑动切换都有动画。
默认值:300
**说明:**
设置为小于0或百分比时,按默认值显示。 | | divider10+ | [DividerStyle](#dividerstyle10对象说明) \| null | 用于设置区分TabBar和TabContent的分割线样式设置分割线样式,默认不显示分割线。
DividerStyle: 分割线的样式;
null: 不显示分割线。 | | fadingEdge10+ | boolean | 设置页签超过容器宽度时是否渐隐消失
默认值:true | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md b/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md index 047b4c783b6802414d20a3c2bfdc84fee13ba3b5..8823443bf9dac73a25e134252837f7a13d9f10e5 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md @@ -27,9 +27,9 @@ OffscreenCanvasRenderingContext2D(width: number, height: number, settings?: Rend | 名称 | 类型 | 描述 | | ----------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -| [fillStyle](#fillstyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](#canvaspattern) | 指定绘制的填充色。
- 类型为string时,表示设置填充区域的颜色。
- 类型为number时,表示设置填充区域的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [fillStyle](#fillstyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](ts-components-canvas-canvaspattern.md#canvaspattern) | 指定绘制的填充色。
- 类型为string时,表示设置填充区域的颜色。
- 类型为number时,表示设置填充区域的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [lineWidth](#linewidth) | number | 设置绘制线条的宽度。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | -| [strokeStyle](#strokestyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](#canvaspattern) | 设置描边的颜色。
- 类型为string时,表示设置描边使用的颜色。
- 类型为number时,表示设置描边使用的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | +| [strokeStyle](#strokestyle) | string \|number10+ \|[CanvasGradient](ts-components-canvas-canvasgradient.md) \| [CanvasPattern](ts-components-canvas-canvaspattern.md#canvaspattern) | 设置描边的颜色。
- 类型为string时,表示设置描边使用的颜色。
- 类型为number时,表示设置描边使用的颜色。
- 类型为CanvasGradient时,表示渐变对象,使用[createLinearGradient](#createlineargradient)方法创建。
- 类型为CanvasPattern时,使用[createPattern](#createpattern)方法创建。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [lineCap](#linecap) | CanvasLineCap | 指定线端点的样式,可选值为:
- 'butt':线端点以方形结束。
- 'round':线端点以圆形结束。
- 'square':线端点以方形结束,该样式下会增加一个长度和线段厚度相同,宽度是线段厚度一半的矩形。
- 默认值:'butt'。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [lineJoin](#linejoin) | CanvasLineJoin | 指定线段间相交的交点样式,可选值为:
- 'round':在线段相连处绘制一个扇形,扇形的圆角半径是线段的宽度。
- 'bevel':在线段相连处使用三角形为底填充, 每个部分矩形拐角独立。
- 'miter':在相连部分的外边缘处进行延伸,使其相交于一点,形成一个菱形区域,该属性可以通过设置miterLimit属性展现效果。
- 默认值:'miter'。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | | [miterLimit](#miterlimit) | number | 设置斜接面限制值,该值指定了线条相交处内角和外角的距离。
- 默认值:10。
从API version 9开始,该接口支持在ArkTS卡片中使用。 | @@ -1280,7 +1280,7 @@ createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | nu | 类型 | 说明 | | ------------------------------- | ----------------------- | -| [CanvasPattern](#canvaspattern) | 通过指定图像和重复方式创建图片填充的模板对象。 | +| [CanvasPattern](ts-components-canvas-canvaspattern.md#canvaspattern) | 通过指定图像和重复方式创建图片填充的模板对象。 | **示例:** @@ -1925,6 +1925,11 @@ getTransform(): Matrix2D 从API version 9开始,该接口支持在ArkTS卡片中使用。 +**返回值:** + +| 类型 | 说明 | +| ----------------------------------------------------- | ---------- | +| [Matrix2D](ts-components-canvas-matrix2d.md#Matrix2D) | 矩阵对象。 | ### resetTransform @@ -3000,9 +3005,3 @@ struct OffscreenCanvasConicGradientPage { ``` ![zh-cn_image_0000001239032419](figures/zh-cn_image_0000001239032420.png) - -## CanvasPattern - -一个Object对象, 通过[createPattern](#createpattern)方法创建。 - -从API version 9开始,该接口支持在ArkTS卡片中使用。 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-modal-transition.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-modal-transition.md index 83c42ef1cc275fa966145179d33fa048a7e21a42..9059796917df1d1b8d9728b790f6e13c1f553ca7 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-modal-transition.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-modal-transition.md @@ -1,15 +1,15 @@ -# 全屏模态转场设置 +# 全屏模态转场 通过bindContentCover属性为组件绑定全屏模态页面,在组件插入和删除时可通过设置转场参数ModalTransition显示过渡动效。 > **说明:** > -> 从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 +> 从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 ## 属性 -| 名称 | 参数 | 参数描述 | -| -------- | -------- | -------- | +| 名称 | 参数 | 参数描述 | +| ---------------- | ---------------------------------------- | ---------------------------------------- | | bindContentCover | isShow: boolean,
builder: [CustomBuilder](ts-types.md#custombuilder8),
type?: [ModalTransition](ts-types.md#modaltransition10) | 给组件绑定全屏模态页面,点击后显示模态页面。模态页面内容自定义,显示方式可设置无动画过渡,上下切换过渡以及透明渐变过渡方式。
isShow: 必填,是否显示全屏模态页面。
builder: 必填,配置全屏模态页面内容。
type: 非必填,配置全屏模态页面的转场方式。 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md index 4d527b1fe4c4ef36af2adf80fc291ba59b9bda66..637af5f82670074428b988214b11e693febe3b5b 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-popup.md @@ -40,7 +40,7 @@ | 名称 | 类型 | 必填 | 描述 | | ---------------------------- | ---------------------------------------- | ---- | ---------------------------------------- | -| builder | [CustomBuilder](ts-types.md#custombuilder8) | 是 | 提示气泡内容的构造器。 | +| builder | [CustomBuilder](ts-types.md#custombuilder8) | 是 | 提示气泡内容的构造器。
**说明:**
popup为通用属性,自定义popup中不支持再次弹出popup。对builder下的第一层容器组件不支持使用position属性,如果使用将导致气泡不显示。 | | placement | [Placement](ts-appendix-enums.md#placement8) | 否 | 气泡组件优先显示的位置,当前位置显示不下时,会自动调整位置。
默认值:Placement.Bottom | | popupColor | [ResourceColor](ts-types.md#resourcecolor) | 否 | 提示气泡的颜色。 | | enableArrow | boolean | 否 | 是否显示箭头。
从API Version 9开始,如果箭头所在方位侧的气泡长度不足以显示下箭头,则会默认不显示箭头。比如:placement设置为Left,此时如果气泡高度小于箭头的宽度(32vp)与气泡圆角两倍(48vp)之和(80vp),则实际不会显示箭头。
默认值:true | @@ -112,7 +112,7 @@ struct PopupExample { .bindPopup(this.customPopup, { builder: this.popupBuilder, placement: Placement.Top, - maskColor: '0x33000000', + mask: {color:'0x33000000'}, popupColor: Color.Yellow, enableArrow: true, showInSubWindow: false, diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sheet-transition.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sheet-transition.md index e4ea2b85c1ae1c3e20bf41e2b6ea7bd7bd9b1df4..235648a9c0604eff8f30edad5e4aeab3a30a4a76 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sheet-transition.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-sheet-transition.md @@ -5,6 +5,7 @@ > **说明: ** > > 从API Version 10开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 +> 不支持横竖屏切换。 ## 属性 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md index ac23958c7db2a7f4271484d5aa6b6ab8ddf042ef..733e49cde195026da3d3ffb7c677c22dfac61704 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-drag-drop.md @@ -71,10 +71,10 @@ | 名称 | 描述 | | ----- | ----------------- | | DRAG_SUCCESS | 拖拽成功 | -| DRAG_FAIL | 拖拽失败 | -| DRAG_CANCEL | 拖拽取消 | -| ENABLE_DROP | 组件允许落入 | -| DISABLE_DROP | 组件不允许落入 | +| DRAG_FAILED | 拖拽失败 | +| DRAG_CANCELED | 拖拽取消 | +| DROP_ENABLED | 组件允许落入 | +| DROP_DISABLED | 组件不允许落入 | ## 示例 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-keyboardshortcut.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-keyboardshortcut.md index 73d26fdb1666fdd9689e1b453af7a6cccad7f92e..28395e37dafa0a22e4bfa1a3a950ef3b6252496c 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-keyboardshortcut.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-keyboardshortcut.md @@ -1,4 +1,4 @@ -# 自定义快捷键 +# 组件快捷键事件 开发者可以设置组件的自定义组合键,组合键的行为与click行为一致,组件在未获得焦点状态下也可以响应自定义组合键,每个组件可以设置多个组合键。 @@ -12,23 +12,23 @@ keyboardShortcut(value: string | [FunctionKey], keys: Array<[ModifierKey]>) **参数:** -| 参数名 | 参数类型 | 必填 | 参数描述 | -| ------ | ------------------------------------- | ---- | ------------------------------------------------------------ | -| value | string \| [FunctionKey](#functionkey) | 是 | 热键的单个字符(可以通过键盘输入的字符)或[FunctionKey](#functionkey)。
| -| keys | Array<[ModifierKey](#modifierkey)> | 是 | 热键组合。
| +| 参数名 | 参数类型 | 必填 | 参数描述 | +| ----- | ------------------------------------- | ---- | ---------------------------------------- | +| value | string \| [FunctionKey](#functionkey) | 是 | 热键的单个字符(可以通过键盘输入的字符)或[FunctionKey](#functionkey)。
| +| keys | Array<[ModifierKey](#modifierkey)> | 是 | 热键组合。
| ## ModifierKey -| 名称 | 描述 | -| ----- | ------------------- | +| 名称 | 描述 | +| ----- | ------------ | | CTRL | 表示键盘上Ctrl键。 | | SHIFT | 表示键盘上Shift键。 | | ALT | 表示键盘上Alt键。 | ## FunctionKey -| 名称 | 描述 | -| ---- | --------------------- | +| 名称 | 描述 | +| ---- | ------------ | | ESC | 表示键盘上ESC功能键。 | | F1 | 表示键盘上F1功能键。 | | F2 | 表示键盘上F2功能键。 | @@ -45,35 +45,35 @@ keyboardShortcut(value: string | [FunctionKey], keys: Array<[ModifierKey]>) ## 快捷键使用注意事项 -| 场景 | 快捷键处理逻辑 | 例子 | -| ------------------------------------------------------------ | -------------------------------------------------------- | ------------------------------------------------------------ | -| 所有支持onClick事件的组件 | 支持自定义组合键 | 无 | -| 自定义组合键要求 | 控制键Ctrl,Shift,Alt及它们的组合加上其它可输入字符按键 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL]) | -| 多个不同组件设置相同组合键 | 只响应结点树上的第一个组件、其它组件不响应快捷键。 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('a',[ModifierKey.CTRL]) | -| 无论组件是否获得焦点 | 只要窗口获焦快捷键就会响应 | 无 | -| 绑定单个快捷键时候,通过keyboardShortcut接口value值或者是keys值或两者都是空的情况下。
绑定多个快捷键的时候无法取消快捷键。 | 取消快捷键的设置 | Button('button1').keyboardShortcut('',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('a',[l])
Button('button3').keyboardShortcut('',[]) | -| 独立pipeline子窗口、主窗口共存的情况下 | 获焦的窗口响应快捷键 | 无 | -| keyboardShortcut接口中的keys命令中ctrl、shift、alt | 不区分左右键都响应 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL, ModifierKey.ALT]) | -| keyboardShortcut接口中的value单个字符 | 不区分大小写都响应 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('A',[ModifierKey.CTRL]) | -| 快捷键的响应 | 所有快捷键down的状态下响应、且连续响应 | 无 | -| 隐藏组件
| 响应快捷键 | 无 | -| disable状态组件 | 不响应快捷键 | 无 | -| 1. 组件的组合键(包括系统预定义快捷键)相同时。
2. 接口参数value有多个字符时。
3. 接口参数keys有重复的控制键时。 | 这几种情况不绑定组合键, 先前绑定的组合键仍然有效 | Button('button1').keyboardShortcut('c',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('ab',[ModifierKey.CTRL])
Button('button3').keyboardShortcut('ab',[ModifierKey.CTRL,ModifierKey.CTRL]) | +| 场景 | 快捷键处理逻辑 | 例子 | +| ---------------------------------------- | ---------------------------------- | ---------------------------------------- | +| 所有支持onClick事件的组件 | 支持自定义组合键 | 无 | +| 自定义组合键要求 | 控制键Ctrl,Shift,Alt及它们的组合加上其它可输入字符按键 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL]) | +| 多个不同组件设置相同组合键 | 只响应结点树上的第一个组件、其它组件不响应快捷键。 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('a',[ModifierKey.CTRL]) | +| 无论组件是否获得焦点 | 只要窗口获焦快捷键就会响应 | 无 | +| 绑定单个快捷键时候,通过keyboardShortcut接口value值或者是keys值或两者都是空的情况下。
绑定多个快捷键的时候无法取消快捷键。 | 取消快捷键的设置 | Button('button1').keyboardShortcut('',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('a',[l])
Button('button3').keyboardShortcut('',[]) | +| 独立pipeline子窗口、主窗口共存的情况下 | 获焦的窗口响应快捷键 | 无 | +| keyboardShortcut接口中的keys命令中ctrl、shift、alt | 不区分左右键都响应 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL, ModifierKey.ALT]) | +| keyboardShortcut接口中的value单个字符 | 不区分大小写都响应 | Button('button1').keyboardShortcut('a',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('A',[ModifierKey.CTRL]) | +| 快捷键的响应 | 所有快捷键down的状态下响应、且连续响应 | 无 | +| 隐藏组件
| 响应快捷键 | 无 | +| disable状态组件 | 不响应快捷键 | 无 | +| 1. 组件的组合键(包括系统预定义快捷键)相同时。
2. 接口参数value有多个字符时。
3. 接口参数keys有重复的控制键时。 | 这几种情况不绑定组合键, 先前绑定的组合键仍然有效 | Button('button1').keyboardShortcut('c',[ModifierKey.CTRL])
Button('button2').keyboardShortcut('ab',[ModifierKey.CTRL])
Button('button3').keyboardShortcut('ab',[ModifierKey.CTRL,ModifierKey.CTRL]) | ## 系统已有组合键 -| 快捷键 | 组件 | -| -------------- | ------------------------------------------------------------ | +| 快捷键 | 组件 | +| -------------- | ---------------------------------------- | | Ctrl + C | [Image](ts-basic-components-image.md)、[TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | | Ctrl+ A | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | | Ctrl+ V | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | | Ctrl+ X | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | -| Shift + 方向键 | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | +| Shift + 方向键 | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | | Ctrl+ Shift+ Z | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | | Ctrl+ Z | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | | Ctrl+ Y | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | -| 方向键、回车键 | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | -| TAB键 | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | +| 方向键、回车键 | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | +| TAB键 | [TextInput](ts-basic-components-textinput.md)、[TextArea](ts-basic-components-textarea.md) | ## 示例 diff --git a/zh-cn/application-dev/reference/errorcodes/Readme-CN.md b/zh-cn/application-dev/reference/errorcodes/Readme-CN.md index 2c99a4845ea42c57f896ce875bd2aded04446aef..5b9633e022fa0c75e2c316cb6f95adfb14ef7567 100644 --- a/zh-cn/application-dev/reference/errorcodes/Readme-CN.md +++ b/zh-cn/application-dev/reference/errorcodes/Readme-CN.md @@ -84,7 +84,7 @@ - [设备管理错误码](errorcode-device-manager.md) - [位置服务子系统错误码](errorcode-geoLocationManager.md) - [键鼠穿越管理错误码](errorcode-devicestatus.md) - - [键鼠穿越管理错误码 (待停用)](errorcode-multimodalinput.md) + - [键鼠穿越管理错误码(待停用)](errorcode-multimodalinput.md) - [传感器错误码](errorcode-sensor.md) - [振动错误码](errorcode-vibrator.md) - [系统参数错误码](errorcode-system-parameterV9.md) diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-datashare.md b/zh-cn/application-dev/reference/errorcodes/errorcode-datashare.md index 46b6f21845ad06667c31091c0c9d34d11f64093c..bd7edf5760e8b30bbc6350aa10a91f36f0e3ebd0 100644 --- a/zh-cn/application-dev/reference/errorcodes/errorcode-datashare.md +++ b/zh-cn/application-dev/reference/errorcodes/errorcode-datashare.md @@ -22,4 +22,41 @@ The DataShareHelper is not initialized successfully. **处理步骤** 1. 咨询DataShare服务端提供者,获取正确的uri路径。 -2. DataShare仅支持Stage模型,检查context是否为Stage模型的context。 \ No newline at end of file +2. DataShare仅支持Stage模型,检查context是否为Stage模型的context。 + +## 15700011 添加/删除模板异常 + +**错误信息** + +The uri is not exist. + +**错误描述** + +添加/删除模板异常时,系统会产生此错误码。 + +**可能原因** + +1. 添加模板异常时,接口addTemplate的入参uri不正确。 +2. 删除模板异常时,接口delTemplate的入参uri不正确。 + +**处理步骤** + +咨询DataShare服务端提供者,获取正确的uri路径。 + +## 15700012 数据区不存在 + +**错误信息** + +The data area is not exist. + +**错误描述** + +数据更新异常时,系统会产生此错误码。 + +**可能原因** + +数据更新异常时,接口publish的入参bundleName不正确。 + +**处理步骤** + +咨询DataShare服务端提供者,获取正确的bundleName。 \ No newline at end of file diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-net-ethernet.md b/zh-cn/application-dev/reference/errorcodes/errorcode-net-ethernet.md index 9da62b519dee086e40edcad453daee5e3c0a41b6..b0bb8ac27f07c7c2988099151e4a88897484c738 100644 --- a/zh-cn/application-dev/reference/errorcodes/errorcode-net-ethernet.md +++ b/zh-cn/application-dev/reference/errorcodes/errorcode-net-ethernet.md @@ -1,4 +1,4 @@ -# 以太网错误码 +# 以太网连接错误码 > **说明:** > diff --git a/zh-cn/application-dev/reference/native-apis/Readme-CN.md b/zh-cn/application-dev/reference/native-apis/Readme-CN.md index a4c69e7b287af84c564ee6a69cc37eaee7144938..56e89cb8de8e3a8bd38b57dbfd595ed7e2d6ad5b 100644 --- a/zh-cn/application-dev/reference/native-apis/Readme-CN.md +++ b/zh-cn/application-dev/reference/native-apis/Readme-CN.md @@ -21,6 +21,7 @@ - [HuksKeyApi](_huks_key_api.md) - [HuksParamSetApi](_huks_param_set_api.md) - [HuksTypeApi](_huks_type_api.md) + - [Init](init.md) - 头文件 - [drawing_bitmap.h](drawing__bitmap_8h.md) - [drawing_brush.h](drawing__brush_8h.md) @@ -62,6 +63,7 @@ - [native_huks_api.h](native__huks__api_8h.md) - [native_huks_param.h](native__huks__param_8h.md) - [native_huks_type.h](native__huks__type_8h.md) + - [syscap_ndk.h](syscap__ndk_8h.md) - 结构体 - [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md) - [OH_NativeBuffer_Config](_o_h___native_buffer___config.md) diff --git a/zh-cn/application-dev/reference/native-apis/_audio_decoder.md b/zh-cn/application-dev/reference/native-apis/_audio_decoder.md index bd434a343ca936184a44d9c07b44710b844ff51a..566fab75c9b5f5683ed72af4f4aec7f768d88689 100644 --- a/zh-cn/application-dev/reference/native-apis/_audio_decoder.md +++ b/zh-cn/application-dev/reference/native-apis/_audio_decoder.md @@ -3,7 +3,7 @@ ## 概述 -AudioDecoder模块提供用于音频解码功能的函数。该模块在部分设备上可能不支持,可以通过[CanIUse](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/syscap.md)接口确认。 +AudioDecoder模块提供用于音频解码功能的函数。该模块在部分设备上可能不支持,可以通过[CanIUse](../syscap.md)接口确认。 @syscap SystemCapability.Multimedia.Media.AudioDecoder diff --git a/zh-cn/application-dev/reference/native-apis/_audio_encoder.md b/zh-cn/application-dev/reference/native-apis/_audio_encoder.md index 3c011bcc363ab52cb91aa0a969d43fcde062b2ba..9a0235deb7db5b5bc6b72c95ee5ce6ce341b3035 100644 --- a/zh-cn/application-dev/reference/native-apis/_audio_encoder.md +++ b/zh-cn/application-dev/reference/native-apis/_audio_encoder.md @@ -3,7 +3,7 @@ ## 概述 -AudioEncoder模块提供用于音频编码功能的函数。该模块在部分设备上可能不支持,可以通过[CanIUse](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/syscap.md)接口确认。 +AudioEncoder模块提供用于音频编码功能的函数。该模块在部分设备上可能不支持,可以通过[CanIUse](../syscap.md)接口确认。 @syscap SystemCapability.Multimedia.Media.AudioEncoder diff --git a/zh-cn/application-dev/reference/native-apis/_codec_base.md b/zh-cn/application-dev/reference/native-apis/_codec_base.md index aa3be62e1ec6e78273ea5fc1316d1f5d18d9eb9f..0246d18de02cae249484000f12c75e23a5119def 100644 --- a/zh-cn/application-dev/reference/native-apis/_codec_base.md +++ b/zh-cn/application-dev/reference/native-apis/_codec_base.md @@ -3,7 +3,7 @@ ## 概述 -CodecBase模块提供运行音视频编解码通用的结构体、字符常量、枚举。该模块在部分设备上可能不支持,可以通过[CanIUse](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/syscap.md)接口确认。 +CodecBase模块提供运行音视频编解码通用的结构体、字符常量、枚举。该模块在部分设备上可能不支持,可以通过[CanIUse](../syscap.md)接口确认。 @syscap SystemCapability.Multimedia.Media.CodecBase diff --git a/zh-cn/application-dev/reference/native-apis/_mind_spore.md b/zh-cn/application-dev/reference/native-apis/_mind_spore.md index 25e71ee14487b95e300e9f7a8d4f7090ed292b2e..5a39e666d0951b461e9a3112e635d49e3986f300 100644 --- a/zh-cn/application-dev/reference/native-apis/_mind_spore.md +++ b/zh-cn/application-dev/reference/native-apis/_mind_spore.md @@ -56,7 +56,7 @@ | [OH_AI_TensorHandleArray](#oh_ai_tensorhandlearray) | 张量数组结构体,用于存储张量数组指针和张量数组长度 | | [OH_AI_ShapeInfo](_o_h___a_i___shape_info.md) | 维度信息,最大的维度为MS_MAX_SHAPE_NUM。 | | [OH_AI_CallBackParam](#oh_ai_callbackparam) | 回调函数中传入的算子信息。 | -| [OH_AI_KernelCallBack](#oh_ai_kernelcallback)) (const [OH_AI_TensorHandleArray](_o_h___a_i___tensor_handle_array.md) inputs, const [OH_AI_TensorHandleArray](_o_h___a_i___tensor_handle_array.md) outputs, const [OH_AI_CallBackParam](_o_h___a_i___call_back_param.md) kernel_Info) | 回调函数指针。 | +| [OH_AI_KernelCallBack](#oh_ai_kernelcallback) | 回调函数指针。 | | [OH_AI_Status](#oh_ai_status) | Minspore的状态码。 | | [OH_AI_TensorHandle](#oh_ai_tensorhandle) | 指向张量对象句柄。 | | [OH_AI_ModelType](#oh_ai_modeltype) | 模型文件的类型。 | @@ -94,11 +94,11 @@ | [OH_AI_ContextGetThreadAffinityMode](#oh_ai_contextgetthreadaffinitymode) (const [OH_AI_ContextHandle](#oh_ai_contexthandle) context) | 获取运行时线程绑定CPU核心的策略。 | | [OH_AI_ContextSetThreadAffinityCoreList](#oh_ai_contextsetthreadaffinitycorelist) ([OH_AI_ContextHandle](#oh_ai_contexthandle) context, const int32_t \*core_list, size_t core_num) | 设置运行时线程绑定CPU核心的列表。 | | [OH_AI_ContextGetThreadAffinityCoreList](#oh_ai_contextgetthreadaffinitycorelist) (const [OH_AI_ContextHandle](#oh_ai_contexthandle) context, size_t \*core_num) | 获取CPU绑核列表。 | -| [OH_AI_ContextSetEnableParallel](#oh_ai_contextsetenableparallel) ([OH_AI_ContextHandle](#oh_ai_contexthandle) context, bool is_parallel) | 设置运行时是否支持并行。 | +| [OH_AI_ContextSetEnableParallel](#oh_ai_contextsetenableparallel) ([OH_AI_ContextHandle](#oh_ai_contexthandle) context, bool is_parallel) | 设置运行时是否支持并行。此接口特性当前未开启,设置无效。 | | [OH_AI_ContextGetEnableParallel](#oh_ai_contextgetenableparallel) (const [OH_AI_ContextHandle](#oh_ai_contexthandle) context) | 获取是否支持算子间并行。 | -| [OH_AI_ContextAddDeviceInfo](#oh_ai_contextadddeviceinfo) ([OH_AI_ContextHandle](#oh_ai_contexthandle) context, [OH_AI_DeviceInfoHandle](#oh_ai_deviceinfohandle) device_info) | 添加运行设备信息。 | +| [OH_AI_ContextAddDeviceInfo](#oh_ai_contextadddeviceinfo) ([OH_AI_ContextHandle](#oh_ai_contexthandle) context, [OH_AI_DeviceInfoHandle](#oh_ai_deviceinfohandle) device_info) | 将一个用户定义的运行设备信息附加到推理上下文中。 | | [OH_AI_DeviceInfoCreate](#oh_ai_deviceinfocreate) ([OH_AI_DeviceType](#oh_ai_devicetype) device_type) | 创建一个设备信息对象。 | -| [OH_AI_DeviceInfoDestroy](#oh_ai_deviceinfodestroy) ([OH_AI_DeviceInfoHandle](#oh_ai_deviceinfohandle) \*device_info) | 释放设备信息实例。 | +| [OH_AI_DeviceInfoDestroy](#oh_ai_deviceinfodestroy) ([OH_AI_DeviceInfoHandle](#oh_ai_deviceinfohandle) \*device_info) | 释放设备信息实例。注意:设备信息实例被添加到context后,无需调用者手动释放。 | | [OH_AI_DeviceInfoSetProvider](#oh_ai_deviceinfosetprovider) ([OH_AI_DeviceInfoHandle](#oh_ai_deviceinfohandle) device_info, const char \*provider) | 设置供应商的名称。 | | [OH_AI_DeviceInfoGetProvider](#oh_ai_deviceinfogetprovider) (const [OH_AI_DeviceInfoHandle](#oh_ai_deviceinfohandle) device_info) | 获取生产商的名称。 | | [OH_AI_DeviceInfoSetProviderDevice](#oh_ai_deviceinfosetproviderdevice) ([OH_AI_DeviceInfoHandle](#oh_ai_deviceinfohandle) device_info, const char \*device) | 设置生产商设备的名称。 | @@ -465,23 +465,23 @@ MSTensor保存的数据支持的排列格式。 | 枚举值 | 描述 | | ------------------- | ---------------- | -| OH_AI_FORMAT_NCHW | 表示NCHW排列。 | -| OH_AI_FORMAT_NHWC | 表示NHWC排列。 | -| OH_AI_FORMAT_NHWC4 | 表示NHWC4排列。 | -| OH_AI_FORMAT_HWKC | 表示HWKC排列。 | -| OH_AI_FORMAT_HWCK | 表示HWCK排列。 | -| OH_AI_FORMAT_KCHW | 表示KCHW排列。 | -| OH_AI_FORMAT_CKHW | 表示CKHW排列。 | -| OH_AI_FORMAT_KHWC | 表示KHWC排列。 | -| OH_AI_FORMAT_CHWK | 表示CHWK排列。 | -| OH_AI_FORMAT_HW | 表示HW排列。 | -| OH_AI_FORMAT_HW4 | 表示HW4排列。 | -| OH_AI_FORMAT_NC | 表示NC排列。 | -| OH_AI_FORMAT_NC4 | 表示NC4排列。 | -| OH_AI_FORMAT_NC4HW4 | 表示NC4HW4排列。 | -| OH_AI_FORMAT_NCDHW | 表示NCDHW排列。 | -| OH_AI_FORMAT_NWC | 表示NWC排列。 | -| OH_AI_FORMAT_NCW | 表示NCW排列。 | +| OH_AI_FORMAT_NCHW | 按批次N、通道C、高度H和宽度W的顺序存储张量数据。 | +| OH_AI_FORMAT_NHWC | 按批次N、高度H、宽度W和通道C的顺序存储张量数据。 | +| OH_AI_FORMAT_NHWC4 | 按批次N、高度H、宽度W和通道C的顺序存储张量数据,其中C轴是4字节对齐格式。 | +| OH_AI_FORMAT_HWKC | 按高度H、宽度W、核数K和通道C的顺序存储张量数据。 | +| OH_AI_FORMAT_HWCK | 按高度H、宽度W、通道C和核数K的顺序存储张量数据。 | +| OH_AI_FORMAT_KCHW | 按核数K、通道C、高度H和宽度W的顺序存储张量数据。 | +| OH_AI_FORMAT_CKHW | 按通道C、核数K、高度H和宽度W的顺序存储张量数据。 | +| OH_AI_FORMAT_KHWC | 按核数K、高度H、宽度W和通道C的顺序存储张量数据。 | +| OH_AI_FORMAT_CHWK | 按通道C、高度H、宽度W和核数K的顺序存储张量数据。 | +| OH_AI_FORMAT_HW | 按高度H和宽度W的顺序存储张量数据。 | +| OH_AI_FORMAT_HW4 | 按高度H和宽度W的顺序存储张量数据,其中W轴是4字节对齐格式。 | +| OH_AI_FORMAT_NC | 按批次N和通道C的顺序存储张量数据。 | +| OH_AI_FORMAT_NC4 | 按批次N和通道C的顺序存储张量数据,其中C轴是4字节对齐格式。 | +| OH_AI_FORMAT_NC4HW4 | 按批次N、通道C、高度H和宽度W的顺序存储张量数据,其中C轴和W轴是4字节对齐格式。 | +| OH_AI_FORMAT_NCDHW | 按批次N、通道C、深度D、高度H和宽度W的顺序存储张量数据。 | +| OH_AI_FORMAT_NWC | 按批次N、宽度W和通道C的顺序存储张量数据。 | +| OH_AI_FORMAT_NCW | 按批次N、通道C和宽度W的顺序存储张量数据。 | ### OH_AI_ModelType @@ -497,7 +497,7 @@ enum OH_AI_ModelType | 枚举值 | 描述 | | ----------------------- | ------------------ | -| OH_AI_MODELTYPE_MINDIR | 模型类型是MindIR。 | +| OH_AI_MODELTYPE_MINDIR | 模型类型是MindIR,对应的模型文件后缀为.ms。 | | OH_AI_MODELTYPE_INVALID | 模型类型无效。 | @@ -620,7 +620,7 @@ OH_AI_API void OH_AI_ContextAddDeviceInfo (OH_AI_ContextHandle context, OH_AI_De **描述:** -添加运行设备信息。 +将一个用户定义的运行设备信息附加到推理上下文中。 **参数:** @@ -706,7 +706,7 @@ OH_AI_API const int32_t* OH_AI_ContextGetThreadAffinityCoreList (const OH_AI_Con **返回:** -CPU绑核列表。 +CPU绑核列表。此列表对象由[OH_AI_ContextHandle](#oh_ai_contexthandle)管理,调用者无须手动释放。 ### OH_AI_ContextGetThreadAffinityMode() @@ -762,7 +762,7 @@ OH_AI_API void OH_AI_ContextSetEnableParallel (OH_AI_ContextHandle context, bool **描述:** -设置运行时是否支持并行。 +设置运行时是否支持并行。此接口特性当前未开启,设置无效。 **参数:** @@ -937,7 +937,7 @@ OH_AI_API void OH_AI_DeviceInfoDestroy (OH_AI_DeviceInfoHandle * device_info) **描述:** -释放设备信息实例。 +释放设备信息实例。注意:设备信息实例被添加到context后,无需调用者手动释放。 **参数:** diff --git a/zh-cn/application-dev/reference/native-apis/_video_decoder.md b/zh-cn/application-dev/reference/native-apis/_video_decoder.md index a53a04ceaac7926389522bd400869fefc1859bf3..df48c843419645ba3dce1858004fddaaa5e577ce 100644 --- a/zh-cn/application-dev/reference/native-apis/_video_decoder.md +++ b/zh-cn/application-dev/reference/native-apis/_video_decoder.md @@ -3,7 +3,7 @@ ## 概述 -VideoDecoder模块提供用于视频解码功能的函数。该模块在部分设备上可能不支持,可以通过[CanIUse](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/syscap.md)接口确认。 +VideoDecoder模块提供用于视频解码功能的函数。该模块在部分设备上可能不支持,可以通过[CanIUse](../syscap.md)接口确认。 @syscap SystemCapability.Multimedia.Media.VideoDecoder diff --git a/zh-cn/application-dev/reference/native-apis/_video_encoder.md b/zh-cn/application-dev/reference/native-apis/_video_encoder.md index b7bf9abf6a31cdb4201bb87b8b3c2649d2f0f816..37734d087ca2f1613cb68d5f29c112fd9e01e617 100644 --- a/zh-cn/application-dev/reference/native-apis/_video_encoder.md +++ b/zh-cn/application-dev/reference/native-apis/_video_encoder.md @@ -3,7 +3,7 @@ ## 概述 -VideoEncoder模块提供用于视频编码功能的函数和枚举。该模块在部分设备上可能不支持,可以通过[CanIUse](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/syscap.md)接口确认。 +VideoEncoder模块提供用于视频编码功能的函数和枚举。该模块在部分设备上可能不支持,可以通过[CanIUse](../syscap.md)接口确认。 @syscap SystemCapability.Multimedia.Media.VideoEncoder diff --git a/zh-cn/application-dev/reference/native-apis/context_8h.md b/zh-cn/application-dev/reference/native-apis/context_8h.md index df34bc97972ece5f49feff906942f01f62d11cd3..c3ad71e2390393b7bcc1f8785770c3a8416db4ab 100644 --- a/zh-cn/application-dev/reference/native-apis/context_8h.md +++ b/zh-cn/application-dev/reference/native-apis/context_8h.md @@ -37,11 +37,11 @@ | [OH_AI_ContextGetThreadAffinityMode](_mind_spore.md#oh_ai_contextgetthreadaffinitymode) (const [OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context) | 获取运行时线程绑定CPU核心的策略。 | | [OH_AI_ContextSetThreadAffinityCoreList](_mind_spore.md#oh_ai_contextsetthreadaffinitycorelist) ([OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context, const int32_t \*core_list, size_t core_num) | 设置运行时线程绑定CPU核心的列表。 | | [OH_AI_ContextGetThreadAffinityCoreList](_mind_spore.md#oh_ai_contextgetthreadaffinitycorelist) (const [OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context, size_t \*core_num) | 获取CPU绑核列表。 | -| [OH_AI_ContextSetEnableParallel](_mind_spore.md#oh_ai_contextsetenableparallel) ([OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context, bool is_parallel) | 设置运行时是否支持并行。 | +| [OH_AI_ContextSetEnableParallel](_mind_spore.md#oh_ai_contextsetenableparallel) ([OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context, bool is_parallel) | 设置运行时是否支持并行。此接口特性当前未开启,设置无效。 | | [OH_AI_ContextGetEnableParallel](_mind_spore.md#oh_ai_contextgetenableparallel) (const [OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context) | 获取是否支持算子间并行。 | -| [OH_AI_ContextAddDeviceInfo](_mind_spore.md#oh_ai_contextadddeviceinfo) ([OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context, [OH_AI_DeviceInfoHandle](_mind_spore.md#oh_ai_deviceinfohandle) device_info) | 添加运行设备信息。 | +| [OH_AI_ContextAddDeviceInfo](_mind_spore.md#oh_ai_contextadddeviceinfo) ([OH_AI_ContextHandle](_mind_spore.md#oh_ai_contexthandle) context, [OH_AI_DeviceInfoHandle](_mind_spore.md#oh_ai_deviceinfohandle) device_info) | 将一个用户定义的运行设备信息附加到推理上下文中。 | | [OH_AI_DeviceInfoCreate](_mind_spore.md#oh_ai_deviceinfocreate) ([OH_AI_DeviceType](_mind_spore.md#oh_ai_devicetype) device_type) | 创建一个设备信息对象。 | -| [OH_AI_DeviceInfoDestroy](_mind_spore.md#oh_ai_deviceinfodestroy) ([OH_AI_DeviceInfoHandle](_mind_spore.md#oh_ai_deviceinfohandle) \*device_info) | 释放设备信息实例。 | +| [OH_AI_DeviceInfoDestroy](_mind_spore.md#oh_ai_deviceinfodestroy) ([OH_AI_DeviceInfoHandle](_mind_spore.md#oh_ai_deviceinfohandle) \*device_info) | 释放设备信息实例。注意:设备信息实例被添加到context后,无需调用者手动释放。 | | [OH_AI_DeviceInfoSetProvider](_mind_spore.md#oh_ai_deviceinfosetprovider) ([OH_AI_DeviceInfoHandle](_mind_spore.md#oh_ai_deviceinfohandle) device_info, const char \*provider) | 设置供应商的名称。 | | [OH_AI_DeviceInfoGetProvider](_mind_spore.md#oh_ai_deviceinfogetprovider) (const [OH_AI_DeviceInfoHandle](_mind_spore.md#oh_ai_deviceinfohandle) device_info) | 获取生产商的名称。 | | [OH_AI_DeviceInfoSetProviderDevice](_mind_spore.md#oh_ai_deviceinfosetproviderdevice) ([OH_AI_DeviceInfoHandle](_mind_spore.md#oh_ai_deviceinfohandle) device_info, const char \*device) | 设置生产商设备的名称。 | diff --git a/zh-cn/application-dev/reference/native-apis/init.md b/zh-cn/application-dev/reference/native-apis/init.md new file mode 100644 index 0000000000000000000000000000000000000000..227e03e0b4c878790ccbd142b2e93756e5b02396 --- /dev/null +++ b/zh-cn/application-dev/reference/native-apis/init.md @@ -0,0 +1,54 @@ +# Init + + +## 概述 + +提供系统能力查询接口。 + +通过读取系统能力参数文件,返回指定的某个系统能力是否被支持。 + +**起始版本:** + +8 + + +## 汇总 + + +### 文件 + +| 名称 | 描述 | +| -------- | -------- | +| [syscap_ndk.h](syscap__ndk_8h.md) | 查询单个系统能力是否被支持的API。 | + + +### 函数 + +| 名称 | 描述 | +| -------- | -------- | +| [canIUse](#caniuse) (const char \*cap) | 查询指定的系统能力是否被支持。 系统能力(SystemCapability,简称SysCap),指操作系统中每一个相对独立的特性。不同的设备对应不同的系统能力集,每个系统能力对应一个或多个API。开发者可根据系统能力来判断是否可以使用某接口。 | + + +## 函数说明 + + +### canIUse() + + +``` +bool canIUse (const char * cap) +``` + +**描述:** + +查询指定的系统能力是否被支持。 系统能力(SystemCapability,简称SysCap),指操作系统中每一个相对独立的特性。不同的设备对应不同的系统能力集,每个系统能力对应一个或多个API。开发者可根据系统能力来判断是否可以使用某接口。 + +**参数:** + +| 名称 | 描述 | +| -------- | -------- | +| cap | 待查询的系统能力名称。 | + +**返回:** + +系统能力查询结果,true表示系统具备该能力,false表示系统不具备。 diff --git a/zh-cn/application-dev/reference/native-apis/syscap__ndk_8h.md b/zh-cn/application-dev/reference/native-apis/syscap__ndk_8h.md new file mode 100644 index 0000000000000000000000000000000000000000..a8803443c00b1df574f9568202dc7ff6f4ad4bcc --- /dev/null +++ b/zh-cn/application-dev/reference/native-apis/syscap__ndk_8h.md @@ -0,0 +1,24 @@ +# syscap_ndk.h + + +## 概述 + +查询单个系统能力是否被支持的API。 + +**起始版本:** + +8 + +**相关模块:** + +[Init](init.md) + + +## 汇总 + + +### 函数 + +| 名称 | 描述 | +| -------- | -------- | +| [canIUse](init.md#caniuse) (const char \*cap) | 查询指定的系统能力是否被支持。
系统能力(SystemCapability,简称SysCap),指操作系统中每一个相对独立的特性。不同的设备对应不同的系统能力集,每个系统能力对应一个或多个API。开发者可根据系统能力来判断是否可以使用某接口。 | diff --git a/zh-cn/application-dev/reference/native-lib/Readme-CN.md b/zh-cn/application-dev/reference/native-lib/Readme-CN.md index 3edca1fa95b46222ccb34cb7c59313909a6feab0..6c28ebf7a877c5070bea98db62334ee929eb1be7 100644 --- a/zh-cn/application-dev/reference/native-lib/Readme-CN.md +++ b/zh-cn/application-dev/reference/native-lib/Readme-CN.md @@ -1,7 +1,7 @@ # Native API标准库 -- [Node_API](third_party_napi/napi.md) +- [Node-API](third_party_napi/napi.md) - [libuv](third_party_libuv/libuv.md) -- [支持的标准库介绍](third_party_libc/musl.md) +- [Native API中支持的标准库](third_party_libc/musl.md) - 附录 - [Native api中没有导出的符号列表](third_party_libc/musl-peculiar-symbol.md) - [Native api中由于权限管控可能调用失败的符号列表](third_party_libc/musl-permission-control-symbol.md) diff --git a/zh-cn/application-dev/reference/syscap.md b/zh-cn/application-dev/reference/syscap.md index 5ab69bbb18a97b2645a1300ea7a258741fb19bad..2eeaed9a4cda4c4404c683270a3fefa164f1378e 100644 --- a/zh-cn/application-dev/reference/syscap.md +++ b/zh-cn/application-dev/reference/syscap.md @@ -93,29 +93,49 @@ DevEco Studio会根据创建的工程所支持的设置自动配置联想能力 ### 判断 API 是否可以使用 -- 方法1:OpenHarmony定义了API canIUse帮助开发者来判断该设备是否支持某个特定的syscap。 - - ```ts - if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) { - console.log("该设备支持SystemCapability.ArkUI.ArkUI.Full"); - } else { - console.log("该设备不支持SystemCapability.ArkUI.ArkUI.Full"); - } - ``` - -- 方法2:开发者可通过import的方式将模块导入,若当前设备不支持该模块,import的结果为undefined,开发者在使用其API时,需要判断其是否存在。 - - ```ts - import geolocation from '@ohos.geolocation'; - - if (geolocation) { - geolocation.getCurrentLocation((location) => { - console.log(location.latitude, location.longitude); - }); - } else { - console.log('该设备不支持位置信息'); - } - ``` +当前提供了ArtTS API和Native API用于帮助判断某个API是否可以使用。 + +- ArkTS API + + - 方法1:OpenHarmony定义了API canIUse帮助开发者来判断该设备是否支持某个特定的syscap。 + + ```ts + if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) { + console.log("该设备支持SystemCapability.ArkUI.ArkUI.Full"); + } else { + console.log("该设备不支持SystemCapability.ArkUI.ArkUI.Full"); + } + ``` + + - 方法2:开发者可通过import的方式将模块导入,若当前设备不支持该模块,import的结果为undefined,开发者在使用其API时,需要判断其是否存在。 + + ```ts + import geolocation from '@ohos.geolocation'; + + if (geolocation) { + geolocation.getCurrentLocation((location) => { + console.log(location.latitude, location.longitude); + }); + } else { + console.log('该设备不支持位置信息'); + } + ``` +- Native API + + ```c + #include + #include + #include "syscap_ndk.h" + + char syscap[] = "SystemCapability.ArkUI.ArkUI.Full"; + bool result = canIUse(syscap); + if (result) { + printf("SysCap: %s is supported!\n", syscap); + } else { + printf("SysCap: %s is not supported!\n", syscap); + } + ``` + 除此之外,开发者可以通过API参考文档查询API接口所属的SysCap。 ### 不同设备相同能力的差异检查 diff --git a/zh-cn/application-dev/security/Readme-CN.md b/zh-cn/application-dev/security/Readme-CN.md index c7c50de3b885e922047c97ec68f09bdfa40ab589..450b81acceefa6d53156159bf3deb99e9637dc97 100644 --- a/zh-cn/application-dev/security/Readme-CN.md +++ b/zh-cn/application-dev/security/Readme-CN.md @@ -14,7 +14,7 @@ - [通用密钥库密码算法规格](huks-appendix.md) - 加解密算法库框架 - [加解密算法库框架概述](cryptoFramework-overview.md) - - [加解密算法框架开发指导](cryptoFramework-guidelines.md) + - [加解密算法库框架开发指导](cryptoFramework-guidelines.md) - 证书 - [证书概述](cert-overview.md) - [证书开发指导](cert-guidelines.md) diff --git a/zh-cn/application-dev/security/accesstoken-guidelines.md b/zh-cn/application-dev/security/accesstoken-guidelines.md index d512d0d715c0a82060cec85d950a11c4f9f0f9e9..8b8c26fd1fae0f51cd267143b4a73e5f767d6187 100644 --- a/zh-cn/application-dev/security/accesstoken-guidelines.md +++ b/zh-cn/application-dev/security/accesstoken-guidelines.md @@ -1,4 +1,4 @@ -# 访问控制授权申请 +# 访问控制授权申请指导 ## 场景介绍 diff --git a/zh-cn/application-dev/security/cryptoFramework-guidelines.md b/zh-cn/application-dev/security/cryptoFramework-guidelines.md index cbfd2ba12b1b336730567bc1aafd45f98c3a45a7..8c6a5429a824e2e4b100bbf0983e9835802a96ea 100644 --- a/zh-cn/application-dev/security/cryptoFramework-guidelines.md +++ b/zh-cn/application-dev/security/cryptoFramework-guidelines.md @@ -13,8 +13,10 @@ 1. 随机生成算法库密钥对象。该对象可用于后续的加解密等操作。 2. 根据指定数据生成算法库密钥对象(也就是将外部或存储的二进制数据转换为算法库的密钥对象)。该对象可用于后续的加解密等操作。 3. 获取算法库密钥对象的二进制数据,用于存储或传输。 -> **说明**:密钥对象Key包括对称密钥SymKey和非对称密钥(公钥PubKey和私钥PriKey),其中公钥和私钥组成密钥对KeyPair。密钥之间的具体关系可参考[API参考](../reference/apis/js-apis-cryptoFramework.md)。 +> **说明:** +> +> 密钥对象Key包括对称密钥SymKey和非对称密钥(公钥PubKey和私钥PriKey),其中公钥和私钥组成密钥对KeyPair。密钥之间的具体关系可参考[API参考](../reference/apis/js-apis-cryptoFramework.md)。 **接口及参数说明** @@ -46,7 +48,7 @@ 以使用Promise方式随机生成RSA密钥(1024位,素数个数为2)为例: -```javascript +```js import cryptoFramework from '@ohos.security.cryptoFramework'; function generateAsyKey() { @@ -75,7 +77,7 @@ function generateAsyKey() { 以使用Promise方式随机生成AES密钥(256位)为例: -```javascript +```js import cryptoFramework from '@ohos.security.cryptoFramework'; // 字节流以16进制输出 @@ -103,7 +105,7 @@ function testGenerateAesKey() { 1. 获取RSA公钥或私钥二进制数据,公钥需满足ASN.1语法、X.509规范、DER编码格式,私钥需满足ASN.1语法、PKCS#8规范、DER编码格式。 2. 创建AsyKeyGenerator对象,调用convertKey方法,传入公钥二进制和私钥二进制(二者非必选项,可只传入其中一个),转换为KeyPair对象。 -```javascript +```js import cryptoFramework from '@ohos.security.cryptoFramework'; function convertAsyKey() { @@ -119,16 +121,16 @@ function convertAsyKey() { } ``` -**说明** - - 当前convertKey操作,公钥只支持转换满足X.509规范的DER格式,私钥只支持PKCS#8规范的DER格式; +> **说明:** +> +> 当前convertKey操作,公钥只支持转换满足X.509规范的DER格式,私钥只支持PKCS#8规范的DER格式。 示例4:根据指定的ECC非对称密钥二进制数据,生成KeyPair对象(场景2、3) 1. 获取ECC二进制密钥数据,封装成DataBlob对象。 2. 调用convertKey方法,传入公钥二进制和私钥二进制(二者非必选项,可只传入其中一个),转换为KeyPair对象。 -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" function convertEccAsyKey() { @@ -154,7 +156,7 @@ function convertEccAsyKey() { 以使用callback方式生成3DES密钥(3DES密钥只能为192位)为例: -```javascript +```js import cryptoFramework from '@ohos.security.cryptoFramework'; // 字节流以16进制输出 @@ -201,12 +203,15 @@ function testConvertAesKey() { **场景说明** 在数据存储或传输场景中,可以使用加解密操作用于保证数据的机密性,防止敏感数据泄露。使用加解密操作中,典型的场景有: + 1. 使用对称密钥的加解密操作 2. 使用非对称密钥的加解密操作 **接口及参数说明** -详细接口说明可参考[API参考](../reference/apis/js-apis-cryptoFramework.md)。
由于密码算法的复杂性,在选取不同规格和参数时,开发差异较大,无法通过代码示例一一列举,请仔细阅读API参考资料中的相关接口,确保使用正确。 +详细接口说明可参考[API参考](../reference/apis/js-apis-cryptoFramework.md)。 + +由于密码算法的复杂性,在选取不同规格和参数时,开发差异较大,无法通过代码示例一一列举,请仔细阅读API参考资料中的相关接口,确保使用正确。 以上场景设计的常用接口如下表所示: @@ -490,9 +495,10 @@ function test3DesEcb() { } } ``` + 以AES GCM以promise方式,分段update()实现加解密为例: -```javascript +```js import cryptoFramework from '@ohos.security.cryptoFramework'; var globalCipher; @@ -638,7 +644,7 @@ function testAesMultiUpdate() { 2. 生成Cipher对象。通过createCipher接口创建Cipher对象,执行初始化操作,设置密钥及加解密模式。 3. 执行加解密操作。通过调用Cipher对象提供的doFinal接口,执行加密操作生成密文或执行解密操作生成明文。 -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" let plan = "This is cipher test."; @@ -738,8 +744,10 @@ function decryptMessageCallback() { }); } ``` + 以RSA非对称加解密(多次调用doFinal实现分段)为例: -```javascript + +```js import cryptoFramework from "@ohos.security.cryptoFramework" function stringToUint8Array(str) { @@ -823,17 +831,18 @@ function encryptLongMessagePromise() { } ``` -**说明** - -1. 使用RSA加解密时,Cipher对象不可重复调用init方法初始化,在创建了一个加密Cipher对象后,如果要进行解密,则需要重新创建另一个Cipher对象执行解密操作。 -2. RSA加密有长度限制,允许加密明文的最大长度见[加解密算法库框架概述](cryptoFramework-overview.md)中的基本概念章节。 -3. RSA解密每次允许解密的密文长度为,RSA密钥的位数/8。 +> **说明:** +> +> 1. 使用RSA加解密时,Cipher对象不可重复调用init方法初始化,在创建了一个加密Cipher对象后,如果要进行解密,则需要重新创建另一个Cipher对象执行解密操作。 +> 2. RSA加密有长度限制,允许加密明文的最大长度见[加解密算法库框架概述](cryptoFramework-overview.md)中的基本概念章节。 +> 3. RSA解密每次允许解密的密文长度为,RSA密钥的位数/8。 ## 使用签名验签操作 **场景说明** 当需要判断接收的数据是否被篡改且是否为指定对象发送的数据时,可以使用签名验签操作。使用签名验签操作中,典型的场景有: + 1. 使用RSA签名验签操作 2. 使用ECC签名验签操作 @@ -861,21 +870,23 @@ function encryptLongMessagePromise() { **开发步骤** 示例1:使用RSA签名验签操作 + 1. 生成RSA密钥。通过createAsyKeyGenerator接口创建AsyKeyGenerator对象,并生成RSA非对称密钥。 2. 生成Sign对象。通过createSign接口创建Sign对象,执行初始化操作并设置签名私钥。 3. 执行签名操作。通过Sign类提供的update接口,添加签名数据,并调用sign接口生成数据的签名。 4. 生成Verify对象。通过createVerify接口创建Verify对象,执行初始化操作并设置验签公钥。 5. 执行验签操作。通过Verify类提供的update接口,添加签名数据,并调用verify接口传入签名进行验签。 -```javascript + +```js import cryptoFramework from "@ohos.security.cryptoFramework" function stringToUint8Array(str) { - var arr = []; - for (var i = 0, j = str.length; i < j; ++i) { - arr.push(str.charCodeAt(i)); - } - var tmpArray = new Uint8Array(arr); - return tmpArray; + var arr = []; + for (var i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); + } + var tmpArray = new Uint8Array(arr); + return tmpArray; } let globalKeyPair; @@ -945,22 +956,23 @@ function verifyMessageCallback() { ``` 示例2:使用ECDSA操作 + 1. 生成ECC密钥。通过createAsyKeyGenerator接口创建AsyKeyGenerator对象,并生成ECC非对称密钥。 2. 生成Sign对象。通过createSign接口创建Sign对象,执行初始化操作并设置签名私钥。 3. 执行签名操作。通过Sign类提供的update接口,添加签名数据,并调用doFinal接口生成数据的签名。 4. 生成Verify对象。通过createVerify接口创建Verify对象,执行初始化操作并设置验签公钥。 5. 执行验签操作。通过Verify类提供的update接口,添加签名数据,并调用doFinal接口传入签名进行验签。 -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" function stringToUint8Array(str) { - var arr = []; - for (var i = 0, j = str.length; i < j; ++i) { - arr.push(str.charCodeAt(i)); - } - var tmpArray = new Uint8Array(arr); - return tmpArray; + var arr = []; + for (var i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); + } + var tmpArray = new Uint8Array(arr); + return tmpArray; } let globalKeyPair; @@ -1028,9 +1040,10 @@ function verifyMessageCallback() { }) } ``` + 以执行签名、验签操作时多次调用update实现分段为例: -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" function stringToUint8Array(str) { @@ -1127,142 +1140,133 @@ function signLongMessagePromise() { 3. 通过接口`digest`,返回摘要计算结果 4. 获取当前摘要算法名与摘要计算长度 -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" -// turn string into uint8Arr +// 可理解的字符串转成字节流 function stringToUint8Array(str) { - var arr = []; - for (var i = 0, j = str.length; i < j; ++i) { - arr.push(str.charCodeAt(i)); - } - var tmpUint8Array = new Uint8Array(arr); - return tmpUint8Array; -} - -// generate dataBlob with given length -function GenDataBlob(dataBlobLen) { - var dataBlob; - if (dataBlobLen == 12) { - dataBlob = {data: stringToUint8Array("my test data")}; - } else { - console.error("GenDataBlob: dataBlobLen is invalid"); - dataBlob = {data: stringToUint8Array("my test data")}; + let arr = []; + for (let i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); } - return dataBlob; + return new Uint8Array(arr); } -// md with promise async -function doMdByPromise(algName) { - var md; +// 以Promise方式完成摘要 +function doMdByPromise() { + let mdAlgName = "SHA256"; // 摘要算法名 + let message = "mdTestMessgae"; // 待摘要数据 + let md; + let mdOutput; try { - md = cryptoFramework.createMd(algName); + md = cryptoFramework.createMd(mdAlgName); } catch (error) { console.error("[Promise]: error code: " + error.code + ", message is: " + error.message); + return; } - console.error("[Promise]: Md algName is: " + md.algName); - // 初次update - var promiseMdUpdate = md.update(GenDataBlob(12)); + console.info("[Promise]: Md algName is: " + md.algName); + // 数据量较少时,可以只做一次update,将数据全部传入,接口未对入参长度做限制 + let promiseMdUpdate = md.update({ data: stringToUint8Array(message) }); promiseMdUpdate.then(() => { - // 可根据情况进行多次update - promiseMdUpdate = md.update(GenDataBlob(12)); - return promiseMdUpdate; - }).then(mdOutput => { - var PromiseMdDigest = md.digest(); + // 通过digest,返回摘要结果 + let PromiseMdDigest = md.digest(); return PromiseMdDigest; - }).then(mdOutput => { - console.error("[Promise]: MD result: " + mdOutput.data); - var mdLen = md.getMdLength(); - console.error("[Promise]: MD len: " + mdLen); + }).then(digestOutput => { + mdOutput = digestOutput; + console.info("[Promise]: MD result: " + mdOutput.data); + let mdLen = md.getMdLength(); + console.info("[Promise]: MD len: " + mdLen); }).catch(error => { console.error("[Promise]: error: " + error.message); }); } -// md with callback async -function doMdByCallback(algName) { - var md; +// 以Callback方式完成摘要 +function doMdByCallback() { + let mdAlgName = "SHA256"; // 摘要算法名 + let message = "mdTestMessgae"; // 待摘要数据 + let md; + let mdOutput; try { - md = cryptoFramework.createMd(algName); + md = cryptoFramework.createMd(mdAlgName); } catch (error) { console.error("[Callback]: error code: " + error.code + ", message is: " + error.message); } - console.error("[Callback]: Md algName is: " + md.algName); - // 初次update - md.update(GenDataBlob(12), (err,) => { + console.info("[Callback]: Md algName is: " + md.algName); + // 数据量较少时,可以只做一次update,将数据全部传入,接口未对入参长度做限制 + md.update({ data: stringToUint8Array(message) }, (err,) => { if (err) { console.error("[Callback]: err: " + err.code); } - // 可根据情况进行多次update - md.update(GenDataBlob(12), (err1,) => { + md.digest((err1, digestOutput) => { if (err1) { console.error("[Callback]: err: " + err1.code); + } else { + mdOutput = digestOutput; + console.info("[Callback]: MD result: " + mdOutput.data); + let mdLen = md.getMdLength(); + console.info("[Callback]: MD len: " + mdLen); } - md.digest((err2, mdOutput) => { - if (err2) { - console.error("[Callback]: err: " + err2.code); - } else { - console.error("[Callback]: MD result: " + mdOutput.data); - var mdLen = md.getMdLength(); - console.error("[Callback]: MD len: " + mdLen); - } - }); }); }); } ``` + 以MD更新时多次调用update实现分段为例: -```javascript -import cryptoFramework from "@ohos.security.cryptoFramework" -async function updateData(index, obj, data) { - console.error("update " + (index + 1) + " MB data..."); - return obj.update(data); -} +```js +import cryptoFramework from "@ohos.security.cryptoFramework" +// 可理解的字符串转成字节流 function stringToUint8Array(str) { - var arr = []; - for (var i = 0, j = str.length; i < j; ++i) { + let arr = []; + for (let i = 0, j = str.length; i < j; ++i) { arr.push(str.charCodeAt(i)); } - var tmpUint8Array = new Uint8Array(arr); - return tmpUint8Array; + return new Uint8Array(arr); } -function GenDataBlob(dataBlobLen) { - var dataBlob; - if (dataBlobLen == 12) { - dataBlob = {data: stringToUint8Array("my test data")}; - } else { - console.error("GenDataBlob: dataBlobLen is invalid"); - dataBlob = {data: stringToUint8Array("my test data")}; - } - return dataBlob; -} -function LoopMdPromise(algName, loopSize) { - var md; +// 使用Promise方式,完成分段摘要 +async function doLoopMdPromise() { + let mdAlgName = "SHA256"; // 摘要算法名 + let md; + let mdOutput; try { - md = cryptoFramework.createMd(algName); + md = cryptoFramework.createMd(mdAlgName); } catch (error) { console.error("[Promise]: error code: " + error.code + ", message is: " + error.message); return; } - console.error("[Promise]: Md algName is: " + md.algName); - var promiseMdUpdate = md.update(GenDataBlob(12)); - promiseMdUpdate.then(() => { - var PromiseMdDigest = md.digest(); - return PromiseMdDigest; - }).then(async () => { - for (var i = 0; i < loopSize; i++) { - await updateData(i, md, GenDataBlob(12)); + console.info("[Promise]: Md algName is: " + md.algName); + let messageText = "aaaaa.....bbbbb.....ccccc.....ddddd.....eee"; // 假设信息总共43字节 + let messageArr = []; + let updateLength = 20; // 假设每20字节分段update一次,实际并无要求 + + for (let i = 0; i <= messageText.length; i++) { + if ((i % updateLength == 0 || i == messageText.length) && messageArr.length != 0) { + let message = new Uint8Array(messageArr); + let messageBlob = { data : message }; + // 使用await处理for循环里的update + try { + await md.update(messageBlob); // 分段update + } catch (error) { + console.error("await update error code: " + error.code + ", message is: " + error.message); + return; + } + messageArr = []; } - var PromiseMdDigest = md.digest(); - return PromiseMdDigest; - }).then(mdOutput => { - console.error("[Promise]: MD result: " + mdOutput.data); - var mdLen = md.getMdLength(); - console.error("[Promise]: MD len: " + mdLen); + // 按分割长度,填充messageArr + if (i < messageText.length) { + messageArr.push(messageText.charCodeAt(i)); + } + } + let PromiseMdDigest = md.digest(); + PromiseMdDigest.then(digestOutput => { + mdOutput = digestOutput; + console.info("[Promise]: MD result: " + mdOutput.data); + let mdLen = md.getMdLength(); + console.info("[Promise]: MD len: " + mdLen); }).catch(error => { console.error("[Promise]: error: " + error.message); }); @@ -1292,7 +1296,7 @@ function LoopMdPromise(algName, loopSize) { 1. 通过createKeyAgreement接口创建KeyAgreement对象,用于后续的密钥协商操作。 2. 调用KeyAgreement对象提供的generateSecret方法,传入对端的ECC公钥对象,以及本地生成的ECC私钥对象。 -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" let globalSelfPriKey; @@ -1371,80 +1375,75 @@ Mac(message authentication code)可以对消息进行完整性校验,通过使 4. 通过接口`doFinal`,返回Mac计算结果 5. 获取当前摘要算法名与Mac计算长度 -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" -// turn string into uint8Arr +// 可理解的字符串转成字节流 function stringToUint8Array(str) { - var arr = []; - for (var i = 0, j = str.length; i < j; ++i) { - arr.push(str.charCodeAt(i)); - } - var tmpUint8Array = new Uint8Array(arr); - return tmpUint8Array; -} - -// generate blob with this func -function GenDataBlob(dataBlobLen) { - var dataBlob; - if (dataBlobLen == 12) { - dataBlob = {data: stringToUint8Array("my test data")}; - } else { - console.error("GenDataBlob: dataBlobLen is invalid"); - dataBlob = {data: stringToUint8Array("my test data")}; + let arr = []; + for (let i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); } - return dataBlob; + return new Uint8Array(arr); } -function doHmacByPromise(algName) { - var mac; +// 以Promise方式完成HMAC +function doHmacByPromise() { + let macAlgName = "SHA256"; // 摘要算法名 + let message = "hmacTestMessgae"; // 待hmac数据 + let macOutput; + let mac; try { - mac = cryptoFramework.createMac(algName); + mac = cryptoFramework.createMac(macAlgName); } catch (error) { console.error("[Promise]: error code: " + error.code + ", message is: " + error.message); } - console.error("[Promise]: Mac algName is: " + mac.algName); - var KeyBlob = { + console.info("[Promise]: Mac algName is: " + mac.algName); + let KeyBlob = { + // 128位密钥 data : stringToUint8Array("12345678abcdefgh") } - var symKeyGenerator = cryptoFramework.createSymKeyGenerator("AES128"); - var promiseConvertKey = symKeyGenerator.convertKey(KeyBlob); + let symKeyGenerator = cryptoFramework.createSymKeyGenerator("AES128"); + // 将二进制密钥转换为算法库密钥 + let promiseConvertKey = symKeyGenerator.convertKey(KeyBlob); promiseConvertKey.then(symKey => { - var promiseMacInit = mac.init(symKey); + let promiseMacInit = mac.init(symKey); return promiseMacInit; }).then(() => { - // 初次update - var promiseMacUpdate = mac.update(GenDataBlob(12)); - return promiseMacUpdate; - }).then(() => { - // 可根据情况进行多次update - var promiseMacUpdate = mac.update(GenDataBlob(12)); + // 数据量较少时,可以只做一次update,将数据全部传入,接口未对入参长度做限制 + let promiseMacUpdate = mac.update({ data: stringToUint8Array(message) }); return promiseMacUpdate; }).then(() => { - var PromiseMacDoFinal = mac.doFinal(); + let PromiseMacDoFinal = mac.doFinal(); return PromiseMacDoFinal; - }).then(macOutput => { - console.error("[Promise]: HMAC result: " + macOutput.data); - var macLen = mac.getMacLength(); - console.error("[Promise]: MAC len: " + macLen); + }).then(output => { + macOutput = output; + console.info("[Promise]: HMAC result: " + macOutput.data); + let macLen = mac.getMacLength(); + console.info("[Promise]: MAC len: " + macLen); }).catch(error => { console.error("[Promise]: error: " + error.message); }); } -// process by callback -function doHmacByCallback(algName) { - var mac; +// 以Callback方式完成HMAC +function doHmacByCallback() { + let macAlgName = "SHA256"; // 摘要算法名 + let message = "hmacTestMessgae"; // 待hmac数据 + let macOutput; + let mac; try { - mac = cryptoFramework.createMac(algName); + mac = cryptoFramework.createMac(macAlgName); } catch (error) { - AlertDialog.show({message: "[Callback]: error code: " + error.code + ", message is: " + error.message}); console.error("[Callback]: error code: " + error.code + ", message is: " + error.message); } - var KeyBlob = { + console.info("[Promise]: Mac algName is: " + mac.algName); + let KeyBlob = { + // 128位密钥 data : stringToUint8Array("12345678abcdefgh") } - var symKeyGenerator = cryptoFramework.createSymKeyGenerator("AES128"); + let symKeyGenerator = cryptoFramework.createSymKeyGenerator("AES128"); + // 将二进制密钥转换为算法库密钥 symKeyGenerator.convertKey(KeyBlob, (err, symKey) => { if (err) { console.error("[Callback]: err: " + err.code); @@ -1453,97 +1452,99 @@ function doHmacByCallback(algName) { if (err1) { console.error("[Callback]: err: " + err1.code); } - // 初次update - mac.update(GenDataBlob(12), (err2, ) => { + // 数据量较少时,可以只做一次update,将数据全部传入,接口未对入参长度做限制 + mac.update({ data: stringToUint8Array(message) }, (err2, ) => { if (err2) { console.error("[Callback]: err: " + err2.code); } - // 可根据情况进行多次update - mac.update(GenDataBlob(12), (err3, ) => { + mac.doFinal((err3, output) => { if (err3) { console.error("[Callback]: err: " + err3.code); + } else { + macOutput = output; + console.info("[Callback]: HMAC result: " + macOutput.data); + let macLen = mac.getMacLength(); + console.info("[Callback]: MAC len: " + macLen); } - mac.doFinal((err4, macOutput) => { - if (err4) { - console.error("[Callback]: err: " + err4.code); - } else { - console.error("[Callback]: HMAC result: " + macOutput.data); - var macLen = mac.getMacLength(); - console.error("[Callback]: MAC len: " + macLen); - } - }); }); }); }); }); } ``` + 以HMAC更新MAC时多次调用update实现分段为例: -```javascript -import cryptoFramework from "@ohos.security.cryptoFramework" -async function updateData(index, obj, data) { - console.error("update " + (index + 1) + " MB data..."); - return obj.update(data); -} +```js +import cryptoFramework from "@ohos.security.cryptoFramework" function stringToUint8Array(str) { - var arr = []; - for (var i = 0, j = str.length; i < j; ++i) { + let arr = []; + for (let i = 0, j = str.length; i < j; ++i) { arr.push(str.charCodeAt(i)); } - var tmpUint8Array = new Uint8Array(arr); - return tmpUint8Array; -} - -function GenDataBlob(dataBlobLen) { - var dataBlob; - if (dataBlobLen == 12) { - dataBlob = {data: stringToUint8Array("my test data")}; - } else { - console.error("GenDataBlob: dataBlobLen is invalid"); - dataBlob = {data: stringToUint8Array("my test data")}; - } - return dataBlob; + return new Uint8Array(arr); } -function LoopHmacPromise(algName, loopSize) { - var mac; +function doLoopHmacPromise() { + let macAlgName = "SHA256"; // 摘要算法名 + let macOutput; + let mac; try { - mac = cryptoFramework.createMac(algName); + mac = cryptoFramework.createMac(macAlgName); } catch (error) { console.error("[Promise]: error code: " + error.code + ", message is: " + error.message); return; } - console.error("[Promise]: Mac algName is: " + mac.algName); - var KeyBlob = { + console.info("[Promise]: Mac algName is: " + mac.algName); + let KeyBlob = { + // 128位密钥 data : stringToUint8Array("12345678abcdefgh") } - var symKeyGenerator = cryptoFramework.createSymKeyGenerator("AES128"); - var promiseConvertKey = symKeyGenerator.convertKey(KeyBlob); + let messageText = "aaaaa.....bbbbb.....ccccc.....ddddd.....eee"; // 假设信息总共43字节 + let updateLength = 20; // 假设每20字节分段update一次,实际并无要求 + let symKeyGenerator = cryptoFramework.createSymKeyGenerator("AES128"); + // 将二进制密钥转换为算法库密钥 + let promiseConvertKey = symKeyGenerator.convertKey(KeyBlob); promiseConvertKey.then(symKey => { - var promiseMacInit = mac.init(symKey); + let promiseMacInit = mac.init(symKey); return promiseMacInit; }).then(async () => { - for (var i = 0; i < loopSize; i++) { - await updateData(i, mac, GenDataBlob(12)); + let promiseMacUpdate; + let messageArr = []; + for (let i = 0; i <= messageText.length; i++) { + if ((i % updateLength == 0 || i == messageText.length) && messageArr.length != 0) { + let message = new Uint8Array(messageArr); + let messageBlob = { data : message }; + // 使用await处理for循环里的update + try { + promiseMacUpdate = await mac.update(messageBlob); // 分段update + } catch (error) { + console.error("await update error code: " + error.code + ", message is: " + error.message); + return; + } + messageArr = []; + } + // 按分割长度,填充messageArr + if (i < messageText.length) { + messageArr.push(messageText.charCodeAt(i)); + } } - var promiseMacUpdate = mac.update(GenDataBlob(12)); return promiseMacUpdate; }).then(() => { - var PromiseMacDoFinal = mac.doFinal(); + let PromiseMacDoFinal = mac.doFinal(); return PromiseMacDoFinal; - }).then(macOutput => { - console.error("[Promise]: HMAC result: " + macOutput.data); - var macLen = mac.getMacLength(); - console.error("[Promise]: MAC len: " + macLen); + }).then(output => { + macOutput = output; + console.log("[Promise]: HMAC result: " + macOutput.data); + let macLen = mac.getMacLength(); + console.log("[Promise]: MAC len: " + macLen); }).catch(error => { console.error("[Promise]: error: " + error.message); }); } ``` - ## 使用随机数操作 **场景说明** @@ -1570,7 +1571,7 @@ function LoopHmacPromise(algName, loopSize) { 2. 接受输入长度,通过接口`generateRandom`,生成指定长度的随机数 3. 接受DataBlob数据,通过接口`setSeed`,为随机数生成池设置种子 -```javascript +```js import cryptoFramework from "@ohos.security.cryptoFramework" // process by promise diff --git a/zh-cn/application-dev/security/cryptoFramework-overview.md b/zh-cn/application-dev/security/cryptoFramework-overview.md index 65c6ef5d43d7773be21c1f73cf17c0a46200b8c9..a039e6eba1b92c9e552ece87d90574b527690a48 100644 --- a/zh-cn/application-dev/security/cryptoFramework-overview.md +++ b/zh-cn/application-dev/security/cryptoFramework-overview.md @@ -1,12 +1,16 @@ # 加解密算法库框架概述 + 加解密算法库框架是一个屏蔽了第三方密码学算法库实现差异的算法框架,提供加解密、签名验签、消息验证码、哈希、安全随机数等相关功能。开发者可以通过调用加解密算法库框架,忽略底层不同三方算法库的差异,实现迅捷开发。 -> **说明:** 加解密算法库框架仅提供密钥的密码学操作,而不提供密钥管理功能。因此,使用算法库时,需要应用自己来保管密钥(适用于临时会话密钥等仅在内存中使用的场景,或者应用自己实现密钥安全存储的场景)。如果业务需要由系统提供密钥管理功能(密钥存储等),请使用[HUKS部件](huks-overview.md)。 +> **说明:** +> +> 加解密算法库框架仅提供密钥的密码学操作,而不提供密钥管理功能。因此,使用算法库时,需要应用自己来保管密钥(适用于临时会话密钥等仅在内存中使用的场景,或者应用自己实现密钥安全存储的场景)。如果业务需要由系统提供密钥管理功能(密钥存储等),请使用[HUKS部件](huks-overview.md)。 ## 框架实现原理 加解密算法库框架提供的组件分为三层:接口层,Framework层和插件层。接口层负责对外提供统一的JS接口,插件层实现针对具体三方算法库的功能,Framework层通过灵活加载插件层的插件适配并屏蔽三方算法库差异。 ## 基本概念 + **对称密钥** 对称密钥使用同一个密钥对数据进行加密解密操作。即对称加密算法中,数据发送方使用加密密钥对明文进行特殊加密算法处理后,使其变成复杂的加密密文发送出去。接收方收到密文后,若想解读原文,则需要使用同一个加密密钥以及相同算法的逆算法对密文进行解密,才能使其恢复成可读明文。 @@ -14,6 +18,7 @@ - **AES加密** AES的全称是Advanced Encryption Standard,是最常见的对称加密。AES为分组密码,分组密码也就是把明文分成一组一组的,每组长度相等,每次加密一组数据,直到加密完整个明文。在AES标准规范中,分组长度只能是128位,也就是说,每个分组为16个字节(每个字节8位)。密钥的长度可以使用128位、192位或256位。 + - **3DES加密** 3DES,也称为 3DESede 或 TripleDES,是三重数据加密算法,相当于是对每个数据块应用三次DES的对称加密算法,它使用3个64位的密钥对数据块进行三次加密。相比DES,3DES因密钥长度变长,安全性有所提高,但其处理速度不高。因此又出现了AES加密算法,AES较于3DES速度更快、安全性更高。 @@ -27,6 +32,7 @@ RSA密钥以极大整数做因数分解的数学难题作为密钥安全性的基石。生成密钥时,首先需要随机出两个大素数p和q,计算n = p * q并将n做为模,再选择一个大于1且小于(p - 1) * (q - 1)的整数e,确保e与(p - 1)*(q - 1)互素,最后计算d,使得e * d - 1为(p - 1)和(q - 1)的倍数,则可得到公钥(n, e)和私钥(n, d)。 算法库框架除提供了默认的双素数RSA密钥生成外,还提供了多素数密钥生成方式,可以在密钥生成时通过指定primes参数(PRIMES_2, PRIMES_3, PRIMES_4, PRIMES_5)指定素数个数。多素数密钥的优点是可以减少解密、签名的计算量(中国剩余定理),但相对的劣势是密钥强度会越低,算法库依据OpenSSL的素数使用规则制定了相应规格,具体将在**约束与限制**章节中说明。 + - **ECC密钥** ECC是一种基于椭圆曲线数学的公开密钥加密算法,其数学基础是利用椭圆曲线上的有理点构成Abel加法群上椭圆离散对数的计算困难性,算法库框架提供了多种椭圆曲线的ECC密钥生成能力。 @@ -36,38 +42,47 @@ - **对称AES加解密** 算法库目前提供了AES加解密常用的7种加密模式:ECB、CBC、OFB、CFB、CTR、GCM和CCM。AES为分组加密算法,分组长度大小为128位。实际应用中明文最后一组可能不足128位,不足数据可以使用各种padding模式做数据填充。下文中描述了各个padding的区别: - - NoPadding:不带填充; - - PKCS5:填充字符由一个字节序列组成,每个字节填充该填充字节序列的长度,规定是8字节填充; - - PKCS7:填充字符和PKCS5填充方法一致,但是可以在1-255字节之间任意填充; - - > **说明:** ECB、CBC加密模式,明文长度不是128位整数倍,必须使用填充方法补足。
由于需要填充至分组大小,所以实际算法库中的PKCS5和PKCS7都是以分组大小作为填充长度的,即AES加密填充至16字节。 + - NoPadding:不带填充。 + - PKCS5:填充字符由一个字节序列组成,每个字节填充该填充字节序列的长度,规定是8字节填充。 + - PKCS7:填充字符和PKCS5填充方法一致,但是可以在1-255字节之间任意填充。 + + > **说明:** + > + > ECB、CBC加密模式,明文长度不是128位整数倍,必须使用填充方法补足。
+ > 由于需要填充至分组大小,所以实际算法库中的PKCS5和PKCS7都是以分组大小作为填充长度的,即AES加密填充至16字节。 - **对称3DES加解密** 该算法的加解密过程分别是对明文/密文数据进行三次DES加密或解密,得到相应的密文或明文。 算法库目前提供了3DES加解密常用的4种加密模式:ECB、CBC、OFB和CFB。DES为分组加密算法,分组长度大小为64位。实际应用中明文最后一组可能不足64位,不足数据可以使用各种padding模式做数据填充。下文中描述了各个padding的区别: - - NoPadding:不带填充; - - PKCS5:填充字符由一个字节序列组成,每个字节填充该填充字节序列的长度,规定是8字节填充; - - PKCS7:填充字符和PKCS5填充方法一致,但是可以在1-255字节之间任意填充; + - NoPadding:不带填充。 + - PKCS5:填充字符由一个字节序列组成,每个字节填充该填充字节序列的长度,规定是8字节填充。 + - PKCS7:填充字符和PKCS5填充方法一致,但是可以在1-255字节之间任意填充。 - > **说明:** ECB、CBC加密模式,明文长度不是64位整数倍,必须使用填充方法补足。
由于需要填充至分组大小,所以实际算法库中的PKCS5和PKCS7都是以分组大小作为填充长度的,即3DES加密填充至8字节。 + > **说明:** + > + > ECB、CBC加密模式,明文长度不是64位整数倍,必须使用填充方法补足。
+ > 由于需要填充至分组大小,所以实际算法库中的PKCS5和PKCS7都是以分组大小作为填充长度的,即3DES加密填充至8字节。 - **非对称RSA加解密** 当持有RSA公钥(n, e)和私钥(n, d)后,RSA加密过程为:密文 = 明文 ^ e mod n, 解密过程为:明文 = 密文 ^ d mod n。算法库目前提供了RSA加解密常用的三种模式:PKCS1、PKCS1_OAEP和NoPadding。RSA为块加密算法,加密长度需要在固定长度进行,实际应用中会使用各种padding模式做数据填充。下文中描述了各个padding的区别: - - NoPadding:不带填充,输入的数据必须与RSA钥模一样长,输出数据长度与RSA钥模一样长; - - PKCS1:pkcs1padding V1.5是RSA加解密默认的填充方式,输入的数据必须<=RSA钥模-11,输出数据长度与RSA钥模一样长; - - PKCS1_OAEP:RSA_PKCS1_OAEP_PADDING填充模式是PKCS#1推出的新填充方式,此模式需要设置两个摘要(md和mgf1_md),输入的数据必须小于RSA钥模 - md摘要长度 - mgf1_md摘要长度 - 2,输出数据长度与RSA钥模一样长;
+ - NoPadding:不带填充,输入的数据必须与RSA钥模一样长,输出数据长度与RSA钥模一样长。 + - PKCS1:pkcs1padding V1.5是RSA加解密默认的填充方式,输入的数据必须<=RSA钥模-11,输出数据长度与RSA钥模一样长。 + - PKCS1_OAEP:RSA_PKCS1_OAEP_PADDING填充模式是PKCS#1推出的新填充方式,此模式需要设置两个摘要(md和mgf1_md),输入的数据必须小于RSA钥模 - md摘要长度 - mgf1_md摘要长度 - 2,输出数据长度与RSA钥模一样长。 - **补充说明:** RSA钥模 = (RSA的bits + 7) / 8 + > **说明:** + > + > RSA钥模 = (RSA的bits + 7) / 8 **签名验签** - **RSA签名验签** - 当持有RSA公钥(n, e)和私钥(n, d)后,RSA签名生成过程为:签名 = 消息 ^ d mod n, 验签过程为:消息 = 签名 ^ d mod n。消息发送方发送数据时,同时发送消息和私钥签名后的签名信息,消息接收方接受到数据后,将签名信息用公钥解密并验证消息是否一致。因发送的消息长度大多大于RSA钥模,因此算法库框架提供了两种padding模式,通过摘要提取消息的散列值再做签名。算法库框架中提供了签名验签相关的两种模式:PKCS1和PSS。下问对两种模式做详细描述: - - PKCS1: pkcs1padding V1.5是RSA加解密默认的填充方式,使用该模式时需要设置摘要(md); - - PSS: PSS模式是RSA 算法的基础上叠加上一种填充算法,使用该签名算法时需要使用摘要(md)和掩码函数(mgf1_md); + 当持有RSA公钥(n, e)和私钥(n, d)后,RSA签名生成过程为:签名 = 消息 ^ d mod n, 验签过程为:消息 = 签名 ^ d mod n。消息发送方发送数据时,同时发送消息和私钥签名后的签名信息,消息接收方接受到数据后,将签名信息用公钥解密并验证消息是否一致。因发送的消息长度大多大于RSA钥模,因此算法库框架提供了两种padding模式,通过摘要提取消息的散列值再做签名。算法库框架中提供了签名验签相关的两种模式:PKCS1和PSS。下问对两种模式做详细描述: + - PKCS1: pkcs1padding V1.5是RSA加解密默认的填充方式,使用该模式时需要设置摘要(md)。 + - PSS: PSS模式是RSA 算法的基础上叠加上一种填充算法,使用该签名算法时需要使用摘要(md)和掩码函数(mgf1_md)。 + - **ECDSA** 椭圆曲线数字签名算法(ECDSA)是基于椭圆曲线密码(ECC)模拟数字签名算法(DSA)。相比普通的离散对数问题(DLP)和大数分解问题(IFP),椭圆曲线密码的单位比特强度要高于其他公钥体制。算法库框架提供了多种椭圆曲线及摘要算法组合的椭圆曲线数字签名算法(ECDSA)能力。 @@ -83,9 +98,9 @@ 消息摘要MD算法是一种能将任意长度的输入消息,通过哈希算法生成长度固定的摘要的算法。消息摘要算法通过其不可逆的特性能被用于敏感信息的加密。消息摘要算法也被称为哈希算法或单向散列算法。 在摘要算法相同时,生成的摘要值主要有下列特点: -- 当输入消息相同时,生成摘要序列相同; -- 当输入消息的长度不一致时,生成摘要序列长度固定(摘要长度由算法决定); -- 当输入消息不一致时,生成摘要序列几乎不会相同(依然存在相同概率,由摘要长度决定相同概率); +- 当输入消息相同时,生成摘要序列相同。 +- 当输入消息的长度不一致时,生成摘要序列长度固定(摘要长度由算法决定)。 +- 当输入消息不一致时,生成摘要序列几乎不会相同(依然存在相同概率,由摘要长度决定相同概率)。 消息摘要算法主要分为三类:MD,SHA与MAC(详见HMAC章节) MD算法包括MD2,MD4和MD5。 @@ -102,7 +117,6 @@ HMAC(Hash-based Message Authentication Code)是一种基于密钥的消息 - **内部状态**代表随机数生成器内存中的数值,当内部状态相同时,随机数生成器会生成固定的随机数序列 - **种子**(seed)是一个用来对伪随机数的内部状态进行初始化的数据,随机数生成器通过种子来生成一系列的随机序列。 - ## 约束与限制 - 算法库框架不支持多线程并发操作。 @@ -121,9 +135,12 @@ HMAC(Hash-based Message Authentication Code)是一种基于密钥的消息 |AES|192|AES192| |AES|256|AES256| - > **说明**:“字符串参数”是“对称密钥算法”和“密钥长度”拼接而成,用于在创建对称密钥生成器时,指定密钥规格。 + > **说明:** + > + > “字符串参数”是“对称密钥算法”和“密钥长度”拼接而成,用于在创建对称密钥生成器时,指定密钥规格。 **非对称密钥生成规格** + - **RSA密钥生成** 支持的非对称密钥生成参数: @@ -146,7 +163,9 @@ HMAC(Hash-based Message Authentication Code)是一种基于密钥的消息 |RSA8192|4|RSA8192\|PRIMES_4| |RSA8192|5|RSA8192\|PRIMES_5| - > **说明**:生成RSA非对称密钥时,默认素数为2,PRIMES_2参数可省略。 + > **说明:** + > + > 生成RSA非对称密钥时,默认素数为2,PRIMES_2参数可省略。 - **ECC密钥生成** @@ -179,14 +198,15 @@ HMAC(Hash-based Message Authentication Code)是一种基于密钥的消息 |AES|GCM|AES[128\|192\|256]\|GCM\|[NoPadding\|PKCS5\|PKCS7]| |AES|CCM|AES[128\|192\|256]\|CCM\|[NoPadding\|PKCS5\|PKCS7]| -> **说明:** -> -> 1. []中只能任选一项。 -> 2. “字符串参数”是“对称加解密算法(含密钥长度)”、“分组模式”、“填充模式”拼接而成,用于在创建对称加解密实例时,指定对称加解密算法规格。 + > **说明:** + > + > 1. []中只能任选一项。 + > 2. “字符串参数”是“对称加解密算法(含密钥长度)”、“分组模式”、“填充模式”拼接而成,用于在创建对称加解密实例时,指定对称加解密算法规格。 **非对称RSA加解密** RSA加解密时,涉及三种填充模式:NoPadding, PKCS1和PKCS1_OAEP。 + - 使用NoPadding模式时可以指定的参数: |非对称密钥类型| 填充模式 | 字符串参数 | @@ -199,7 +219,7 @@ RSA加解密时,涉及三种填充模式:NoPadding, PKCS1和PKCS1_OAEP。 |RSA4096|NoPadding|RSA4096\|NoPadding| |RSA8192|NoPadding|RSA8192\|NoPadding| -- 使用PKCS1模式时可以指定的参数: +- 使用PKCS1模式时可以指定的参数: |非对称密钥类型| 填充模式 | 字符串参数 | |---|---|---| @@ -212,11 +232,12 @@ RSA加解密时,涉及三种填充模式:NoPadding, PKCS1和PKCS1_OAEP。 |RSA8192|PKCS1|RSA8192\|PKCS1| - 使用PKCS1_OAEP模式时可以指定的参数: - > **说明:** - > - > 1.[]内的参数只能任选一项,非[]内的为固定值; - > 2.使用时请从表格中选择非对称密钥类型、填充模式、摘要、掩码摘要四个数据,用|拼接成字符串。 - > 例如:"RSA2048|PKCS1_OAEP|SHA256|MGF1_SHA256" + + > **说明:** + > + > 1. []内的参数只能任选一项,非[]内的为固定值; + > 2. 使用时请从表格中选择非对称密钥类型、填充模式、摘要、掩码摘要四个数据,用|拼接成字符串。
+ > 例如:"RSA2048|PKCS1_OAEP|SHA256|MGF1_SHA256" | 非对称密钥类型 | 填充模式 | 摘要 | 掩码摘要 | |---|---|---|---| @@ -261,13 +282,13 @@ RSA加解密时,涉及三种填充模式:NoPadding, PKCS1和PKCS1_OAEP。 |RSA8192|PKCS1_OAEP|SHA384|[MGF1_MD5\|MGF1_SHA1\|MGF1_SHA224\|MGF1_SHA256\|MGF1_SHA384\|MGF1_SHA512]| |RSA8192|PKCS1_OAEP|SHA512|[MGF1_MD5\|MGF1_SHA1\|MGF1_SHA224\|MGF1_SHA256\|MGF1_SHA384\|MGF1_SHA512]| - ### 签名验签规格 **RSA签名验签** RSA签名验签时,涉及两种填充模式:PKCS1和PSS。 -- 使用PKCS1模式时可以指定的参数: + +- 使用PKCS1模式时可以指定的参数: | 非对称密钥类型 | 填充模式 | 摘要 | 字符串参数 | |---|---|---|---| @@ -280,11 +301,11 @@ RSA签名验签时,涉及两种填充模式:PKCS1和PSS。 |RSA8192|PKCS1|[MD5\|SHA1\|SHA224\|SHA256\|SHA384\|SHA512]|RSA8192\|PKCS1\|[MD5\|SHA1\|SHA224\|SHA256\|SHA384\|SHA512]| - 使用PSS模式时可以指定的参数: - > **说明:** - > - > 1.[]内的参数只能任选一项,非[]内的为固定值; - > 2.使用时请从表格中选择非对称密钥类型、填充模式、摘要、掩码摘要四个数据,用|拼接成字符串。 - > 例如:"RSA2048|PSS|SHA256|MGF1_SHA256" + > **说明:** + > + > 1. []内的参数只能任选一项,非[]内的为固定值; + > 2. 使用时请从表格中选择非对称密钥类型、填充模式、摘要、掩码摘要四个数据,用|拼接成字符串。
+ > 例如:"RSA2048|PSS|SHA256|MGF1_SHA256" | 非对称密钥类型 | 填充模式 | 摘要 | 掩码摘要 | |---|---|---|---| @@ -362,6 +383,7 @@ RSA签名验签时,涉及两种填充模式:PKCS1和PSS。 |ECC|ECC521| ### MD消息摘要算法规格 + - 加解密算法库框架当前支持的MD算法参数: |摘要算法|支持种类| @@ -374,6 +396,7 @@ RSA签名验签时,涉及两种填充模式:PKCS1和PSS。 |HASH|MD5| ### HMAC消息认证码算法规格 + - 加解密算法库框架当前支持的HMAC算法参数: |摘要算法|支持种类| diff --git a/zh-cn/application-dev/security/huks-guidelines.md b/zh-cn/application-dev/security/huks-guidelines.md index 855b5adcd2140fac53f3e3e9c8adfe698c03bfa8..abd865f96c6e4dc7b10625cdab47050d63063b4a 100644 --- a/zh-cn/application-dev/security/huks-guidelines.md +++ b/zh-cn/application-dev/security/huks-guidelines.md @@ -92,24 +92,19 @@ async function TestGenKey() { ``` ## 导入外部密钥 + 如果密钥是在HUKS外部生成(比如应用间协商生成、服务器端生成),应用可以将密钥导入到HUKS托管。HUKS支持直接将密钥明文导入到HUKS,但是明文导入会导致密钥暴露在REE内存中,一般适用于轻量级设备或低安业务。对于高安敏感业务,HUKS还提供了安全导入密钥的能力,允许业务自己生成密钥,并通过与处于安全环境中的HUKS建立端到端的加密传输通道,将密钥安全加密导入到HUKS中,确保导入传入过程中密钥不被泄露。 与生成密钥一样,密钥一旦导入到HUKS中,密钥的生命周期明文不出安全环境,同样能保证任何人都无法接触获取到密钥的明文。 - - ### 明文导入 - 导入明文密钥时使用[huks.importKeyItem(keyAlias,options,callback)](../reference/apis/js-apis-huks.md#huksimportkeyitem9)方法,传入keyAlias作为密钥别名,传入options,其中必须包含密钥材料和密钥属性集,传入callback用于回调异步结果。关于接口的具体信息,可在[API参考文档](../reference/apis/js-apis-huks.md)中查看。 - 1. 确定密钥别名; 2. 封装密钥材料和密钥属性集:密钥材料须符合[HUKS密钥材料格式](./huks-appendix.md#密钥材料格式)并以Uint8Array形式赋值给[HuksOptions](../reference/apis/js-apis-huks.md#huksoptions)的inData字段;另外,通过[HuksParam](../reference/apis/js-apis-huks.md#huksparam)封装密钥属性,搭配Array组成密钥属性集赋值给properties字段,属性集中必须包含[HuksKeyAlg](../reference/apis/js-apis-huks.md#hukskeyalg),[HuksKeySize](../reference/apis/js-apis-huks.md#hukskeysize),[HuksKeyPurpose](../reference/apis/js-apis-huks.md#hukskeypurpose)属性; 3. 导入密钥。 - - **代码示例:** ```ts @@ -207,15 +202,10 @@ try { 相比明文导入,加密导入步骤更多,密钥材料更复杂,此章节将展示开发过程中关键的开发流程和密钥材料数据结构。下图是加密导入的基本开发流程。 - - **图2** 加密导入开发流程 ![huks_import_wrapped_key](figures/huks_import_wrapped_key.png) - - - **接口说明** 根据开发流程,在导入加密密钥过程中,需要依次调用HUKS的生成密钥、导出公钥、导入加密密钥、删除密钥接口。 @@ -243,6 +233,7 @@ try { **开发步骤** 这里主要展示涉及调用HUKS的开发样例(使用ECDH密钥协商套件),部分在业务本地执行的步骤不在这里展示详细样例。 + 1. 转换成HUKS格式的密钥材料 2. 生成加密导入用途的密钥 3. 导出公钥材料 @@ -625,7 +616,6 @@ try { } ``` - ## 常见密钥操作 **场景概述** @@ -635,11 +625,13 @@ try { **通用开发流程** HUKS基于密钥会话来操作数据,使用密钥时基于以下流程: + 1. **初始化密钥会话[huks.initSession()](../reference/apis/js-apis-huks.md#huksinitsession9):** 传入密钥别名和密钥操作参数,初始化一个密钥会话并获取会话句柄。其中密钥操作参数中必须包含对应密码算法所必须的参数,包括密码算法、密钥大小、密钥目的、工作模式、填充模式、散列模式、IV、Nonce、AAD等。如果密钥设置了访问控制属性,还需要其他参数具体[密钥访问控制](#密钥访问控制)。此步骤必选! 2. **分段操作数据[huks.updateSession()](../reference/apis/js-apis-huks.md#huksupdatesession9):** 如数据过大(超过100K)或密码算法的要求需要对数据进行分段操作,反之可跳过此步。此步骤可选! 3. **结束密钥会话[huks.finishSession()](../reference/apis/js-apis-huks.md#huksfinishsession9):** 操作最后一段数据并结束密钥会话,如过程中发生错误或不需要此次密钥操作数据,必须取消会话[huks.abortSession()](../reference/apis/js-apis-huks.md#huksabortsession9)。此步骤必选! ### 加密解密 + ```ts /* * 以下以AES 128密钥的Callback操作使用为例 @@ -957,7 +949,7 @@ struct Index { ### 密钥协商 -应用在协商密钥时建议传入[HuksKeyStorageType](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-huks.md#hukskeystoragetype)中定义的类型;从API10开始应用只能选择存储(HUKS_STORAGE_ONLY_USED_IN_HUKS),或者选择导出(HUKS_STORAGE_KEY_EXPORT_ALLOWED),若不传入,则默认同时支持存储和导出,存在安全问题,不推荐业务使用。 +应用在协商密钥时建议传入[HuksKeyStorageType](../reference/apis/js-apis-huks.md#hukskeystoragetype)中定义的类型;从API10开始应用只能选择存储(HUKS_STORAGE_ONLY_USED_IN_HUKS),或者选择导出(HUKS_STORAGE_KEY_EXPORT_ALLOWED),若不传入,则默认同时支持存储和导出,存在安全问题,不推荐业务使用。 ```ts /* @@ -1328,7 +1320,7 @@ async function testAgree() { ### 密钥派生 -应用在派生密钥时建议传入[HuksKeyStorageType](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-huks.md#hukskeystoragetype)中定义的类型;从API10开始应用只能选择存储(HUKS_STORAGE_ONLY_USED_IN_HUKS),或者选择导出(HUKS_STORAGE_KEY_EXPORT_ALLOWED),若不传入,则默认同时支持存储和导出,存在安全问题,不推荐业务使用。 +应用在派生密钥时建议传入[HuksKeyStorageType](../reference/apis/js-apis-huks.md#hukskeystoragetype)中定义的类型;从API10开始应用只能选择存储(HUKS_STORAGE_ONLY_USED_IN_HUKS),或者选择导出(HUKS_STORAGE_KEY_EXPORT_ALLOWED),若不传入,则默认同时支持存储和导出,存在安全问题,不推荐业务使用。 ```ts /* @@ -1663,6 +1655,7 @@ HUKS提供了全面完善的密钥访问控制能力,确保存储在HUKS中的 生成或导入密钥时,可以指定密钥必须经过用户身份认证后才能使用。您可以指定用于解锁设备锁屏的凭据(锁屏密码、指纹、人脸)的子集进行身份认证。在生成/导入密钥后,即使应用进程被攻击也不会导致未经用户授权的密钥访问,一般用于高敏感且高级别安全保护的场景,比如免密登录、免密支付、自动填充密码保护场景。 除用户身份认证外,应用还须将密钥的授权访问类型(即失效条件)设置为以下两种类型之一: + - **清除锁屏密码后密钥永久无效。** 设置此模式的前提是当前用户已经设置了锁屏密码,在生成/导入密钥后,一旦清除了锁屏密码,此类密钥将永久失效。注意,修改密码不会导致失效情况发生。此模式适合那些需要锁屏密码授权访问或用户强相关的数据保护的场景。 - **用户新录入生物特征后永久无效。** 此模式需要当前用户至少录入了一个生物特征(如指纹)才能生效,在生成/导入密钥后,一旦录入新的生物特征,这些密钥将永久失效。注意,仅删除生物特征不会导致失效情况发生。如果您不希望新录入的生物特征后,用户还可以授权访问原有数据(密钥保护的数据),那么可以使用此模式,如免密登录,免密支付等场景。 @@ -1699,13 +1692,12 @@ HUKS提供了全面完善的密钥访问控制能力,确保存储在HUKS中的 | HUKS_CHALLENGE_TYPE_NONE | 2 | 无挑战值类型,用户认证时不需要挑战值 | > **注意** - > + > > 当指定挑战值类型为**HUKS_CHALLENGE_TYPE_NONE** 时,不需要传递挑战值,但是存在新的限制:在用户身份认证后,一段时间内允许访问该密钥,超时后不能访问,需要重新认证才能访问。因此应用需要额外指定超时时间**HUKS_TAG_AUTH_TIMEOUT**属性(最大60秒)。 - 2. 使用密钥时,先初始化密钥会话,然后根据密钥生成/导入阶段指定的挑战值类型属性是否需要获取挑战值,或组装新的挑战值。 - **表6** 使用密钥的接口介绍 + **表6** 使用密钥的接口介绍 | 接口名 | 描述 | | -------------------------------------- | ----------------------------| @@ -1713,386 +1705,387 @@ HUKS提供了全面完善的密钥访问控制能力,确保存储在HUKS中的 |updateSession(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback\) : void| 分段操作数据,传递认证令牌| |finishSession(handle: number, options: HuksOptions, token: Uint8Array, callback: AsyncCallback\) : void| 结束密钥会话,传递认证令牌| - - **开发步骤** 1. 生成密钥并指定指纹访问控制和相关属性 -```ts -import huks from '@ohos.security.huks'; -/* - * 确定密钥别名和封装密钥属性参数集 - */ -let keyAlias = 'dh_key_fingerprint_access'; -let properties = new Array(); -properties[0] = { - tag: huks.HuksTag.HUKS_TAG_ALGORITHM, - value: huks.HuksKeyAlg.HUKS_ALG_SM4, -} -properties[1] = { - tag: huks.HuksTag.HUKS_TAG_PURPOSE, - value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, -} -properties[2] = { - tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, - value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, -} -properties[3] = { - tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, - value: huks.HuksCipherMode.HUKS_MODE_CBC, -} -properties[4] = { - tag: huks.HuksTag.HUKS_TAG_PADDING, - value: huks.HuksKeyPadding.HUKS_PADDING_NONE, -} -// 指定密钥身份认证的类型:指纹 -properties[5] = { - tag: huks.HuksTag.HUKS_TAG_USER_AUTH_TYPE, - value: huks.HuksUserAuthType.HUKS_USER_AUTH_TYPE_FINGERPRINT -} -// 指定密钥安全授权的类型(失效类型):新录入生物特征(指纹)后无效 -properties[6] = { - tag: huks.HuksTag.HUKS_TAG_KEY_AUTH_ACCESS_TYPE, - value: huks.HuksAuthAccessType.HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL -} -// 指定挑战值的类型:默认类型 -properties[7] = { - tag: huks.HuksTag.HUKS_TAG_CHALLENGE_TYPE, - value: huks.HuksChallengeType.HUKS_CHALLENGE_TYPE_NORMAL -} -let huksOptions = { - properties: properties, - inData: new Uint8Array(new Array()) -} - -/* - * 生成密钥 - */ -function generateKeyItem(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) { - return new Promise((resolve, reject) => { - try { - huks.generateKeyItem(keyAlias, huksOptions, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + ```ts + import huks from '@ohos.security.huks'; + + /* + * 确定密钥别名和封装密钥属性参数集 + */ + let keyAlias = 'dh_key_fingerprint_access'; + let properties = new Array(); + properties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_SM4, + } + properties[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, + } + properties[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, + } + properties[3] = { + tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, + value: huks.HuksCipherMode.HUKS_MODE_CBC, + } + properties[4] = { + tag: huks.HuksTag.HUKS_TAG_PADDING, + value: huks.HuksKeyPadding.HUKS_PADDING_NONE, + } + // 指定密钥身份认证的类型:指纹 + properties[5] = { + tag: huks.HuksTag.HUKS_TAG_USER_AUTH_TYPE, + value: huks.HuksUserAuthType.HUKS_USER_AUTH_TYPE_FINGERPRINT + } + // 指定密钥安全授权的类型(失效类型):新录入生物特征(指纹)后无效 + properties[6] = { + tag: huks.HuksTag.HUKS_TAG_KEY_AUTH_ACCESS_TYPE, + value: huks.HuksAuthAccessType.HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL + } + // 指定挑战值的类型:默认类型 + properties[7] = { + tag: huks.HuksTag.HUKS_TAG_CHALLENGE_TYPE, + value: huks.HuksChallengeType.HUKS_CHALLENGE_TYPE_NORMAL + } + let huksOptions = { + properties: properties, + inData: new Uint8Array(new Array()) + } -async function publicGenKeyFunc(keyAlias:string, huksOptions:huks.HuksOptions) { - console.info(`enter callback generateKeyItem`); - let throwObject = {isThrow: false}; - try { - await generateKeyItem(keyAlias, huksOptions, throwObject) - .then((data) => { - console.info(`callback: generateKeyItem success, data = ${JSON.stringify(data)}`); - }) - .catch(error => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: generateKeyItem failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: generateKeyItem input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + /* + * 生成密钥 + */ + function generateKeyItem(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) { + return new Promise((resolve, reject) => { + try { + huks.generateKeyItem(keyAlias, huksOptions, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } -async function TestGenKeyForFingerprintAccessControl() { - await publicGenKeyFunc(keyAlias, huksOptions); -} -``` + async function publicGenKeyFunc(keyAlias:string, huksOptions:huks.HuksOptions) { + console.info(`enter callback generateKeyItem`); + let throwObject = {isThrow: false}; + try { + await generateKeyItem(keyAlias, huksOptions, throwObject) + .then((data) => { + console.info(`callback: generateKeyItem success, data = ${JSON.stringify(data)}`); + }) + .catch(error => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: generateKeyItem failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: generateKeyItem input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } + async function TestGenKeyForFingerprintAccessControl() { + await publicGenKeyFunc(keyAlias, huksOptions); + } + ``` 2. 初始化密钥会话获取挑战值并发起指纹认证获取认证令牌 -```ts -import huks from '@ohos.security.huks'; -import userIAM_userAuth from '@ohos.userIAM.userAuth'; - -/* - * 确定密钥别名和封装密钥属性参数集 - */ -let srcKeyAlias = 'sm4_key_fingerprint_access'; -let handle; -let challenge; -let fingerAuthToken; -let authType = userIAM_userAuth.UserAuthType.FINGERPRINT; -let authTrustLevel = userIAM_userAuth.AuthTrustLevel.ATL1; - -/* 集成生成密钥参数集 & 加密参数集 */ -let properties = new Array(); -properties[0] = { - tag: huks.HuksTag.HUKS_TAG_ALGORITHM, - value: huks.HuksKeyAlg.HUKS_ALG_SM4, -} -properties[1] = { - tag: huks.HuksTag.HUKS_TAG_PURPOSE, - value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, -} -properties[2] = { - tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, - value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, -} -properties[3] = { - tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, - value: huks.HuksCipherMode.HUKS_MODE_CBC, -} -properties[4] = { - tag: huks.HuksTag.HUKS_TAG_PADDING, - value: huks.HuksKeyPadding.HUKS_PADDING_NONE, -} -let huksOptions = { - properties: properties, - inData: new Uint8Array(new Array()) -} - -function initSession(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) : Promise { - return new Promise((resolve, reject) => { - try { - huks.initSession(keyAlias, huksOptions, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} -async function publicInitFunc(keyAlias:string, huksOptions:huks.HuksOptions) { - console.info(`enter callback doInit`); - let throwObject = {isThrow: false}; - try { - await initSession(keyAlias, huksOptions, throwObject) - .then ((data) => { - console.info(`callback: doInit success, data = ${JSON.stringify(data)}`); - handle = data.handle; - challenge = data.challenge; - }) - .catch((error) => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: doInit failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: doInit input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + ```ts + import huks from '@ohos.security.huks'; + import userIAM_userAuth from '@ohos.userIAM.userAuth'; + + /* + * 确定密钥别名和封装密钥属性参数集 + */ + let srcKeyAlias = 'sm4_key_fingerprint_access'; + let handle; + let challenge; + let fingerAuthToken; + let authType = userIAM_userAuth.UserAuthType.FINGERPRINT; + let authTrustLevel = userIAM_userAuth.AuthTrustLevel.ATL1; + + /* 集成生成密钥参数集 & 加密参数集 */ + let properties = new Array(); + properties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_SM4, + } + properties[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, + } + properties[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, + } + properties[3] = { + tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, + value: huks.HuksCipherMode.HUKS_MODE_CBC, + } + properties[4] = { + tag: huks.HuksTag.HUKS_TAG_PADDING, + value: huks.HuksKeyPadding.HUKS_PADDING_NONE, + } + let huksOptions = { + properties: properties, + inData: new Uint8Array(new Array()) + } -function userIAMAuthFinger(huksChallenge:Uint8Array) { - // 获取认证对象 - let auth; - try { - auth = userIAM_userAuth.getAuthInstance(huksChallenge, authType, authTrustLevel); - console.log("get auth instance success"); - } catch (error) { - console.log("get auth instance failed" + error); - } + function initSession(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) : Promise { + return new Promise((resolve, reject) => { + try { + huks.initSession(keyAlias, huksOptions, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } - // 订阅认证结果 - try { - auth.on("result", { - callback: (result: userIAM_userAuth.AuthResultInfo) => { - /* 认证成功获取认证令牌 */ - fingerAuthToken = result.token; - } - }); - console.log("subscribe authentication event success"); - } catch (error) { - console.log("subscribe authentication event failed " + error); - } + async function publicInitFunc(keyAlias:string, huksOptions:huks.HuksOptions) { + console.info(`enter callback doInit`); + let throwObject = {isThrow: false}; + try { + await initSession(keyAlias, huksOptions, throwObject) + .then ((data) => { + console.info(`callback: doInit success, data = ${JSON.stringify(data)}`); + handle = data.handle; + challenge = data.challenge; + }) + .catch((error) => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: doInit failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: doInit input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } - // 开始认证 - try { - auth.start(); - console.info("authV9 start auth success"); - } catch (error) { - console.info("authV9 start auth failed, error = " + error); - } -} + function userIAMAuthFinger(huksChallenge:Uint8Array) { + // 获取认证对象 + let auth; + try { + auth = userIAM_userAuth.getAuthInstance(huksChallenge, authType, authTrustLevel); + console.log("get auth instance success"); + } catch (error) { + console.log("get auth instance failed" + error); + } + + // 订阅认证结果 + try { + auth.on("result", { + callback: (result: userIAM_userAuth.AuthResultInfo) => { + /* 认证成功获取认证令牌 */ + fingerAuthToken = result.token; + } + }); + console.log("subscribe authentication event success"); + } catch (error) { + console.log("subscribe authentication event failed " + error); + } + + // 开始认证 + try { + auth.start(); + console.info("authV9 start auth success"); + } catch (error) { + console.info("authV9 start auth failed, error = " + error); + } + } -async function testInitAndAuthFinger() { - /* 初始化密钥会话获取挑战值 */ - await publicInitFunc(srcKeyAlias, huksOptions); - /* 调用userIAM进行身份认证 */ - userIAMAuthFinger(challenge); -} -``` + async function testInitAndAuthFinger() { + /* 初始化密钥会话获取挑战值 */ + await publicInitFunc(srcKeyAlias, huksOptions); + /* 调用userIAM进行身份认证 */ + userIAMAuthFinger(challenge); + } + ``` 3. 传入认证令牌进行数据操作 -```ts -/* - * 以下以SM4 128密钥的Callback操作使用为例 - */ -import huks from '@ohos.security.huks'; - -/* - * 确定密钥别名和封装密钥属性参数集 - */ -let srcKeyAlias = 'sm4_key_fingerprint_access'; -let IV = '1234567890123456'; -let cipherInData = 'Hks_SM4_Cipher_Test_101010101010101010110_string'; -let handle; -let fingerAuthToken; -let updateResult = new Array(); -let finishOutData; -/* 集成生成密钥参数集 & 加密参数集 */ -let propertiesEncrypt = new Array(); -propertiesEncrypt[0] = { - tag: huks.HuksTag.HUKS_TAG_ALGORITHM, - value: huks.HuksKeyAlg.HUKS_ALG_SM4, -} -propertiesEncrypt[1] = { - tag: huks.HuksTag.HUKS_TAG_PURPOSE, - value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT, -} -propertiesEncrypt[2] = { - tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, - value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, -} -propertiesEncrypt[3] = { - tag: huks.HuksTag.HUKS_TAG_PADDING, - value: huks.HuksKeyPadding.HUKS_PADDING_NONE, -} -propertiesEncrypt[4] = { - tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, - value: huks.HuksCipherMode.HUKS_MODE_CBC, -} -propertiesEncrypt[5] = { - tag: huks.HuksTag.HUKS_TAG_IV, - value: StringToUint8Array(IV), -} -let encryptOptions = { - properties: propertiesEncrypt, - inData: new Uint8Array(new Array()) -} - -function StringToUint8Array(str) { - let arr = []; - for (let i = 0, j = str.length; i < j; ++i) { - arr.push(str.charCodeAt(i)); - } - return new Uint8Array(arr); -} + ```ts + /* + * 以下以SM4 128密钥的Callback操作使用为例 + */ + import huks from '@ohos.security.huks'; + + /* + * 确定密钥别名和封装密钥属性参数集 + */ + let srcKeyAlias = 'sm4_key_fingerprint_access'; + let IV = '1234567890123456'; + let cipherInData = 'Hks_SM4_Cipher_Test_101010101010101010110_string'; + let handle; + let fingerAuthToken; + let updateResult = new Array(); + let finishOutData; + + /* 集成生成密钥参数集 & 加密参数集 */ + let propertiesEncrypt = new Array(); + propertiesEncrypt[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_SM4, + } + propertiesEncrypt[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT, + } + propertiesEncrypt[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, + } + propertiesEncrypt[3] = { + tag: huks.HuksTag.HUKS_TAG_PADDING, + value: huks.HuksKeyPadding.HUKS_PADDING_NONE, + } + propertiesEncrypt[4] = { + tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, + value: huks.HuksCipherMode.HUKS_MODE_CBC, + } + propertiesEncrypt[5] = { + tag: huks.HuksTag.HUKS_TAG_IV, + value: StringToUint8Array(IV), + } + let encryptOptions = { + properties: propertiesEncrypt, + inData: new Uint8Array(new Array()) + } -function updateSession(handle:number, huksOptions:huks.HuksOptions, token:Uint8Array, throwObject) : Promise { - return new Promise((resolve, reject) => { - try { - huks.updateSession(handle, huksOptions, token, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + function StringToUint8Array(str) { + let arr = []; + for (let i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); + } + return new Uint8Array(arr); + } -async function publicUpdateFunc(handle:number, token:Uint8Array, huksOptions:huks.HuksOptions) { - console.info(`enter callback doUpdate`); - let throwObject = {isThrow: false}; - try { - await updateSession(handle, huksOptions, token, throwObject) - .then ((data) => { - console.info(`callback: doUpdate success, data = ${JSON.stringify(data)}`); - }) - .catch(error => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: doUpdate failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: doUpdate input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + function updateSession(handle:number, huksOptions:huks.HuksOptions, token:Uint8Array, throwObject) : Promise { + return new Promise((resolve, reject) => { + try { + huks.updateSession(handle, huksOptions, token, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } -function finishSession(handle:number, huksOptions:huks.HuksOptions, token:Uint8Array, throwObject) : Promise { - return new Promise((resolve, reject) => { - try { - huks.finishSession(handle, huksOptions, token, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + async function publicUpdateFunc(handle:number, token:Uint8Array, huksOptions:huks.HuksOptions) { + console.info(`enter callback doUpdate`); + let throwObject = {isThrow: false}; + try { + await updateSession(handle, huksOptions, token, throwObject) + .then ((data) => { + console.info(`callback: doUpdate success, data = ${JSON.stringify(data)}`); + }) + .catch(error => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: doUpdate failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: doUpdate input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } -async function publicFinishFunc(handle:number, token:Uint8Array, huksOptions:huks.HuksOptions) { - console.info(`enter callback doFinish`); - let throwObject = {isThrow: false}; - try { - await finishSession(handle, huksOptions, token, throwObject) - .then ((data) => { - finishOutData = data.outData; - console.info(`callback: doFinish success, data = ${JSON.stringify(data)}`); - }) - .catch(error => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: doFinish failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: doFinish input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + function finishSession(handle:number, huksOptions:huks.HuksOptions, token:Uint8Array, throwObject) : Promise { + return new Promise((resolve, reject) => { + try { + huks.finishSession(handle, huksOptions, token, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } -async function testSm4Cipher() { - encryptOptions.inData = StringToUint8Array(cipherInData); - /* 传入认证令牌 */ - await publicUpdateFunc(handle, fingerAuthToken, encryptOptions); - encryptUpdateResult = updateResult; + async function publicFinishFunc(handle:number, token:Uint8Array, huksOptions:huks.HuksOptions) { + console.info(`enter callback doFinish`); + let throwObject = {isThrow: false}; + try { + await finishSession(handle, huksOptions, token, throwObject) + .then ((data) => { + finishOutData = data.outData; + console.info(`callback: doFinish success, data = ${JSON.stringify(data)}`); + }) + .catch(error => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: doFinish failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: doFinish input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } - encryptOptions.inData = new Uint8Array(new Array()); - /* 传入认证令牌 */ - await publicFinishFunc(handle, fingerAuthToken, encryptOptions); - if (finishOutData === cipherInData) { - console.info('test finish encrypt err '); - } else { - console.info('test finish encrypt success'); - } -} -``` + async function testSm4Cipher() { + encryptOptions.inData = StringToUint8Array(cipherInData); + /* 传入认证令牌 */ + await publicUpdateFunc(handle, fingerAuthToken, encryptOptions); + encryptUpdateResult = updateResult; + + encryptOptions.inData = new Uint8Array(new Array()); + /* 传入认证令牌 */ + await publicFinishFunc(handle, fingerAuthToken, encryptOptions); + if (finishOutData === cipherInData) { + console.info('test finish encrypt err '); + } else { + console.info('test finish encrypt success'); + } + } + ``` ### 细粒度用户身份认证访问控制 -该功能是基于已有[密钥访问控制](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/huks-guidelines.md#%E5%AF%86%E9%92%A5%E8%AE%BF%E9%97%AE%E6%8E%A7%E5%88%B6)能力的扩展,提供了基于生物特征和锁屏密码二次身份认证的细粒度访问控制能力,允许设置密钥在加密、解密、签名、验签、密钥协商、密钥派生的单个或多个场景时是否需要进行身份验证。比如,业务需要使用HUKS密钥加密保存账号密码信息等数据,要求在加密的时候不进行指纹等身份认证,解密的时候需要进行指纹等身份认证,这是就需要依赖HUKS提供细粒度的二次身份认证访问控制机制。 +该功能是基于已有[密钥访问控制](#密钥访问控制)能力的扩展,提供了基于生物特征和锁屏密码二次身份认证的细粒度访问控制能力,允许设置密钥在加密、解密、签名、验签、密钥协商、密钥派生的单个或多个场景时是否需要进行身份验证。比如,业务需要使用HUKS密钥加密保存账号密码信息等数据,要求在加密的时候不进行指纹等身份认证,解密的时候需要进行指纹等身份认证,这是就需要依赖HUKS提供细粒度的二次身份认证访问控制机制。 **开发流程** -1. 基于用户身份认证访问控制的流程,在密钥生成阶段,通过额外指定用于细粒度用户身份认证访问控制的HuksTag:[HUKS_TAG_KEY_AUTH_PURPOSE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-huks.md#hukstag)值,来指定在某种算法用途的情况下需要使用用户身份认证访问控制能力。 + +1. 基于用户身份认证访问控制的流程,在密钥生成阶段,通过额外指定用于细粒度用户身份认证访问控制的HuksTag:[HUKS_TAG_KEY_AUTH_PURPOSE](../reference/apis/js-apis-huks.md#hukstag)值,来指定在某种算法用途的情况下需要使用用户身份认证访问控制能力。 2. 基于用户身份认证访问控制的流程,在密钥使用阶段,业务无需再次指定HUKS_TAG_KEY_AUTH_PURPOSE值,同用户身份认证访问控制的开发流程。 **接口说明** -新增用于细粒度用户身份认证访问控制的HuksTag:[HUKS_TAG_KEY_AUTH_PURPOSE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-huks.md#hukstag),该Tag值取值范围为枚举类[HuksKeyAlg](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-huks.md#hukskeyalg)。 +新增用于细粒度用户身份认证访问控制的HuksTag:[HUKS_TAG_KEY_AUTH_PURPOSE](../reference/apis/js-apis-huks.md#hukstag),该Tag值取值范围为枚举类[HuksKeyAlg](../reference/apis/js-apis-huks.md#hukskeyalg)。 **表8** 细粒度用户身份认证访问控制Tag类型介绍 | 名称 | 描述 | @@ -2100,6 +2093,7 @@ async function testSm4Cipher() { |HUKS_TAG_KEY_AUTH_PURPOSE| 表示密钥认证用途的tag,用于设置某种算法用途下需要用户身份认证访问控制| **注意** + 1. 当业务未指定用户认证类型[HuksUserAuthType](../reference/apis/js-apis-huks.md#huksuserauthtype9)时表示默认都不需要用户身份认证访问控制能力,则此时设置HUKS_TAG_KEY_AUTH_PURPOSE是默认无效的; 当业务指定了[HuksUserAuthType](../reference/apis/js-apis-huks.md#huksuserauthtype9)时表示需要用户身份认证访问控制能力,此时若不设置HUKS_TAG_KEY_AUTH_PURPOSE值,则生成密钥阶段指定的算法用途在密钥使用时都默认需要进行用户身份认证访问控制。 2. 当指定的算法是对称算法AES和SM4时,且同时指定用于加解密用途,则只允许设置CBC模式,其它模式不支持细粒度用户身份认证访问控制能力。 @@ -2108,425 +2102,429 @@ async function testSm4Cipher() { 示例场景:密钥生成阶段,生成用于加解密的密钥并指定只有解密的时候需要用户身份认证访问控制;密钥使用阶段,加密时不需要用户身份认证访问控制,解密时需要用户身份认证访问控制 1. 生成密钥并指定指纹访问控制和相关属性,以及HUKS_TAG_KEY_AUTH_PURPOSE值 -```ts -import huks from '@ohos.security.huks'; -/* - * 确定密钥别名和封装密钥属性参数集 - */ -let keyAlias = 'dh_key_fingerprint_access'; -let properties = new Array(); -properties[0] = { - tag: huks.HuksTag.HUKS_TAG_ALGORITHM, - value: huks.HuksKeyAlg.HUKS_ALG_SM4, -} -properties[1] = { - tag: huks.HuksTag.HUKS_TAG_PURPOSE, - value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, -} -properties[2] = { - tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, - value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, -} -properties[3] = { - tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, - value: huks.HuksCipherMode.HUKS_MODE_CBC, -} -properties[4] = { - tag: huks.HuksTag.HUKS_TAG_PADDING, - value: huks.HuksKeyPadding.HUKS_PADDING_NONE, -} -// 指定密钥身份认证的类型:指纹 -properties[5] = { - tag: huks.HuksTag.HUKS_TAG_USER_AUTH_TYPE, - value: huks.HuksUserAuthType.HUKS_USER_AUTH_TYPE_FINGERPRINT -} -// 指定密钥安全授权的类型(失效类型):新录入生物特征(指纹)后无效 -properties[6] = { - tag: huks.HuksTag.HUKS_TAG_KEY_AUTH_ACCESS_TYPE, - value: huks.HuksAuthAccessType.HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL -} -// 指定挑战值的类型:默认类型 -properties[7] = { - tag: huks.HuksTag.HUKS_TAG_CHALLENGE_TYPE, - value: huks.HuksChallengeType.HUKS_CHALLENGE_TYPE_NORMAL -} -// 指定某种算法用途时需要用户身份认证访问控制:比如解密需要 -properties[8] = { - tag: huks.HuksTag.HUKS_TAG_KEY_AUTH_PURPOSE, - value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT -} -let huksOptions = { - properties: properties, - inData: new Uint8Array(new Array()) -} + ```ts + import huks from '@ohos.security.huks'; + + /* + * 确定密钥别名和封装密钥属性参数集 + */ + let keyAlias = 'dh_key_fingerprint_access'; + let properties = new Array(); + properties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_SM4, + } + properties[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, + } + properties[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, + } + properties[3] = { + tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, + value: huks.HuksCipherMode.HUKS_MODE_CBC, + } + properties[4] = { + tag: huks.HuksTag.HUKS_TAG_PADDING, + value: huks.HuksKeyPadding.HUKS_PADDING_NONE, + } + // 指定密钥身份认证的类型:指纹 + properties[5] = { + tag: huks.HuksTag.HUKS_TAG_USER_AUTH_TYPE, + value: huks.HuksUserAuthType.HUKS_USER_AUTH_TYPE_FINGERPRINT + } + // 指定密钥安全授权的类型(失效类型):新录入生物特征(指纹)后无效 + properties[6] = { + tag: huks.HuksTag.HUKS_TAG_KEY_AUTH_ACCESS_TYPE, + value: huks.HuksAuthAccessType.HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL + } + // 指定挑战值的类型:默认类型 + properties[7] = { + tag: huks.HuksTag.HUKS_TAG_CHALLENGE_TYPE, + value: huks.HuksChallengeType.HUKS_CHALLENGE_TYPE_NORMAL + } + // 指定某种算法用途时需要用户身份认证访问控制:比如解密需要 + properties[8] = { + tag: huks.HuksTag.HUKS_TAG_KEY_AUTH_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT + } + let huksOptions = { + properties: properties, + inData: new Uint8Array(new Array()) + } -/* - * 生成密钥 - */ -async function generateKeyItem(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) { - return new Promise((resolve, reject) => { - try { - huks.generateKeyItem(keyAlias, huksOptions, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + /* + * 生成密钥 + */ + async function generateKeyItem(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) { + return new Promise((resolve, reject) => { + try { + huks.generateKeyItem(keyAlias, huksOptions, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } -async function publicGenKeyFunc(keyAlias:string, huksOptions:huks.HuksOptions) { - console.info(`enter callback generateKeyItem`); - let throwObject = {isThrow: false}; - try { - await generateKeyItem(keyAlias, huksOptions, throwObject) - .then((data) => { - console.info(`callback: generateKeyItem success, data = ${JSON.stringify(data)}`); - }) - .catch(error => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: generateKeyItem failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: generateKeyItem input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + async function publicGenKeyFunc(keyAlias:string, huksOptions:huks.HuksOptions) { + console.info(`enter callback generateKeyItem`); + let throwObject = {isThrow: false}; + try { + await generateKeyItem(keyAlias, huksOptions, throwObject) + .then((data) => { + console.info(`callback: generateKeyItem success, data = ${JSON.stringify(data)}`); + }) + .catch(error => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: generateKeyItem failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: generateKeyItem input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } -async function TestGenKeyForFingerprintAccessControl() { - await publicGenKeyFunc(keyAlias, huksOptions); -} -``` + async function TestGenKeyForFingerprintAccessControl() { + await publicGenKeyFunc(keyAlias, huksOptions); + } + ``` 2. 使用密钥-加密场景-加密时不需要进行用户身份认证访问控制 -```ts -import huks from '@ohos.security.huks'; - -/* - * 确定密钥别名和封装密钥属性参数集 - */ -let srcKeyAlias = 'sm4_key_fingerprint_access'; -let cipherInData = 'Hks_SM4_Cipher_Test_101010101010101010110_string'; // 明文数据 -let IV = '1234567890123456'; -let handle; -let cipherText; // 加密后的密文数据 -function StringToUint8Array(str) { - let arr = []; - for (let i = 0, j = str.length; i < j; ++i) { - arr.push(str.charCodeAt(i)); - } - return new Uint8Array(arr); -} + ```ts + import huks from '@ohos.security.huks'; + + /* + * 确定密钥别名和封装密钥属性参数集 + */ + let srcKeyAlias = 'sm4_key_fingerprint_access'; + let cipherInData = 'Hks_SM4_Cipher_Test_101010101010101010110_string'; // 明文数据 + let IV = '1234567890123456'; + let handle; + let cipherText; // 加密后的密文数据 + + function StringToUint8Array(str) { + let arr = []; + for (let i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); + } + return new Uint8Array(arr); + } -/* 集成生成密钥参数集 & 加密参数集 */ -let propertiesEncrypt = new Array(); -propertiesEncrypt[0] = { - tag: huks.HuksTag.HUKS_TAG_ALGORITHM, - value: huks.HuksKeyAlg.HUKS_ALG_SM4, -} -propertiesEncrypt[1] = { - tag: huks.HuksTag.HUKS_TAG_PURPOSE, - value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT, -} -propertiesEncrypt[2] = { - tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, - value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, -} -propertiesEncrypt[3] = { - tag: huks.HuksTag.HUKS_TAG_PADDING, - value: huks.HuksKeyPadding.HUKS_PADDING_NONE, -} -propertiesEncrypt[4] = { - tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, - value: huks.HuksCipherMode.HUKS_MODE_CBC, -} -propertiesEncrypt[5] = { - tag: huks.HuksTag.HUKS_TAG_IV, - value: StringToUint8Array(IV), -} -let encryptOptions = { - properties: propertiesEncrypt, - inData: new Uint8Array(new Array()) -} + /* 集成生成密钥参数集 & 加密参数集 */ + let propertiesEncrypt = new Array(); + propertiesEncrypt[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_SM4, + } + propertiesEncrypt[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT, + } + propertiesEncrypt[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, + } + propertiesEncrypt[3] = { + tag: huks.HuksTag.HUKS_TAG_PADDING, + value: huks.HuksKeyPadding.HUKS_PADDING_NONE, + } + propertiesEncrypt[4] = { + tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, + value: huks.HuksCipherMode.HUKS_MODE_CBC, + } + propertiesEncrypt[5] = { + tag: huks.HuksTag.HUKS_TAG_IV, + value: StringToUint8Array(IV), + } + let encryptOptions = { + properties: propertiesEncrypt, + inData: new Uint8Array(new Array()) + } -function initSession(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) : Promise { - return new Promise((resolve, reject) => { - try { - huks.initSession(keyAlias, huksOptions, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + function initSession(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) : Promise { + return new Promise((resolve, reject) => { + try { + huks.initSession(keyAlias, huksOptions, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } -async function publicInitFunc(keyAlias:string, huksOptions:huks.HuksOptions) { - console.info(`enter callback doInit`); - let throwObject = {isThrow: false}; - try { - await initSession(keyAlias, huksOptions, throwObject) - .then ((data) => { - console.info(`callback: doInit success, data = ${JSON.stringify(data)}`); - handle = data.handle; - }) - .catch((error) => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: doInit failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: doInit input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + async function publicInitFunc(keyAlias:string, huksOptions:huks.HuksOptions) { + console.info(`enter callback doInit`); + let throwObject = {isThrow: false}; + try { + await initSession(keyAlias, huksOptions, throwObject) + .then ((data) => { + console.info(`callback: doInit success, data = ${JSON.stringify(data)}`); + handle = data.handle; + }) + .catch((error) => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: doInit failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: doInit input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } -function finishSession(handle:number, huksOptions:huks.HuksOptions, throwObject) : Promise { - return new Promise((resolve, reject) => { - try { - huks.finishSession(handle, huksOptions, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + function finishSession(handle:number, huksOptions:huks.HuksOptions, throwObject) : Promise { + return new Promise((resolve, reject) => { + try { + huks.finishSession(handle, huksOptions, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } -async function publicFinishFunc(handle:number, huksOptions:huks.HuksOptions) { - console.info(`enter callback doFinish`); - let throwObject = {isThrow: false}; - try { - await finishSession(handle, huksOptions, throwObject) - .then ((data) => { - cipherText = data.outData; - console.info(`callback: doFinish success, data = ${JSON.stringify(data)}`); - }) - .catch(error => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: doFinish failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: doFinish input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + async function publicFinishFunc(handle:number, huksOptions:huks.HuksOptions) { + console.info(`enter callback doFinish`); + let throwObject = {isThrow: false}; + try { + await finishSession(handle, huksOptions, throwObject) + .then ((data) => { + cipherText = data.outData; + console.info(`callback: doFinish success, data = ${JSON.stringify(data)}`); + }) + .catch(error => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: doFinish failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: doFinish input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } -async function testSm4Cipher() { - /* 初始化密钥会话获取挑战值 */ - await publicInitFunc(srcKeyAlias, encryptOptions); + async function testSm4Cipher() { + /* 初始化密钥会话获取挑战值 */ + await publicInitFunc(srcKeyAlias, encryptOptions); - /* 加密 */ - encryptOptions.inData = StringToUint8Array(cipherInData); - await publicFinishFunc(handle, encryptOptions); -} -``` + /* 加密 */ + encryptOptions.inData = StringToUint8Array(cipherInData); + await publicFinishFunc(handle, encryptOptions); + } + ``` 3. 使用密钥-解密场景-解密时需要进行用户身份认证访问控制 -```ts -import huks from '@ohos.security.huks'; -import userIAM_userAuth from '@ohos.userIAM.userAuth'; - -/* - * 确定密钥别名和封装密钥属性参数集 - */ -let srcKeyAlias = 'sm4_key_fingerprint_access'; -let cipherText = 'r56ywtTJUQC6JFJ2VV2kZw=='; // 加密时得到的密文数据, 业务需根据实际加密结果修改 -let IV = '1234567890123456'; -let handle; -let finishOutData; // 解密后的明文数据 -let fingerAuthToken; -let authType = userIAM_userAuth.UserAuthType.FINGERPRINT; -let authTrustLevel = userIAM_userAuth.AuthTrustLevel.ATL1; - -function StringToUint8Array(str) { - let arr = []; - for (let i = 0, j = str.length; i < j; ++i) { - arr.push(str.charCodeAt(i)); - } - return new Uint8Array(arr); -} - -/* 集成生成密钥参数集 & 加密参数集 */ -let propertiesDecrypt = new Array(); -propertiesDecrypt[0] = { - tag: huks.HuksTag.HUKS_TAG_ALGORITHM, - value: huks.HuksKeyAlg.HUKS_ALG_SM4, -} -propertiesDecrypt[1] = { - tag: huks.HuksTag.HUKS_TAG_PURPOSE, - value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, -} -propertiesDecrypt[2] = { - tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, - value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, -} -propertiesDecrypt[3] = { - tag: huks.HuksTag.HUKS_TAG_PADDING, - value: huks.HuksKeyPadding.HUKS_PADDING_NONE, -} -propertiesDecrypt[4] = { - tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, - value: huks.HuksCipherMode.HUKS_MODE_CBC, -} -propertiesDecrypt[5] = { - tag: huks.HuksTag.HUKS_TAG_IV, - value: StringToUint8Array(IV), -} -let decryptOptions = { - properties: propertiesDecrypt, - inData: new Uint8Array(new Array()) -} -function initSession(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) : Promise { - return new Promise((resolve, reject) => { - try { - huks.initSession(keyAlias, huksOptions, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + ```ts + import huks from '@ohos.security.huks'; + import userIAM_userAuth from '@ohos.userIAM.userAuth'; + + /* + * 确定密钥别名和封装密钥属性参数集 + */ + let srcKeyAlias = 'sm4_key_fingerprint_access'; + let cipherText = 'r56ywtTJUQC6JFJ2VV2kZw=='; // 加密时得到的密文数据, 业务需根据实际加密结果修改 + let IV = '1234567890123456'; + let handle; + let finishOutData; // 解密后的明文数据 + let fingerAuthToken; + let authType = userIAM_userAuth.UserAuthType.FINGERPRINT; + let authTrustLevel = userIAM_userAuth.AuthTrustLevel.ATL1; + + function StringToUint8Array(str) { + let arr = []; + for (let i = 0, j = str.length; i < j; ++i) { + arr.push(str.charCodeAt(i)); + } + return new Uint8Array(arr); + } -async function publicInitFunc(keyAlias:string, huksOptions:huks.HuksOptions) { - console.info(`enter callback doInit`); - let throwObject = {isThrow: false}; - try { - await initSession(keyAlias, huksOptions, throwObject) - .then ((data) => { - console.info(`callback: doInit success, data = ${JSON.stringify(data)}`); - handle = data.handle; - challenge = data.challenge; - }) - .catch((error) => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: doInit failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: doInit input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + /* 集成生成密钥参数集 & 加密参数集 */ + let propertiesDecrypt = new Array(); + propertiesDecrypt[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_SM4, + } + propertiesDecrypt[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT, + } + propertiesDecrypt[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_SM4_KEY_SIZE_128, + } + propertiesDecrypt[3] = { + tag: huks.HuksTag.HUKS_TAG_PADDING, + value: huks.HuksKeyPadding.HUKS_PADDING_NONE, + } + propertiesDecrypt[4] = { + tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, + value: huks.HuksCipherMode.HUKS_MODE_CBC, + } + propertiesDecrypt[5] = { + tag: huks.HuksTag.HUKS_TAG_IV, + value: StringToUint8Array(IV), + } + let decryptOptions = { + properties: propertiesDecrypt, + inData: new Uint8Array(new Array()) + } -function userIAMAuthFinger(huksChallenge:Uint8Array) { - // 获取认证对象 - let auth; - try { - auth = userIAM_userAuth.getAuthInstance(huksChallenge, authType, authTrustLevel); - console.log("get auth instance success"); - } catch (error) { - console.log("get auth instance failed" + error); - } + function initSession(keyAlias:string, huksOptions:huks.HuksOptions, throwObject) : Promise { + return new Promise((resolve, reject) => { + try { + huks.initSession(keyAlias, huksOptions, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } - // 订阅认证结果 - try { - auth.on("result", { - callback: (result: userIAM_userAuth.AuthResultInfo) => { - /* 认证成功获取认证令牌 */ - fingerAuthToken = result.token; - } - }); - console.log("subscribe authentication event success"); - } catch (error) { - console.log("subscribe authentication event failed " + error); - } + async function publicInitFunc(keyAlias:string, huksOptions:huks.HuksOptions) { + console.info(`enter callback doInit`); + let throwObject = {isThrow: false}; + try { + await initSession(keyAlias, huksOptions, throwObject) + .then ((data) => { + console.info(`callback: doInit success, data = ${JSON.stringify(data)}`); + handle = data.handle; + challenge = data.challenge; + }) + .catch((error) => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: doInit failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: doInit input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } - // 开始认证 - try { - auth.start(); - console.info("authV9 start auth success"); - } catch (error) { - console.info("authV9 start auth failed, error = " + error); - } -} + function userIAMAuthFinger(huksChallenge:Uint8Array) { + // 获取认证对象 + let auth; + try { + auth = userIAM_userAuth.getAuthInstance(huksChallenge, authType, authTrustLevel); + console.log("get auth instance success"); + } catch (error) { + console.log("get auth instance failed" + error); + } + + // 订阅认证结果 + try { + auth.on("result", { + callback: (result: userIAM_userAuth.AuthResultInfo) => { + /* 认证成功获取认证令牌 */ + fingerAuthToken = result.token; + } + }); + console.log("subscribe authentication event success"); + } catch (error) { + console.log("subscribe authentication event failed " + error); + } + + // 开始认证 + try { + auth.start(); + console.info("authV9 start auth success"); + } catch (error) { + console.info("authV9 start auth failed, error = " + error); + } + } -function finishSession(handle:number, huksOptions:huks.HuksOptions, token:Uint8Array, throwObject) : Promise { - return new Promise((resolve, reject) => { - try { - huks.finishSession(handle, huksOptions, token, function (error, data) { - if (error) { - reject(error); - } else { - resolve(data); - } - }); - } catch (error) { - throwObject.isThrow = true; - throw(error); - } - }); -} + function finishSession(handle:number, huksOptions:huks.HuksOptions, token:Uint8Array, throwObject) : Promise { + return new Promise((resolve, reject) => { + try { + huks.finishSession(handle, huksOptions, token, function (error, data) { + if (error) { + reject(error); + } else { + resolve(data); + } + }); + } catch (error) { + throwObject.isThrow = true; + throw(error); + } + }); + } -async function publicFinishFunc(handle:number, token:Uint8Array, huksOptions:huks.HuksOptions) { - console.info(`enter callback doFinish`); - let throwObject = {isThrow: false}; - try { - await finishSession(handle, huksOptions, token, throwObject) - .then ((data) => { - finishOutData = data.outData; - console.info(`callback: doFinish success, data = ${JSON.stringify(data)}`); - }) - .catch(error => { - if (throwObject.isThrow) { - throw(error); - } else { - console.error(`callback: doFinish failed, code: ${error.code}, msg: ${error.message}`); - } - }); - } catch (error) { - console.error(`callback: doFinish input arg invalid, code: ${error.code}, msg: ${error.message}`); - } -} + async function publicFinishFunc(handle:number, token:Uint8Array, huksOptions:huks.HuksOptions) { + console.info(`enter callback doFinish`); + let throwObject = {isThrow: false}; + try { + await finishSession(handle, huksOptions, token, throwObject) + .then ((data) => { + finishOutData = data.outData; + console.info(`callback: doFinish success, data = ${JSON.stringify(data)}`); + }) + .catch(error => { + if (throwObject.isThrow) { + throw(error); + } else { + console.error(`callback: doFinish failed, code: ${error.code}, msg: ${error.message}`); + } + }); + } catch (error) { + console.error(`callback: doFinish input arg invalid, code: ${error.code}, msg: ${error.message}`); + } + } -async function testSm4Cipher() { - /* 初始化密钥会话获取挑战值 */ - await publicInitFunc(srcKeyAlias, decryptOptions); + async function testSm4Cipher() { + /* 初始化密钥会话获取挑战值 */ + await publicInitFunc(srcKeyAlias, decryptOptions); - /* 调用userIAM进行身份认证 */ - userIAMAuthFinger(challenge); + /* 调用userIAM进行身份认证 */ + userIAMAuthFinger(challenge); - /* 认证成功后进行解密, 需要传入Auth获取到的authToken值 */ - decryptOptions.inData = StringToUint8Array(cipherText); - await publicFinishFunc(handle, fingerAuthToken, decryptOptions); -} -``` + /* 认证成功后进行解密, 需要传入Auth获取到的authToken值 */ + decryptOptions.inData = StringToUint8Array(cipherText); + await publicFinishFunc(handle, fingerAuthToken, decryptOptions); + } + ``` ## 密钥证明 HUKS为密钥提供合法性证明能力,主要应用于非对称密钥的公钥的证明。基于PKI证书链技术,HUKS可以为存储在HUKS中的非对称密钥对的公钥签发证书,证明其公钥的合法性。业务可以通过OpenHarmony提供的根CA证书,逐级验证HUKS签发的密钥证明证书,来确保证书中的公钥以及对应的私钥,确实来自合法的硬件设备,且存储管理在HUKS中。 **开发流程** + 1. 指定密钥别名和需要证明的密钥属性的标签传入HUKS。 2. 调用HUKS为应用生成一个依次由根CA证书、设备CA证书、设备证书、密钥证书组成的X.509证书链。 3. 将证书链传输至受信任的服务器,并在服务器上解析和验证证书链的有效性和单个证书是否吊销。 @@ -2708,7 +2706,7 @@ async function AttestKeyTest() { } ``` -> 常见问题 +**常见问题** 1. Cannot find name 'huks'. diff --git a/zh-cn/application-dev/task-management/Readme-CN.md b/zh-cn/application-dev/task-management/Readme-CN.md index b4312a624b16fb2fc66e713eab464e2d53677ed2..3ea02ae686749eb66dec03e5f4b70f975980883d 100644 --- a/zh-cn/application-dev/task-management/Readme-CN.md +++ b/zh-cn/application-dev/task-management/Readme-CN.md @@ -1,11 +1,11 @@ -# 后台任务(Background Task)管理 +# 后台任务(Background Task)管理 -- 后台任务 +- 后台任务 - [后台任务概述](background-task-overview.md) - [短时任务开发指导](transient-task-dev-guide.md) - [长时任务开发指导](continuous-task-dev-guide.md) - - [延迟任务开发指导](work-scheduler-dev-guide.md) - - [延迟任务回调能力开发指导](workscheduler-extensionability.md) + - [延迟任务调度开发指导](work-scheduler-dev-guide.md) + - [延迟任务回调能力开发指导(WorkSchedulerExtensionAbility)](workscheduler-extensionability.md) - [申请能效资源开发指导](efficiency-resources-apply-dev-guide.md) - 后台代理提醒 diff --git a/zh-cn/application-dev/task-management/continuous-task-dev-guide.md b/zh-cn/application-dev/task-management/continuous-task-dev-guide.md index f7f7437bb8285960bf9d986d82cc355456209a2f..a52def2cb9ee79c8341d274d92d6f466b792735b 100644 --- a/zh-cn/application-dev/task-management/continuous-task-dev-guide.md +++ b/zh-cn/application-dev/task-management/continuous-task-dev-guide.md @@ -1,4 +1,4 @@ -# 长时任务 +# 长时任务开发指导 ## 场景说明 diff --git a/zh-cn/application-dev/task-management/efficiency-resources-apply-dev-guide.md b/zh-cn/application-dev/task-management/efficiency-resources-apply-dev-guide.md index 056918f672881e64e8b399d7ead97de17df47a19..aea04c231c2cdef5dccf4e14eb4e4c6ed7495d31 100644 --- a/zh-cn/application-dev/task-management/efficiency-resources-apply-dev-guide.md +++ b/zh-cn/application-dev/task-management/efficiency-resources-apply-dev-guide.md @@ -1,4 +1,4 @@ -# 申请能效资源 +# 申请能效资源开发指导 ## 场景说明 diff --git a/zh-cn/application-dev/task-management/transient-task-dev-guide.md b/zh-cn/application-dev/task-management/transient-task-dev-guide.md index cebf29a4d823778a797a867214de304992249133..e0de4621dd2dd023548285a13f6b34ee850c8b8c 100644 --- a/zh-cn/application-dev/task-management/transient-task-dev-guide.md +++ b/zh-cn/application-dev/task-management/transient-task-dev-guide.md @@ -1,4 +1,4 @@ -# 短时任务 +# 短时任务开发指导 ## 场景说明 diff --git a/zh-cn/application-dev/ui/Readme-CN.md b/zh-cn/application-dev/ui/Readme-CN.md index a6b7701f266fdfd54913c114a16b7e63ee6a08b3..a858e0f0603db676aeaf8752dfd0e8f729f64c78 100755 --- a/zh-cn/application-dev/ui/Readme-CN.md +++ b/zh-cn/application-dev/ui/Readme-CN.md @@ -86,33 +86,33 @@ - [页面路由](ui-js-building-ui-routes.md) - 常见组件开发指导 - 容器组件 - - [List开发指导](ui-js-components-list.md) - - [Dialog开发指导](ui-js-components-dialog.md) - - [Form开发指导](ui-js-components-form.md) - - [Stepper开发指导](ui-js-components-stepper.md) - - [Tabs开发指导](ui-js-component-tabs.md) - - [Swiper开发指导](ui-js-components-swiper.md) + - [list开发指导](ui-js-components-list.md) + - [dialog开发指导](ui-js-components-dialog.md) + - [form开发指导](ui-js-components-form.md) + - [stepper开发指导](ui-js-components-stepper.md) + - [tabs开发指导](ui-js-component-tabs.md) + - [swiper开发指导](ui-js-components-swiper.md) - 基础组件 - - [Text开发指导](ui-js-components-text.md) - - [Input开发指导](ui-js-components-input.md) - - [Button开发指导](ui-js-components-button.md) - - [Picker开发指导](ui-js-components-picker.md) - - [Image开发指导](ui-js-components-images.md) - - [Image-animator开发指导](ui-js-components-image-animator.md) - - [Rating开发指导](ui-js-components-rating.md) - - [Slider开发指导](ui-js-components-slider.md) - - [Chart开发指导](ui-js-components-chart.md) - - [Switch开发指导](ui-js-components-switch.md) - - [Toolbar开发指导](ui-js-components-toolbar.md) - - [Menu开发指导](ui-js-components-menu.md) - - [Marquee开发指导](ui-js-components-marquee.md) - - [Qrcode开发指导](ui-js-components-qrcode.md) - - [Search开发指导](ui-js-components-search.md) + - [text开发指导](ui-js-components-text.md) + - [input开发指导](ui-js-components-input.md) + - [button开发指导](ui-js-components-button.md) + - [picker开发指导](ui-js-components-picker.md) + - [image开发指导](ui-js-components-images.md) + - [image-animator开发指导](ui-js-components-image-animator.md) + - [rating开发指导](ui-js-components-rating.md) + - [slider开发指导](ui-js-components-slider.md) + - [chart开发指导](ui-js-components-chart.md) + - [switch开发指导](ui-js-components-switch.md) + - [toolbar开发指导](ui-js-components-toolbar.md) + - [menu开发指导](ui-js-components-menu.md) + - [marquee开发指导](ui-js-components-marquee.md) + - [qrcode开发指导](ui-js-components-qrcode.md) + - [search开发指导](ui-js-components-search.md) - Canvas开发指导 - [Canvas对象](ui-js-components-canvas.md) - [CanvasRenderingContext2D对象](ui-js-components-canvasrenderingcontext2d.md) - [Path2D对象](ui-js-components-path2d.md) - - [OffscreenCanvas对象](ui-js-components-offscreencanvas.md) + - [OffscreenCanvasRenderingContext2D对象](ui-js-components-offscreencanvas.md) - [栅格布局](ui-js-components-grid.md) - Svg开发指导 - [基础知识](ui-js-components-svg-overview.md) diff --git a/zh-cn/application-dev/ui/arkts-event-overview.md b/zh-cn/application-dev/ui/arkts-event-overview.md index c3cee4a8467513a08f6fc898770db72dba0839b1..c603c7ca036cb4745dc04e399d721cbd78a2f3ac 100644 --- a/zh-cn/application-dev/ui/arkts-event-overview.md +++ b/zh-cn/application-dev/ui/arkts-event-overview.md @@ -1,4 +1,4 @@ -# 概述 +# 交互事件概述 交互事件按照触发类型来分类,包括触屏事件、键鼠事件和焦点事件。 diff --git a/zh-cn/application-dev/ui/ui-js-components-search.md b/zh-cn/application-dev/ui/ui-js-components-search.md index 1e334f17bbf8462ab2291280141490688c87853b..9cbd70d681833978118b551998f44964a2cb3ea8 100644 --- a/zh-cn/application-dev/ui/ui-js-components-search.md +++ b/zh-cn/application-dev/ui/ui-js-components-search.md @@ -1,4 +1,4 @@ -# search +# search开发指导 提供搜索框组件,用于提供用户搜索内容的输入区域,具体用法请参考[search](../reference/arkui-js/js-components-basic-search.md)。 diff --git a/zh-cn/application-dev/webgl/webgl-overview.md b/zh-cn/application-dev/webgl/webgl-overview.md index 5333e869497c351587cd4aac55025e5a5db9a208..f7abbb1e02a224fb28f30ed53f76edc90e7904d8 100644 --- a/zh-cn/application-dev/webgl/webgl-overview.md +++ b/zh-cn/application-dev/webgl/webgl-overview.md @@ -1,4 +1,4 @@ -# 概述 +# WebGL开发概述 WebGL的全称为Web Graphic Library(网页图形库),主要用于交互式渲染2D图形和3D图形。目前OpenHarmony中使用的WebGL是基于OpenGL裁剪的OpenGL ES,可以在HTML5的canvas元素对象中使用,无需使用插件,支持跨平台。WebGL程序是由JavaScript代码组成的,其中使用的API可以利用用户设备提供的GPU硬件完成图形渲染和加速。更多信息请参考[WebGL™标准](https://www.khronos.org/registry/webgl/specs/latest/1.0/)。 diff --git a/zh-cn/application-dev/website.md b/zh-cn/application-dev/website.md index d525d27655312eff1c73cb021ea0b07b88666f9a..be5d7b25e9938055ac31a9c2a338ebaab8795030 100644 --- a/zh-cn/application-dev/website.md +++ b/zh-cn/application-dev/website.md @@ -26,10 +26,10 @@ - [HAR](quick-start/har-package.md) - HSP - [应用内HSP开发指导](quick-start/in-app-hsp.md) - - [应用间HSP开发指导(仅对系统应用开放)](quick-start/cross-app-hsp.md) + - [应用间HSP开发指导](quick-start/cross-app-hsp.md) - 应用程序包快速修复 - [快速修复概述](quick-start/quickfix-principles.md) - - [快速修复调试指导](quick-start/quickfix-debug.md) + - [快速修复命令行调试开发指导](quick-start/quickfix-debug.md) - 应用配置文件(Stage模型) - [应用配置文件概述(Stage模型)](quick-start/application-configuration-file-overview-stage.md) - [app.json5配置文件](quick-start/app-configuration-file.md) @@ -98,7 +98,7 @@ - [AccessibilityExtensionAbility](application-models/accessibilityextensionability.md) - [EnterpriseAdminExtensionAbility](application-models/enterprise-extensionAbility.md) - [InputMethodExtensionAbility](application-models/inputmethodextentionability.md) - - [WindowExtensionAbility](application-models/windowextensionability.md) + - [WindowExtensionAbility(仅对系统应用开放)](application-models/windowextensionability.md) - 服务卡片开发指导(Stage模型) - [服务卡片概述](application-models/service-widget-overview.md) - 开发基于ArkTS UI的卡片 @@ -151,7 +151,7 @@ - [静态订阅公共事件(仅对系统应用开放)](application-models/common-event-static-subscription.md) - [取消动态订阅公共事件](application-models/common-event-unsubscription.md) - [公共事件发布](application-models/common-event-publish.md) - - [移除粘性公共事件](application-models/common-event-remove-sticky.md) + - [移除粘性公共事件(仅对系统应用开放)](application-models/common-event-remove-sticky.md) - [后台服务](application-models/background-services.md) - 了解线程模型 - [线程模型概述](application-models/thread-model-stage.md) @@ -328,33 +328,33 @@ - [页面路由](ui/ui-js-building-ui-routes.md) - 常见组件开发指导 - 容器组件 - - [List开发指导](ui/ui-js-components-list.md) - - [Dialog开发指导](ui/ui-js-components-dialog.md) - - [Form开发指导](ui/ui-js-components-form.md) - - [Stepper开发指导](ui/ui-js-components-stepper.md) - - [Tabs开发指导](ui/ui-js-component-tabs.md) - - [Swiper开发指导](ui/ui-js-components-swiper.md) + - [list开发指导](ui/ui-js-components-list.md) + - [dialog开发指导](ui/ui-js-components-dialog.md) + - [form开发指导](ui/ui-js-components-form.md) + - [stepper开发指导](ui/ui-js-components-stepper.md) + - [tabs开发指导](ui/ui-js-component-tabs.md) + - [swiper开发指导](ui/ui-js-components-swiper.md) - 基础组件 - - [Text开发指导](ui/ui-js-components-text.md) - - [Input开发指导](ui/ui-js-components-input.md) - - [Button开发指导](ui/ui-js-components-button.md) - - [Picker开发指导](ui/ui-js-components-picker.md) - - [Image开发指导](ui/ui-js-components-images.md) - - [Image-animator开发指导](ui/ui-js-components-image-animator.md) - - [Rating开发指导](ui/ui-js-components-rating.md) - - [Slider开发指导](ui/ui-js-components-slider.md) - - [Chart开发指导](ui/ui-js-components-chart.md) - - [Switch开发指导](ui/ui-js-components-switch.md) - - [Toolbar开发指导](ui/ui-js-components-toolbar.md) - - [Menu开发指导](ui/ui-js-components-menu.md) - - [Marquee开发指导](ui/ui-js-components-marquee.md) - - [Qrcode开发指导](ui/ui-js-components-qrcode.md) - - [Search开发指导](ui/ui-js-components-search.md) + - [text开发指导](ui/ui-js-components-text.md) + - [input开发指导](ui/ui-js-components-input.md) + - [button开发指导](ui/ui-js-components-button.md) + - [picker开发指导](ui/ui-js-components-picker.md) + - [image开发指导](ui/ui-js-components-images.md) + - [image-animator开发指导](ui/ui-js-components-image-animator.md) + - [rating开发指导](ui/ui-js-components-rating.md) + - [slider开发指导](ui/ui-js-components-slider.md) + - [chart开发指导](ui/ui-js-components-chart.md) + - [switch开发指导](ui/ui-js-components-switch.md) + - [toolbar开发指导](ui/ui-js-components-toolbar.md) + - [menu开发指导](ui/ui-js-components-menu.md) + - [marquee开发指导](ui/ui-js-components-marquee.md) + - [qrcode开发指导](ui/ui-js-components-qrcode.md) + - [search开发指导](ui/ui-js-components-search.md) - Canvas开发指导 - [Canvas对象](ui/ui-js-components-canvas.md) - [CanvasRenderingContext2D对象](ui/ui-js-components-canvasrenderingcontext2d.md) - [Path2D对象](ui/ui-js-components-path2d.md) - - [OffscreenCanvas对象](ui/ui-js-components-offscreencanvas.md) + - [OffscreenCanvasRenderingContext2D对象](ui/ui-js-components-offscreencanvas.md) - [栅格布局](ui/ui-js-components-grid.md) - Svg开发指导 - [基础知识](ui/ui-js-components-svg-overview.md) @@ -393,7 +393,7 @@ - [通知概述](notification/notification-overview.md) - [订阅通知(仅对系统应用开放)](notification/notification-subscription.md) - [使能通知开关](notification/notification-enable.md) - - [通知角标](notification/notification-badge.md) + - [管理通知角标](notification/notification-badge.md) - 发布通知 - [发布基础类型通知](notification/text-notification.md) - [发布进度条类型通知](notification/progress-bar-notification.md) @@ -426,7 +426,7 @@ - [音频录制开发概述](media/audio-recording-overview.md) - [使用AVRecorder开发音频录制功能](media/using-avrecorder-for-recording.md) - [使用AudioCapturer开发音频录制功能](media/using-audiocapturer-for-recording.md) - - [使用OpenSLES开发音频录制功能](media/using-opensl-es-for-recording.md) + - [使用OpenSL ES开发音频录制功能](media/using-opensl-es-for-recording.md) - [管理麦克风](media/mic-management.md) - [音频录制流管理](media/audio-recording-stream-management.md) - [音频输入设备管理](media/audio-input-device-management.md) @@ -435,7 +435,7 @@ - [开发音频通话功能](media/audio-call-development.md) - [视频播放](media/video-playback.md) - [视频录制](media/video-recording.md) - - 媒体会话(仅对系统应用开放) + - 媒体会话 - [媒体会话概述](media/avsession-overview.md) - 本地媒体会话 - [本地媒体会话概述](media/local-avsession-overview.md) @@ -480,7 +480,7 @@ - [通用密钥库密码算法规格](security/huks-appendix.md) - 加解密算法库框架 - [加解密算法库框架概述](security/cryptoFramework-overview.md) - - [加解密算法框架开发指导](security/cryptoFramework-guidelines.md) + - [加解密算法库框架开发指导](security/cryptoFramework-guidelines.md) - 证书 - [证书概述](security/cert-overview.md) - [证书开发指导](security/cert-guidelines.md) @@ -553,13 +553,13 @@ - [分布式文件系统概述](file-management/distributed-fs-overview.md) - [设置分布式文件数据等级](file-management/set-security-label.md) - [跨设备文件访问](file-management/file-access-across-devices.md) - - 任务管理 + - 后台任务(Background Task)管理 - 后台任务 - [后台任务概述](task-management/background-task-overview.md) - [短时任务开发指导](task-management/transient-task-dev-guide.md) - [长时任务开发指导](task-management/continuous-task-dev-guide.md) - - [延迟任务开发指导](task-management/work-scheduler-dev-guide.md) - - [延迟任务回调能力开发指导](task-management/workscheduler-extensionability.md) + - [延迟任务调度开发指导](task-management/work-scheduler-dev-guide.md) + - [延迟任务回调能力开发指导(WorkSchedulerExtensionAbility)](task-management/workscheduler-extensionability.md) - [申请能效资源开发指导](task-management/efficiency-resources-apply-dev-guide.md) - 后台代理提醒 - [后台代理提醒概述](task-management/reminder-agent-overview.md) @@ -574,8 +574,8 @@ - [传感器开发概述](device/sensor-overview.md) - [传感器开发指导](device/sensor-guidelines.md) - 振动 - - [振动开发概述](device/vibrator-overview.md) - - [振动开发指导](device/vibrator-guidelines.md) + - [Vibrator开发概述](device/vibrator-overview.md) + - [Vibrator开发指导](device/vibrator-guidelines.md) - 多模输入 - [输入设备开发指导](device/inputdevice-guidelines.md) - [鼠标光标开发指导](device/pointerstyle-guidelines.md) @@ -583,7 +583,7 @@ - [示例服务器开发概述](device/sample-server-overview.md) - [示例服务器开发指导](device/sample-server-guidelines.md) - 设备状态 - - [设备状态开发指导](device/stationary-guidelines.md) + - [Stationary开发指导](device/stationary-guidelines.md) - 设备使用信息统计 - [设备使用信息统计概述](device-usage-statistics/device-usage-statistics-overview.md) - [设备使用信息统计开发指导](device-usage-statistics/device-usage-statistics-use-guide.md) @@ -722,12 +722,15 @@ - [触摸热区设置](reference/arkui-ts/ts-universal-attributes-touch-target.md) - [多态样式](reference/arkui-ts/ts-universal-attributes-polymorphic-style.md) - [触摸测试控制](reference/arkui-ts/ts-universal-attributes-hit-test-behavior.md) - - [背景模糊设置](reference/arkui-ts/ts-universal-attributes-backgroundBlurStyle.md) + - [组件背景模糊](reference/arkui-ts/ts-universal-attributes-backgroundBlurStyle.md) - [分布式迁移标识](reference/arkui-ts/ts-universal-attributes-restoreId.md) - [前景色设置](reference/arkui-ts/ts-universal-attributes-foreground-color.md) - - [图像球面效果设置](reference/arkui-ts/ts-universal-attributes-sphericalEffect.md) - - [图像渐亮效果设置](reference/arkui-ts/ts-universal-attributes-lightUpEffect.md) - - [图像像素扩展效果设置](reference/arkui-ts/ts-universal-attributes-pixelStretchEffect.md) + - [图像球面效果](reference/arkui-ts/ts-universal-attributes-sphericalEffect.md) + - [图像渐亮效果](reference/arkui-ts/ts-universal-attributes-lightUpEffect.md) + - [图像边缘像素扩展效果](reference/arkui-ts/ts-universal-attributes-pixelStretchEffect.md) + - 模态转场设置 + - [全屏模态转场](reference/arkui-ts/ts-universal-attributes-modal-transition.md) + - [半模态转场](reference/arkui-ts/ts-universal-attributes-sheet-transition.md) - [文本通用属性](reference/arkui-ts/ts-universal-attributes-text-style.md) - 手势处理 - [绑定手势方法](reference/arkui-ts/ts-gesture-settings.md) @@ -748,7 +751,7 @@ - [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md) - [DatePicker](reference/arkui-ts/ts-basic-components-datepicker.md) - [Divider](reference/arkui-ts/ts-basic-components-divider.md) - - [Formcomponent](reference/arkui-ts/ts-basic-components-formcomponent.md) + - [FormComponent](reference/arkui-ts/ts-basic-components-formcomponent.md) - [Gauge](reference/arkui-ts/ts-basic-components-gauge.md) - [Image](reference/arkui-ts/ts-basic-components-image.md) - [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md) @@ -827,10 +830,12 @@ - [Shape](reference/arkui-ts/ts-drawing-components-shape.md) - 画布组件 - [Canvas](reference/arkui-ts/ts-components-canvas-canvas.md) - - [CanvasRenderingContext2D对象](reference/arkui-ts/ts-canvasrenderingcontext2d.md) - [CanvasGradient对象](reference/arkui-ts/ts-components-canvas-canvasgradient.md) + - [CanvasPattern](reference/arkui-ts/ts-components-canvas-canvaspattern.md) + - [CanvasRenderingContext2D对象](reference/arkui-ts/ts-canvasrenderingcontext2d.md) - [ImageBitmap对象](reference/arkui-ts/ts-components-canvas-imagebitmap.md) - [ImageData对象](reference/arkui-ts/ts-components-canvas-imagedata.md) + - [Matrix2D](reference/arkui-ts/ts-components-canvas-matrix2d.md) - [OffscreenCanvasRenderingContext2D对象](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md) - [Path2D对象](reference/arkui-ts/ts-components-canvas-path2d.md) - [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md) @@ -847,15 +852,15 @@ - [警告弹窗](reference/arkui-ts/ts-methods-alert-dialog-box.md) - [列表选择弹窗](reference/arkui-ts/ts-methods-action-sheet.md) - [自定义弹窗](reference/arkui-ts/ts-methods-custom-dialog-box.md) - - [日期选择弹窗](reference/arkui-ts/ts-methods-datepicker-dialog.md) - - [时间选择弹窗](reference/arkui-ts/ts-methods-timepicker-dialog.md) - - [文本选择弹窗](reference/arkui-ts/ts-methods-textpicker-dialog.md) + - [日期滑动选择器弹窗](reference/arkui-ts/ts-methods-datepicker-dialog.md) + - [时间滑动选择器弹窗](reference/arkui-ts/ts-methods-timepicker-dialog.md) + - [文本滑动选择器弹窗](reference/arkui-ts/ts-methods-textpicker-dialog.md) - [菜单](reference/arkui-ts/ts-methods-menu.md) - [自定义组件的生命周期](reference/arkui-ts/ts-custom-component-lifecycle.md) - [应用级变量的状态管理](reference/arkui-ts/ts-state-management.md) - [像素单位](reference/arkui-ts/ts-pixel-units.md) - [枚举说明](reference/arkui-ts/ts-appendix-enums.md) - - [类型说明](reference/arkui-ts/ts-types.md) + - [类型定义](reference/arkui-ts/ts-types.md) - 已停止维护的组件 - [GridContainer](reference/arkui-ts/ts-container-gridcontainer.md) - 组件参考(兼容JS的类Web开发范式-ArkUI.Full) @@ -952,7 +957,7 @@ - [animateMotion](reference/arkui-js/js-components-svg-animatemotion.md) - [animateTransform](reference/arkui-js/js-components-svg-animatetransform.md) - 自定义组件 - - [基本用法](reference/arkui-js/js-components-custom-basic-usage.md) + - [自定义组件的基本用法](reference/arkui-js/js-components-custom-basic-usage.md) - [数据传递与处理](reference/arkui-js/js-components-custom-props.md) - [继承样式](reference/arkui-js/js-components-custom-style.md) - [slot插槽](reference/arkui-js/js-components-custom-slot.md) @@ -1213,17 +1218,17 @@ - [shortcutInfo](reference/apis/js-apis-bundleManager-shortcutInfo.md) - UI界面 - [@ohos.animator (动画)](reference/apis/js-apis-animator.md) - - [@ohos.arkui.componentSnapshot(组件截图)](reference/apis/js-apis-arkui-componentSnapshot.md) + - [@ohos.arkui.componentSnapshot (组件截图)](reference/apis/js-apis-arkui-componentSnapshot.md) - [@ohos.arkui.drawableDescriptor (DrawableDescriptor)](reference/apis/js-apis-arkui-drawableDescriptor.md) - [@ohos.curves (插值计算)](reference/apis/js-apis-curve.md) - - [@ohos.font(注册自定义字体)](reference/apis/js-apis-font.md) + - [@ohos.font (注册自定义字体)](reference/apis/js-apis-font.md) - [@ohos.matrix4 (矩阵变换)](reference/apis/js-apis-matrix4.md) - [@ohos.mediaquery (媒体查询)](reference/apis/js-apis-mediaquery.md) - - [@ohos.pluginComponent(PluginComponentManager)](reference/apis/js-apis-plugincomponent.md) + - [@ohos.pluginComponent (PluginComponentManager)](reference/apis/js-apis-plugincomponent.md) - [@ohos.promptAction (弹窗)](reference/apis/js-apis-promptAction.md) - [@ohos.router (页面路由)](reference/apis/js-apis-router.md) - [@ohos.measure (文本计算)](reference/apis/js-apis-measure.md) - - [@ohos.uiAppearance(用户界面外观)](reference/apis/js-apis-uiappearance.md) + - [@ohos.uiAppearance (用户界面外观)](reference/apis/js-apis-uiappearance.md) - 图形图像 - [@ohos.animation.windowAnimationManager (窗口动画管理)](reference/apis/js-apis-windowAnimationManager.md) - [@ohos.application.WindowExtensionAbility (窗口扩展能力)](reference/apis/js-apis-application-windowExtensionAbility.md) @@ -1269,7 +1274,7 @@ - security - [PermissionRequestResult](reference/apis/js-apis-permissionrequestresult.md) - 数据管理 - - [@ohos.data.cloudData(端云协同)](reference/apis/js-apis-data-cloudData.md) + - [@ohos.data.cloudData (端云协同)](reference/apis/js-apis-data-cloudData.md) - [@ohos.data.dataAbility (DataAbility谓词)](reference/apis/js-apis-data-ability.md) - [@ohos.data.dataShare (数据共享)](reference/apis/js-apis-data-dataShare.md) - [@ohos.data.dataSharePredicates (数据共享谓词)](reference/apis/js-apis-data-dataSharePredicates.md) @@ -1278,6 +1283,7 @@ - [@ohos.data.distributedKVStore (分布式键值数据库)](reference/apis/js-apis-distributedKVStore.md) - [@ohos.data.preferences (用户首选项)](reference/apis/js-apis-data-preferences.md) - [@ohos.data.relationalStore (关系型数据库)](reference/apis/js-apis-data-relationalStore.md) + - [@ohos.data.UDMF (统一数据管理框架)](reference/apis/js-apis-data-udmf.md) - [@ohos.data.ValuesBucket (数据集)](reference/apis/js-apis-data-valuesBucket.md) - 文件管理 - [@ohos.file.backup (备份恢复)](reference/apis/js-apis-file-backup.md) @@ -1355,6 +1361,7 @@ - [@ohos.web.webview (Webview)](reference/apis/js-apis-webview.md) - [console (控制台)](reference/apis/js-apis-logs.md) - [Timer (定时器)](reference/apis/js-apis-timer.md) + - [syscap (系统能力)](reference/apis/js-apis-syscap.md) - application - [AccessibilityExtensionContext (辅助功能扩展上下文)](reference/apis/js-apis-inner-application-accessibilityExtensionContext.md) - 设备管理 @@ -1377,7 +1384,7 @@ - [@ohos.multimodalInput.mouseEvent (鼠标输入事件)](reference/apis/js-apis-mouseevent.md) - [@ohos.multimodalInput.pointer (鼠标指针)](reference/apis/js-apis-pointer.md) - [@ohos.multimodalInput.touchEvent (触摸输入事件)](reference/apis/js-apis-touchevent.md) - - [@ohos.multimodalInput.shortKey (快捷键)](reference/apis/js-apis-shortKey.md) + - [@ohos.multimodalInput.shortKey(快捷键)](reference/apis/js-apis-shortKey.md) - [@ohos.power (系统电源管理)](reference/apis/js-apis-power.md) - [@ohos.runningLock (Runninglock锁)](reference/apis/js-apis-runninglock.md) - [@ohos.sensor (传感器)](reference/apis/js-apis-sensor.md) @@ -1395,16 +1402,16 @@ - [@ohos.account.osAccount (系统帐号管理)](reference/apis/js-apis-osAccount.md) - 定制管理 - [@ohos.configPolicy (配置策略)](reference/apis/js-apis-configPolicy.md) - - [@ohos.enterprise.accountManager (帐户管理)](reference/apis/js-apis-enterprise-accountManager.md) + - [@ohos.enterprise.accountManager(帐户管理)](reference/apis/js-apis-enterprise-accountManager.md) - [@ohos.enterprise.adminManager (企业设备管理)](reference/apis/js-apis-enterprise-adminManager.md) - - [@ohos.enterprise.applicationManager (应用管理)](reference/apis/js-apis-enterprise-applicationManager.md) - - [@ohos.enterprise.bundleManager (包管理)](reference/apis/js-apis-enterprise-bundleManager.md) + - [@ohos.enterprise.applicationManager(应用管理)](reference/apis/js-apis-enterprise-applicationManager.md) + - [@ohos.enterprise.bundleManager(包管理)](reference/apis/js-apis-enterprise-bundleManager.md) - [@ohos.enterprise.dateTimeManager (系统时间管理)](reference/apis/js-apis-enterprise-dateTimeManager.md) - [@ohos.enterprise.deviceControl (设备控制管理)](reference/apis/js-apis-enterprise-deviceControl.md) - - [@ohos.enterprise.deviceInfo (设备信息管理)](reference/apis/js-apis-enterprise-deviceInfo.md) + - [@ohos.enterprise.deviceInfo(设备信息管理)](reference/apis/js-apis-enterprise-deviceInfo.md) - [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](reference/apis/js-apis-EnterpriseAdminExtensionAbility.md) - - [@ohos.enterprise.networkManager (网络管理)](reference/apis/js-apis-enterprise-networkManager.md) - - [@ohos.enterprise.wifiManager (WiFi管理)](reference/apis/js-apis-enterprise-wifiManager.md) + - [@ohos.enterprise.networkManager(网络管理)](reference/apis/js-apis-enterprise-networkManager.md) + - [@ohos.enterprise.wifiManager(WiFi管理)](reference/apis/js-apis-enterprise-wifiManager.md) - 语言基础类库 - [@ohos.buffer (Buffer)](reference/apis/js-apis-buffer.md) - [@ohos.convertxml (xml转换JavaScript)](reference/apis/js-apis-convertxml.md) @@ -1574,7 +1581,7 @@ - [设备管理错误码](reference/errorcodes/errorcode-device-manager.md) - [位置服务子系统错误码](reference/errorcodes/errorcode-geoLocationManager.md) - [键鼠穿越管理错误码](reference/errorcodes/errorcode-devicestatus.md) - - [键鼠穿越管理错误码 (待停用)](reference/errorcodes/errorcode-multimodalinput.md) + - [键鼠穿越管理错误码(待停用)](reference/errorcodes/errorcode-multimodalinput.md) - [传感器错误码](reference/errorcodes/errorcode-sensor.md) - [振动错误码](reference/errorcodes/errorcode-vibrator.md) - [系统参数错误码](reference/errorcodes/errorcode-system-parameterV9.md) @@ -1608,6 +1615,7 @@ - [HuksKeyApi](reference/native-apis/_huks_key_api.md) - [HuksParamSetApi](reference/native-apis/_huks_param_set_api.md) - [HuksTypeApi](reference/native-apis/_huks_type_api.md) + - [Init](reference/native-apis/init.md) - 头文件 - [drawing_bitmap.h](reference/native-apis/drawing__bitmap_8h.md) - [drawing_brush.h](reference/native-apis/drawing__brush_8h.md) @@ -1649,6 +1657,7 @@ - [native_huks_api.h](reference/native-apis/native__huks__api_8h.md) - [native_huks_param.h](reference/native-apis/native__huks__param_8h.md) - [native_huks_type.h](reference/native-apis/native__huks__type_8h.md) + - [syscap_ndk.h](reference/native-apis/syscap__ndk_8h.md) - 结构体 - [OH_Drawing_BitmapFormat](reference/native-apis/_o_h___drawing___bitmap_format.md) - [OH_NativeBuffer_Config](reference/native-apis/_o_h___native_buffer___config.md) @@ -1686,9 +1695,9 @@ - [OH_Huks_PubKeyInfo](reference/native-apis/_o_h___huks___pub_key_info.md) - [OH_Huks_Result](reference/native-apis/_o_h___huks___result.md) - 标准库 - - [Node_API](reference/native-lib/third_party_napi/napi.md) + - [Node-API](reference/native-lib/third_party_napi/napi.md) - [libuv](reference/native-lib/third_party_libuv/libuv.md) - - [支持的标准库介绍](reference/native-lib/third_party_libc/musl.md) + - [Native API中支持的标准库](reference/native-lib/third_party_libc/musl.md) - 附录 - [Native api中没有导出的符号列表](reference/native-lib/third_party_libc/musl-peculiar-symbol.md) - [Native api中由于权限管控可能调用失败的符号列表](reference/native-lib/third_party_libc/musl-permission-control-symbol.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/Readme-CN.md b/zh-cn/device-dev/reference/hdi-apis/Readme-CN.md index 2bd9d277227ef129572b18b0def810169c77b548..773236e3b8c3e789ab39591a90d5f3242a367313 100644 --- a/zh-cn/device-dev/reference/hdi-apis/Readme-CN.md +++ b/zh-cn/device-dev/reference/hdi-apis/Readme-CN.md @@ -3,254 +3,223 @@ - 模块 - [Audio](_audio.md) - [Battery](battery.md) - - [Camera](camera.md) - - [Codec](codec.md) + - [Camera](_camera.md) + - [Codec](_codec.md) - [Display](_display.md) - [HdfFaceAuth](_hdf_face_auth.md) - [HdfPinAuth](_hdf_pin_auth.md) - [HdfUserAuth](_hdf_user_auth.md) - - [HdiActivityRecognition](activity_recognition.md) - - [Input](input.md) - - [Light](light.md) - - [Motion](motion.md) + - [HdiActivityRecognition](_hdi_activity_recognition.md) + - [HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + - [HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + - [HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + - [HdiLpfenceWififence](_hdi_lpfence_wififence.md) + - [Input](_input.md) + - [Light](_light.md) + - [Motion](_motion.md) + - [NNRt](_n_n_rt.md) - [Power](power.md) - - [Sensor](sensor.md) + - [Ril](_ril.md) + - [Sensor](_sensor.md) - [Thermal](thermal.md) - - [USB](usb.md) - - [Vibrator](vibrator.md) - - [WLAN](wlan.md) -- 头文件和结构体 - - 头文件 - - [audio_adapter.h](audio__adapter_8h.md) - - [audio_attribute.h](audio__attribute_8h.md) - - [audio_capture.h](audio__capture_8h.md) - - [audio_control.h](audio__control_8h.md) - - [audio_manager.h](audio__manager_8h.md) - - [audio_render.h](audio__render_8h.md) - - [audio_scene.h](audio__scene_8h.md) - - [audio_types.h](audio__types_8h.md) - - [audio_volume.h](audio__volume_8h.md) - - [codec_callback_if.h](codec_callback_if_h.md) - - [codec_common_type.h](codec_common_type_h.md) - - [codec_component_if.h](codec_component_if_h.md) - - [codec_component_manager.h](codec__component__manager_h.md) - - [codec_component_type.h](codec__component__type_h.md) + - [USB](_u_s_b.md) + - [Vibrator](_vibrator.md) + - [WLAN](_w_l_a_n.md) +- 头文件 + - Audio模块头文件 + - [AudioTypes.idl](_audio_types_8idl.md) + - [IAudioAdapter.idl](_i_audio_adapter_8idl.md) + - [IAudioCallback.idl](_i_audio_callback_8idl.md) + - [IAudioCapture.idl](_i_audio_capture_8idl.md) + - [IAudioManager.idl](_i_audio_manager_8idl.md) + - [IAudioRender.idl](_i_audio_render_8idl.md) + - Battery模块相关头文件 + - [IBatteryCallback.idl](_i_battery_callback_8idl.md) + - [IBatteryInterface.idl](_i_battery_interface_8idl.md) + - [Types.idl](_battery_types_8idl.md) + - Camera模块头文件 + - [ICameraDevice.idl](_i_camera_device_8idl.md) + - [ICameraDeviceCallback.idl](_i_camera_device_callback_8idl.md) + - [ICameraHost.idl](_i_camera_host_8idl.md) + - [ICameraHostCallback.idl](_i_camera_host_callback_8idl.md) + - [IOfflineStreamOperator.idl](_i_offline_stream_operator_8idl.md) + - [IStreamOperator.idl](_i_stream_operator_8idl.md) + - [IStreamOperatorCallback.idl](_i_stream_operator_callback_8idl.md) + - [Types.idl](_types_8idl.md) + - Codec模块头文件 + - [codec_callback_if.h](codec__callback__if_8h.md) + - [codec_common_type.h](codec__common__type_8h.md) + - [codec_component_if.h](codec__component__if_8h.md) + - [codec_component_manager.h](codec__component__manager_8h.md) + - [codec_component_type.h](codec__component__type_8h.md) + - Display模块头文件 - [display_device.h](display__device_8h.md) - [display_gfx.h](display__gfx_8h.md) - [display_gralloc.h](display__gralloc_8h.md) - [display_layer.h](display__layer_8h.md) - [display_type.h](display__type_8h.md) - [display_vgu.h](display__vgu_8h.md) - - [input_controller.h](input__controller_8h.md) - - [input_manager.h](input__manager_8h.md) - - [input_reporter.h](input__reporter_8h.md) - - [input_type.h](input__type_8h.md) - - [ActivityRecognitionTypes.idl](activity_recognition_types_idl.md) - - [Types.idl](battery_types_idl.md) - - [IExecutor.idl](face__auth_2_i_executor_8idl.md) - - [IExecutorCallback.idl](face__auth_2_i_executor_callback_8idl.md) + - HdfFaceAuth模块头文件 - [FaceAuthTypes.idl](_face_auth_types_8idl.md) - - [PinAuthTypes.idl](_pin_auth_types_8idl.md) - - [IExecutor.idl](pin__auth_2_i_executor_8idl.md) - - [IExecutorCallback.idl](pin__auth_2_i_executor_callback_8idl.md) + - [IExecutor.idl](_i_executor_8idl_faceauth.md) + - [IExecutorCallback.idl](_i_executor_callback_8idl_faceauth.md) - [IFaceAuthInterface.idl](_i_face_auth_interface_8idl.md) + - HdfPinAuth模块头文件 + - [IExecutor.idl](_i_executor_8idl_pinauth.md) + - [IExecutorCallback.idl](_i_executor_callback_8idl_pinauth.md) - [IPinAuthInterface.idl](_i_pin_auth_interface_8idl.md) + - HdfUserAuth模块头文件 - [IUserAuthInterface.idl](_i_user_auth_interface_8idl.md) - [UserAuthTypes.idl](_user_auth_types_8idl.md) + - HdiActivityRecognition模块头文件 + - [ActivityRecognitionTypes.idl](_activity_recognition_types_8idl.md) - [IActivityChangedCallback.idl](_i_activity_changed_callback_8idl.md) - [IActivityInterface.idl](_i_activity_interface_8idl.md) - - [IBatteryCallback.idl](_i_battery_callback_8idl.md) - - [IBatteryInterface.idl](_i_battery_interface_8idl.md) - - [ICameraDevice.idl](_i_camera_device_8idl.md) - - [ICameraDeviceCallback.idl](_i_camera_device_callback_8idl.md) - - [ICameraHostCallback.idl](_i_camera_host_callback_8idl.md) - - [ICameraHost.idl](_i_camera_host_8idl.md) + - HdiLpfenceCellbatching模块头文件 + - [CellbatchingTypes.idl](_cellbatching_types_8idl.md) + - [ICellbatchingCallback.idl](_i_cellbatching_callback_8idl.md) + - [ICellbatchingInterface.idl](_i_cellbatching_interface_8idl.md) + - HdiLpfenceCellfence模块头文件 + - [CellfenceTypes.idl](_cellfence_types_8idl.md) + - [ICellfenceCallback.idl](_i_cellfence_callback_8idl.md) + - [ICellfenceInterface.idl](_i_cellfence_interface_8idl.md) + - HdiLpfenceGeofence模块头文件 + - [GeofenceTypes.idl](_geofence_types_8idl.md) + - [IGeofenceCallback.idl](_i_geofence_callback_8idl.md) + - [IGeofenceIntf.idl](_i_geofence_intf_8idl.md) + - HdiLpfenceWififence模块头文件 + - [IWififenceCallback.idl](_i_wififence_callback_8idl.md) + - [IWififenceInterface.idl](_i_wififence_interface_8idl.md) + - [WififenceTypes.idl](_wififence_types_8idl.md) + - Input模块头文件 + - [input_controller.h](input__controller_8h.md) + - [input_manager.h](input__manager_8h.md) + - [input_reporter.h](input__reporter_8h.md) + - [input_type.h](input__type_8h.md) + - Light模块头文件 - [ILightInterface.idl](_i_light_interface_8idl.md) + - [LightTypes.idl](_light_types_8idl.md) + - Motion模块头文件 - [IMotionCallback.idl](_i_motion_callback_8idl.md) - [IMotionInterface.idl](_i_motion_interface_8idl.md) - - [IOfflineStreamOperator.idl](_i_offline_stream_operator_8idl.md) + - [MotionTypes.idl](_motion_types_8idl.md) + - NNRt模块头文件 + - [INnrtDevice.idl](_i_nnrt_device_8idl.md) + - [IPreparedModel.idl](_i_prepared_model_8idl.md) + - [ModelTypes.idl](_model_types_8idl.md) + - [NnrtTypes.idl](_nnrt_types_8idl.md) + - [NodeAttrTypes.idl](_node_attr_types_8idl.md) + - Power模块头文件 - [IPowerHdiCallback.idl](_i_power_hdi_callback_8idl.md) - [IPowerInterface.idl](_i_power_interface_8idl.md) + - [PowerTypes.idl](_power_types_8idl.md) + - Ril模块头文件 + - [IRil.idl](_i_ril_8idl.md) + - [IRilCallback.idl](_i_ril_callback_8idl.md) + - [Types.idl](_ril_types_8idl.md) + - Sensor模块头文件 - [ISensorCallback.idl](_i_sensor_callback_8idl.md) - [ISensorInterface.idl](_i_sensor_interface_8idl.md) - - [IStreamOperator.idl](_i_stream_operator_8idl.md) - - [IStreamOperatorCallback.idl](_i_stream_operator_callback_8idl.md) + - [SensorTypes.idl](_sensor_types_8idl.md) + - Thermal模块头文件 - [IThermalCallback.idl](_i_thermal_callback_8idl.md) - [IThermalInterface.idl](_i_thermal_interface_8idl.md) + - [ThermalTypes.idl](_thermal_types_8idl.md) + - USB模块头文件 - [IUsbdBulkCallback.idl](_i_usbd_bulk_callback_8idl.md) - - [IUsbInterface.idl](_i_usb_interface_8idl.md) - [IUsbdSubscriber.idl](_i_usbd_subscriber_8idl.md) + - [IUsbInterface.idl](_i_usb_interface_8idl.md) + - [UsbTypes.idl](_usb_types_8idl.md) + - Vibrator模块头文件 - [IVibratorInterface.idl](_i_vibrator_interface_8idl.md) + - [VibratorTypes.idl](_vibrator_types_8idl.md) + - WLAN模块头文件 - [IWlanCallback.idl](_i_wlan_callback_8idl.md) - [IWlanInterface.idl](_i_wlan_interface_8idl.md) - - [LightTypes.idl](_light_types_8idl.md) - - [MotionTypes.idl](_motion_types_8idl.md) - - [PowerTypes.idl](_power_types_8idl.md) - - [SensorTypes.idl](_sensor_types_8idl.md) - - [ThermalTypes.idl](_thermal_types_8idl.md) - - [Types.idl](camera_2v1__0_2_types_8idl.md) - - [UsbTypes.idl](_usb_types_8idl.md) - - [VibratorTypes.idl](_vibrator_types_8idl.md) - [WlanTypes.idl](_wlan_types_8idl.md) - - 结构体 - - [YUVDescInfo](_yun_desc_info_.md) - - [ExtDataHandle](_ext_data_handle.md) - - [ActRecognitionEvent](_act_recognition_event.md) - - [AllocInfo](_alloc_info.md) - - [Alignment](_alignment.md) - - [AudioAdapter](_audio_adapter.md) +- 结构体 + - Audio模块结构体 - [AudioAdapterDescriptor](_audio_adapter_descriptor.md) - - [AudioAttribute](_audio_attribute.md) - - [AudioCapture](_audio_capture.md) - - [AudioControl](_audio_control.md) - [AudioDevExtInfo](_audio_dev_ext_info.md) - [AudioDeviceDescriptor](_audio_device_descriptor.md) - - [AudioManager](_audio_manager.md) + - [AudioDeviceStatus](_audio_device_status.md) + - [AudioEvent](_audio_event.md) + - [AudioInfo](_audio_info.md) - [AudioMixExtInfo](_audio_mix_ext_info.md) - - [AudioMmapBufferDescriptor](_audio_mmap_buffer_descriptor.md) + - [AudioMmapBufferDescripter](_audio_mmap_buffer_descripter.md) - [AudioPort](_audio_port.md) - - [AudioPortCap](audio_portcap.md) - [AudioPortCapability](_audio_port_capability.md) - - [AudioRender](_audio_render.md) - [AudioRoute](_audio_route.md) - [AudioRouteNode](_audio_route_node.md) - [AudioSampleAttributes](_audio_sample_attributes.md) - - [AudioScene](_audio_scene.md) - [AudioSceneDescriptor](_audio_scene_descriptor.md) - - [AudioSceneDescriptor::SceneDesc](union_audio_scene_descriptor_1_1_scene_desc.md) - [AudioSessionExtInfo](_audio_session_ext_info.md) - [AudioSubPortCapability](_audio_sub_port_capability.md) - [AudioTimeStamp](_audio_time_stamp.md) - - [AudioVolume](_audio_volume.md) - - [AuthResultInfo](_auth_result_info.md) - - [AuthSolution](_auth_solution.md) - - [BufferData](_buffer_data.md) + - [IAudioAdapter](interface_i_audio_adapter.md) + - [IAudioCallback](interface_i_audio_callback.md) + - [IAudioCapture](interface_i_audio_capture.md) + - [IAudioManager](interface_i_audio_manager.md) + - [IAudioRender](interface_i_audio_render.md) + - [SceneDesc](union_scene_desc.md) + - Battery模块结构体 - [BatteryInfo](_battery_info.md) + - [IBatteryCallback](interface_i_battery_callback.md) + - [IBatteryInterface](interface_i_battery_interface.md) + - Camera模块结构体 - [CaptureEndedInfo](_capture_ended_info.md) - [CaptureErrorInfo](_capture_error_info.md) - [CaptureInfo](_capture_info.md) + - [ICameraDevice](interface_i_camera_device.md) + - [ICameraDeviceCallback](interface_i_camera_device_callback.md) + - [ICameraHost](interface_i_camera_host.md) + - [ICameraHostCallback](interface_i_camera_host_callback.md) + - [IOfflineStreamOperator](interface_i_offline_stream_operator.md) + - [IStreamOperator](interface_i_stream_operator.md) + - [IStreamOperatorCallback](interface_i_stream_operator_callback.md) + - [StreamAttribute](_stream_attribute.md) + - [StreamInfo](_stream_info.md) + - Codec模块结构体 + - [Alignment](_alignment.md) + - [AudioPortCap](_audio_port_cap.md) - [CodecCallbackType](_codec_callback_type.md) - [CodecCompCapability](_codec_comp_capability.md) - [CodecComponentManager](_codec_component_manager.md) - [CodecComponentType](_codec_component_type.md) - - [ColorValue](union_color_value.md) - [CompVerInfo](_comp_ver_info.md) - - [CredentialInfo](_credential_info.md) + - [EventInfo](_event_info.md) + - [GetBufferHandleUsageParams](_get_buffer_handle_usage_params.md) + - [OmxCodecBuffer](_omx_codec_buffer.md) + - [PortCap](union_port_cap.md) + - [RangeValue](_range_value.md) + - [Rect](_rect.md) + - [SupportBufferType](_support_buffer_type.md) + - [UseBufferType](_use_buffer_type.md) + - [VideoPortCap](_video_port_cap.md) + - Display模块结构体 + - [AllocInfo](_alloc_info.md) + - [BufferData](_buffer_data.md) - [DeviceFuncs](_device_funcs.md) - [DisplayCapability](_display_capability.md) - [DisplayInfo](_display_info.md) - [DisplayModeInfo](_display_mode_info.md) - - [EnrolledInfo](_enrolled_info.md) - - [EnrollParam](_enroll_param.md) - - [EnrollResultInfo](_enroll_resultinfo.md) - - [EventInfo](_event_info.md) - - [ExecutorInfo](_executor_info.md) - - [ExecutorInfo](_user_executor_info.md) - - [ExecutorRegisterInfo](_executor_register_info.md) - - [ExecutorSendMsg](_executor_send_msg.md) - - [GetBufferHandleUsageParams](_get_buffer_handle_usage_params.md) + - [ExtDataHandle](_ex_data_handle.md) - [GfxFuncs](_gfx_funcs.md) - [GfxOpt](_gfx_opt.md) - [GrallocFuncs](_gralloc_funcs.md) - - [HdfFeatureInfo](_hdf_feature_info.md) - - [HdfLightColor](_hdf_light_color.md) - - [HdfLightEffect](_hdf_light_effect.md) - - [HdfLightFlashEffect](_hdf_light_flash_effect.md) - - [HdfLightInfo](_hdf_light_info.md) - - [HdfMotionEvent](_hdf_motion_event.md) - - [HdfNetDeviceInfo](_hdf_net_device_info.md) - - [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) - - [HdfSensorEvents](_hdf_sensor_events.md) - - [HdfSensorInformation](_hdf_sensor_information.md) - - [HdfStaInfo](_hdf_sta_info.md) - - [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) - - [HdfVibratorInfo](_hdf_vibrator_info.md) - - [HdfWifiDriverScanSsid](_hdf_wifi_driver_scan_ssid.md) - - [HdfWifiInfo](_hdf_wifi_info.md) - - [HdfWifiScan](_hdf_wifi_scan.md) - - [HdfWifiScanResult](_hdf_wifi_scan_result.md) - [HDRCapability](_h_d_r_capability.md) - [HDRMetaData](_h_d_r_meta_data.md) - - [IActivityChangedCallback](interface_i_activity_changed_callback.md) - - [IActivityInterface](interface_i_activity_interface.md) - - [IBatteryCallback](interface_i_battery_callback.md) - - [IBatteryInterface](interface_i_battery_interface.md) - - [ICameraDevice](interface_i_camera_device.md) - - [ICameraDeviceCallback](interface_i_camera_device_callback.md) - - [ICameraHost](interface_i_camera_host.md) - - [ICameraHostCallback](interface_i_camera_host_callback.md) - [ICircle](_i_circle.md) - - [IdentifyResultInfo](_identify_result_info.md) - - [IExecutor](interface_i_executor.md) - - [IExecutor](interface_pin_i_executor.md) - - [IExecutorCallback](interface_i_executor_callback.md) - - [IExecutorCallback](interface_pin_i_executor_callback.md) - - [IFaceAuthInterface](interface_i_face_auth_interface.md) - [ILine](_i_line.md) - - [IInputInterface](_i_input_interface.md) - - [ILightInterface](interface_i_light_interface.md) - - [IMotionCallback](interface_i_motion_callback.md) - - [IMotionInterface](interface_i_motion_interface.md) - - [InputController](_input_controller.md) - - [InputDevAbility](_input_dev_ability.md) - - [InputDevAttr](_input_dev_attr.md) - - [InputDevDesc](_input_dev_desc.md) - - [InputDeviceInfo](_input_device_info.md) - - [InputDevIdentify](_input_dev_identify.md) - - [InputDimensionInfo](_input_dimension_info.md) - - [InputEventCb](_input_event_cb.md) - - [InputEventPackage](_input_event_package.md) - - [IPowerHdiCallback](interface_i_power_hdi_callback.md) - - [InputExtraCmd](_input_extra_cmd.md) - - [InputHostCb](_input_host_cb.md) - - [InputHotPlugEvent](_input_hot_plug_event.md) - - [InputManager](_input_manager.md) - - [InputReporter](_input_reporter.md) - - [IOfflineStreamOperator](interface_i_offline_stream_operator.md) - - [IPinAuthInterface](interface_i_pin_auth_interface.md) - - [IPowerInterface](interface_i_power_interface.md) - [IRect](_i_rect.md) - - [ISensorCallback](interface_i_sensor_callback.md) - - [ISensorInterface](interface_i_sensor_interface.md) - - [IStreamOperator](interface_i_stream_operator.md) - - [IStreamOperatorCallback](interface_i_stream_operator_callback.md) - [ISurface](_i_surface.md) - - [IThermalCallback](interface_i_thermal_callback.md) - - [IThermalInterface](interface_i_thermal_interface.md) - - [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) - - [IUsbdSubscriber](interface_i_usbd_subscriber.md) - - [IUsbInterface](interface_i_usb_interface.md) - - [IUserAuthInterface](interface_i_user_auth_interface.md) - - [IVibratorInterface](interface_i_vibrator_interface.md) - - [IWlanCallback](interface_i_wlan_callback.md) - - [IWlanInterface](interface_i_wlan_interface.md) - [LayerAlpha](_layer_alpha.md) - [LayerBuffer](_layer_buffer.md) - [LayerFuncs](_layer_funcs.md) - [LayerInfo](_layer_info.md) - - [MeasChannelParam](_meas_channel_param.md) - - [MeasChannelResult](_meas_channel_result.md) - - [OmxCodecBuffer](_omx_codec_buffer.md) - - [PortCap](union_port_cap.md) - - [PortInfo](_port_info.md) - [PresentTimestamp](_present_timestamp.md) - [PropertyObject](_property_object.md) - - [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) - - [RangeValue](_range_value.md) - - [Rect](_rect.md) - [Rectangle](_rectangle.md) - - [RGBColor](_r_g_b_color.md) - - [ScheduleInfo](_schedule_info.md) - - [StreamAttribute](_stream_attribute.md) - - [StreamInfo](_stream_info.md) - - [SupportBufferType](_support_buffer_type.md) - - [TemplateInfo](_template_info.md) - - [ThermalZoneInfo](_thermal_zone_info.md) - - [UsbCtrlTransfer](_usb_ctrl_transfer.md) - - [UsbDev](_usb_dev.md) - - [USBDeviceInfo](_u_s_b_device_info.md) - - [UsbPipe](_usb_pipe.md) - - [UseBufferType](_use_buffer_type.md) - [VerifyAllocInfo](_verify_alloc_info.md) - [VGUBuffer](_v_g_u_buffer.md) - [VGUColorStop](_v_g_u_color_stop.md) @@ -271,6 +240,284 @@ - [VGUSolid](_v_g_u_solid.md) - [VGUStrokeAttr](_v_g_u_stroke_attr.md) - [VGUSurface](_v_g_u_surface.md) - - [VideoPortCap](_video_port_cap.md) - - [WifiStationInfo](_wifi_station_info.md) + - [YUVDescInfo](_yuv_desc_info.md) + - HdfFaceAuth模块结构体 + - [ExecutorInfo](_executor_info_faceauth.md) + - [IExecutor](interface_i_executor_faceauth.md) + - [IExecutorCallback](interface_i_executor_callback_faceauth.md) + - [IFaceAuthInterface](interface_i_face_auth_interface.md) + - [TemplateInfo](_template_info_faceauth.md) + - HdfPinAuth模块结构体 + - [ExecutorInfo](_executor_info_pinauth.md) + - [IExecutor](interface_i_executor_pinauth.md) + - [IExecutorCallback](interface_i_executor_callback_pinauth.md) + - [IPinAuthInterface](interface_i_pin_auth_interface.md) + - [TemplateInfo](_template_info_pinauth.md) + - HdfUserAuth模块结构体 + - [AuthResultInfo](_auth_result_info.md) + - [AuthSolution](_auth_solution.md) + - [CredentialInfo](_credential_info.md) + - [EnrolledInfo](_enrolled_info.md) + - [EnrollParam](_enroll_param.md) + - [EnrollResultInfo](_enroll_result_info.md) + - [ExecutorInfo](_executor_info_userauth.md) + - [ExecutorRegisterInfo](_executor_register_info.md) + - [ExecutorSendMsg](_executor_send_msg.md) + - [IdentifyResultInfo](_identify_result_info.md) + - [IUserAuthInterface](interface_i_user_auth_interface.md) + - [ScheduleInfo](_schedule_info.md) + - HdiActivityRecognition模块结构体 + - [ActRecognitionEvent](_act_recognition_event.md) + - [IActivityChangedCallback](interface_i_activity_changed_callback.md) + - [IActivityInterface](interface_i_activity_interface.md) + - HdiLpfenceCellbatching模块结构体 + - [CellbatchingRequest](_cellbatching_request.md) + - [CellTrajectoryData](_cell_trajectory_data.md) + - [ICellbatchingCallback](interface_i_cellbatching_callback.md) + - [ICellbatchingInterface](interface_i_cellbatching_interface.md) + - HdiLpfenceCellfence模块结构体 + - [CellfenceInfo](_cellfence_info.md) + - [CellfenceRequest](_cellfence_request.md) + - [CellfenceSize](_cellfence_size.md) + - [CellfenceStatus](_cellfence_status.md) + - [ICellfenceCallback](interface_i_cellfence_callback.md) + - [ICellfenceInterface](interface_i_cellfence_interface.md) + - HdiLpfenceGeofence模块结构体 + - [CurrentCell](_current_cell.md) + - [GeofenceCellInfo](_geofence_cell_info.md) + - [GeofenceCircleRequest](_geofence_circle_request.md) + - [GeofencePolygonRequest](_geofence_polygon_request.md) + - [GeofenceResult](_geofence_result.md) + - [GeofenceSize](_geofence_size.md) + - [GeoLocationInfo](_geo_location_info.md) + - [IGeofenceCallback](interface_i_geofence_callback.md) + - [IGeofenceInterface](interface_i_geofence_interface.md) + - [NeighborCell](_neighbor_cell.md) + - [OfflineDb](_offline_db.md) + - [Point](_point.md) + - [RequestCellDb](_request_cell_db.md) + - HdiLpfenceWififence模块结构体 + - [IWififenceCallback](interface_i_wififence_callback.md) + - [IWififenceInterface](interface_i_wififence_interface.md) + - [WififenceRequest](_wififence_request.md) + - [WififenceSize](_wififence_size.md) + + + - Input模块结构体 + - [IInputInterface](_i_input_interface.md) + - [InputController](_input_controller.md) + - [InputDevAbility](_input_dev_ability.md) + - [InputDevAttr](_input_dev_attr.md) + - [InputDevDesc](_input_dev_desc.md) + - [InputDeviceInfo](_input_device_info.md) + - [InputDevIdentify](_input_dev_identify.md) + - [InputDimensionInfo](_input_dimension_info.md) + - [InputEventCb](_input_event_cb.md) + - [InputEventPackage](_input_event_package.md) + - [InputExtraCmd](_input_extra_cmd.md) + - [InputHostCb](_input_host_cb.md) + - [InputHotPlugEvent](_input_hot_plug_event.md) + - [InputManager](_input_manager.md) + - [InputReporter](_input_reporter.md) + - Light模块结构体 + - [ColorValue](union_color_value.md) + - [HdfLightColor](_hdf_light_color.md) + - [HdfLightEffect](_hdf_light_effect.md) + - [HdfLightFlashEffect](_hdf_light_flash_effect.md) + - [HdfLightInfo](_hdf_light_info.md) + - [ILightInterface](interface_i_light_interface.md) + - [RGBColor](_r_g_b_color.md) - [WRGBColor](_w_r_g_b_color.md) + - Motion模块结构体 + - [HdfMotionEvent](_hdf_motion_event.md) + - [IMotionCallback](interface_i_motion_callback.md) + - [IMotionInterface](interface_i_motion_interface.md) + - NNRt模块结构体 + - [Activation](_activation.md) + - [AddFusion](_add_fusion.md) + - [ArgMaxFusion](_arg_max_fusion.md) + - [AvgPoolFusion](_avg_pool_fusion.md) + - [BatchToSpaceND](_batch_to_space_n_d.md) + - [BiasAdd](_bias_add.md) + - [Cast](_cast.md) + - [Concat](_concat.md) + - [Conv2DFusion](_conv2_d_fusion.md) + - [Conv2dTransposeFusion](_conv2d_transpose_fusion.md) + - [DivFusion](_div_fusion.md) + - [Eltwise](_eltwise.md) + - [ExpandDims](_expand_dims.md) + - [Fill](_fill.md) + - [FullConnection](_full_connection.md) + - [FusedBatchNorm](_fused_batch_norm.md) + - [Gather](_gather.md) + - [INnrtDevice](interface_i_nnrt_device.md) + - [IOTensor](_i_o_tensor.md) + - [IPreparedModel](interface_i_prepared_model.md) + - [LayerNormFusion](_layer_norm_fusion.md) + - [LessEqual](_less_equal.md) + - [MatMulFusion](_mat_mul_fusion.md) + - [Maximum](_maximum.md) + - [MaxPoolFusion](_max_pool_fusion.md) + - [Model](_model.md) + - [ModelConfig](_model_config.md) + - [MulFusion](_mul_fusion.md) + - [Node](_node.md) + - [OneHot](_one_hot.md) + - [PadFusion](_pad_fusion.md) + - [PowFusion](_pow_fusion.md) + - [PReLUFusion](_p_re_l_u_fusion.md) + - [QuantDTypeCast](_quant_d_type_cast.md) + - [QuantParam](_quant_param.md) + - [ReduceFusion](_reduce_fusion.md) + - [Reshape](_reshape.md) + - [Resize](_resize.md) + - [Rsqrt](_rsqrt.md) + - [ScaleFusion](_scale_fusion.md) + - [Shape](_shape.md) + - [SharedBuffer](_shared_buffer.md) + - [SliceFusion](_slice_fusion.md) + - [Softmax](_softmax.md) + - [SpaceToBatchND](_space_to_batch_n_d.md) + - [Split](_split.md) + - [Sqrt](_sqrt.md) + - [SquaredDifference](_squared_difference.md) + - [Squeeze](_squeeze.md) + - [Stack](_stack.md) + - [StridedSlice](_strided_slice.md) + - [SubFusion](_sub_fusion.md) + - [SubGraph](_sub_graph.md) + - [Tensor](_tensor.md) + - [TileFusion](_tile_fusion.md) + - [TopKFusion](_top_k_fusion.md) + - [Transpose](_transpose.md) + - [Unsqueeze](_unsqueeze.md) + - Power模块结构体 + - [IPowerHdiCallback](interface_i_power_hdi_callback.md) + - [IPowerInterface](interface_i_power_interface.md) + - Ril模块结构体 + - [ApduSimIORequestInfo](_apdu_sim_i_o_request_info.md) + - [AvailableNetworkInfo](_available_network_info.md) + - [AvailableNetworkList](_available_network_list.md) + - [CallForwardQueryInfoList](_call_forward_query_info_list.md) + - [CallForwardQueryResult](_call_forward_query_result.md) + - [CallForwardSetInfo](_call_forward_set_info.md) + - [CallInfo](_call_info.md) + - [CallInfoList](_call_info_list.md) + - [CallRestrictionInfo](_call_restriction_info.md) + - [CallRestrictionResult](_call_restriction_result.md) + - [CallWaitResult](_call_wait_result.md) + - [CardStatusInfo](_card_status_info.md) + - [CBConfigInfo](_c_b_config_info.md) + - [CBConfigReportInfo](_c_b_config_report_info.md) + - [CdmaCBConfigInfo](_cdma_c_b_config_info.md) + - [CdmaCBConfigInfoList](_cdma_c_b_config_info_list.md) + - [CdmaRssi](_cdma_rssi.md) + - [CellListCurrentInfo](_cell_list_current_info.md) + - [CellListNearbyInfo](_cell_list_nearby_info.md) + - [CellListRatCdma](_cell_list_rat_cdma.md) + - [CellListRatGsm](_cell_list_rat_gsm.md) + - [CellListRatLte](_cell_list_rat_lte.md) + - [CellListRatNr](_cell_list_rat_nr.md) + - [CellListRatTdscdma](_cell_list_rat_tdscdma.md) + - [CellListRatWcdma](_cell_list_rat_wcdma.md) + - [CellNearbyInfo](_cell_nearby_info.md) + - [CellRatCdma](_cell_rat_cdma.md) + - [CellRatGsm](_cell_rat_gsm.md) + - [CellRatLte](_cell_rat_lte.md) + - [CellRatNr](_cell_rat_nr.md) + - [CellRatTdscdma](_cell_rat_tdscdma.md) + - [CellRatWcdma](_cell_rat_wcdma.md) + - [ChannelConfigInfoList](_channel_config_info_list.md) + - [CsRegStatusInfo](_cs_reg_status_info.md) + - [CurrentCellInfo](_current_cell_info.md) + - [CurrentServiceCellParas](union_current_service_cell_paras.md) + - [DataCallInfo](_data_call_info.md) + - [DataCallResultList](_data_call_result_list.md) + - [DataLinkBandwidthInfo](_data_link_bandwidth_info.md) + - [DataLinkBandwidthReportingRule](_data_link_bandwidth_reporting_rule.md) + - [DataPerformanceInfo](_data_performance_info.md) + - [DataProfileDataInfo](_data_profile_data_info.md) + - [DataProfilesInfo](_data_profiles_info.md) + - [DataSleepInfo](_data_sleep_info.md) + - [DialInfo](_dial_info.md) + - [DtmfInfo](_dtmf_info.md) + - [EmergencyCall](_emergency_call.md) + - [EmergencyInfoList](_emergency_info_list.md) + - [GetClipResult](_get_clip_result.md) + - [GetClirResult](_get_clir_result.md) + - [GsmRssi](_gsm_rssi.md) + - [GsmSmsMessageInfo](_gsm_sms_message_info.md) + - [IccIoResultInfo](_icc_io_result_info.md) + - [IRil](interface_i_ril.md) + - [IRilCallback](interface_i_ril_callback.md) + - [LockStatusResp](_lock_status_resp.md) + - [LteRssi](_lte_rssi.md) + - [ModeData](_mode_data.md) + - [NrRssi](_nr_rssi.md) + - [OpenLogicalChannelResponse](_open_logical_channel_response.md) + - [OperatorInfo](_operator_info.md) + - [PhysicalChannelConfig](_physical_channel_config.md) + - [PreferredNetworkTypeInfo](_preferred_network_type_info.md) + - [PsRegStatusInfo](_ps_reg_status_info.md) + - [RadioProtocol](_radio_protocol.md) + - [RilRadioResponseInfo](_ril_radio_response_info.md) + - [RingbackVoice](_ringback_voice.md) + - [Rssi](_rssi.md) + - [SendCdmaSmsMessageInfo](_send_cdma_sms_message_info.md) + - [SendSmsResultInfo](_send_sms_result_info.md) + - [ServiceCellParas](union_service_cell_paras.md) + - [ServiceCenterAddress](_service_center_address.md) + - [SetBarringInfo](_set_barring_info.md) + - [SetNetworkModeInfo](_set_network_mode_info.md) + - [SetupDataCallResultInfo](_setup_data_call_result_info.md) + - [SimAuthenticationRequestInfo](_sim_authentication_request_info.md) + - [SimIoRequestInfo](_sim_io_request_info.md) + - [SimLockInfo](_sim_lock_info.md) + - [SimPasswordInfo](_sim_password_info.md) + - [SimPinInputTimes](_sim_pin_input_times.md) + - [SmsMessageInfo](_sms_message_info.md) + - [SmsMessageIOInfo](_sms_message_i_o_info.md) + - [SrvccStatus](_srvcc_status.md) + - [SsNoticeInfo](_ss_notice_info.md) + - [TdScdmaRssi](_td_scdma_rssi.md) + - [UniInfo](_uni_info.md) + - [UssdNoticeInfo](_ussd_notice_info.md) + - [VoiceRadioTechnology](_voice_radio_technology.md) + - [WcdmaRssi](_wcdma_rssi.md) + - Sensor模块结构体 + - [HdfSensorEvents](_hdf_sensor_events.md) + - [HdfSensorInformation](_hdf_sensor_information.md) + - [ISensorCallback](interface_i_sensor_callback.md) + - [ISensorInterface](interface_i_sensor_interface.md) + - Thermal模块结构体 + - [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) + - [IThermalCallback](interface_i_thermal_callback.md) + - [IThermalInterface](interface_i_thermal_interface.md) + - [ThermalZoneInfo](_thermal_zone_info.md) + - USB模块结构体 + - [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) + - [IUsbdSubscriber](interface_i_usbd_subscriber.md) + - [IUsbInterface](interface_i_usb_interface.md) + - [PortInfo](_port_info.md) + - [UsbCtrlTransfer](_usb_ctrl_transfer.md) + - [UsbDev](_usb_dev.md) + - [USBDeviceInfo](_u_s_b_device_info.md) + - [UsbPipe](_usb_pipe.md) + - Vibrator模块结构体 + - [HdfVibratorInfo](_hdf_vibrator_info.md) + - [IVibratorInterface](interface_i_vibrator_interface.md) + - WLAN模块结构体 + - [HdfFeatureInfo](_hdf_feature_info.md) + - [HdfNetDeviceInfo](_hdf_net_device_info.md) + - [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) + - [HdfStaInfo](_hdf_sta_info.md) + - [HdfWifiDriverScanSsid](_hdf_wifi_driver_scan_ssid.md) + - [HdfWifiInfo](_hdf_wifi_info.md) + - [HdfWifiScan](_hdf_wifi_scan.md) + - [HdfWifiScanResult](_hdf_wifi_scan_result.md) + - [IWlanCallback](interface_i_wlan_callback.md) + - [IWlanInterface](interface_i_wlan_interface.md) + - [MeasChannelParam](_meas_channel_param.md) + - [MeasChannelResult](_meas_channel_result.md) + - [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) + - [WifiStationInfo](_wifi_station_info.md) \ No newline at end of file diff --git a/zh-cn/device-dev/reference/hdi-apis/_act_recognition_event.md b/zh-cn/device-dev/reference/hdi-apis/_act_recognition_event.md index be0a24cf5da6609d76c3ae7dc8d6bc8ebfeb0ae5..1f8128bc9c58927a087020fedf20f98b1c261338 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_act_recognition_event.md +++ b/zh-cn/device-dev/reference/hdi-apis/_act_recognition_event.md @@ -1,37 +1,33 @@ # ActRecognitionEvent -## **概述** +## 概述 -定义行为识别模块使用的数据类型。 +定义行为事件上报的数据结构。 -**Since**: +**Since:** 3.2 -**Version**: - -1.0 - **相关模块:** -[HdiActivityRecognition](activity_recognition.md) +[HdiActivityRecognition](_hdi_activity_recognition.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [activity](#activity) | 行为类型 | -| [eventType](#eventtype) | 事件类型 | -| [timestamp](#timestamp) | 时间戳 | -| [confidence](#confidence) | 置信度 | +| [activity](#activity) | int
行为类型,详见[ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype)。 | +| [eventType](#eventtype) | int
事件类型,详见[ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype)。 | +| [timestamp](#timestamp) | long
时间戳 | +| [confidence](#confidence) | int
置信度,100为最可信,0为最不可信,-1为该行为不支持置信度的计算。 | -## **类成员变量说明** +## 类成员变量说明 ### activity @@ -41,9 +37,9 @@ int ActRecognitionEvent::activity ``` -**描述:** +**描述:** -行为类型,详见[ActRecognitionEventType](activity_recognition.md#actrecognitioneventtype)。 +行为类型,详见[ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype)。 ### confidence @@ -53,7 +49,7 @@ int ActRecognitionEvent::activity int ActRecognitionEvent::confidence ``` -**描述:** +**描述:** 置信度,100为最可信,0为最不可信,-1为该行为不支持置信度的计算。 @@ -65,9 +61,9 @@ int ActRecognitionEvent::confidence int ActRecognitionEvent::eventType ``` -**描述:** +**描述:** -事件类型,详见[ActRecognitionEventType](activity_recognition.md#actrecognitioneventtype)。 +事件类型,详见[ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype)。 ### timestamp @@ -77,6 +73,6 @@ int ActRecognitionEvent::eventType long ActRecognitionEvent::timestamp ``` -**描述:** +**描述:** -时间戳。 +时间戳 diff --git a/zh-cn/device-dev/reference/hdi-apis/_activation.md b/zh-cn/device-dev/reference/hdi-apis/_activation.md new file mode 100644 index 0000000000000000000000000000000000000000..75fd2cf52b8c0b71b62bafa86b720d7a88625815 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_activation.md @@ -0,0 +1,91 @@ +# Activation + + +## 概述 + +激活类型的算子,所有的激活函数都属于该算子,具体的激活函数类型一句参数来确定。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_ACTIVATION。 + +输入: + +- x,n维张量。 + +输出: + +- 输出x经过激活函数之后的张量。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数类型。  | +| [alpha](#alpha) | float
尺寸因子,用于LeakyReLU和ELU激活函数。  | +| [minVal](#minval) | float
最小值,用于HardTanh激活函数。  | +| [maxVal](#maxval) | float
最大值,用于HardTanh激活函数。  | +| [approximate](#approximate) | boolean
是否使用近似算法,用于GRLU激活函数。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType Activation::activationType +``` +**描述:** +激活函数类型。 + + +### alpha + + +``` +float Activation::alpha +``` +**描述:** +尺寸因子,用于LeakyReLU和ELU激活函数。 + + +### approximate + + +``` +boolean Activation::approximate +``` +**描述:** +是否使用近似算法,用于GRLU激活函数。 + + +### maxVal + + +``` +float Activation::maxVal +``` +**描述:** +最大值,用于HardTanh激活函数。 + + +### minVal + + +``` +float Activation::minVal +``` +**描述:** +最小值,用于HardTanh激活函数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_activity_recognition_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_activity_recognition_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..21d103ba0eeb625179595bc5ac721cb576d19892 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_activity_recognition_types_8idl.md @@ -0,0 +1,43 @@ +# ActivityRecognitionTypes.idl + + +## 概述 + +定义行为识别模块使用的数据类型。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[HdiActivityRecognition](_hdi_activity_recognition.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [ActRecognitionEvent](_act_recognition_event.md) | struct
定义行为事件上报的数据结构。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype) { ACT_RECOGNITION_EVENT_ENTER = 0x01 , ACT_RECOGNITION_EVENT_EXIT = 0x02 } | 枚举行为事件的类型。 | +| [ActRecognitionPowerMode](_hdi_activity_recognition.md#actrecognitionpowermode) { ACT_RECOGNITION_NORMAL_MODE = 0 , ACT_RECOGNITION_LOW_POWER_MODE = 1 } | 枚举功耗模式的类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.activity_recognition.v1_0 | 行为识别模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_add_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_add_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..9e04ac3100e79c4dc25d136d503fa591fc1fb77e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_add_fusion.md @@ -0,0 +1,55 @@ +# AddFusion + + +## 概述 + +输入Tensor逐元素相加, 输出x和y的和,数据形状与输入broadcast之后一样,数据类型与较高精度的输入精度一致。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_ADD_FUSION。 + +输入: + +- x,第一个输入张量。 + +- y,第二个输入张量,数据类型和第一个张量保持一致。 + +输出: + +- output,x和y逐元素相加, 输出x和y的和,数据形状与输入broadcast之后一样,数据类型与较高精度的输入精度一致。 如果配置了activationType则会在输出之前调用指定的激活函数。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数类型。详情请参考:[ActivationType](_n_n_rt.md#activationtype) | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType AddFusion::activationType +``` + +**描述:** + +激活函数类型。详情请参考:[ActivationType](_n_n_rt.md#activationtype) diff --git a/zh-cn/device-dev/reference/hdi-apis/_alignment.md b/zh-cn/device-dev/reference/hdi-apis/_alignment.md index 508dff7fee34820fe172e03b1cc4c60587153ce1..b91e8b1c2f605dbc7faad276ef71eac1fd195816 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_alignment.md +++ b/zh-cn/device-dev/reference/hdi-apis/_alignment.md @@ -1,27 +1,27 @@ # Alignment -## **概述** +## 概述 对齐结构定义,包含宽高的对齐值。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [widthAlignment](#widthalignment) | 宽的对齐值。 | -| [heightAlignment](#heightalignment) | 高的对齐值。 | +| [widthAlignment](#widthalignment) | int32_t
宽的对齐值。  | +| [heightAlignment](#heightalignment) | int32_t
高的对齐值。  | -## **类成员变量说明** +## 类成员变量说明 ### heightAlignment @@ -30,9 +30,7 @@ ``` int32_t Alignment::heightAlignment ``` - -**描述:** - +**描述:** 高的对齐值。 @@ -42,7 +40,5 @@ int32_t Alignment::heightAlignment ``` int32_t Alignment::widthAlignment ``` - -**描述:** - +**描述:** 宽的对齐值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_alloc_info.md b/zh-cn/device-dev/reference/hdi-apis/_alloc_info.md index b75e855aa644a53d4a51f52124346e34c4368d9c..692cb5eac9e95d8e9761ebfa84dbf914f7a54d0d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_alloc_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_alloc_info.md @@ -1,24 +1,24 @@ # AllocInfo -## **概述** +## 概述 -定义待分配的内存的信息。 +定义关于要分配的内存的信息。 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [width](_display.md#width-69) | 申请内存宽度 | -| [height](_display.md#height-68) | 申请内存高度 | -| [usage](_display.md#usage-12) | 申请内存的使用场景 | -| [format](_display.md#format-12) | 申请内存格式 | -| [expectedSize](_display.md#expectedsize) | 申请内存大小 | +| [width](_display.md#width-69) | uint32_t
申请内存宽度 | +| [height](_display.md#height-68) | uint32_t
申请内存高度 | +| [usage](_display.md#usage-12) | uint64_t
申请内存的使用场景 | +| [format](_display.md#format-12) | [PixelFormat](_display.md#pixelformat)
申请内存格式 | +| [expectedSize](_display.md#expectedsize) | uint32_t
申请内存大小 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_apdu_sim_i_o_request_info.md b/zh-cn/device-dev/reference/hdi-apis/_apdu_sim_i_o_request_info.md new file mode 100644 index 0000000000000000000000000000000000000000..e01fa6ea44f763fa0a707896cf69bf5b4905eb0f --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_apdu_sim_i_o_request_info.md @@ -0,0 +1,110 @@ +# ApduSimIORequestInfo + + +## 概述 + +APDU数据传输请求信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [channelId](#channelid) | int
通道ID  | +| [type](#type) | int
APDU指令类型,参考ETSI 102 221 [55]  | +| [instruction](#instruction) | int
APDU指令,参考ETSI 102 221 [55]  | +| [p1](#p1) | int
SIM数据请求命令参数,参考3GPP TS 51.011[28]  | +| [p2](#p2) | int
SIM数据请求命令参数2,参考3GPP TS 51.011[28]  | +| [p3](#p3) | int
SIM数据请求命令参数3,参考3GPP TS 51.011[28] 如果p3为负值,则会向SIM发送一个4字节的APDU  | +| [data](#data) | String
请求传输的数据信息  | + + +## 类成员变量说明 + + +### channelId + + +``` +int ApduSimIORequestInfo::channelId +``` +**描述:** +通道ID + + +### data + + +``` +String ApduSimIORequestInfo::data +``` +**描述:** +请求传输的数据信息 + + +### instruction + + +``` +int ApduSimIORequestInfo::instruction +``` +**描述:** +APDU指令,参考ETSI 102 221 [55] + + +### p1 + + +``` +int ApduSimIORequestInfo::p1 +``` +**描述:** +SIM数据请求命令参数,参考3GPP TS 51.011[28] + + +### p2 + + +``` +int ApduSimIORequestInfo::p2 +``` +**描述:** +SIM数据请求命令参数2,参考3GPP TS 51.011[28] + + +### p3 + + +``` +int ApduSimIORequestInfo::p3 +``` +**描述:** +SIM数据请求命令参数3,参考3GPP TS 51.011[28] 如果p3为负值,则会向SIM发送一个4字节的APDU + + +### serial + + +``` +int ApduSimIORequestInfo::serial +``` +**描述:** +请求的序列号 + + +### type + + +``` +int ApduSimIORequestInfo::type +``` +**描述:** +APDU指令类型,参考ETSI 102 221 [55] diff --git a/zh-cn/device-dev/reference/hdi-apis/_arg_max_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_arg_max_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..f01668424335aafbcbe48ccf7135a4f8ad1ecbc4 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_arg_max_fusion.md @@ -0,0 +1,80 @@ +# ArgMaxFusion + + +## 概述 + +返回跨轴的tensor前K个索引或者是数值。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_ARGMAX_FUSION。 + +输入: + +- x,n维tensor,输入张量(N,\*),其中\*意味着数量任意的附加维度。 + +输出: + +- output,轴上输入张量最大值的前K个索引或者是数值。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long
指定求最大值索引的维度。  | +| [topK](#topk) | long
轴上前K个最大值。  | +| [keepDims](#keepdims) | boolean
是否保持输出维度和输入的维度是否相同。  | +| [outMaxValue](#outmaxvalue) | boolean
若为false则输出索引,为true则输出数值,默认为false。  | + + +## 类成员变量说明 + + +### axis + + +``` +long ArgMaxFusion::axis +``` +**描述:** +指定求最大值索引的维度。 + + +### keepDims + + +``` +boolean ArgMaxFusion::keepDims +``` +**描述:** +是否保持输出维度和输入的维度是否相同。 + + +### outMaxValue + + +``` +boolean ArgMaxFusion::outMaxValue +``` +**描述:** +若为false则输出索引,为true则输出数值,默认为false。 + + +### topK + + +``` +long ArgMaxFusion::topK +``` +**描述:** +轴上前K个最大值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio.md b/zh-cn/device-dev/reference/hdi-apis/_audio.md index 9dde93d0d7f47911dc97740ccf20f51b7a7ad570..4e9cfad3426e420db829c29e59555f6a5e09c5f5 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio.md @@ -1,210 +1,101 @@ # Audio -## **概述** +## 概述 Audio模块接口定义。 -音频接口涉及自定义类型、驱动加载接口、驱动适配器接口、音频播放(Render)接口、音频录音(Capture)接口等。 +音频接口涉及数据类型、驱动加载接口、驱动适配器接口、音频播放接口、音频录音接口等。 -**Since**: +**Since:** -1.0 +3.2 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 | 名称 | 描述 | | -------- | -------- | -| [audio_adapter.h](audio__adapter_8h.md) | Audio适配器的接口定义文件 | -| [audio_attribute.h](audio__attribute_8h.md) | Audio属性的接口定义文件 | -| [audio_capture.h](audio__capture_8h.md) | Audio录音的接口定义文件 | -| [audio_control.h](audio__control_8h.md) | Audio控制的接口定义文件 | -| [audio_manager.h](audio__manager_8h.md) | Audio适配器管理及加载的接口定义文件 | -| [audio_render.h](audio__render_8h.md) | Audio播放的接口定义文件 | -| [audio_scene.h](audio__scene_8h.md) | Audio场景的接口定义文件 | -| [audio_types.h](audio__types_8h.md) | Audio模块接口定义中使用的自定义数据类型 | -| [audio_volume.h](audio__volume_8h.md) | Audio音量的接口定义文件 | +| [AudioTypes.idl](_audio_types_8idl.md) | Audio模块接口定义中使用的数据类型。 | +| [IAudioAdapter.idl](_i_audio_adapter_8idl.md) | Audio适配器的接口定义文件。 | +| [IAudioCallback.idl](_i_audio_callback_8idl.md) | Audio播放的回调函数定义文件。 | +| [IAudioCapture.idl](_i_audio_capture_8idl.md) | Audio录音的接口定义文件。 | +| [IAudioManager.idl](_i_audio_manager_8idl.md) | Audio适配器管理及加载的接口定义文件。 | +| [IAudioRender.idl](_i_audio_render_8idl.md) | Audio播放的接口定义文件。 | ### 类 | 名称 | 描述 | | -------- | -------- | -| [AudioAdapter](_audio_adapter.md) | AudioAdapter音频适配器接口 | -| [AudioAttribute](_audio_attribute.md) | AudioAttribute音频属性接口 | -| [AudioCapture](_audio_capture.md) | AudioCapture音频录音接口 | -| [AudioControl](_audio_control.md) | AudioControl音频控制接口 | -| [AudioManager](_audio_manager.md) | AudioManager音频适配器管理接口 | -| [AudioRender](_audio_render.md) | AudioRender音频播放接口 | -| [AudioScene](_audio_scene.md) | AudioScene音频场景接口 | -| [AudioPort](_audio_port.md) | 音频端口 | -| [AudioAdapterDescriptor](_audio_adapter_descriptor.md) | 音频适配器描述符 | -| [AudioDeviceDescriptor](_audio_device_descriptor.md) | 音频设备描述符 | -| [AudioSceneDescriptor](_audio_scene_descriptor.md) | 音频场景描述符 | -| [AudioSceneDescriptor::SceneDesc](union_audio_scene_descriptor_1_1_scene_desc.md) | 音频场景描述 | -| [AudioSampleAttributes](_audio_sample_attributes.md) | 音频采样属性 | -| [AudioTimeStamp](_audio_time_stamp.md) | 音频时间戳 | -| [AudioSubPortCapability](_audio_sub_port_capability.md) | 音频子端口的支持能力 | -| [AudioPortCapability](_audio_port_capability.md) | 音频端口的支持能力 | -| [AudioMmapBufferDescriptor](_audio_mmap_buffer_descriptor.md) | mmap缓冲区描述符 | -| [AudioDevExtInfo](_audio_dev_ext_info.md) | 音频设备拓展信息 | -| [AudioMixExtInfo](_audio_mix_ext_info.md) | 音轨拓展信息 | -| [AudioSessionExtInfo](_audio_session_ext_info.md) | 会话拓展信息 | -| [AudioRouteNode](_audio_route_node.md) | 音频路由节点 | -| [AudioRoute](_audio_route.md) | 音频路由信息 | -| [AudioVolume](_audio_volume.md) | AudioVolume音频音量接口 | - - -### 类型定义 - - | 名称 | 描述 | -| -------- | -------- | -| AudioHandle | 音频句柄 | -| ([RenderCallback](#rendercallback)) (enum AudioCallbackType, void \*reserved, void \*cookie) | 回调函数指针 | +| [AudioDeviceStatus](_audio_device_status.md) | struct
音频设备状态。 | +| [SceneDesc](union_scene_desc.md) | union
音频场景描述。 | +| [AudioPort](_audio_port.md) | struct
音频端口。 | +| [AudioAdapterDescriptor](_audio_adapter_descriptor.md) | struct
音频适配器描述符。 | +| [AudioDeviceDescriptor](_audio_device_descriptor.md) | struct
音频设备描述符。 | +| [AudioSceneDescriptor](_audio_scene_descriptor.md) | struct
音频场景描述符。 | +| [AudioSampleAttributes](_audio_sample_attributes.md) | struct
音频采样属性。 | +| [AudioTimeStamp](_audio_time_stamp.md) | struct
音频时间戳。 | +| [AudioSubPortCapability](_audio_sub_port_capability.md) | struct
音频子端口的支持能力。 | +| [AudioPortCapability](_audio_port_capability.md) | struct
音频端口的支持能力。 | +| [AudioMmapBufferDescripter](_audio_mmap_buffer_descripter.md) | struct
mmap缓冲区描述符。 | +| [AudioDevExtInfo](_audio_dev_ext_info.md) | struct
音频设备拓展信息。 | +| [AudioMixExtInfo](_audio_mix_ext_info.md) | struct
音轨拓展信息。 | +| [AudioSessionExtInfo](_audio_session_ext_info.md) | struct
会话拓展信息。 | +| [AudioInfo](_audio_info.md) | struct
音频端口特定信息。 | +| [AudioRouteNode](_audio_route_node.md) | struct
音频路由节点。 | +| [AudioRoute](_audio_route.md) | struct
音频路由信息。 | +| [AudioEvent](_audio_event.md) | struct
音频事件。 | +| [IAudioAdapter](interface_i_audio_adapter.md) | interface
AudioAdapter音频适配器接口。 | +| [IAudioCallback](interface_i_audio_callback.md) | interface
Audio回调接口。 | +| [IAudioCapture](interface_i_audio_capture.md) | interface
AudioCapture音频录音接口。 | +| [IAudioManager](interface_i_audio_manager.md) | interface
AudioManager音频适配器管理接口。 | +| [IAudioRender](interface_i_audio_render.md) | interface
AudioRender音频播放接口。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [AudioPortDirection](#audioportdirection) { PORT_OUT = 0x1u, PORT_IN = 0x2u, PORT_OUT_IN = 0x3u } | 音频端口的类型 | -| [AudioPortPin](#audioportpin) { PIN_NONE = 0x0u, PIN_OUT_SPEAKER = 0x1u, PIN_OUT_HEADSET = 0x2u, PIN_OUT_LINEOUT = 0x4u,   PIN_OUT_HDMI = 0x8u, PIN_OUT_USB = 0x10u, PIN_OUT_USB_EXT = 0x20u, PIN_IN_MIC = 0x8000001u,   PIN_IN_HS_MIC = 0x8000002u, PIN_IN_LINEIN = 0x8000004u, PIN_IN_USB_EXT = 0x8000008u } | 音频适配器端口的PIN脚 | -| [AudioCategory](#audiocategory) { AUDIO_IN_MEDIA = 0, AUDIO_IN_COMMUNICATION, AUDIO_IN_RINGTONE, AUDIO_IN_CALL } | 音频类型(category) | -| [AudioFormat](#audioformat){ AUDIO_FORMAT_PCM_8_BIT = 0x1u, AUDIO_FORMAT_PCM_16_BIT = 0x2u, AUDIO_FORMAT_PCM_24_BIT = 0x3u, AUDIO_FORMAT_PCM_32_BIT = 0x4u,   AUDIO_FORMAT_AAC_MAIN = 0x1000001u, AUDIO_FORMAT_AAC_LC = 0x1000002u, AUDIO_FORMAT_AAC_LD = 0x1000003u, AUDIO_FORMAT_AAC_ELD = 0x1000004u,   AUDIO_FORMAT_AAC_HE_V1 = 0x1000005u, AUDIO_FORMAT_AAC_HE_V2 = 0x1000006u, AUDIO_FORMAT_G711A = 0x2000001u, AUDIO_FORMAT_G711U = 0x2000002u,   AUDIO_FORMAT_G726 = 0x2000003u } | 音频格式 | -| [AudioChannelMask](#audiochannelmask){ AUDIO_CHANNEL_FRONT_LEFT = 0x1, AUDIO_CHANNEL_FRONT_RIGHT = 0x2, AUDIO_CHANNEL_MONO = 0x1u, AUDIO_CHANNEL_STEREO = 0x3u } | 音频通道掩码(mask) | -| [AudioSampleRatesMask](#audiosampleratesmask){ AUDIO_SAMPLE_RATE_MASK_8000 = 0x1u, AUDIO_SAMPLE_RATE_MASK_12000 = 0x2u, AUDIO_SAMPLE_RATE_MASK_11025 = 0x4u, AUDIO_SAMPLE_RATE_MASK_16000 = 0x8u,   AUDIO_SAMPLE_RATE_MASK_22050 = 0x10u, AUDIO_SAMPLE_RATE_MASK_24000 = 0x20u, AUDIO_SAMPLE_RATE_MASK_32000 = 0x40u, AUDIO_SAMPLE_RATE_MASK_44100 = 0x80u,   AUDIO_SAMPLE_RATE_MASK_48000 = 0x100u, AUDIO_SAMPLE_RATE_MASK_64000 = 0x200u, AUDIO_SAMPLE_RATE_MASK_96000 = 0x400u, AUDIO_SAMPLE_RATE_MASK_INVALID = 0xFFFFFFFFu } | 音频采样频率MASK | -| [AudioPortPassthroughMode](#audioportpassthroughmode){ PORT_PASSTHROUGH_LPCM = 0x1, PORT_PASSTHROUGH_RAW = 0x2, PORT_PASSTHROUGH_HBR2LBR = 0x4, PORT_PASSTHROUGH_AUTO = 0x8 } | 音频端口的数据透传模式 | -| [AudioSampleFormat](#audiosampleformat){ AUDIO_SAMPLE_FORMAT_S8, AUDIO_SAMPLE_FORMAT_S8P, AUDIO_SAMPLE_FORMAT_U8, AUDIO_SAMPLE_FORMAT_U8P,   AUDIO_SAMPLE_FORMAT_S16, AUDIO_SAMPLE_FORMAT_S16P, AUDIO_SAMPLE_FORMAT_U16, AUDIO_SAMPLE_FORMAT_U16P,   AUDIO_SAMPLE_FORMAT_S24, AUDIO_SAMPLE_FORMAT_S24P, AUDIO_SAMPLE_FORMAT_U24, AUDIO_SAMPLE_FORMAT_U24P,   AUDIO_SAMPLE_FORMAT_S32, AUDIO_SAMPLE_FORMAT_S32P, AUDIO_SAMPLE_FORMAT_U32, AUDIO_SAMPLE_FORMAT_U32P,   AUDIO_SAMPLE_FORMAT_S64, AUDIO_SAMPLE_FORMAT_S64P, AUDIO_SAMPLE_FORMAT_U64, AUDIO_SAMPLE_FORMAT_U64P,   AUDIO_SAMPLE_FORMAT_F32, AUDIO_SAMPLE_FORMAT_F32P, AUDIO_SAMPLE_FORMAT_F64, AUDIO_SAMPLE_FORMAT_F64P } | 原始音频样本格式 | -| [AudioChannelMode](#audiochannelmode){  AUDIO_CHANNEL_NORMAL = 0, AUDIO_CHANNEL_BOTH_LEFT, AUDIO_CHANNEL_BOTH_RIGHT, AUDIO_CHANNEL_EXCHANGE,   AUDIO_CHANNEL_MIX, AUDIO_CHANNEL_LEFT_MUTE, AUDIO_CHANNEL_RIGHT_MUTE, AUDIO_CHANNEL_BOTH_MUTE } | 音频播放的通道模式 | -| [AudioDrainNotifyType](#audiodrainnotifytype){ AUDIO_DRAIN_NORMAL_MODE, AUDIO_DRAIN_EARLY_MODE } | DrainBuffer函数结束类型 | -| [AudioCallbackType](#audiocallbacktype){ AUDIO_NONBLOCK_WRITE_COMPLETED, AUDIO_DRAIN_COMPLETED, AUDIO_FLUSH_COMPLETED, AUDIO_RENDER_FULL,   AUDIO_ERROR_OCCUR } | 回调函数通知事件类型 | -| [AudioPortRole](#audioportrole){ AUDIO_PORT_UNASSIGNED_ROLE = 0, AUDIO_PORT_SOURCE_ROLE = 1, AUDIO_PORT_SINK_ROLE = 2 } | 音频端口角色 | -| [AudioPortType](#audioporttype){ AUDIO_PORT_UNASSIGNED_TYPE = 0, AUDIO_PORT_DEVICE_TYPE = 1, AUDIO_PORT_MIX_TYPE = 2, AUDIO_PORT_SESSION_TYPE = 3 } | 音频端口类型. | -| [AudioSessionType](#audiosessiontype){ AUDIO_OUTPUT_STAGE_SESSION = 0, AUDIO_OUTPUT_MIX_SESSION, AUDIO_ALLOCATE_SESSION, AUDIO_INVALID_SESSION } | 端口会话类型 | - - -### 函数 - - | 名称 | 描述 | -| -------- | -------- | -| [GetAudioManagerFuncs](#getaudiomanagerfuncs)(void) | 获取音频适配器管理接口的操作函数列表,详情参考[AudioManager](_audio_manager.md)。 | - - -### 变量 - - | 变量 名称 | 描述 | -| -------- | -------- | -| [AudioPort::dir](#dir) | 音频端口的类型。 | -| [AudioPort::portId](#portid-14) | 音频端口的ID。 | -| [AudioPort::portName](#portname) | 音频端口的名称。 | -| [AudioAdapterDescriptor::adapterName](#adaptername) | 音频适配器的名称。 | -| [AudioAdapterDescriptor::portNum](#portnum) | 一个音频适配器支持的端口数目。 | -| [AudioAdapterDescriptor::ports](#ports) | 一个音频适配器支持的端口列表。 | -| [AudioDeviceDescriptor::portId](#portid-24) | 音频端口ID。 | -| [AudioDeviceDescriptor::pins](#pins) | 音频端口上的PIN脚(输出、输入)。 | -| [AudioDeviceDescriptor::desc](#desc-15) | 以字符串命名的音频设备。 | -| [AudioSceneDescriptor::SceneDesc::id](#id) | 音频场景的ID。 | -| [AudioSceneDescriptor::SceneDesc::desc](#desc-35) | 以字符串命名的音频场景。 | -| [AudioSceneDescriptor::scene](#scene) | 音频场景的名称。 | -| [AudioSceneDescriptor::desc](#desc-25) | 音频设备描述符。 | -| [AudioSampleAttributes::type](#type-13) | 音频类型。 | -| [AudioSampleAttributes::interleaved](#interleaved) | 音频数据交织的标记。 | -| [AudioSampleAttributes::format](#format) | 音频数据格式。 | -| [AudioSampleAttributes::sampleRate](#samplerate) | 音频采样频率。 | -| [AudioSampleAttributes::channelCount](#channelcount-12) | 音频通道数目,如单通道(mono)为1、立体声(stereo)为2。 | -| [AudioSampleAttributes::period](#period) | 音频采样周期。 | -| [AudioSampleAttributes::frameSize](#framesize) | 音频数据的帧大小。 | -| [AudioSampleAttributes::isBigEndian](#isbigendian) | 音频数据的大端标志。 | -| [AudioSampleAttributes::isSignedData](#issigneddata) | 音频数据的有符号或无符号标志。 | -| [AudioSampleAttributes::startThreshold](#startthreshold) | 音频渲染开始阈值。 | -| [AudioSampleAttributes::stopThreshold](#stopthreshold) | 音频渲染停止阈值。 | -| [AudioSampleAttributes::silenceThreshold](#silencethreshold) | 音频捕获缓冲区阈值。 | -| [AudioSampleAttributes::streamId](#streamid-12) | 渲染或捕获的音频标识符。 | -| [AudioTimeStamp::tvSec](#tvsec) | tvSec时间,单位:秒。 | -| [AudioTimeStamp::tvNSec](#tvnsec) | tvNSec时间,单位:纳秒。 | -| [AudioSubPortCapability::portId](#portid-34) | 子端口ID。 | -| [AudioSubPortCapability::desc](#desc-45) | 以字符串命名的子端口。 | -| [AudioSubPortCapability::mask](#mask) | 数据透传模式。 | -| [AudioPortCapability::deviceType](#devicetype) | 设备输出、输入类型。 | -| [AudioPortCapability::deviceId](#deviceid) | 绑定(bind)设备ID,唯一的设备识别符。 | -| [AudioPortCapability::hardwareMode](#hardwaremode) | 是否支持设备绑定处理。 | -| [AudioPortCapability::formatNum](#formatnum) | 支持的音频格式数目。 | -| [AudioPortCapability::formats](#formats) | 支持的音频格式。 | -| [AudioPortCapability::sampleRateMasks](#sampleratemasks) | 支持的音频采样频率(8k、16k、32k、48k)。 | -| [AudioPortCapability::channelMasks](#channelmasks) | 设备的声道布局掩码(mask)。 | -| [AudioPortCapability::channelCount](#channelcount-22) | 支持的最大声道总数。 | -| [AudioPortCapability::subPortsNum](#subportsnum) | 支持的子端口数目(仅用于输出设备)。 | -| [AudioPortCapability::subPorts](#subports) | 支持的子端口列表。 | -| [AudioPortCapability::supportSampleFormatNum](#supportsampleformatnum) | 支持的音频样本格式数量。 | -| [AudioPortCapability::supportSampleFormats](#supportsampleformats) | 支持的音频样本格式。 | -| [AudioMmapBufferDescriptor::memoryAddress](#memoryaddress) | 指向mmap缓冲区的指针。 | -| [AudioMmapBufferDescriptor::memoryFd](#memoryfd) | mmap缓冲区的文件描述符。 | -| [AudioMmapBufferDescriptor::totalBufferFrames](#totalbufferframes) | 缓冲区总大小,单位:帧。 | -| [AudioMmapBufferDescriptor::transferFrameSize](#transferframesize) | 传输大小,单位:帧。 | -| [AudioMmapBufferDescriptor::isShareable](#isshareable) | mmap缓冲区是否可以在进程间共享。 | -| [AudioDevExtInfo::moduleId](#moduleid-12) | 音频流绑定的模块ID。 | -| [AudioDevExtInfo::type](#type-23) | 音频端口上的PIN脚(输出、输入)。 | -| [AudioDevExtInfo::desc](#desc-55) | 地址描述。 | -| [AudioMixExtInfo::moduleId](#moduleid-22) | 流所属模块标识符。 | -| [AudioMixExtInfo::streamId](#streamid-22) | 由调用者传递的Render或Capture标识符。 | -| [AudioSessionExtInfo::sessionType](#sessiontype) | 音频会话类型。 | -| [AudioRouteNode::portId](#portid-44) | 音频端口ID。 | -| [AudioRouteNode::role](#role) | 指定端口角色为sink或source。 | -| [AudioRouteNode::type](#type-33) | 指定端口类型。 | -| [AudioRouteNode::device](#device) | 设备特定信息。 | -| [AudioRouteNode::mix](#mix) | 音轨特定信息。 | -| [AudioRouteNode::session](#session) | 会话特定信息。 | -| [AudioRoute::sourcesNum](#sourcesnum) | 发送端节点数量。 | -| [AudioRoute::sources](#sources) | 发送端列表。 | -| [AudioRoute::sinksNum](#sinksnum) | 接受端节点数量。 | -| [AudioRoute::sinks](#sinks) | 接受端列表。 | - - -## **类型定义说明** - - -### RenderCallback - - -``` -typedef int32_t(* RenderCallback) (enum AudioCallbackType, void *reserved, void *cookie) -``` - -**描述:** - -回调函数指针。 - -**参数:** +| [AudioPortDirection](#audioportdirection) { PORT_OUT = 1 , PORT_IN = 2 , PORT_OUT_IN = 3 } | 音频端口的类型。 | +| [AudioPortPin](#audioportpin) {
PIN_NONE = 0 , PIN_OUT_SPEAKER = 1 , PIN_OUT_HEADSET = 2 , PIN_OUT_LINEOUT = 4 ,
PIN_OUT_HDMI = 8 , PIN_IN_MIC = 134217729 , PIN_IN_HS_MIC = 134217730 , PIN_IN_LINEIN = 134217732 ,
PIN_IN_USB_EXT = 134217736
} | 音频端口上的Pin脚。 | +| [AudioCategory](#audiocategory) { AUDIO_IN_MEDIA = 0 , AUDIO_IN_COMMUNICATION = 1 , AUDIO_IN_RINGTONE = 2 , AUDIO_IN_CALL = 3 } | 音频类型(场景)。 | +| [AudioFormat](#audioformat) {
AUDIO_FORMAT_PCM_8_BIT = 1 , AUDIO_FORMAT_PCM_16_BIT = 2 , AUDIO_FORMAT_PCM_24_BIT = 3 , AUDIO_FORMAT_PCM_32_BIT = 4 ,
AUDIO_FORMAT_AAC_MAIN = 16777217 , AUDIO_FORMAT_AAC_LC = 16777218 , AUDIO_FORMAT_AAC_LD = 16777219 , AUDIO_FORMAT_AAC_ELD = 16777220 ,
AUDIO_FORMAT_AAC_HE_V1 = 16777221 , AUDIO_FORMAT_AAC_HE_V2 = 16777222 , AUDIO_FORMAT_G711A = 33554433 , AUDIO_FORMAT_G711U = 33554434 ,
AUDIO_FORMAT_G726 = 33554435
} | 音频格式。 | +| [AudioChannelMask](#audiochannelmask) { AUDIO_CHANNEL_FRONT_LEFT = 1 , AUDIO_CHANNEL_FRONT_RIGHT = 2 , AUDIO_CHANNEL_MONO = 1 , AUDIO_CHANNEL_STEREO = 3 } | 音频通道掩码。 | +| [AudioSampleRatesMask](#audiosampleratesmask) {
AUDIO_SAMPLE_RATE_MASK_8000 = 1 << 0 , AUDIO_SAMPLE_RATE_MASK_12000 = 1 << 1 , AUDIO_SAMPLE_RATE_MASK_11025 = 1 << 2 , AUDIO_SAMPLE_RATE_MASK_16000 = 1 << 3 ,
AUDIO_SAMPLE_RATE_MASK_22050 = 1 << 4 , AUDIO_SAMPLE_RATE_MASK_24000 = 1 << 5 , AUDIO_SAMPLE_RATE_MASK_32000 = 1 << 6 , AUDIO_SAMPLE_RATE_MASK_44100 = 1 << 7 ,
AUDIO_SAMPLE_RATE_MASK_48000 = 1 << 8 , AUDIO_SAMPLE_RATE_MASK_64000 = 1 << 9 , AUDIO_SAMPLE_RATE_MASK_96000 = 1 << 10 , AUDIO_SAMPLE_RATE_MASK_INVALID = 4294967295
} | 音频采样频率掩码。 | +| [AudioPortPassthroughMode](#audioportpassthroughmode) { PORT_PASSTHROUGH_LPCM = 1 , PORT_PASSTHROUGH_RAW = 2 , PORT_PASSTHROUGH_HBR2LBR = 4 , PORT_PASSTHROUGH_AUTO = 8 } | 音频端口的数据透传模式。 | +| [AudioDeviceType](#audiodevicetype) {
AUDIO_LINEOUT = 1 << 0 , AUDIO_HEADPHONE = 1 << 1 , AUDIO_HEADSET = 1 << 2 , AUDIO_USB_HEADSET = 1 << 3 ,
AUDIO_USB_HEADPHONE = 1 << 4 , AUDIO_USBA_HEADSET = 1 << 5 , AUDIO_USBA_HEADPHONE = 1 << 6 , AUDIO_PRIMARY_DEVICE = 1 << 7 ,
AUDIO_USB_DEVICE = 1 << 8 , AUDIO_A2DP_DEVICE = 1 << 9 , AUDIO_DEVICE_UNKOWN
} | 音频设备类型。 | +| [AudioEventType](#audioeventtype) {
AUDIO_DEVICE_ADD = 1 , AUDIO_DEVICE_REMOVE = 2 , AUDIO_LOAD_SUCCESS = 3 , AUDIO_LOAD_FAILURE = 4 ,
AUDIO_UNLOAD = 5 , AUDIO_SERVICE_VALID = 7 , AUDIO_SERVICE_INVALID = 8 , AUDIO_CAPTURE_THRESHOLD = 9 ,
AUDIO_EVENT_UNKOWN = 10
} | 音频事件类型。 | +| [AudioExtParamKey](#audioextparamkey) {
AUDIO_EXT_PARAM_KEY_NONE = 0 , AUDIO_EXT_PARAM_KEY_VOLUME = 1 , AUDIO_EXT_PARAM_KEY_FOCUS = 2 , AUDIO_EXT_PARAM_KEY_BUTTON = 3 ,
AUDIO_EXT_PARAM_KEY_EFFECT = 4 , AUDIO_EXT_PARAM_KEY_STATUS = 5 , AUDIO_EXT_PARAM_KEY_LOWPOWER = 1000
} | 音频扩展参数键类型。 | +| [AudioSampleFormat](#audiosampleformat) {
AUDIO_SAMPLE_FORMAT_S8 = 0 , AUDIO_SAMPLE_FORMAT_S8P = 1 , AUDIO_SAMPLE_FORMAT_U8 = 2 , AUDIO_SAMPLE_FORMAT_U8P = 3 ,
AUDIO_SAMPLE_FORMAT_S16 = 4 , AUDIO_SAMPLE_FORMAT_S16P = 5 , AUDIO_SAMPLE_FORMAT_U16 = 6 , AUDIO_SAMPLE_FORMAT_U16P = 7 ,
AUDIO_SAMPLE_FORMAT_S24 = 8 , AUDIO_SAMPLE_FORMAT_S24P = 9 , AUDIO_SAMPLE_FORMAT_U24 = 10 , AUDIO_SAMPLE_FORMAT_U24P = 11 ,
AUDIO_SAMPLE_FORMAT_S32 = 12 , AUDIO_SAMPLE_FORMAT_S32P = 13 , AUDIO_SAMPLE_FORMAT_U32 = 14 , AUDIO_SAMPLE_FORMAT_U32P = 15 ,
AUDIO_SAMPLE_FORMAT_S64 = 16 , AUDIO_SAMPLE_FORMAT_S64P = 17 , AUDIO_SAMPLE_FORMAT_U64 = 18 , AUDIO_SAMPLE_FORMAT_U64P = 19 ,
AUDIO_SAMPLE_FORMAT_F32 = 20 , AUDIO_SAMPLE_FORMAT_F32P = 21 , AUDIO_SAMPLE_FORMAT_F64 = 22 , AUDIO_SAMPLE_FORMAT_F64P = 23
} | 原始音频样本格式。 | +| [AudioChannelMode](#audiochannelmode) {
AUDIO_CHANNEL_NORMAL = 0 , AUDIO_CHANNEL_BOTH_LEFT , AUDIO_CHANNEL_BOTH_RIGHT , AUDIO_CHANNEL_EXCHANGE ,
AUDIO_CHANNEL_MIX , AUDIO_CHANNEL_LEFT_MUTE , AUDIO_CHANNEL_RIGHT_MUTE , AUDIO_CHANNEL_BOTH_MUTE
} | 音频播放的通道模式。 | +| [AudioDrainNotifyType](#audiodrainnotifytype) { AUDIO_DRAIN_NORMAL_MODE , AUDIO_DRAIN_EARLY_MODE } | 音频数据结束类型。 | +| [AudioCallbackType](#audiocallbacktype) {
AUDIO_NONBLOCK_WRITE_COMPELETED , AUDIO_DRAIN_COMPELETED , AUDIO_FLUSH_COMPLETED , AUDIO_RENDER_FULL ,
AUDIO_ERROR_OCCUR
} | 回调函数通知事件类型。 | +| [AudioPortRole](#audioportrole) { AUDIO_PORT_UNASSIGNED_ROLE = 0 , AUDIO_PORT_SOURCE_ROLE = 1 , AUDIO_PORT_SINK_ROLE = 2 } | 音频端口角色。 | +| [AudioPortType](#audioporttype) { AUDIO_PORT_UNASSIGNED_TYPE = 0 , AUDIO_PORT_DEVICE_TYPE = 1 , AUDIO_PORT_MIX_TYPE = 2 , AUDIO_PORT_SESSION_TYPE = 3 } | 音频端口类型。 | +| [AudioSessionType](#audiosessiontype) { AUDIO_OUTPUT_STAGE_SESSION = 0 , AUDIO_OUTPUT_MIX_SESSION , AUDIO_ALLOCATE_SESSION , AUDIO_INVALID_SESSION } | 端口会话类型。 | + + +### 关键字 | 名称 | 描述 | | -------- | -------- | -| AudioCallbackType | 回调函数响应类型 | -| reserved | 保留字段 | -| cookie | 用于传递数据 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** +| package ohos.hdi.audio.v1_0 | 音频接口的包路径。 | -[RegCallback](_audio_render.md#regcallback) - -## **枚举类型说明** +## 枚举类型说明 ### AudioCallbackType - + ``` enum AudioCallbackType ``` @@ -215,56 +106,56 @@ enum AudioCallbackType | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_NONBLOCK_WRITE_COMPLETED | 非阻塞式写完成 | -| AUDIO_DRAIN_COMPLETED | DrainBuffer完成 | -| AUDIO_FLUSH_COMPLETED | Flush完成 | -| AUDIO_RENDER_FULL | Render缓冲区已满 | -| AUDIO_ERROR_OCCUR | 发生了错误 | +| AUDIO_NONBLOCK_WRITE_COMPELETED | 非阻塞式写完成。 | +| AUDIO_DRAIN_COMPELETED | DrainBuffer完成,详情参考[DrainBuffer()](interface_i_audio_render.md#drainbuffer)。 | +| AUDIO_FLUSH_COMPLETED | Flush完成,详情参考[Flush()](interface_i_audio_capture.md#flush)。 | +| AUDIO_RENDER_FULL | 录音缓冲区已满。 | +| AUDIO_ERROR_OCCUR | 发生了错误。 | ### AudioCategory - + ``` enum AudioCategory ``` **描述:** -音频类型(category)。 +音频类型(场景)。 | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_IN_MEDIA | 媒体 | -| AUDIO_IN_COMMUNICATION | 通信 | -| AUDIO_IN_RINGTONE | 铃声 | -| AUDIO_IN_CALL | 呼叫 | +| AUDIO_IN_MEDIA | 媒体。 | +| AUDIO_IN_COMMUNICATION | 通信。 | +| AUDIO_IN_RINGTONE | 电话铃声。 | +| AUDIO_IN_CALL | 呼叫。 | ### AudioChannelMask - + ``` enum AudioChannelMask ``` **描述:** -音频通道掩码(mask)。 +音频通道掩码。 -定义音频声道的位置。 +定义音频声道的位置掩码。 | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_CHANNEL_FRONT_LEFT | 声道布局前左 | -| AUDIO_CHANNEL_FRONT_RIGHT | 声道布局前右 | -| AUDIO_CHANNEL_MONO | 单声道 | -| AUDIO_CHANNEL_STEREO | 立体声,由左右声道组成(FRONT_LEFT \| FRONT_RIGHT) | +| AUDIO_CHANNEL_FRONT_LEFT | 声道布局前左。 | +| AUDIO_CHANNEL_FRONT_RIGHT | 声道布局前右。 | +| AUDIO_CHANNEL_MONO | 单声道。 | +| AUDIO_CHANNEL_STEREO | 立体声,由左右声道组成。 | ### AudioChannelMode - + ``` enum AudioChannelMode ``` @@ -279,1031 +170,311 @@ enum AudioChannelMode | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_CHANNEL_NORMAL | 正常模式,不做处理 | -| AUDIO_CHANNEL_BOTH_LEFT | 两个声道全部为左声道声音 | -| AUDIO_CHANNEL_BOTH_RIGHT | 两个声道全部为右声道声音 | -| AUDIO_CHANNEL_EXCHANGE | 左右声道数据互换,左声道为右声道声音,右声道为左声道声音 | -| AUDIO_CHANNEL_MIX | 左右两个声道输出为左右声道相加(混音) | -| AUDIO_CHANNEL_LEFT_MUTE | 左声道静音,右声道播放原右声道声音 | -| AUDIO_CHANNEL_RIGHT_MUTE | 右声道静音,左声道播放原左声道声音 | -| AUDIO_CHANNEL_BOTH_MUTE | 左右声道均静音 | - - -### AudioDrainNotifyType - - -``` -enum AudioDrainNotifyType -``` +| AUDIO_CHANNEL_NORMAL | 正常模式,不做处理。 | +| AUDIO_CHANNEL_BOTH_LEFT | 两个声道全部为左声道声音。 | +| AUDIO_CHANNEL_BOTH_RIGHT | 两个声道全部为右声道声音。 | +| AUDIO_CHANNEL_EXCHANGE | 左右声道数据互换,左声道为右声道声音,右声道为左声道声音。 | +| AUDIO_CHANNEL_MIX | 左右两个声道输出为左右声道相加(混音)。 | +| AUDIO_CHANNEL_LEFT_MUTE | 左声道静音,右声道播放原右声道声音。 | +| AUDIO_CHANNEL_RIGHT_MUTE | 右声道静音,左声道播放原左声道声音。 | +| AUDIO_CHANNEL_BOTH_MUTE | 左右声道均静音。 | -**描述:** - -DrainBuffer函数结束类型。 - - | 枚举值 | 描述 | -| -------- | -------- | -| AUDIO_DRAIN_NORMAL_MODE | DrainBuffer在所有数据播放结束后返回 | -| AUDIO_DRAIN_EARLY_MODE | DrainBuffer()在当前曲目的所有数据播放完之前返回,以便留出时间给音频服务做连续性曲目切换 | +### AudioDeviceType -### AudioFormat - ``` -enum AudioFormat +enum AudioDeviceType ``` **描述:** -音频格式。 +音频设备类型。 | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_FORMAT_PCM_8_BIT | 8bit位宽pcm格式 | -| AUDIO_FORMAT_PCM_16_BIT | 16bit位宽pcm格式 | -| AUDIO_FORMAT_PCM_24_BIT | 24bit位宽pcm格式 | -| AUDIO_FORMAT_PCM_32_BIT | 32bit位宽pcm格式 | -| AUDIO_FORMAT_AAC_MAIN | AAC MAIN格式 | -| AUDIO_FORMAT_AAC_LC | AAC LC格式 | -| AUDIO_FORMAT_AAC_LD | AAC LD格式 | -| AUDIO_FORMAT_AAC_ELD | AAC ELD格式 | -| AUDIO_FORMAT_AAC_HE_V1 | AAC HE_V1格式 | -| AUDIO_FORMAT_AAC_HE_V2 | AAC HE_V2格式 | -| AUDIO_FORMAT_G711A | G711A格式 | -| AUDIO_FORMAT_G711U | G711u格式 | -| AUDIO_FORMAT_G726 | G726格式 | - - -### AudioPortDirection - - -``` -enum AudioPortDirection -``` - -**描述:** - -音频端口的类型。 +| AUDIO_LINEOUT | LINEOUT设备。 | +| AUDIO_HEADPHONE | 耳机。 | +| AUDIO_HEADSET | 头戴式耳机。 | +| AUDIO_USB_HEADSET | USB头戴式耳机。 | +| AUDIO_USB_HEADPHONE | USB耳机。 | +| AUDIO_USBA_HEADSET | USB模拟头戴式耳机。 | +| AUDIO_USBA_HEADPHONE | USB模拟耳机。 | +| AUDIO_PRIMARY_DEVICE | 主音频设备。 | +| AUDIO_USB_DEVICE | USB音频设备。 | +| AUDIO_A2DP_DEVICE | 蓝牙音频设备。 | +| AUDIO_DEVICE_UNKOWN | 未知设备。 | - | 枚举值 | 描述 | -| -------- | -------- | -| PORT_OUT | 音频输出端口 | -| PORT_IN | 音频输入端口 | -| PORT_OUT_IN | 音频输出/入端口, 同时支持输出和输入能力(OUT \| IN) | +### AudioDrainNotifyType -### AudioPortPassthroughMode - ``` -enum AudioPortPassthroughMode +enum AudioDrainNotifyType ``` **描述:** -音频端口的数据透传模式。 +音频数据结束类型。 | 枚举值 | 描述 | | -------- | -------- | -| PORT_PASSTHROUGH_LPCM | 立体声pcm | -| PORT_PASSTHROUGH_RAW | HDMI透传 | -| PORT_PASSTHROUGH_HBR2LBR | 蓝光次世代音频降规格输出 | -| PORT_PASSTHROUGH_AUTO | 根据HDMI EDID能力自动匹配 | - - -### AudioPortPin - - -``` -enum AudioPortPin -``` - -**描述:** - -音频适配器端口的PIN脚。 +| AUDIO_DRAIN_NORMAL_MODE | 曲目的所有数据播放完就结束。 | +| AUDIO_DRAIN_EARLY_MODE | 曲目的所有数据未播放完就结束,以便给音频服务做连续性曲目切换留出时间。 | - | 枚举值 | 描述 | -| -------- | -------- | -| PIN_NONE | 无效PIN | -| PIN_OUT_SPEAKER | 喇叭输出 | -| PIN_OUT_HEADSET | 有线耳机输出 | -| PIN_OUT_LINEOUT | Lineout输出 | -| PIN_OUT_HDMI | HDMI输出 | -| PIN_OUT_USB | USB设备输出 | -| PIN_OUT_USB_EXT | 扩展 USB 设备输出 | -| PIN_IN_MIC | Mic输入 | -| PIN_IN_HS_MIC | 有线耳机Mic输入 | -| PIN_IN_LINEIN | Linein输入 | -| PIN_IN_USB_EXT | 扩展 USB 设备输入 | +### AudioEventType -### AudioPortRole - ``` -enum AudioPortRole +enum AudioEventType ``` **描述:** -音频端口角色。 +音频事件类型。 | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_PORT_UNASSIGNED_ROLE | 未指定端口角色 | -| AUDIO_PORT_SOURCE_ROLE | 指定端口为发送端角色 | -| AUDIO_PORT_SINK_ROLE | 指定端口为接受端角色 | - - -### AudioPortType - - -``` -enum AudioPortType -``` +| AUDIO_DEVICE_ADD | 音频设备添加。 | +| AUDIO_DEVICE_REMOVE | 音频设备移除。 | +| AUDIO_LOAD_SUCCESS | 声卡加载成功。 | +| AUDIO_LOAD_FAILURE | 声卡加载失败。 | +| AUDIO_UNLOAD | 声卡卸载。 | +| AUDIO_SERVICE_VALID | 音频服务可用。 | +| AUDIO_SERVICE_INVALID | 音频服务不可用。 | +| AUDIO_CAPTURE_THRESHOLD | 录音阈值上报。 | +| AUDIO_EVENT_UNKOWN | 未知事件。 | -**描述:** - -音频端口类型。 - - | 枚举值 | 描述 | -| -------- | -------- | -| AUDIO_PORT_UNASSIGNED_TYPE | 未指定端口类型 | -| AUDIO_PORT_DEVICE_TYPE | 指定端口为设备类型 | -| AUDIO_PORT_MIX_TYPE | 指定端口类型为复合类型 | -| AUDIO_PORT_SESSION_TYPE | 指定端口为会话类型 | +### AudioExtParamKey -### AudioSampleFormat - ``` -enum AudioSampleFormat +enum AudioExtParamKey ``` **描述:** -原始音频样本格式。 +音频扩展参数键类型。 | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_SAMPLE_FORMAT_S8 | 8bit位宽有符号交织样本 | -| AUDIO_SAMPLE_FORMAT_S8P | 8bit位宽有符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_U8 | 8bit位宽无符号交织样本 | -| AUDIO_SAMPLE_FORMAT_U8P | 8bit位宽无符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_S16 | 16bit位宽有符号交织样本 | -| AUDIO_SAMPLE_FORMAT_S16P | 16bit位宽有符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_U16 | 16bit位宽无符号交织样本 | -| AUDIO_SAMPLE_FORMAT_U16P | 16bit位宽无符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_S24 | 24bit位宽有符号交织样本 | -| AUDIO_SAMPLE_FORMAT_S24P | 24bit位宽有符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_U24 | 24bit位宽无符号交织样本 | -| AUDIO_SAMPLE_FORMAT_U24P | 24bit位宽无符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_S32 | 32bit位宽有符号交织样本 | -| AUDIO_SAMPLE_FORMAT_S32P | 32bit位宽有符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_U32 | 32bit位宽无符号交织样本 | -| AUDIO_SAMPLE_FORMAT_U32P | 32bit位宽无符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_S64 | 64bit位宽有符号交织样本 | -| AUDIO_SAMPLE_FORMAT_S64P | 64bit位宽有符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_U64 | 64bit位宽无符号交织样本 | -| AUDIO_SAMPLE_FORMAT_U64P | 64bit位宽无符号非交织样本 | -| AUDIO_SAMPLE_FORMAT_F32 | 32bit位宽浮点型交织样本 | -| AUDIO_SAMPLE_FORMAT_F32P | 64bit位宽浮点型非交织样本 | -| AUDIO_SAMPLE_FORMAT_F64 | 64bit位宽双精度浮点型交织样本 | -| AUDIO_SAMPLE_FORMAT_F64P | 64bit位宽双精度浮点型非交织样本 | - - -### AudioSampleRatesMask - - -``` -enum AudioSampleRatesMask -``` +| AUDIO_EXT_PARAM_KEY_NONE | 分布式音频-无效事件。 | +| AUDIO_EXT_PARAM_KEY_VOLUME | 分布式音频-音量事件。 | +| AUDIO_EXT_PARAM_KEY_FOCUS | 分布式音频-焦点事件。 | +| AUDIO_EXT_PARAM_KEY_BUTTON | 分布式音频-媒体按钮事件。 | +| AUDIO_EXT_PARAM_KEY_EFFECT | 分布式音频-音频效果事件。 | +| AUDIO_EXT_PARAM_KEY_STATUS | 分布式音频-设备状态事件。 | +| AUDIO_EXT_PARAM_KEY_LOWPOWER | 低电量事件。 | -**描述:** - -音频采样频率MASK。 - - | 枚举值 | 描述 | -| -------- | -------- | -| AUDIO_SAMPLE_RATE_MASK_8000 | 8K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_12000 | 12K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_11025 | 11.025K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_16000 | 16K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_22050 | 22.050K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_24000 | 24K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_32000 | 32K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_44100 | 44.1K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_48000 | 48K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_64000 | 64K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_96000 | 96K 采样频率 | -| AUDIO_SAMPLE_RATE_MASK_INVALID | 无效的采样频率 | +### AudioFormat -### AudioSessionType - ``` -enum AudioSessionType +enum AudioFormat ``` **描述:** -端口会话类型。 +音频格式。 | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_OUTPUT_STAGE_SESSION | 会话绑定到指定输出流 | -| AUDIO_OUTPUT_MIX_SESSION | 会话绑定到特定音轨 | -| AUDIO_ALLOCATE_SESSION | 会话ID需重新申请 | -| AUDIO_INVALID_SESSION | 无效会话类型 | - - -## **函数说明** - - -### GetAudioManagerFuncs() - - -``` -struct AudioManager* GetAudioManagerFuncs (void ) -``` - -**描述:** - -获取音频适配器管理接口的操作函数列表,详情参考[AudioManager](_audio_manager.md)。 - -**返回:** - -成功返回一个音频适配器管理接口的对象,失败返回NULL。 - - -## **变量说明** - - -### adapterName - - -``` -const char* AudioAdapterDescriptor::adapterName -``` - -**描述:** +| AUDIO_FORMAT_PCM_8_BIT | 8bit位宽PCM(Pulse Code Modulation)格式。 | +| AUDIO_FORMAT_PCM_16_BIT | 16bit位宽PCM格式。 | +| AUDIO_FORMAT_PCM_24_BIT | 24bit位宽PCM格式。 | +| AUDIO_FORMAT_PCM_32_BIT | 32bit位宽PCM格式。 | +| AUDIO_FORMAT_AAC_MAIN | AAC(Advanced Audio Coding) MAIN格式。 | +| AUDIO_FORMAT_AAC_LC | AAC LC格式。 | +| AUDIO_FORMAT_AAC_LD | AAC LD格式。 | +| AUDIO_FORMAT_AAC_ELD | AAC ELD格式。 | +| AUDIO_FORMAT_AAC_HE_V1 | AAC HE_V1格式。 | +| AUDIO_FORMAT_AAC_HE_V2 | AAC HE_V2格式。 | +| AUDIO_FORMAT_G711A | PCM G711A格式。 | +| AUDIO_FORMAT_G711U | PCM G711u格式。 | +| AUDIO_FORMAT_G726 | PCM G726格式。 | -音频适配器的名称 - - -### channelCount [1/2] - - -``` -uint32_t AudioSampleAttributes::channelCount -``` - -**描述:** - -音频通道数目,如单通道(mono)为1、立体声(stereo)为2。 - - -### channelCount [2/2] - - -``` -unsigned int AudioPortCapability::channelCount -``` - -**描述:** - -支持的最大声道总数 - - -### channelMasks - - -``` -enum AudioChannelMask AudioPortCapability::channelMasks -``` - -**描述:** - -设备的声道布局掩码(mask),详情参考[AudioChannelMask](#audiochannelmask)。 - - -### desc [1/5] - - -``` -const char* AudioDeviceDescriptor::desc -``` - -**描述:** - -以字符串命名的音频设备 - - -### desc [2/5] - - -``` -struct AudioDeviceDescriptor AudioSceneDescriptor::desc -``` - -**描述:** - -音频设备描述符 - - -### desc [3/5] - - -``` -const char* AudioSceneDescriptor::SceneDesc::desc -``` - -**描述:** - -以字符串命名的音频场景 +### AudioPortDirection -### desc [4/5] - ``` -const char* AudioSubPortCapability::desc +enum AudioPortDirection ``` **描述:** -以字符串命名的子端口 - - -### desc [5/5] - - -``` -const char* AudioDevExtInfo::desc -``` +音频端口的类型。 -**描述:** + | 枚举值 | 描述 | +| -------- | -------- | +| PORT_OUT | 音频输出端口。 | +| PORT_IN | 音频输入端口。 | +| PORT_OUT_IN | 音频输出输入端口。 | -地址描述 +### AudioPortPassthroughMode -### device - ``` -struct AudioDevExtInfo AudioRouteNode::ext::device +enum AudioPortPassthroughMode ``` **描述:** -设备特定信息。 - - -### deviceId - - -``` -unsigned int AudioPortCapability::deviceId -``` +音频端口的数据透传模式。 -**描述:** + | 枚举值 | 描述 | +| -------- | -------- | +| PORT_PASSTHROUGH_LPCM | 立体声PCM。 | +| PORT_PASSTHROUGH_RAW | HDMI透传。 | +| PORT_PASSTHROUGH_HBR2LBR | 蓝光次世代音频降规格输出。 | +| PORT_PASSTHROUGH_AUTO | 根据HDMI EDID能力自动匹配。 | -绑定(bind)设备ID,唯一的设备识别符。 +### AudioPortPin -### deviceType - ``` -unsigned int AudioPortCapability::deviceType +enum AudioPortPin ``` **描述:** -设备输出、输入类型。 +音频端口上的Pin脚。 + | 枚举值 | 描述 | +| -------- | -------- | +| PIN_NONE | 无效端口。 | +| PIN_OUT_SPEAKER | 喇叭输出。 | +| PIN_OUT_HEADSET | 有线耳机输出。 | +| PIN_OUT_LINEOUT | Lineout输出。 | +| PIN_OUT_HDMI | HDMI输出。 | +| PIN_IN_MIC | 麦克风输入。 | +| PIN_IN_HS_MIC | 有线耳机麦克风输入。 | +| PIN_IN_LINEIN | Linein输入。 | +| PIN_IN_USB_EXT | USB外部声卡输出。 | -### dir - - -``` -enum AudioPortDirection AudioPort::dir -``` - -**描述:** - -音频端口的类型,详情参考[AudioPortDirection](#audioportdirection)。 +### AudioPortRole -### format - ``` -enum AudioFormat AudioSampleAttributes::format +enum AudioPortRole ``` **描述:** -音频数据格式,详情参考[AudioFormat](#audioformat)。 - - -### formatNum - - -``` -unsigned int AudioPortCapability::formatNum -``` +音频端口角色。 -**描述:** + | 枚举值 | 描述 | +| -------- | -------- | +| AUDIO_PORT_UNASSIGNED_ROLE | 未指定端口角色。 | +| AUDIO_PORT_SOURCE_ROLE | 指定端口为发送端角色。 | +| AUDIO_PORT_SINK_ROLE | 指定端口为接受端角色。 | -支持的音频格式数目 +### AudioPortType -### formats - ``` -enum AudioFormat* AudioPortCapability::formats +enum AudioPortType ``` **描述:** -支持的音频格式,详情参考[AudioFormat](#audioformat)。 - - -### frameSize - - -``` -uint32_t AudioSampleAttributes::frameSize -``` +音频端口类型。 -**描述:** + | 枚举值 | 描述 | +| -------- | -------- | +| AUDIO_PORT_UNASSIGNED_TYPE | 未指定端口类型。 | +| AUDIO_PORT_DEVICE_TYPE | 指定端口为设备类型。 | +| AUDIO_PORT_MIX_TYPE | 指定端口为复合类型。 | +| AUDIO_PORT_SESSION_TYPE | 指定端口为会话类型。 | -音频数据的帧大小 +### AudioSampleFormat -### hardwareMode - ``` -bool AudioPortCapability::hardwareMode +enum AudioSampleFormat ``` **描述:** -是否支持设备绑定处理 - - -### id - - -``` -unsigned int AudioSceneDescriptor::SceneDesc::id -``` +原始音频样本格式。 -**描述:** +| 枚举值 | 描述 | +| -------- | -------- | +| AUDIO_SAMPLE_FORMAT_S8 | 8bit位宽有符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_S8P | 8bit位宽有符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_U8 | 8bit位宽无符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_U8P | 8bit位宽无符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_S16 | 16bit位宽有符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_S16P | 16bit位宽有符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_U16 | 16bit位宽无符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_U16P | 16bit位宽无符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_S24 | 24bit位宽有符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_S24P | 24bit位宽有符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_U24 | 24bit位宽无符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_U24P | 24bit位宽无符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_S32 | 32bit位宽有符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_S32P | 32bit位宽有符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_U32 | 32bit位宽无符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_U32P | 32bit位宽无符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_S64 | 64bit位宽有符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_S64P | 64bit位宽有符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_U64 | 64bit位宽无符号交织样本。 | +| AUDIO_SAMPLE_FORMAT_U64P | 64bit位宽无符号非交织样本。 | +| AUDIO_SAMPLE_FORMAT_F32 | 32bit位宽浮点型交织样本。 | +| AUDIO_SAMPLE_FORMAT_F32P | 64bit位宽浮点型非交织样本。 | +| AUDIO_SAMPLE_FORMAT_F64 | 64bit位宽双精度浮点型交织样本。 | +| AUDIO_SAMPLE_FORMAT_F64P | 64bit位宽双精度浮点型非交织样本。 | -音频场景的ID +### AudioSampleRatesMask -### interleaved - ``` -bool AudioSampleAttributes::interleaved +enum AudioSampleRatesMask ``` **描述:** -音频数据交织的标记 - - -### isBigEndian +音频采样频率掩码。 - -``` -bool AudioSampleAttributes::isBigEndian -``` - -**描述:** + | 枚举值 | 描述 | +| -------- | -------- | +| AUDIO_SAMPLE_RATE_MASK_8000 | 8K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_12000 | 12K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_11025 | 11.025K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_16000 | 16K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_22050 | 22.050K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_24000 | 24K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_32000 | 32K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_44100 | 44.1K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_48000 | 48K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_64000 | 64K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_96000 | 96K 采样频率。 | +| AUDIO_SAMPLE_RATE_MASK_INVALID | 无效的采样频率。 | -音频数据的大端标志 +### AudioSessionType -### isShareable - ``` -int32_t AudioMmapBufferDescriptor::isShareable +enum AudioSessionType ``` **描述:** -mmap缓冲区是否可以在进程间共享 - - -### isSignedData +端口会话类型。 - -``` -bool AudioSampleAttributes::isSignedData -``` - -**描述:** - -音频数据的有符号或无符号标志 - - -### mask - - -``` -enum AudioPortPassthroughMode AudioSubPortCapability::mask -``` - -**描述:** - -数据透传模式,详情参考[AudioPortPassthroughMode](#audioportpassthroughmode)。 - - -### memoryAddress - - -``` -void* AudioMmapBufferDescriptor::memoryAddress -``` - -**描述:** - -指向mmap缓冲区的指针 - - -### memoryFd - - -``` -int32_t AudioMmapBufferDescriptor::memoryFd -``` - -**描述:** - -mmap缓冲区的文件描述符 - - -### mix - - -``` -struct AudioMixExtInfo AudioRouteNode::ext::mix -``` - -**描述:** - -音轨特定信息。 - - -### moduleId [1/2] - - -``` -int32_t AudioDevExtInfo::moduleId -``` - -**描述:** - -音频流绑定的模块ID - - -### moduleId [2/2] - - -``` -int32_t AudioMixExtInfo::moduleId -``` - -**描述:** - -流所属模块标识符 - - -### period - - -``` -uint32_t AudioSampleAttributes::period -``` - -**描述:** - -音频采样周期 - - -### pins - - -``` -enum AudioPortPin AudioDeviceDescriptor::pins -``` - -**描述:** - -音频端口上的PIN脚(输出、输入),详情参考[AudioPortPin](#audioportpin)。 - - -### portId [1/4] - - -``` -unsigned int AudioPort::portId -``` - -**描述:** - -音频端口的ID - - -### portId [2/4] - - -``` -unsigned int AudioDeviceDescriptor::portId -``` - -**描述:** - -音频端口ID - - -### portId [3/4] - - -``` -unsigned int AudioSubPortCapability::portId -``` - -**描述:** - -子端口ID - - -### portId [4/4] - - -``` -int32_t AudioRouteNode::portId -``` - -**描述:** - -音频端口ID - - -### portName - - -``` -const char* AudioPort::portName -``` - -**描述:** - -音频端口的名称 - - -### portNum - - -``` -unsigned int AudioAdapterDescriptor::portNum -``` - -**描述:** - -一个音频适配器支持的端口数目 - - -### ports - - -``` -struct AudioPort* AudioAdapterDescriptor::ports -``` - -**描述:** - -一个音频适配器支持的端口列表 - - -### role - - -``` -enum AudioPortRole AudioRouteNode::role -``` - -**描述:** - -指定端口角色为sink或source - - -### sampleRate - - -``` -unsigned int AudioSampleAttributes::sampleRate -``` - -**描述:** - -音频采样频率 - - -### sampleRateMasks - - -``` -unsigned int AudioPortCapability::sampleRateMasks -``` - -**描述:** - -支持的音频采样频率(8k、16k、32k、48k) - - -### scene - - -``` -union AudioSceneDescriptor::SceneDesc AudioSceneDescriptor::scene -``` - -**描述:** - -音频场景的名称 - - -### session - - -``` -struct AudioSessionExtInfo AudioRouteNode::ext::session -``` - -**描述:** - -会话特定信息。 - - -### sessionType - - -``` -enum AudioSessionType AudioSessionExtInfo::sessionType -``` - -**描述:** - -音频会话类型 - - -### silenceThreshold - - -``` -uint32_t AudioSampleAttributes::silenceThreshold -``` - -**描述:** - -音频捕获缓冲区阈值 - - -### sinks - - -``` -const struct AudioRouteNode* AudioRoute::sinks -``` - -**描述:** - -接受端列表 - - -### sinksNum - - -``` -uint32_t AudioRoute::sinksNum -``` - -**描述:** - -接受端节点数量 - - -### sources - - -``` -const struct AudioRouteNode* AudioRoute::sources -``` - -**描述:** - -发送端列表 - - -### sourcesNum - - -``` -uint32_t AudioRoute::sourcesNum -``` - -**描述:** - -发送端节点数量 - - -### startThreshold - - -``` -uint32_t AudioSampleAttributes::startThreshold -``` - -**描述:** - -音频渲染开始阈值 - - -### stopThreshold - - -``` -uint32_t AudioSampleAttributes::stopThreshold -``` - -**描述:** - -音频渲染停止阈值 - - -### streamId [1/2] - - -``` -int32_t AudioSampleAttributes::streamId -``` - -**描述:** - -渲染或捕获的音频标识符 - - -### streamId [2/2] - - -``` -int32_t AudioMixExtInfo::streamId -``` - -**描述:** - -由调用者传递的Render或Capture标识符 - - -### subPorts - - -``` -struct AudioSubPortCapability* AudioPortCapability::subPorts -``` - -**描述:** - -支持的子端口列表 - - -### subPortsNum - - -``` -unsigned int AudioPortCapability::subPortsNum -``` - -**描述:** - -支持的子端口数目(仅用于输出设备) - - -### supportSampleFormatNum - - -``` -uint32_t AudioPortCapability::supportSampleFormatNum -``` - -**描述:** - -支持的音频样本格式数量 - - -### supportSampleFormats - - -``` -enum AudioSampleFormat* AudioPortCapability::supportSampleFormats -``` - -**描述:** - -支持的音频样本格式,详请参考[AudioSampleFormat](#audiosampleformat)。 - - -### totalBufferFrames - - -``` -int32_t AudioMmapBufferDescriptor::totalBufferFrames -``` - -**描述:** - -缓冲区总大小,单位:帧。 - - -### transferFrameSize - - -``` -int32_t AudioMmapBufferDescriptor::transferFrameSize -``` - -**描述:** - -传输大小,单位:帧。 - - -### tvNSec - - -``` -int64_t AudioTimeStamp::tvNSec -``` - -**描述:** - -tvNSec时间,单位:纳秒。 - - -### tvSec - - -``` -int64_t AudioTimeStamp::tvSec -``` - -**描述:** - -tvSec时间,单位:秒。 - - -### type [1/3] - - -``` -enum AudioCategory AudioSampleAttributes::type -``` - -**描述:** - -音频类型,详情参考[AudioCategory](#audiocategory)。 - - -### type [2/3] - - -``` -enum AudioPortPin AudioDevExtInfo::type -``` - -**描述:** - -音频端口上的PIN脚(输出、输入),详情参考[AudioPortPin](#audioportpin)。 - - -### type [3/3] - - -``` -enum AudioPortType AudioRouteNode::type -``` - -**描述:** - -指定端口类型为device, mix等。 + | 枚举值 | 描述 | +| -------- | -------- | +| AUDIO_OUTPUT_STAGE_SESSION | 会话绑定到指定输出流。 | +| AUDIO_OUTPUT_MIX_SESSION | 会话绑定到特定音轨。 | +| AUDIO_ALLOCATE_SESSION | 会话ID需重新申请。 | +| AUDIO_INVALID_SESSION | 无效会话类型。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_adapter.md b/zh-cn/device-dev/reference/hdi-apis/_audio_adapter.md deleted file mode 100644 index 21b6213df6b8046579946e9992314dadd360fa22..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_adapter.md +++ /dev/null @@ -1,327 +0,0 @@ -# AudioAdapter - - -## **概述** - -AudioAdapter音频适配器接口。 - -提供音频适配器(声卡)对外支持的驱动能力,包括初始化端口、创建Render、创建Capture、获取端口能力集等。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - -**参见:** - -[AudioRender](_audio_render.md) - -[AudioCapture](_audio_capture.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| ([InitAllPorts](#initallports))(struct AudioAdapter \*adapter) | 初始化一个音频适配器所有的端口驱动 | -| ([CreateRender](#createrender) )(struct AudioAdapter \*adapter, const struct AudioDeviceDescriptor \*desc, const struct AudioSampleAttributes \*attrs, struct AudioRender \*\*render) | 创建一个音频播放(Render)接口的对象 | -| ([DestroyRender](#destroyrender) )(struct AudioAdapter \*adapter, struct AudioRender \*render) | 销毁一个音频播放(Render)接口的对象 | -| ([CreateCapture](#createcapture))(struct AudioAdapter \*adapter, const struct AudioDeviceDescriptor \*desc, const struct AudioSampleAttributes \*attrs, struct AudioCapture \*\*capture) | 创建一个音频录音(Capture)接口的对象 | -| ([DestroyCapture](#destroycapture))(struct AudioAdapter \*adapter, struct AudioCapture \*capture) | 销毁一个音频录音(Capture)接口的对象 | -| ([GetPortCapability](#getportcapability) )(struct AudioAdapter \*adapter, struct AudioPort \*port, struct AudioPortCapability \*capability) | 获取一个音频适配器的端口驱动的能力集 | -| ([SetPassthroughMode](#setpassthroughmode) )(struct AudioAdapter \*adapter, struct AudioPort \*port, enum AudioPortPassthroughMode mode) | 设置音频端口驱动的数据透传模式 | -| ([GetPassthroughMode](#getpassthroughmode))(struct AudioAdapter \*adapter, struct AudioPort \*port, enum AudioPortPassthroughMode \*mode) | 获取音频端口驱动的数据透传模式 | -| ([UpdateAudioRoute](#updateaudioroute))(struct AudioAdapter \*adapter, const struct AudioRoute \*route, int32_t \*routeHandle) | 更新一个或多个发送端和接受端之间的路由 | -| ([ReleaseAudioRoute](#releaseaudioroute))(struct AudioAdapter \*adapter, int32_t routeHandle) | 释放一个音频路由 | - - -## **类成员变量说明** - - -### CreateCapture - - -``` -int32_t(* AudioAdapter::CreateCapture) (struct AudioAdapter *adapter, const struct AudioDeviceDescriptor *desc, const struct AudioSampleAttributes *attrs, struct AudioCapture **capture) -``` - -**描述:** - -创建一个音频录音(Capture)接口的对象。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器的指针 | -| desc | 指向要启动的音频适配器的描述符的指针 | -| attrs | 指向要打开的音频采样属性的指针 | -| capture | 指向AudioCapture对象的二级指针 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetPortCapability](#getportcapability) - -[DestroyCapture](#destroycapture) - - -### CreateRender - - -``` -int32_t(* AudioAdapter::CreateRender) (struct AudioAdapter *adapter, const struct AudioDeviceDescriptor *desc, const struct AudioSampleAttributes *attrs, struct AudioRender **render) -``` - -**描述:** - -创建一个音频播放(Render)接口的对象。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| desc | 待打开的音频设备描述符 | -| attrs | 待打开的音频采样属性 | -| render | 获取的音频播放接口的对象实例保存到render中 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetPortCapability](#getportcapability) - -[DestroyRender](#destroyrender) - - -### DestroyCapture - - -``` -int32_t(* AudioAdapter::DestroyCapture) (struct AudioAdapter *adapter, struct AudioCapture *capture) -``` - -**描述:** - -销毁一个音频录音(Capture)接口的对象。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| capture | 待操作的音频录音接口对象 | - -**注意:** - -在音频录音过程中,不能销毁该接口对象。 - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[CreateCapture](#createcapture) - - -### DestroyRender - - -``` -int32_t(* AudioAdapter::DestroyRender) (struct AudioAdapter *adapter, struct AudioRender *render) -``` - -**描述:** - -销毁一个音频播放(Render)接口的对象。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| render | 待操作的音频播放接口对象 | - -**注意:** - -在音频播放过程中,不能销毁该接口对象 - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[CreateRender](#createrender) - - -### GetPassthroughMode - - -``` -int(* AudioAdapter::GetPassthroughMode) (struct AudioAdapter *adapter, struct AudioPort *port, enum AudioPortPassthroughMode *mode) -``` - -**描述:** - -获取音频端口驱动的数据透传模式。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| port | 待获取的端口 | -| mode | 获取的传输模式保存到mode中 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[SetPassthroughMode](#setpassthroughmode) - - -### GetPortCapability - - -``` -int(* AudioAdapter::GetPortCapability) (struct AudioAdapter *adapter, struct AudioPort *port, struct AudioPortCapability *capability) -``` - -**描述:** - -获取一个音频适配器的端口驱动的能力集。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| port | 待获取的端口 | -| capability | 获取的端口能力保存到capability中 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### InitAllPorts - - -``` -int(* AudioAdapter::InitAllPorts) (struct AudioAdapter *adapter) -``` - -**描述:** - -初始化一个音频适配器所有的端口驱动。 - -在音频服务中,调用其他驱动接口前需要首先调用该接口检查端口是否已经初始化完成: - -- 如果端口驱动初始化完成,则函数返回值0, 否则返回负值。 - -- 如果端口没有初始化完成,则需要等待一段时间(例如100ms)后重新进行检查,直到端口初始化完成后再继续操作。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### ReleaseAudioRoute - - -``` -int32_t(* AudioAdapter::ReleaseAudioRoute) (struct AudioAdapter *adapter, int32_t routeHandle) -``` - -**描述:** - -释放一个音频路由。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| routeHandle | 待释放的路由句柄 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### SetPassthroughMode - - -``` -int(* AudioAdapter::SetPassthroughMode) (struct AudioAdapter *adapter, struct AudioPort *port, enum AudioPortPassthroughMode mode) -``` - -**描述:** - -设置音频端口驱动的数据透传模式。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| port | 待设置的端口 | -| mode | 待设置的传输模式 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetPassthroughMode](#getpassthroughmode) - - -### UpdateAudioRoute - - -``` -int32_t(* AudioAdapter::UpdateAudioRoute) (struct AudioAdapter *adapter, const struct AudioRoute *route, int32_t *routeHandle) -``` - -**描述:** - -更新一个或多个发送端和接受端之间的路由。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| adapter | 待操作的音频适配器对象 | -| route | 路由信息 | -| routeHandle | 生成的路由句柄 | - -**返回:** - -成功返回值0,失败返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_adapter_descriptor.md b/zh-cn/device-dev/reference/hdi-apis/_audio_adapter_descriptor.md index 93f007349acdeaafcd080489f1cb530cc84da07c..a29da8ce1ef22ccfbb2f97c66d0a67b4d546aff2 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_adapter_descriptor.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_adapter_descriptor.md @@ -1,24 +1,58 @@ # AudioAdapterDescriptor -## **概述** +## 概述 音频适配器描述符。 -一个音频适配器(adapter)是一个声卡的端口驱动集合,包含输出端口、输入端口, 其中一个端口对应着多个PIN脚,一个PIN脚对应着一个实体的器件(例如喇叭、有线耳机)。 +一个音频适配器(Adapter)是一个声卡的端口驱动集合,包含输出端口、输入端口, 其中一个端口对应着多个Pin脚,一个Pin脚对应着一个实体的器件(例如喇叭、有线耳机)。 + +**Since:** + +3.2 + +**Version:** + +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [adapterName](_audio.md#adaptername) | 音频适配器的名称 | -| [portNum](_audio.md#portnum) | 一个音频适配器支持的端口数目 | -| [ports](_audio.md#ports) | 一个音频适配器支持的端口列表 | +| [adapterName](#adaptername) | String
音频适配器的名称。 | +| [ports](#ports) | struct [AudioPort](_audio_port.md)[]
一个音频适配器支持的端口列表,详情参考[AudioPort](_audio_port.md)。 | + + +## 类成员变量说明 + + +### adapterName + + +``` +String AudioAdapterDescriptor::adapterName +``` + +**描述:** + +音频适配器的名称。 + + +### ports + + +``` +struct AudioPort [] AudioAdapterDescriptor::ports +``` + +**描述:** + +一个音频适配器支持的端口列表,详情参考[AudioPort](_audio_port.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_attribute.md b/zh-cn/device-dev/reference/hdi-apis/_audio_attribute.md deleted file mode 100644 index 2281b389b21c0a4c1111e9b1d12490fc9c3070fb..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_attribute.md +++ /dev/null @@ -1,330 +0,0 @@ -# AudioAttribute - - -## **概述** - -AudioAttribute音频属性接口。 - -提供音频播放(Render)或录音(Capture)需要的公共属性驱动能力,包括获取帧(frame)信息、设置采样属性等。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| ([GetFrameSize](#getframesize))(AudioHandle handle, uint64_t \*size) | 获取音频帧(frame)的大小 | -| ([GetFrameCount](#getframecount))(AudioHandle handle, uint64_t \*count) | 获取音频buffer中的音频帧数 | -| ([SetSampleAttributes](#setsampleattributes))(AudioHandle handle, const struct AudioSampleAttributes \*attrs) | 设置音频采样的属性参数 | -| ([GetSampleAttributes](#getsampleattributes))(AudioHandle handle, struct AudioSampleAttributes \*attrs) | 获取音频采样的属性参数 | -| ([GetCurrentChannelId](#getcurrentchannelid))(AudioHandle handle, uint32_t \*channelId) | 获取音频的数据通道ID | -| ([SetExtraParams](#setextraparams))(AudioHandle handle, const char \*keyValueList) | 设置音频拓展参数 | -| ([GetExtraParams](#getextraparams))(AudioHandle handle, char \*keyValueList) | 获取音频拓展参数 | -| ([ReqMmapBuffer](#reqmmapbuffer))(AudioHandle handle, int32_t reqSize, struct AudioMmapBufferDescriptor \*desc) | 请求Mmap缓冲区 | -| ([GetMmapPosition](#getmmapposition))(AudioHandle handle, uint64_t \*frames, struct AudioTimeStamp \*time) | 获取当前Mmap的读/写位置 | -| ([AddAudioEffect](#addaudioeffect))(AudioHandle handle, uint64_t effectid) | 添加音频效果算法实例 | -| ([RemoveAudioEffect](#removeaudioeffect))(AudioHandle handle, uint64_t effectid) | 移除音频效果算法实例 | -| ([GetFrameBufferSize](#getframebuffersize))(AudioHandle handle, uint64_t \*bufferSize) | 获取播放或录音的缓冲区大小 | - - -## **类成员变量说明** - - -### AddAudioEffect - - -``` -int32_t (*AudioAttribute::AddAudioEffect)(AudioHandle handle, uint64_t effectid) -``` - -**描述:** - -添加音频效果算法实例。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| effectid | 输入参数,待添加的音频效果算法实例ID。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetCurrentChannelId - - -``` -int32_t(* AudioAttribute::GetCurrentChannelId) (AudioHandle handle, uint32_t *channelId) -``` - -**描述:** - -获取音频的数据通道ID。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| channelId | 输出参数,获取的通道ID保存到channelId中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetExtraParams - - -``` -int32_t(* AudioAttribute::GetExtraParams) (AudioHandle handle, char *keyValueList) -``` - -**描述:** - -获取音频拓展参数。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| keyValueList | 输出参数,拓展参数键值对字符串列表,格式为key=value,多个键值对通过分号分割。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetFrameBufferSize - - -``` -int32_t (*AudioAttribute::GetFrameBufferSize)(AudioHandle handle, uint64_t *bufferSize) -``` - -**描述:** - -获取播放或录音的缓冲区大小。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| bufferSize | 输出参数,获取的缓冲区大小保存到bufferSize中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetFrameCount - - -``` -int32_t(* AudioAttribute::GetFrameCount) (AudioHandle handle, uint64_t *count) -``` - -**描述:** - -获取音频buffer中的音频帧数。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| count | 输出参数,一个音频buffer中包含的音频帧数,获取后保存到count中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetFrameSize - - -``` -int32_t(* AudioAttribute::GetFrameSize) (AudioHandle handle, uint64_t *size) -``` - -**描述:** - -获取音频帧(frame)的大小,即一帧音频数据的长度(字节数)。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| size | 输出参数,获取的音频帧大小(字节数)保存到size中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetMmapPosition - - -``` -int32_t(* AudioAttribute::GetMmapPosition) (AudioHandle handle, uint64_t *frames, struct AudioTimeStamp *time) -``` - -**描述:** - -获取当前Mmap的读/写位置。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| frames | 输出参数,获取的音频帧计数保存到frames中。 | -| time | 输出参数,获取的关联时间戳保存到time中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetSampleAttributes - - -``` -int32_t(* AudioAttribute::GetSampleAttributes) (AudioHandle handle, struct AudioSampleAttributes *attrs) -``` - -**描述:** - -获取音频采样的属性参数。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| attrs | 输出参数,获取的音频采样属性(例如采样频率、采样精度、通道)保存到attrs中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetSampleAttributes](#getsampleattributes) - - -### RemoveAudioEffect - - -``` -int32_t (*AudioAttribute::RemoveAudioEffect)(AudioHandle handle, uint64_t effectid) -``` - -**描述:** - -移除音频效果算法实例。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| effectid | 输入参数,待移除的音频效果算法实例ID。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### ReqMmapBuffer - - -``` -int32_t(* AudioAttribute::ReqMmapBuffer) (AudioHandle handle, int32_t reqSize, struct AudioMmapBufferDescriptor *desc) -``` - -**描述:** - -请求Mmap缓冲区。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| reqSize | 输入参数,请求缓冲区的大小。 | -| desc | 输出参数,缓冲区描述符。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### SetExtraParams - - -``` -int32_t(* AudioAttribute::SetExtraParams) (AudioHandle handle, const char *keyValueList) -``` - -**描述:** - -设置音频拓展参数。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| keyValueList | 输入参数,拓展参数键值对字符串列表,格式为key=value,多个键值对通过分号分割。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### SetSampleAttributes - - -``` -int32_t(* AudioAttribute::SetSampleAttributes) (AudioHandle handle, const struct AudioSampleAttributes *attrs) -``` - -**描述:** - -设置音频采样的属性参数。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| attrs | 输入参数,待设置的音频采样属性,例如采样频率、采样精度、通道。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetSampleAttributes](#getsampleattributes) diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_capture.md b/zh-cn/device-dev/reference/hdi-apis/_audio_capture.md deleted file mode 100644 index c3cecd48016cf8819856ae7cf1eccf85fe778c86..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_capture.md +++ /dev/null @@ -1,81 +0,0 @@ -# AudioCapture - - -## **概述** - -AudioCapture录音接口。 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| control | 音频控制能力接口,详情参考[AudioControl](_audio_control.md)。 | -| attr | 音频属性能力接口,详情参考[AudioAttribute](_audio_attribute.md)。 | -| scene | 音频场景能力接口,详情参考[AudioScene](_audio_scene.md)。 | -| volume | 音频音量能力接口,详情参考[AudioVolume](_audio_volume.md)。 | -| ([CaptureFrame](#captureframe))(struct AudioCapture \*capture, void \*frame, uint64_t requestBytes, uint64_t \*replyBytes) | 从音频驱动中录制(Capture)一帧输入数据(录音,音频上行数据)。 | -| ([GetCapturePosition](#getcaptureposition))(struct AudioCapture \*capture, uint64_t \*frames, struct AudioTimeStamp \*time) | 获取音频输入帧数的上一次计数。 | - - -## **类成员变量说明** - - -### CaptureFrame - - -``` -int32_t(* AudioCapture::CaptureFrame) (struct AudioCapture *capture, void *frame, uint64_t requestBytes, uint64_t *replyBytes) -``` - -**描述:** - -从音频驱动中录制(Capture)一帧输入数据(录音,音频上行数据)。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| capture | 输入参数,待操作的音频录音接口对象。 | -| frame | 输入参数,待存放输入数据的音频frame。 | -| requestBytes | 输入参数,待存放输入数据的音频frame大小(字节数)。 | -| replyBytes | 输出参数,实际读取到的音频数据长度(字节数),获取后保存到replyBytes中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetCapturePosition - - -``` -int32_t(* AudioCapture::GetCapturePosition) (struct AudioCapture *capture, uint64_t *frames, struct AudioTimeStamp *time) -``` - -**描述:** - -获取音频输入帧数的上一次计数。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| capture | 输入参数,待操作的音频录音接口对象。| -| frames | 输出参数,获取的音频帧计数保存到frames中。 | -| time | 输出参数,获取的关联时间戳保存到time中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[CaptureFrame](#captureframe) diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_control.md b/zh-cn/device-dev/reference/hdi-apis/_audio_control.md deleted file mode 100644 index 368c9f34b2028cbd0a4b99d7abf6bb0ebe502fdc..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_control.md +++ /dev/null @@ -1,211 +0,0 @@ -# AudioControl - - -## **概述** - -AudioControl音频控制接口。 - -提供音频播放(Render)或录音(Capture)需要的公共控制驱动能力,包括Start、Stop、Pause、Resume、Flush等。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| ([Start](#start))(AudioHandle handle) | 启动一个音频播放(Render)或录音(Capture)处理。 | -| ([Stop](#stop))(AudioHandle handle) | 停止一个音频播放(Render)或录音(Capture)处理。 | -| ([Pause](#pause))(AudioHandle handle) | 暂停一个音频播放(Render)或录音(Capture)处理。 | -| ([Resume](#resume))(AudioHandle handle) | 恢复一个音频播放(Render)或录音(Capture)处理。 | -| ([Flush](#flush))(AudioHandle handle) | 刷新音频缓冲区buffer中的数据。 | -| ([TurnStandbyMode](#turnstandbymode))(AudioHandle handle) | 设置或去设置设备的待机模式。 | -| ([AudioDevDump](#audiodevdump))(AudioHandle handle, int32_t range, int32_t fd) | Dump音频设备信息。 | - - -## **类成员变量说明** - - -### AudioDevDump - - -``` -int32_t(* AudioControl::AudioDevDump) (AudioHandle handle, int32_t range, int32_t fd) -``` - -**描述:** - -Dump音频设备信息。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 待操作的音频句柄 | -| range | Dump信息范围,分为简要信息、全量信息 | -| fd | 指定Dump目标文件 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### Flush - - -``` -int32_t(* AudioControl::Flush) (AudioHandle handle) -``` - -**描述:** - -刷新音频缓冲区buffer中的数据。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 待操作的音频句柄 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### Pause - - -``` -int32_t(* AudioControl::Pause) (AudioHandle handle) -``` - -**描述:** - -暂停一个音频播放(Render)或录音(Capture)处理。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 待操作的音频句柄 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[Resume](#resume) - - -### Resume - - -``` -int32_t(* AudioControl::Resume) (AudioHandle handle) -``` - -**描述:** - -恢复一个音频播放(Render)或录音(Capture)处理。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 待操作的音频句柄 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[Pause](#pause) - - -### Start - - -``` -int32_t(* AudioControl::Start) (AudioHandle handle) -``` - -**描述:** - -启动一个音频播放(Render)或录音(Capture)处理。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 待操作的音频句柄 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[Stop](#stop) - - -### Stop - - -``` -int32_t(* AudioControl::Stop) (AudioHandle handle) -``` - -**描述:** - -停止一个音频播放(Render)或录音(Capture)处理。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 待操作的音频句柄 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[Start](#start) - - -### TurnStandbyMode - - -``` -int32_t(* AudioControl::TurnStandbyMode) (AudioHandle handle) -``` - -**描述:** - -设置或去设置设备的待机模式。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 待操作的音频句柄 | - -**返回:** - -设置设备待机模式成功返回值0,再次执行后去设置待机模式成功返回正值,失败返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_dev_ext_info.md b/zh-cn/device-dev/reference/hdi-apis/_audio_dev_ext_info.md index d3f01acc1f1826b366fbfa92b6370b86ebc480fe..1035604499d478c86ff97776ec1ed4511a3b24f0 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_dev_ext_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_dev_ext_info.md @@ -1,22 +1,69 @@ # AudioDevExtInfo -## **概述** +## 概述 音频设备拓展信息。 +**Since:** + +3.2 + +**Version:** + +1.0 + **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [moduleId](_audio.md#moduleid-12) | 音频流绑定的模块ID | -| [type](_audio.md#type-23) | 音频端口上的PIN脚(输出、输入) | -| [desc](_audio.md#desc-55) | 地址描述 | +| [moduleId](#moduleid) | unsigned int
音频流绑定的模块ID。 | +| [type](#type) | enum [AudioPortPin](_audio.md#audioportpin)
音频端口上的Pin脚(输出、输入),详情参考[AudioPortPin](_audio.md#audioportpin)。 | +| [desc](#desc) | String
地址描述。 | + + +## 类成员变量说明 + + +### desc + + +``` +String AudioDevExtInfo::desc +``` + +**描述:** + +地址描述。 + + +### moduleId + + +``` +unsigned int AudioDevExtInfo::moduleId +``` + +**描述:** + +音频流绑定的模块ID。 + + +### type + + +``` +enum AudioPortPin AudioDevExtInfo::type +``` + +**描述:** + +音频端口上的Pin脚(输出、输入),详情参考[AudioPortPin](_audio.md#audioportpin)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_device_descriptor.md b/zh-cn/device-dev/reference/hdi-apis/_audio_device_descriptor.md index 3046db7ba8f824722145bb83855dc5cc53d60a42..04c725e84577bbd291d6da6f826302ee9c6d0941 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_device_descriptor.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_device_descriptor.md @@ -1,22 +1,59 @@ # AudioDeviceDescriptor -## **概述** +## 概述 -音频设备描述符 +音频设备描述符。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [portId](_audio.md#portid-24) | 音频端口ID | -| [pins](_audio.md#pins) | 音频端口上的PIN脚(输出、输入) | -| [desc](_audio.md#desc-15) | 以字符串命名的音频设备 | +| [portId](#portid) | unsigned int
音频端口ID。  | +| [pins](#pins) | enum [AudioPortPin](_audio.md#audioportpin)
音频端口上的Pin脚(输出、输入),详情参考[AudioPortPin](_audio.md#audioportpin)。  | +| [desc](#desc) | String
以字符串命名的音频设备。  | + + +## 类成员变量说明 + + +### desc + + +``` +String AudioDeviceDescriptor::desc +``` +**描述:** +以字符串命名的音频设备。 + + +### pins + + +``` +enum AudioPortPin AudioDeviceDescriptor::pins +``` +**描述:** +音频端口上的Pin脚(输出、输入),详情参考[AudioPortPin](_audio.md#audioportpin)。 + + +### portId + + +``` +unsigned int AudioDeviceDescriptor::portId +``` +**描述:** +音频端口ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_device_status.md b/zh-cn/device-dev/reference/hdi-apis/_audio_device_status.md new file mode 100644 index 0000000000000000000000000000000000000000..6f1aeead10a159ba6c2d50d955a37e68da115054 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_device_status.md @@ -0,0 +1,37 @@ +# AudioDeviceStatus + + +## 概述 + +音频设备状态。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [pnpStatus](#pnpstatus) | unsigned int
PnP设备状态,详情参考[AudioDeviceType](_audio.md#audiodevicetype),[AudioEventType](_audio.md#audioeventtype)。  | + + +## 类成员变量说明 + + +### pnpStatus + + +``` +unsigned int AudioDeviceStatus::pnpStatus +``` +**描述:** +PnP设备状态,详情参考[AudioDeviceType](_audio.md#audiodevicetype),[AudioEventType](_audio.md#audioeventtype)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_event.md b/zh-cn/device-dev/reference/hdi-apis/_audio_event.md new file mode 100644 index 0000000000000000000000000000000000000000..fda96635bc119e702f85e507c95fac62fe913053 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_event.md @@ -0,0 +1,56 @@ +# AudioEvent + + +## 概述 + +音频事件。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [eventType](#eventtype) | unsigned int
事件类型,详情参考[AudioEventType](_audio.md#audioeventtype)。 | +| [deviceType](#devicetype) | unsigned int
设备类型,详情参考[AudioDeviceType](_audio.md#audiodevicetype)。 | + + +## 类成员变量说明 + + +### deviceType + + +``` +unsigned int AudioEvent::deviceType +``` + +**描述:** + +设备类型,详情参考[AudioDeviceType](_audio.md#audiodevicetype)。 + + +### eventType + + +``` +unsigned int AudioEvent::eventType +``` + +**描述:** + +事件类型,详情参考[AudioEventType](_audio.md#audioeventtype)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_info.md b/zh-cn/device-dev/reference/hdi-apis/_audio_info.md new file mode 100644 index 0000000000000000000000000000000000000000..d74fab5a41b564a69f0e15c79e45395a19de2175 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_info.md @@ -0,0 +1,59 @@ +# AudioInfo + + +## 概述 + +音频端口特定信息。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [device](#device) | struct [AudioDevExtInfo](_audio_dev_ext_info.md)
设备特定信息,详情参考[AudioDevExtInfo](_audio_dev_ext_info.md)。  | +| [mix](#mix) | struct [AudioMixExtInfo](_audio_mix_ext_info.md)
音轨特定信息,详情参考[AudioMixExtInfo](_audio_mix_ext_info.md)。  | +| [session](#session) | struct [AudioSessionExtInfo](_audio_session_ext_info.md)
会话特定信息,详情参考[AudioSessionExtInfo](_audio_session_ext_info.md)。  | + + +## 类成员变量说明 + + +### device + + +``` +struct AudioDevExtInfo AudioInfo::device +``` +**描述:** +设备特定信息,详情参考[AudioDevExtInfo](_audio_dev_ext_info.md)。 + + +### mix + + +``` +struct AudioMixExtInfo AudioInfo::mix +``` +**描述:** +音轨特定信息,详情参考[AudioMixExtInfo](_audio_mix_ext_info.md)。 + + +### session + + +``` +struct AudioSessionExtInfo AudioInfo::session +``` +**描述:** +会话特定信息,详情参考[AudioSessionExtInfo](_audio_session_ext_info.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_manager.md b/zh-cn/device-dev/reference/hdi-apis/_audio_manager.md deleted file mode 100644 index c809c03c0b8835dcea26e5d18c48cf05d59f3211..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_manager.md +++ /dev/null @@ -1,145 +0,0 @@ -# AudioManager - - -## **概述** - -AudioManager音频适配器管理接口。 - -按照音频服务下发的音频适配器(声卡)描述符加载一个具体的音频适配器驱动程序。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - -**参见:** - -[AudioAdapter](_audio_adapter.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| ([GetAllAdapters](#getalladapters))(struct AudioAdapterManager \*manager, struct AudioAdapterDescriptor \*\*descs, int \*size) | 获取音频驱动中支持的所有适配器的列表 | -| ([LoadAdapter](#loadadapter))(struct AudioAdapterManager \*manager, const struct AudioAdapterDescriptor \*desc, struct AudioAdapter \*\*adapter) | 加载一个音频适配器(声卡)的驱动 | -| ([UnloadAdapter](#unloadadapter))(struct AudioAdapterManager \*manager, struct AudioAdapter \*adapter) | 卸载音频适配器(声卡)的驱动 | -| ([ReleaseAudioManagerObject](#releaseaudiomanagerobject))(struct AudioManager \*object) | 释放音频管理接口对象 | - - -## **类成员变量说明** - - -### GetAllAdapters - - -``` -int(* AudioManager::GetAllAdapters) (struct AudioAdapterManager *manager, struct AudioAdapterDescriptor **descs, int *size) -``` - -**描述:** - -获取音频驱动中支持的所有适配器的列表。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| manager | 输入参数,待操作的音频管理接口对象。 | -| descs | 输出参数,获取到的音频适配器列表保存到descs中。 | -| size | 输出参数,获取到的音频适配器列表的长度保存到size中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[LoadAdapter](#loadadapter) - - -### LoadAdapter - - -``` -int(* AudioManager::LoadAdapter) (struct AudioAdapterManager *manager, const struct AudioAdapterDescriptor *desc, struct AudioAdapter **adapter) -``` - -**描述:** - -加载一个音频适配器(声卡)的驱动。 - -加载一个具体的音频驱动,例如USB驱动,在具体实现中可能加载的是一个动态链接库(\*.so)。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| manager | 输入参数,待操作的音频管理接口对象。 | -| desc | 输入参数,待加载的音频适配器描述符。 | -| adapter | 输出参数,获取的音频适配器接口的对象实例保存到adapter中。| - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetAllAdapters](#getalladapters) - -[UnloadAdapter](#unloadadapter) - - -### ReleaseAudioManagerObject - - -``` -bool(* AudioManager::ReleaseAudioManagerObject) (struct AudioManager *object) -``` - -**描述:** - -释放音频管理接口对象。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| object | 输入参数,待操作的音频管理接口对象。 | - -**返回:** - -成功返回true,失败返回false。 - - -### UnloadAdapter - - -``` -void(* AudioManager::UnloadAdapter) (struct AudioAdapterManager *manager, struct AudioAdapter *adapter) -``` - -**描述:** - -卸载音频适配器(声卡)的驱动。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| manager | 输入参数,待操作的音频管理接口对象。 | -| adapter | 输入参数,待卸载的音频适配器接口的对象。 | - -**参见:** - -[LoadAdapter](#loadadapter) diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_mix_ext_info.md b/zh-cn/device-dev/reference/hdi-apis/_audio_mix_ext_info.md index 50032fae465492d88b676b63a14a54d8a5b3cb87..b5ef1a7aa5293de4f6e039390d3b3ed3b51f45c3 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_mix_ext_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_mix_ext_info.md @@ -1,21 +1,48 @@ # AudioMixExtInfo -## **概述** +## 概述 音轨拓展信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [moduleId](_audio.md#moduleid-22) | 流所属模块标识符 | -| [streamId](_audio.md#streamid-22) | 由调用者传递的Render或Capture标识符 | +| [moduleId](#moduleid) | unsigned int
流所属模块标识符。  | +| [streamId](#streamid) | unsigned int
由调用者传递的Render或Capture标识符。  | + + +## 类成员变量说明 + + +### moduleId + + +``` +unsigned int AudioMixExtInfo::moduleId +``` +**描述:** +流所属模块标识符。 + + +### streamId + + +``` +unsigned int AudioMixExtInfo::streamId +``` +**描述:** +由调用者传递的Render或Capture标识符。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_mmap_buffer_descripter.md b/zh-cn/device-dev/reference/hdi-apis/_audio_mmap_buffer_descripter.md new file mode 100644 index 0000000000000000000000000000000000000000..7272b233bb8a6300965ec6f97a8293cb960b8899 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_mmap_buffer_descripter.md @@ -0,0 +1,103 @@ +# AudioMmapBufferDescripter + + +## 概述 + +mmap缓冲区描述符。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [memoryAddress](#memoryaddress) | byte[]
指向mmap缓冲区的指针。  | +| [memoryFd](#memoryfd) | int
mmap缓冲区的文件描述符。  | +| [totalBufferFrames](#totalbufferframes) | int
缓冲区总大小,单位:帧。  | +| [transferFrameSize](#transferframesize) | int
传输大小,单位:帧。  | +| [isShareable](#isshareable) | int
mmap缓冲区是否可以在进程间共享。  | +| [offset](#offset) | unsigned int
文件偏移。  | +| [filePath](#filepath) | String
mmap文件路径。  | + + +## 类成员变量说明 + + +### filePath + + +``` +String AudioMmapBufferDescripter::filePath +``` +**描述:** +mmap文件路径。 + + +### isShareable + + +``` +int AudioMmapBufferDescripter::isShareable +``` +**描述:** +mmap缓冲区是否可以在进程间共享。 + + +### memoryAddress + + +``` +byte [] AudioMmapBufferDescripter::memoryAddress +``` +**描述:** +指向mmap缓冲区的指针。 + + +### memoryFd + + +``` +int AudioMmapBufferDescripter::memoryFd +``` +**描述:** +mmap缓冲区的文件描述符。 + + +### offset + + +``` +unsigned int AudioMmapBufferDescripter::offset +``` +**描述:** +文件偏移。 + + +### totalBufferFrames + + +``` +int AudioMmapBufferDescripter::totalBufferFrames +``` +**描述:** +缓冲区总大小,单位:帧。 + + +### transferFrameSize + + +``` +int AudioMmapBufferDescripter::transferFrameSize +``` +**描述:** +传输大小,单位:帧。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_mmap_buffer_descriptor.md b/zh-cn/device-dev/reference/hdi-apis/_audio_mmap_buffer_descriptor.md deleted file mode 100644 index 8488a838eff0aaec2b8f565f494ee0f07e88fcbb..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_mmap_buffer_descriptor.md +++ /dev/null @@ -1,24 +0,0 @@ -# AudioMmapBufferDescriptor - - -## **概述** - -Mmap缓冲区描述符。 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [memoryAddress](_audio.md#memoryaddress) | 指向Mmap缓冲区的指针 | -| [memoryFd](_audio.md#memoryfd) | Mmap缓冲区的文件描述符 | -| [totalBufferFrames](_audio.md#totalbufferframes) | 缓冲区总大小,单位:帧 | -| [transferFrameSize](_audio.md#transferframesize) | 传输大小,单位:帧 | -| [isShareable](_audio.md#isshareable) | Mmap缓冲区是否可以在进程间共享 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_port.md b/zh-cn/device-dev/reference/hdi-apis/_audio_port.md index 4cf79c86ea3854c602904c120e54a43e7abd1779..525ea18208831dfaa04ce314f950fd1d2da8251c 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_port.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_port.md @@ -1,22 +1,59 @@ # AudioPort -## **概述** +## 概述 音频端口。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [dir](_audio.md#dir) | 音频端口的类型。 | -| [portId](_audio.md#portid-14) | 音频端口的ID。 | -| [portName](_audio.md#portname) | 音频端口的名称。 | +| [dir](#dir) | enum [AudioPortDirection](_audio.md#audioportdirection)
音频端口的类型,详情参考[AudioPortDirection](_audio.md#audioportdirection)。  | +| [portId](#portid) | unsigned int
音频端口的ID。  | +| [portName](#portname) | String
音频端口的名称。  | + + +## 类成员变量说明 + + +### dir + + +``` +enum AudioPortDirection AudioPort::dir +``` +**描述:** +音频端口的类型,详情参考[AudioPortDirection](_audio.md#audioportdirection)。 + + +### portId + + +``` +unsigned int AudioPort::portId +``` +**描述:** +音频端口的ID。 + + +### portName + + +``` +String AudioPort::portName +``` +**描述:** +音频端口的名称。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_port_cap.md b/zh-cn/device-dev/reference/hdi-apis/_audio_port_cap.md new file mode 100644 index 0000000000000000000000000000000000000000..f4fa3c9840004ba11a1be6263e55f4afb5ccd5e4 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_port_cap.md @@ -0,0 +1,74 @@ +# AudioPortCap + + +## 概述 + +定义音频编解码能力。 + +**相关模块:** + +[Codec](_codec.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [sampleFormats](#sampleformats) [[SAMPLE_FMT_NUM](_codec.md#sample_fmt_num)] | int32_t
支持的音频采样格式,详见[AudioSampleFormat](_codec.md#audiosampleformat)。 | +| [sampleRate](#samplerate) [[SAMPLE_RATE_NUM](_codec.md#sample_rate_num)] | int32_t
支持的音频采样率,详见[AudioSampleRate](_codec.md#audiosamplerate)。 | +| [channelLayouts](#channellayouts) [[CHANNEL_NUM](_codec.md#channel_num)] | int32_t
支持的音频通道数channel layouts。 | +| [channelCount](#channelcount) [[CHANNEL_NUM](_codec.md#channel_num)] | int32_t
支持的音频通道数。 | + + +## 类成员变量说明 + + +### channelCount + + +``` +int32_t AudioPortCap::channelCount[CHANNEL_NUM] +``` + +**描述:** + +支持的音频通道数。 + + +### channelLayouts + + +``` +int32_t AudioPortCap::channelLayouts[CHANNEL_NUM] +``` + +**描述:** + +支持的音频通道数channel layouts。 + + +### sampleFormats + + +``` +int32_t AudioPortCap::sampleFormats[SAMPLE_FMT_NUM] +``` + +**描述:** + +支持的音频采样格式,详见[AudioSampleFormat](_codec.md#audiosampleformat)。 + + +### sampleRate + + +``` +int32_t AudioPortCap::sampleRate[SAMPLE_RATE_NUM] +``` + +**描述:** + +支持的音频采样率,详见[AudioSampleRate](_codec.md#audiosamplerate)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_port_capability.md b/zh-cn/device-dev/reference/hdi-apis/_audio_port_capability.md index bcd0d457ef2599dde89fc1a3e8d89248800328fb..78665527037ba07d2a6e63a3680bb7f59c0523a6 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_port_capability.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_port_capability.md @@ -1,31 +1,123 @@ # AudioPortCapability -## **概述** +## 概述 音频端口的支持能力。 +**Since:** + +3.2 + +**Version:** + +1.0 + **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [deviceType](_audio.md#devicetype) | 设备输出、输入类型。 | -| [deviceId](_audio.md#deviceid) | 绑定(bind)设备ID,唯一的设备识别符。 | -| [hardwareMode](_audio.md#hardwaremode) | 是否支持设备绑定处理。 | -| [formatNum](_audio.md#formatnum) | 支持的音频格式数目。 | -| [formats](_audio.md#formats) | 支持的音频格式。 | -| [sampleRateMasks](_audio.md#sampleratemasks) | 支持的音频采样频率(8k、16k、32k、48k)。 | -| [channelMasks](_audio.md#channelmasks) | 设备的声道布局掩码(mask)。 | -| [channelCount](_audio.md#channelcount-22) | 支持的最大声道总数。 | -| [subPortsNum](_audio.md#subportsnum) | 支持的子端口数目(仅用于输出设备)。 | -| [subPorts](_audio.md#subports) | 支持的子端口列表。 | -| [supportSampleFormatNum](_audio.md#supportsampleformatnum) | 支持的音频样本格式数量。 | -| [supportSampleFormats](_audio.md#supportsampleformats) | 支持的音频样本格式。 | +| [deviceType](#devicetype) | unsigned int
设备输出、输入类型。 | +| [deviceId](#deviceid) | unsigned int
设备ID,唯一的设备识别符。 | +| [hardwareMode](#hardwaremode) | boolean
是否支持设备绑定处理。 | +| [formatNum](#formatnum) | unsigned int
支持的音频格式数目。 | +| [channelMasks](#channelmasks) | enum [AudioFormat](_audio.md#audioformat)[] formats unsigned int sampleRateMasks enum [AudioChannelMask](_audio.md#audiochannelmask)
支持的音频格式,详情参考[AudioFormat](_audio.md#audioformat)。 | +| [channelCount](#channelcount) | unsigned int
最大支持的声道总数。 | +| [subPorts](#subports) | struct [AudioSubPortCapability](_audio_sub_port_capability.md)[]
支持的子端口列表,详情参考[AudioSubPortCapability](_audio_sub_port_capability.md)。 | + + +## 类成员变量说明 + + +### channelCount + + +``` +unsigned int AudioPortCapability::channelCount +``` + +**描述:** + +最大支持的声道总数。 + + +### channelMasks + + +``` +enum AudioFormat [] formats unsigned int sampleRateMasks enum AudioChannelMask AudioPortCapability::channelMasks +``` + +**描述:** + +支持的音频格式,详情参考[AudioFormat](_audio.md#audioformat)。 + +支持的音频采样频率(8k、16k、32k、48k)。 设备的声道布局掩码,详情参考[AudioChannelMask](_audio.md#audiochannelmask)。 + + +### deviceId + + +``` +unsigned int AudioPortCapability::deviceId +``` + +**描述:** + +设备ID,唯一的设备识别符。 + + +### deviceType + + +``` +unsigned int AudioPortCapability::deviceType +``` + +**描述:** + +设备输出、输入类型。 + + +### formatNum + + +``` +unsigned int AudioPortCapability::formatNum +``` + +**描述:** + +支持的音频格式数目。 + + +### hardwareMode + + +``` +boolean AudioPortCapability::hardwareMode +``` + +**描述:** + +是否支持设备绑定处理。 + + +### subPorts + + +``` +struct AudioSubPortCapability [] AudioPortCapability::subPorts +``` + +**描述:** + +支持的子端口列表,详情参考[AudioSubPortCapability](_audio_sub_port_capability.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_render.md b/zh-cn/device-dev/reference/hdi-apis/_audio_render.md deleted file mode 100644 index c7aed448a1393871e2325b41f47be8edeae7bfee..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_render.md +++ /dev/null @@ -1,294 +0,0 @@ -# AudioRender - - -## **概述** - -AudioRender音频播放接口。 - -提供音频播放支持的驱动能力,包括音频控制、音频属性、音频场景、音频音量、获取硬件延迟时间、播放音频帧数据(Render frame)等。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - -**参见:** - -[AudioControl](_audio_control.md) - -[AudioAttribute](_audio_attribute.md) - -[AudioScene](_audio_scene.md) - -[AudioVolume](_audio_volume.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| control | 音频控制能力接口,详情参考[AudioControl](_audio_control.md)。 | -| attr | 音频属性能力接口,详情参考[AudioAttribute](_audio_attribute.md)。 | -| scene | 音频场景能力接口,详情参考[AudioScene](_audio_scene.md)。 | -| volume | 音频音量能力接口,详情参考[AudioVolume](_audio_volume.md)。 | -| ([GetLatency](#getlatency))(struct AudioRender \*render, uint32_t \*ms) | 获取音频硬件驱动估计的延迟时间。 | -| ([RenderFrame](#renderframe))(struct AudioRender \*render, const void \*frame, uint64_t requestBytes, uint64_t \*replyBytes) | 往音频驱动中播放(Render)一帧输出数据(放音,音频下行数据)。 | -| ([GetRenderPosition](#getrenderposition))(struct AudioRender \*render, uint64_t \*frames, struct AudioTimeStamp \*time) | 获取音频输出帧数的上一次计数。 | -| ([SetRenderSpeed](#setrenderspeed))(struct AudioRender \*render, float speed) | 设置一个音频的播放速度。 | -| ([GetRenderSpeed](#getrenderspeed))(struct AudioRender \*render, float \*speed) | 获取一个音频当前的播放速度。 | -| ([SetChannelMode](#setchannelmode))(struct AudioRender \*render, enum AudioChannelMode mode) | 设置音频播放的通道模式。 | -| ([GetChannelMode](#getchannelmode))(struct AudioRender \*render, enum AudioChannelMode \*mode) | 获取音频播放当前的通道模式。 | -| ([RegCallback](#regcallback) )(struct AudioRender \*render, RenderCallback callback, void \*cookie) | 注册音频回调函数,用于放音过程中缓冲区数据写、DrainBuffer完成通知。 | -| ([DrainBuffer](#drainbuffer))(struct AudioRender \*render, enum AudioDrainNotifyType \*type) | 排空缓冲区中的数据。 | - - -## **类成员变量说明** - - -### DrainBuffer - - -``` -int32_t(* AudioRender::DrainBuffer) (struct AudioRender *render, enum AudioDrainNotifyType *type) -``` - -**描述:** - -排空缓冲区中的数据。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| type | 输入参数,DrainBuffer的操作类型,详情请参考[AudioDrainNotifyType](_audio.md#audiodrainnotifytype)。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[RegCallback](#regcallback) - - -### GetChannelMode - - -``` -int32_t(* AudioRender::GetChannelMode) (struct AudioRender *render, enum AudioChannelMode *mode) -``` - -**描述:** - -获取音频播放当前的通道模式。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。| -| mode | 输出参数,获取的通道模式保存到mode中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[SetChannelMode](#setchannelmode) - - -### GetLatency - - -``` -int32_t(* AudioRender::GetLatency) (struct AudioRender *render, uint32_t *ms) -``` - -**描述:** - -获取音频硬件驱动估计的延迟时间。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| ms | 输出参数,获取的延迟时间(单位:毫秒)保存到ms中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### GetRenderPosition - - -``` -int32_t(* AudioRender::GetRenderPosition) (struct AudioRender *render, uint64_t *frames, struct AudioTimeStamp *time) -``` - -**描述:** - -获取音频输出帧数的上一次计数。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| frames | 输出参数,获取的音频帧计数保存到frames中。 | -| time | 输出参数,获取的关联时间戳保存到time中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[RenderFrame](#renderframe) - - -### GetRenderSpeed - - -``` -int32_t(* AudioRender::GetRenderSpeed) (struct AudioRender *render, float *speed) -``` - -**描述:** - -获取一个音频当前的播放速度。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| speed | 输出参数,获取的播放速度保存到speed中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[SetRenderSpeed](#setrenderspeed) - - -### RegCallback - - -``` -int32_t(* AudioRender::RegCallback) (struct AudioRender *render, RenderCallback callback, void *cookie) -``` - -**描述:** - -注册音频回调函数,用于放音过程中缓冲区数据写、DrainBuffer完成通知。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| callback | 输入参数,注册的回调函数。 | -| cookie | 输入参数,回调函数的入参。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[RegCallback](#regcallback) - - -### RenderFrame - - -``` -int32_t(* AudioRender::RenderFrame) (struct AudioRender *render, const void *frame, uint64_t requestBytes, uint64_t *replyBytes) -``` - -**描述:** - -向音频驱动中播放(Render)一帧输出数据(放音,音频下行数据)。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| frame | 输入参数,待写入的输出数据的音频frame。 | -| requestBytes | 输入参数,待写入的输出数据的音频frame大小(字节数)。 | -| replyBytes | 输出参数,实际写入的音频数据长度(字节数),获取后保存到replyBytes中。 | - -**返回:** - -成功返回值0,失败返回负值。 - - -### SetChannelMode - - -``` -int32_t(* AudioRender::SetChannelMode) (struct AudioRender *render, enum AudioChannelMode mode) -``` - -**描述:** - -设置音频播放的通道模式。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| speed | 输入参数,待设置的通道模式。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetChannelMode](#getchannelmode) - - -### SetRenderSpeed - - -``` -int32_t(* AudioRender::SetRenderSpeed) (struct AudioRender *render, float speed) -``` - -**描述:** - -设置一个音频的播放速度。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| render | 输入参数,待操作的音频播放接口对象。 | -| speed | 输入参数,待设置的播放速度。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetRenderSpeed](#getrenderspeed) diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_route.md b/zh-cn/device-dev/reference/hdi-apis/_audio_route.md index 52fe8436dc04d9761877f4a8c652ccc30cfc916d..c6032ed92d5bbcd05b567bfb8c881cd31c6558d8 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_route.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_route.md @@ -1,23 +1,48 @@ # AudioRoute -## **概述** +## 概述 音频路由信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [sourcesNum](_audio.md#sourcesnum) | 发送端节点数量。 | -| [sources](_audio.md#sources) | 发送端列表。 | -| [sinksNum](_audio.md#sinksnum) | 接受端节点数量。 | -| [sinks](_audio.md#sinks) | 接受端列表。 | +| [sources](#sources) | struct [AudioRouteNode](_audio_route_node.md)[]
发送端列表,详情参考[AudioRouteNode](_audio_route_node.md)。  | +| [sinks](#sinks) | struct [AudioRouteNode](_audio_route_node.md)[]
接受端列表,详情参考[AudioRouteNode](_audio_route_node.md)。  | + + +## 类成员变量说明 + + +### sinks + + +``` +struct AudioRouteNode [] AudioRoute::sinks +``` +**描述:** +接受端列表,详情参考[AudioRouteNode](_audio_route_node.md)。 + + +### sources + + +``` +struct AudioRouteNode [] AudioRoute::sources +``` +**描述:** +发送端列表,详情参考[AudioRouteNode](_audio_route_node.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_route_node.md b/zh-cn/device-dev/reference/hdi-apis/_audio_route_node.md index ac409be4c4343dfec9cd459820adaaa74bd5ae01..f6eccafc710c2f87fc14fc813de0a3a198de0259 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_route_node.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_route_node.md @@ -1,25 +1,70 @@ # AudioRouteNode -## **概述** +## 概述 音频路由节点。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [portId](_audio.md#portid-44) | 音频端口ID。 | -| [role](_audio.md#role) | 指定端口角色为sink或source。 | -| [type](_audio.md#type-33) | 指定端口类型。 | -| [device](_audio.md#device) | 设备特定信息。 | -| [mix](_audio.md#mix) | 音轨特定信息。 | -| [session](_audio.md#session) | 会话特定信息。 | +| [portId](#portid) | int
音频端口ID。  | +| [role](#role) | enum [AudioPortRole](_audio.md#audioportrole)
指定端口角色为发送端或接收端,详情参考[AudioPortRole](_audio.md#audioportrole)。  | +| [type](#type) | enum [AudioPortType](_audio.md#audioporttype)
指定端口类型可以为设备类型、复合类型、绘画类型,详情参考[AudioPortType](_audio.md#audioporttype)。  | +| [ext](#ext) | struct [AudioInfo](_audio_info.md)
音频端口特定信息,详情参考[AudioInfo](_audio_info.md)。  | + + +## 类成员变量说明 + + +### ext + + +``` +struct AudioInfo AudioRouteNode::ext +``` +**描述:** +音频端口特定信息,详情参考[AudioInfo](_audio_info.md)。 + + +### portId + + +``` +int AudioRouteNode::portId +``` +**描述:** +音频端口ID。 + + +### role + + +``` +enum AudioPortRole AudioRouteNode::role +``` +**描述:** +指定端口角色为发送端或接收端,详情参考[AudioPortRole](_audio.md#audioportrole)。 + + +### type + + +``` +enum AudioPortType AudioRouteNode::type +``` +**描述:** +指定端口类型可以为设备类型、复合类型、绘画类型,详情参考[AudioPortType](_audio.md#audioporttype)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_sample_attributes.md b/zh-cn/device-dev/reference/hdi-apis/_audio_sample_attributes.md index 4ac66a50a5523a64b15e4f61822c817461bf60c1..2acc68f3c056a37af037c81a7c87451619ebfcd7 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_sample_attributes.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_sample_attributes.md @@ -1,32 +1,169 @@ # AudioSampleAttributes -## **概述** +## 概述 音频采样属性。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [type](_audio.md#type-13) | 音频类型。 | -| [interleaved](_audio.md#interleaved) | 音频数据交织的标记。 | -| [format](_audio.md#format) | 音频数据格式。 | -| [sampleRate](_audio.md#samplerate) | 音频采样频率。 | -| [channelCount](_audio.md#channelcount-12) | 音频通道数目,如单通道(mono)为1、立体声(stereo)为2。 | -| [period](_audio.md#period) | 音频采样周期。 | -| [frameSize](_audio.md#framesize) | 音频数据的帧大小。 | -| [isBigEndian](_audio.md#isbigendian) | 音频数据的大端标志。 | -| [isSignedData](_audio.md#issigneddata) | 音频数据的有符号或无符号标志。 | -| [startThreshold](_audio.md#startthreshold) | 音频渲染开始阈值。 | -| [stopThreshold](_audio.md#stopthreshold) | 音频渲染停止阈值。 | -| [silenceThreshold](_audio.md#silencethreshold) | 音频捕获缓冲区阈值。 | -| [streamId](_audio.md#streamid-12) | 渲染或捕获的音频标识符。 | +| [type](#type) | enum [AudioCategory](_audio.md#audiocategory)
音频类型,详情参考[AudioCategory](_audio.md#audiocategory)。  | +| [interleaved](#interleaved) | boolean
音频数据交织的标记。  | +| [format](#format) | enum [AudioFormat](_audio.md#audioformat)
音频数据格式,详情参考[AudioFormat](_audio.md#audioformat)。  | +| [sampleRate](#samplerate) | unsigned int
音频采样频率。  | +| [channelCount](#channelcount) | unsigned int
音频通道数目,如单通道为1、立体声为2。  | +| [period](#period) | unsigned int
音频采样周期,单位赫兹。  | +| [frameSize](#framesize) | unsigned int
音频数据的帧大小。  | +| [isBigEndian](#isbigendian) | boolean
音频数据的大端标志。  | +| [isSignedData](#issigneddata) | boolean
音频数据有符号或无符号标志。  | +| [startThreshold](#startthreshold) | unsigned int
音频播放起始阈值。  | +| [stopThreshold](#stopthreshold) | unsigned int
音频播放停止阈值。  | +| [silenceThreshold](#silencethreshold) | unsigned int
录音缓冲区阈值。  | +| [streamId](#streamid) | int
录音或播放的标识符。  | + + +## 类成员变量说明 + + +### channelCount + + +``` +unsigned int AudioSampleAttributes::channelCount +``` +**描述:** +音频通道数目,如单通道为1、立体声为2。 + + +### format + + +``` +enum AudioFormat AudioSampleAttributes::format +``` +**描述:** +音频数据格式,详情参考[AudioFormat](_audio.md#audioformat)。 + + +### frameSize + + +``` +unsigned int AudioSampleAttributes::frameSize +``` +**描述:** +音频数据的帧大小。 + + +### interleaved + + +``` +boolean AudioSampleAttributes::interleaved +``` +**描述:** +音频数据交织的标记。 + + +### isBigEndian + + +``` +boolean AudioSampleAttributes::isBigEndian +``` +**描述:** +音频数据的大端标志。 + + +### isSignedData + + +``` +boolean AudioSampleAttributes::isSignedData +``` +**描述:** +音频数据有符号或无符号标志。 + + +### period + + +``` +unsigned int AudioSampleAttributes::period +``` +**描述:** +音频采样周期,单位赫兹。 + + +### sampleRate + + +``` +unsigned int AudioSampleAttributes::sampleRate +``` +**描述:** +音频采样频率。 + + +### silenceThreshold + + +``` +unsigned int AudioSampleAttributes::silenceThreshold +``` +**描述:** +录音缓冲区阈值。 + + +### startThreshold + + +``` +unsigned int AudioSampleAttributes::startThreshold +``` +**描述:** +音频播放起始阈值。 + + +### stopThreshold + + +``` +unsigned int AudioSampleAttributes::stopThreshold +``` +**描述:** +音频播放停止阈值。 + + +### streamId + + +``` +int AudioSampleAttributes::streamId +``` +**描述:** +录音或播放的标识符。 + + +### type + + +``` +enum AudioCategory AudioSampleAttributes::type +``` +**描述:** +音频类型,详情参考[AudioCategory](_audio.md#audiocategory)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_scene.md b/zh-cn/device-dev/reference/hdi-apis/_audio_scene.md deleted file mode 100644 index f2bf7f3c7639d81dbe4f3ef17c511659dbcf02d3..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_scene.md +++ /dev/null @@ -1,97 +0,0 @@ -# AudioScene - - -## **概述** - -AudioScene音频场景接口。 - -提供音频播放(Render)或录音(Capture)需要的公共场景驱动能力,包括选择音频场景等。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| ([CheckSceneCapability](#checkscenecapability))(AudioHandle handle, const struct AudioSceneDescriptor \*scene, bool \*supported) | 是否支持某个音频场景的配置 | -| ([SelectScene](#selectscene))(AudioHandle handle, const struct AudioSceneDescriptor \*scene) | 选择音频场景 | - - -## **类成员变量说明** - - -### CheckSceneCapability - - -``` -int32_t(* AudioScene::CheckSceneCapability) (AudioHandle handle, const struct AudioSceneDescriptor *scene, bool *supported) -``` - -**描述:** - -是否支持某个音频场景的配置。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| scene | 输入参数,待获取的音频场景描述符。 | -| supported | 输出参数,是否支持的状态保存到supported中,true表示支持,false表示不支持。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[SelectScene](#selectscene) - - -### SelectScene - - -``` -int32_t(* AudioScene::SelectScene) (AudioHandle handle, const struct AudioSceneDescriptor *scene) -``` - -**描述:** - -选择音频场景。 - -- 选择一个非常具体的音频场景(应用场景和输出设备的组合),例如同样是使用手机中的喇叭作为输出设备: - - 在媒体播放场景scene为media_speaker - - 在语音通话免提场景scene为voice_speaker - -- 只是选择一个音频场景,例如使用场景为媒体播放(media)、电影播放(movie)、游戏播放(game)。 - -- 只是选择一个音频输出设备,例如输出设备为听筒(receiver)、喇叭(speaker)、有线耳机(headset)。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| scene | 输入参数,待设置的音频场景描述符。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[CheckSceneCapability](#checkscenecapability) diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_scene_descriptor.md b/zh-cn/device-dev/reference/hdi-apis/_audio_scene_descriptor.md index 3910b9897ea0b8337de6762bd93282530c1620c8..f31b4fb415ea38d32faca812197232215e66c616 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_scene_descriptor.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_scene_descriptor.md @@ -1,28 +1,48 @@ # AudioSceneDescriptor -## **概述** +## 概述 音频场景描述符。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 -### 类 +### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [SceneDesc](union_audio_scene_descriptor_1_1_scene_desc.md) | 音频场景描述 | +| [scene](#scene) | union [SceneDesc](union_scene_desc.md)
音频场景描述,详情参考[SceneDesc](union_scene_desc.md)。  | +| [desc](#desc) | struct [AudioDeviceDescriptor](_audio_device_descriptor.md)
音频设备描述符,详情参考[AudioDeviceDescriptor](_audio_device_descriptor.md)。  | -### Public 属性 +## 类成员变量说明 - | 名称 | 描述 | -| -------- | -------- | -| [scene](_audio.md#scene) | 音频场景的名称。 | -| [desc](_audio.md#desc-25) | 音频设备描述符。 | + +### desc + + +``` +struct AudioDeviceDescriptor AudioSceneDescriptor::desc +``` +**描述:** +音频设备描述符,详情参考[AudioDeviceDescriptor](_audio_device_descriptor.md)。 + + +### scene + + +``` +union SceneDesc AudioSceneDescriptor::scene +``` +**描述:** +音频场景描述,详情参考[SceneDesc](union_scene_desc.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_session_ext_info.md b/zh-cn/device-dev/reference/hdi-apis/_audio_session_ext_info.md index dbb96a35bdb71174a5dd356e90dadecc45bb7c75..6f777d5785b9085d3faff8940e8bee2130703ba0 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_session_ext_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_session_ext_info.md @@ -1,20 +1,37 @@ # AudioSessionExtInfo -## **概述** +## 概述 会话拓展信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [sessionType](_audio.md#sessiontype) | 音频会话类型。 | +| [sessionType](#sessiontype) | enum [AudioSessionType](_audio.md#audiosessiontype)
音频会话类型,详情参考[AudioSessionType](_audio.md#audiosessiontype)。  | + + +## 类成员变量说明 + + +### sessionType + + +``` +enum AudioSessionType AudioSessionExtInfo::sessionType +``` +**描述:** +音频会话类型,详情参考[AudioSessionType](_audio.md#audiosessiontype)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_sub_port_capability.md b/zh-cn/device-dev/reference/hdi-apis/_audio_sub_port_capability.md index 33da2e3ebea88ca10826c778d97f7d71d9904844..51b611ff8e84fee162c6581d234bd0813dc2034e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_sub_port_capability.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_sub_port_capability.md @@ -1,22 +1,59 @@ # AudioSubPortCapability -## **概述** +## 概述 音频子端口的支持能力。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [portId](_audio.md#portid-34) | 子端口ID。 | -| [desc](_audio.md#desc-45) | 以字符串命名的子端口。 | -| [mask](_audio.md#mask) | 数据透传模式。 | +| [portId](#portid) | unsigned int
子端口ID。  | +| [desc](#desc) | String
以字符串命名的子端口。  | +| [mask](#mask) | enum [AudioPortPassthroughMode](_audio.md#audioportpassthroughmode)
数据透传模式,详情参考[AudioPortPassthroughMode](_audio.md#audioportpassthroughmode)。  | + + +## 类成员变量说明 + + +### desc + + +``` +String AudioSubPortCapability::desc +``` +**描述:** +以字符串命名的子端口。 + + +### mask + + +``` +enum AudioPortPassthroughMode AudioSubPortCapability::mask +``` +**描述:** +数据透传模式,详情参考[AudioPortPassthroughMode](_audio.md#audioportpassthroughmode)。 + + +### portId + + +``` +unsigned int AudioSubPortCapability::portId +``` +**描述:** +子端口ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_time_stamp.md b/zh-cn/device-dev/reference/hdi-apis/_audio_time_stamp.md index 72f9c7d1b2bb9ef87d876e46620328874560c25d..d0357959d5851c14930fdbe4b4f39b2ce80bae2f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_time_stamp.md +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_time_stamp.md @@ -1,23 +1,50 @@ # AudioTimeStamp -## **概述** +## 概述 音频时间戳。 时间定义,POSIX timespec的替代品。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** [Audio](_audio.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [tvSec](_audio.md#tvsec) | tvSec时间,单位:秒。 | -| [tvNSec](_audio.md#tvnsec) | tvNSec时间,单位:纳秒。 | +| [tvSec](#tvsec) | long
tvSec时间,单位:秒。  | +| [tvNSec](#tvnsec) | long
tvNSec时间,单位:纳秒。  | + + +## 类成员变量说明 + + +### tvNSec + + +``` +long AudioTimeStamp::tvNSec +``` +**描述:** +tvNSec时间,单位:纳秒。 + + +### tvSec + + +``` +long AudioTimeStamp::tvSec +``` +**描述:** +tvSec时间,单位:秒。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_audio_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..66c6dff7f4a8c5088f51b27e055f69d62286e737 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_audio_types_8idl.md @@ -0,0 +1,75 @@ +# AudioTypes.idl + + +## 概述 + +Audio模块接口定义中使用的数据类型,包括音频端口、适配器描述符、设备描述符、场景描述符、采样属性、时间戳等。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [AudioDeviceStatus](_audio_device_status.md) | struct
音频设备状态。 | +| [SceneDesc](union_scene_desc.md) | union
音频场景描述。 | +| [AudioPort](_audio_port.md) | struct
音频端口。 | +| [AudioAdapterDescriptor](_audio_adapter_descriptor.md) | struct
音频适配器描述符。 | +| [AudioDeviceDescriptor](_audio_device_descriptor.md) | struct
音频设备描述符。 | +| [AudioSceneDescriptor](_audio_scene_descriptor.md) | struct
音频场景描述符。 | +| [AudioSampleAttributes](_audio_sample_attributes.md) | struct
音频采样属性。 | +| [AudioTimeStamp](_audio_time_stamp.md) | struct
音频时间戳。 | +| [AudioSubPortCapability](_audio_sub_port_capability.md) | struct
音频子端口的支持能力。 | +| [AudioPortCapability](_audio_port_capability.md) | struct
音频端口的支持能力。 | +| [AudioMmapBufferDescripter](_audio_mmap_buffer_descripter.md) | struct
mmap缓冲区描述符。 | +| [AudioDevExtInfo](_audio_dev_ext_info.md) | struct
音频设备拓展信息。 | +| [AudioMixExtInfo](_audio_mix_ext_info.md) | struct
音轨拓展信息。 | +| [AudioSessionExtInfo](_audio_session_ext_info.md) | struct
会话拓展信息。 | +| [AudioInfo](_audio_info.md) | struct
音频端口特定信息。 | +| [AudioRouteNode](_audio_route_node.md) | struct
音频路由节点。 | +| [AudioRoute](_audio_route.md) | struct
音频路由信息。 | +| [AudioEvent](_audio_event.md) | struct
音频事件。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [AudioPortDirection](_audio.md#audioportdirection) { PORT_OUT = 1 , PORT_IN = 2 , PORT_OUT_IN = 3 } | 音频端口的类型。 | +| [AudioPortPin](_audio.md#audioportpin) {
PIN_NONE = 0 , PIN_OUT_SPEAKER = 1 , PIN_OUT_HEADSET = 2 , PIN_OUT_LINEOUT = 4 ,
PIN_OUT_HDMI = 8 , PIN_IN_MIC = 134217729 , PIN_IN_HS_MIC = 134217730 , PIN_IN_LINEIN = 134217732 ,
PIN_IN_USB_EXT = 134217736
} | 音频端口上的Pin脚。 | +| [AudioCategory](_audio.md#audiocategory) { AUDIO_IN_MEDIA = 0 , AUDIO_IN_COMMUNICATION = 1 , AUDIO_IN_RINGTONE = 2 , AUDIO_IN_CALL = 3 } | 音频类型(场景)。 | +| [AudioFormat](_audio.md#audioformat) {
AUDIO_FORMAT_PCM_8_BIT = 1 , AUDIO_FORMAT_PCM_16_BIT = 2 , AUDIO_FORMAT_PCM_24_BIT = 3 , AUDIO_FORMAT_PCM_32_BIT = 4 ,
AUDIO_FORMAT_AAC_MAIN = 16777217 , AUDIO_FORMAT_AAC_LC = 16777218 , AUDIO_FORMAT_AAC_LD = 16777219 , AUDIO_FORMAT_AAC_ELD = 16777220 ,
AUDIO_FORMAT_AAC_HE_V1 = 16777221 , AUDIO_FORMAT_AAC_HE_V2 = 16777222 , AUDIO_FORMAT_G711A = 33554433 , AUDIO_FORMAT_G711U = 33554434 ,
AUDIO_FORMAT_G726 = 33554435
} | 音频格式。 | +| [AudioChannelMask](_audio.md#audiochannelmask) { AUDIO_CHANNEL_FRONT_LEFT = 1 , AUDIO_CHANNEL_FRONT_RIGHT = 2 , AUDIO_CHANNEL_MONO = 1 , AUDIO_CHANNEL_STEREO = 3 } | 音频通道掩码。 | +| [AudioSampleRatesMask](_audio.md#audiosampleratesmask) {
AUDIO_SAMPLE_RATE_MASK_8000 = 1 << 0 , AUDIO_SAMPLE_RATE_MASK_12000 = 1 << 1 , AUDIO_SAMPLE_RATE_MASK_11025 = 1 << 2 , AUDIO_SAMPLE_RATE_MASK_16000 = 1 << 3 ,
AUDIO_SAMPLE_RATE_MASK_22050 = 1 << 4 , AUDIO_SAMPLE_RATE_MASK_24000 = 1 << 5 , AUDIO_SAMPLE_RATE_MASK_32000 = 1 << 6 , AUDIO_SAMPLE_RATE_MASK_44100 = 1 << 7 ,
AUDIO_SAMPLE_RATE_MASK_48000 = 1 << 8 , AUDIO_SAMPLE_RATE_MASK_64000 = 1 << 9 , AUDIO_SAMPLE_RATE_MASK_96000 = 1 << 10 , AUDIO_SAMPLE_RATE_MASK_INVALID = 4294967295
} | 音频采样频率掩码。 | +| [AudioPortPassthroughMode](_audio.md#audioportpassthroughmode) { PORT_PASSTHROUGH_LPCM = 1 , PORT_PASSTHROUGH_RAW = 2 , PORT_PASSTHROUGH_HBR2LBR = 4 , PORT_PASSTHROUGH_AUTO = 8 } | 音频端口的数据透传模式。 | +| [AudioDeviceType](_audio.md#audiodevicetype) {
AUDIO_LINEOUT = 1 << 0 , AUDIO_HEADPHONE = 1 << 1 , AUDIO_HEADSET = 1 << 2 , AUDIO_USB_HEADSET = 1 << 3 ,
AUDIO_USB_HEADPHONE = 1 << 4 , AUDIO_USBA_HEADSET = 1 << 5 , AUDIO_USBA_HEADPHONE = 1 << 6 , AUDIO_PRIMARY_DEVICE = 1 << 7 ,
AUDIO_USB_DEVICE = 1 << 8 , AUDIO_A2DP_DEVICE = 1 << 9 , AUDIO_DEVICE_UNKOWN
} | 音频设备类型。 | +| [AudioEventType](_audio.md#audioeventtype) {
AUDIO_DEVICE_ADD = 1 , AUDIO_DEVICE_REMOVE = 2 , AUDIO_LOAD_SUCCESS = 3 , AUDIO_LOAD_FAILURE = 4 ,
AUDIO_UNLOAD = 5 , AUDIO_SERVICE_VALID = 7 , AUDIO_SERVICE_INVALID = 8 , AUDIO_CAPTURE_THRESHOLD = 9 ,
AUDIO_EVENT_UNKOWN = 10
} | 音频事件类型。 | +| [AudioExtParamKey](_audio.md#audioextparamkey) {
AUDIO_EXT_PARAM_KEY_NONE = 0 , AUDIO_EXT_PARAM_KEY_VOLUME = 1 , AUDIO_EXT_PARAM_KEY_FOCUS = 2 , AUDIO_EXT_PARAM_KEY_BUTTON = 3 ,
AUDIO_EXT_PARAM_KEY_EFFECT = 4 , AUDIO_EXT_PARAM_KEY_STATUS = 5 , AUDIO_EXT_PARAM_KEY_LOWPOWER = 1000
} | 音频扩展参数键类型。 | +| [AudioSampleFormat](_audio.md#audiosampleformat) {
AUDIO_SAMPLE_FORMAT_S8 = 0 , AUDIO_SAMPLE_FORMAT_S8P = 1 , AUDIO_SAMPLE_FORMAT_U8 = 2 , AUDIO_SAMPLE_FORMAT_U8P = 3 ,
AUDIO_SAMPLE_FORMAT_S16 = 4 , AUDIO_SAMPLE_FORMAT_S16P = 5 , AUDIO_SAMPLE_FORMAT_U16 = 6 , AUDIO_SAMPLE_FORMAT_U16P = 7 ,
AUDIO_SAMPLE_FORMAT_S24 = 8 , AUDIO_SAMPLE_FORMAT_S24P = 9 , AUDIO_SAMPLE_FORMAT_U24 = 10 , AUDIO_SAMPLE_FORMAT_U24P = 11 ,
AUDIO_SAMPLE_FORMAT_S32 = 12 , AUDIO_SAMPLE_FORMAT_S32P = 13 , AUDIO_SAMPLE_FORMAT_U32 = 14 , AUDIO_SAMPLE_FORMAT_U32P = 15 ,
AUDIO_SAMPLE_FORMAT_S64 = 16 , AUDIO_SAMPLE_FORMAT_S64P = 17 , AUDIO_SAMPLE_FORMAT_U64 = 18 , AUDIO_SAMPLE_FORMAT_U64P = 19 ,
AUDIO_SAMPLE_FORMAT_F32 = 20 , AUDIO_SAMPLE_FORMAT_F32P = 21 , AUDIO_SAMPLE_FORMAT_F64 = 22 , AUDIO_SAMPLE_FORMAT_F64P = 23
} | 原始音频样本格式。 | +| [AudioChannelMode](_audio.md#audiochannelmode) {
AUDIO_CHANNEL_NORMAL = 0 , AUDIO_CHANNEL_BOTH_LEFT , AUDIO_CHANNEL_BOTH_RIGHT , AUDIO_CHANNEL_EXCHANGE ,
AUDIO_CHANNEL_MIX , AUDIO_CHANNEL_LEFT_MUTE , AUDIO_CHANNEL_RIGHT_MUTE , AUDIO_CHANNEL_BOTH_MUTE
} | 音频播放的通道模式。 | +| [AudioDrainNotifyType](_audio.md#audiodrainnotifytype) { AUDIO_DRAIN_NORMAL_MODE , AUDIO_DRAIN_EARLY_MODE } | 音频数据结束类型。 | +| [AudioCallbackType](_audio.md#audiocallbacktype) {
AUDIO_NONBLOCK_WRITE_COMPELETED , AUDIO_DRAIN_COMPELETED , AUDIO_FLUSH_COMPLETED , AUDIO_RENDER_FULL ,
AUDIO_ERROR_OCCUR
} | 回调函数通知事件类型。 | +| [AudioPortRole](_audio.md#audioportrole) { AUDIO_PORT_UNASSIGNED_ROLE = 0 , AUDIO_PORT_SOURCE_ROLE = 1 , AUDIO_PORT_SINK_ROLE = 2 } | 音频端口角色。 | +| [AudioPortType](_audio.md#audioporttype) { AUDIO_PORT_UNASSIGNED_TYPE = 0 , AUDIO_PORT_DEVICE_TYPE = 1 , AUDIO_PORT_MIX_TYPE = 2 , AUDIO_PORT_SESSION_TYPE = 3 } | 音频端口类型。 | +| [AudioSessionType](_audio.md#audiosessiontype) { AUDIO_OUTPUT_STAGE_SESSION = 0 , AUDIO_OUTPUT_MIX_SESSION , AUDIO_ALLOCATE_SESSION , AUDIO_INVALID_SESSION } | 端口会话类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.audio.v1_0 | 音频接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_audio_volume.md b/zh-cn/device-dev/reference/hdi-apis/_audio_volume.md deleted file mode 100644 index 677f5f1999aee3d67a1d6ed0df577ca08eafde16..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_audio_volume.md +++ /dev/null @@ -1,239 +0,0 @@ -# AudioVolume - - -## **概述** - -AudioVolume音频音量接口。 - -提供音频播放(Render)或录音(Capture)需要的公共音量驱动能力,包括静音操作、设置音量、设置增益等。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| ([SetMute](#setmute))(AudioHandle handle, bool mute) | 设置音频的静音状态 | -| ([GetMute](#getmute))(AudioHandle handle, bool \*mute) | 获取音频的静音状态 | -| ([SetVolume](#setvolume))(AudioHandle handle, float volume) | 设置一个音频流的音量 | -| ([GetVolume](#getvolume))(AudioHandle handle, float \*volume) | 获取一个音频流的音量 | -| ([GetGainThreshold](#getgainthreshold))(AudioHandle handle, float \*min, float \*max) | 获取音频流增益的阈值 | -| ([GetGain](#getgain))(AudioHandle handle, float \*gain) | 获取音频流的增益 | -| ([SetGain](#setgain))(AudioHandle handle, float gain) | 设置音频流的增益 | - - -## **类成员变量说明** - - -### GetGain - - -``` -int32_t(* AudioVolume::GetGain) (AudioHandle handle, float *gain) -``` - -**描述:** - -获取音频流的增益。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| gain | 输出参数,保存当前获取到的增益到gain中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetGainThreshold](#getgainthreshold) - -[SetGain](#setgain) - - -### GetGainThreshold - - -``` -int32_t(* AudioVolume::GetGainThreshold) (AudioHandle handle, float *min, float *max) -``` - -**描述:** - -获取音频流增益的阈值。 - -在具体的功能实现中,可以根据芯片平台的实际情况来进行处理: - -- 可以使用实际的增益值,例如增益的范围为-50db ~ 6db。 - -- 也可以将增益范围设定为0.0~1.0,如果增益的范围为-50db ~ 6db, 则增益的映射关系为0.0表示静音,1.0表示最大增益(6db)。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| min | 输出参数,获取的音频增益的阈值下限保存到min中。 | -| max | 输出参数,获取的音频增益的阈值上限保存到max中。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetGain](#getgain) - -[SetGain](#setgain) - - -### GetMute - - -``` -int32_t(* AudioVolume::GetMute) (AudioHandle handle, bool *mute) -``` - -**描述:** - -获取音频的静音状态。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| mute | 输出参数,获取的静音状态保存到mute中,true表示静音操作,false表示取消静音操作。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[SetMute](#setmute) - - -### GetVolume - - -``` -int32_t(* AudioVolume::GetVolume) (AudioHandle handle, float *volume) -``` - -**描述:** - -获取一个音频流的音量。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| volume | 输出参数,获取的音量保存到volume中,范围0.0~1.0。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[SetVolume](#setvolume) - - -### SetGain - - -``` -int32_t(* AudioVolume::SetGain) (AudioHandle handle, float gain) -``` - -**描述:** - -设置音频流的增益。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| gain | 输入参数,待设置的增益。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetGainThreshold](#getgainthreshold) - -[GetGain](#getgain) - - -### SetMute - - -``` -int32_t(* AudioVolume::SetMute) (AudioHandle handle, bool mute) -``` - -**描述:** - -设置音频的静音状态。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| mute | 输入参数,待设置的静音状态,true表示静音操作,false表示取消静音操作。 | - -**返回:** - -成功返回值0,失败返回负值。 - -**参见:** - -[GetMute](#getmute) - - -### SetVolume - - -``` -int32_t(* AudioVolume::SetVolume) (AudioHandle handle, float volume) -``` - -**描述:** - -设置一个音频流的音量。 - -音量的取值范围是0.0~1.0,如果音频服务中的音量等级为15级(0 ~ 15),则音量的映射关系为0.0表示静音,1.0表示最大音量等级(15)。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| handle | 输入参数,待操作的音频句柄。 | -| volume | 输入参数,待设置的音量,范围0.0~1.0。 | - -**返回:** - -成功返回值0,失败返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_auth_result_info.md b/zh-cn/device-dev/reference/hdi-apis/_auth_result_info.md index add4d4a1fa15af78a2eea1d0258a4d3966ff6d63..d80012c865519a39632506a5f2c32fda44b8de08 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_auth_result_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_auth_result_info.md @@ -1,39 +1,35 @@ # AuthResultInfo -## **概述** +## 概述 用户身份认证结果信息。 -**Since:** - +**Since:** 3.2 - -**Version:** - +**Version:** 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [result](#result) | 用户身份认证结果。 | -| [freezingTime](#freezingtime) | 认证方式被冻结的时间。 | -| [remainTimes](#remaintimes) | 认证方式距离被冻结的可处理认证请求次数。 | -| [msgs](#msgs) | 执行器发送的消息。 | -| [token](#token) | 用户身份认证令牌。 | -| [rootSecret](#rootsecret) | 保护文件加密密钥的密钥。 | +| [result](#result) | unsigned int
用户身份认证结果。  | +| [freezingTime](#freezingtime) | int
认证方式被冻结的时间。  | +| [remainTimes](#remaintimes) | int
认证方式距离被冻结的可处理认证请求次数。  | +| [msgs](#msgs) | struct [ExecutorSendMsg](_executor_send_msg.md)[]
执行器发送的消息。  | +| [token](#token) | unsigned char[]
用户身份认证令牌。  | +| [rootSecret](#rootsecret) | unsigned char[]
保护文件加密密钥的密钥。  | -## **类成员变量说明** +## 类成员变量说明 ### freezingTime @@ -42,9 +38,7 @@ ``` int AuthResultInfo::freezingTime ``` - -**描述:** - +**描述:** 认证方式被冻结的时间。 @@ -54,9 +48,7 @@ int AuthResultInfo::freezingTime ``` struct ExecutorSendMsg [] AuthResultInfo::msgs ``` - -**描述:** - +**描述:** 执行器发送的消息。 @@ -66,9 +58,7 @@ struct ExecutorSendMsg [] AuthResultInfo::msgs ``` int AuthResultInfo::remainTimes ``` - -**描述:** - +**描述:** 认证方式距离被冻结的可处理认证请求次数。 @@ -78,31 +68,25 @@ int AuthResultInfo::remainTimes ``` unsigned int AuthResultInfo::result ``` - -**描述:** - +**描述:** 用户身份认证结果。 -### token +### rootSecret ``` -unsigned char [] AuthResultInfo::token +unsigned char [] AuthResultInfo::rootSecret ``` - -**描述:** - -用户身份认证令牌。 +**描述:** +保护文件加密密钥的密钥。 -### rootSecret +### token ``` -unsigned char [] AuthResultInfo::rootSecret +unsigned char [] AuthResultInfo::token ``` - -**描述:** - -保护文件加密密钥的密钥。 +**描述:** +用户身份认证令牌。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_auth_solution.md b/zh-cn/device-dev/reference/hdi-apis/_auth_solution.md index 623a2e8497137c71597eaafada3341487173630f..509c9b4dcb935112ebddb398579e37629448439b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_auth_solution.md +++ b/zh-cn/device-dev/reference/hdi-apis/_auth_solution.md @@ -1,38 +1,34 @@ # AuthSolution -## **概述** +## 概述 认证方案。 -**Since:** - +**Since:** 3.2 - -**Version:** - +**Version:** 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [userId](#userid) | 用户ID。 | -| [authTrustLevel](#authtrustlevel) | 认证结果可信等级。 | -| [authType](#authtype) | 用户认证凭据类型。 | -| [executorSensorHint](#executorsensorhint) | 既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 | -| [challenge](#challenge) | 挑战值,用于签发认证令牌。 | +| [userId](#userid) | int
用户ID。  | +| [authTrustLevel](#authtrustlevel) | unsigned int
认证结果可信等级。  | +| [authType](#authtype) | enum [AuthType](_hdf_user_auth.md#authtype)
用户认证凭据类型AuthType}。  | +| [executorSensorHint](#executorsensorhint) | unsigned int
既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。  | +| [challenge](#challenge) | unsigned char[]
挑战值,用于签发认证令牌。  | -## **类成员变量说明** +## 类成员变量说明 ### authTrustLevel @@ -41,9 +37,7 @@ ``` unsigned int AuthSolution::authTrustLevel ``` - -**描述:** - +**描述:** 认证结果可信等级。 @@ -53,10 +47,8 @@ unsigned int AuthSolution::authTrustLevel ``` enum AuthType AuthSolution::authType ``` - -**描述:** - -用户认证凭据类型[AuthType](_hdf_user_auth.md#authtype)。 +**描述:** +用户认证凭据类型AuthType}。 ### challenge @@ -65,9 +57,7 @@ enum AuthType AuthSolution::authType ``` unsigned char [] AuthSolution::challenge ``` - -**描述:** - +**描述:** 挑战值,用于签发认证令牌。 @@ -77,9 +67,7 @@ unsigned char [] AuthSolution::challenge ``` unsigned int AuthSolution::executorSensorHint ``` - -**描述:** - +**描述:** 既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 @@ -89,7 +77,5 @@ unsigned int AuthSolution::executorSensorHint ``` int AuthSolution::userId ``` - -**描述:** - +**描述:** 用户ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_available_network_info.md b/zh-cn/device-dev/reference/hdi-apis/_available_network_info.md new file mode 100644 index 0000000000000000000000000000000000000000..0329b72ee5c76825fbc5d5e6817bd8dbb7b9fdbf --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_available_network_info.md @@ -0,0 +1,77 @@ +# AvailableNetworkInfo + + +## 概述 + +可用网络信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [longName](#longname) | String
获取注册网络的长字母数字格式名称  | +| [shortName](#shortname) | String
获取注册网络的短字母数字格式名称  | +| [numeric](#numeric) | String
可用网络编号  | +| [status](#status) | int
网络状态,具体查看[RilRegStatus](_ril.md#rilregstatus) | +| [rat](#rat) | int
语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) | + + +## 类成员变量说明 + + +### longName + + +``` +String AvailableNetworkInfo::longName +``` +**描述:** +获取注册网络的长字母数字格式名称 + + +### numeric + + +``` +String AvailableNetworkInfo::numeric +``` +**描述:** +可用网络编号 + + +### rat + + +``` +int AvailableNetworkInfo::rat +``` +**描述:** +语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### shortName + + +``` +String AvailableNetworkInfo::shortName +``` +**描述:** +获取注册网络的短字母数字格式名称 + + +### status + + +``` +int AvailableNetworkInfo::status +``` +**描述:** +网络状态,具体查看[RilRegStatus](_ril.md#rilregstatus) diff --git a/zh-cn/device-dev/reference/hdi-apis/_available_network_list.md b/zh-cn/device-dev/reference/hdi-apis/_available_network_list.md new file mode 100644 index 0000000000000000000000000000000000000000..543486402f7281377f91411042551fa8ed7dd5a2 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_available_network_list.md @@ -0,0 +1,61 @@ +# AvailableNetworkList + + +## 概述 + +可用网络列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [itemNum](#itemnum) | int
编号 | +| [availableNetworkInfo](#availablenetworkinfo) | List< struct [AvailableNetworkInfo](_available_network_info.md) >
可用网络列表信息, | +| [flag](#flag) | int
网络列表标识位 | + + +## 类成员变量说明 + + +### availableNetworkInfo + + +``` +List AvailableNetworkList::availableNetworkInfo +``` + +**描述:** + +可用网络列表信息 + + +### flag + + +``` +int AvailableNetworkList::flag +``` + +**描述:** + +网络列表标识位 + + +### itemNum + + +``` +int AvailableNetworkList::itemNum +``` + +**描述:** + +编号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_avg_pool_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_avg_pool_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..bee2119d493edbbbd727abe504781b71f770f2fc --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_avg_pool_fusion.md @@ -0,0 +1,146 @@ +# AvgPoolFusion + + +## 概述 + +在输入tensor上应用 2D 平均池化。支持int8量化输入。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_AVGPOOL_FUSION。 + +参数限制:当padMode==PAD_MODE_PAD时,padList的数值必须大于等于0。其他情况下padding的数值必须为0。 + +输入: + +- x,n维张量。 + +输出: + +- output, 输出平均池化后的张量。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [kernelSize](#kernelsize) | long[]
用来取平均值的kernel大小 | +| [strides](#strides) | long[]
kernel移动的距离 | +| [pad](#pad) | long[]
x周围的填充 | +| [padMode](#padmode) | enum [PadMode](_n_n_rt.md#padmode)
填充模式 | +| [roundMode](#roundmode) | enum [RoundMode](_n_n_rt.md#roundmode)
取整数的算法 | +| [format](#format) | enum [Format](_n_n_rt.md#format)
运算时的数据排列排列,详情请参考:[Format](_n_n_rt.md#format) | +| [global](#global) | boolean
是否是全局池化 | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype) | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType AvgPoolFusion::activationType +``` + +**描述:** + +激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype) + + +### format + + +``` +enum Format AvgPoolFusion::format +``` + +**描述:** + +运算时的数据排列排列,详情请参考:[Format](_n_n_rt.md#format) + + +### global + + +``` +boolean AvgPoolFusion::global +``` + +**描述:** + +是否是全局池化 + + +### kernelSize + + +``` +long [] AvgPoolFusion::kernelSize +``` + +**描述:** + +用来取平均值的kernel大小,是一个长度为2的int数组[kernel_height,kernel_weight], 第一个数表示kernel高度,第二个数表示kernel宽度。 + + +### pad + + +``` +long [] AvgPoolFusion::pad +``` + +**描述:** + +x周围的填充,是一个长度为4的int数组[top,bottom,left,right],并且以最近邻的值填充。 + + +### padMode + + +``` +enum PadMode AvgPoolFusion::padMode +``` + +**描述:** + +填充模式 + + +### roundMode + + +``` +enum RoundMode AvgPoolFusion::roundMode +``` + +**描述:** + +取整数的算法 + + +### strides + + +``` +long [] AvgPoolFusion::strides +``` + +**描述:** + +kernel移动的距离,是一个长度为2的int数组[stride_height,stride_weight], 第一个数表示高度上的移动步幅,第二个数表示宽度上的移动步幅。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_batch_to_space_n_d.md b/zh-cn/device-dev/reference/hdi-apis/_batch_to_space_n_d.md new file mode 100644 index 0000000000000000000000000000000000000000..330569cb69209dbf13f636931e137fb94eb0b6ad --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_batch_to_space_n_d.md @@ -0,0 +1,71 @@ +# BatchToSpaceND + + +## 概述 + +将一个4维tensor的batch维度按block_shape切分成小块,并将这些小块拼接到空间维度。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_BATCH_TO_SPACE_ND。 + +输入: + +- x,n维tensor。 + +输出: + +- 输出张量,假设x的形状为(n,h,w,c),output的形状为(n',h',w',c'): + + - $ n' = n / (block_shape[0] \* block_shape[1]) $ + - $ h' = h \* block_shape[0] - crops[0][0] - crops[0][1] $ + - $ w' = w \* block_shape[1] - crops[1][0] - crops[1][1] $ + - $ c'= c $ + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [blockShape](#blockshape) | long[]
一个长度为2的数组[height_block,weight_block],指定切分到空间维度上的block大小。 | +| [crops](#crops) | long[][]
一个shape为(2,2)的2维数组[[crop0_start,crop0_end],[crop1_start,crop1_end]], 表示在output的空间维度上截掉部分元素。 | + + +## 类成员变量说明 + + +### blockShape + + +``` +long [] BatchToSpaceND::blockShape +``` + +**描述:** + +一个长度为2的数组[height_block,weight_block],指定切分到空间维度上的block大小。 + + +### crops + + +``` +long [][] BatchToSpaceND::crops +``` + +**描述:** + +一个shape为(2,2)的2维数组[[crop0_start,crop0_end],[crop1_start,crop1_end]], 表示在output的空间维度上截掉部分元素。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_battery_info.md b/zh-cn/device-dev/reference/hdi-apis/_battery_info.md index adc0e59b43be9c41ad81db6d428b7a3a6f26cbb9..4caca96ce5c036b1ce19c85e67a3ae3ddee8f616 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_battery_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_battery_info.md @@ -1,44 +1,42 @@ # BatteryInfo -## **概述** +## 概述 电池相关信息。 **Since:** - 3.1 - **相关模块:** [Battery](battery.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [capacity](#capacity) | 表示电池的电量百分比。 | -| [voltage](#voltage) | 表示电池的电压。 | -| [temperature](#temperature) | 表示电池的温度。 | -| [healthState](#healthstate) | 表示电池的健康状态。 | -| [pluggedType](#pluggedtype) | 表示电池的充电设备类型。 | -| [pluggedMaxCurrent](#pluggedmaxcurrent) | 表示电池的最大充电电流。 | -| [pluggedMaxVoltage](#pluggedmaxvoltage) | 表示电池的最大充电电压。 | -| [chargeState](#chargestate) | 表示电池的充电状态。 | -| [chargeCounter](#chargecounter) | 表示电池的充电次数。 | -| [totalEnergy](#totalenergy) | 表示电池的总容量。 | -| [curAverage](#curaverage) | 表示电池的平均电流。 | -| [curNow](#curnow) | 表示电池的实时电流。 | -| [remainEnergy](#remainenergy) | 表示电池的剩余容量。 | -| [present](#present) | 表示是否支持电池或者电池是否在位。 | -| [technology](#technology) | 表示电池的技术型号。 | - - -## **类成员变量说明** +| [capacity](#capacity) | int
表示电池的电量百分比。  | +| [voltage](#voltage) | int
表示电池的电压。  | +| [temperature](#temperature) | int
表示电池的温度  | +| [healthState](#healthstate) | int
表示电池的健康状态。  | +| [pluggedType](#pluggedtype) | int
表示电池的充电设备类型。  | +| [pluggedMaxCurrent](#pluggedmaxcurrent) | int
表示电池的最大充电电流。  | +| [pluggedMaxVoltage](#pluggedmaxvoltage) | int
表示电池的最大充电电压。  | +| [chargeState](#chargestate) | int
表示电池的充电状态。  | +| [chargeCounter](#chargecounter) | int
表示电池的充电次数。  | +| [totalEnergy](#totalenergy) | int
表示电池的总容量。  | +| [curAverage](#curaverage) | int
表示电池的平均电流。  | +| [curNow](#curnow) | int
表示电池的实时电流。  | +| [remainEnergy](#remainenergy) | int
表示电池的剩余容量。  | +| [present](#present) | byte
表示是否支持电池或者电池是否在位。  | +| [technology](#technology) | String
表示电池的技术型号。  | + + +## 类成员变量说明 ### capacity @@ -47,9 +45,7 @@ ``` int BatteryInfo::capacity ``` - -**描述:** - +**描述:** 表示电池的电量百分比。 @@ -59,9 +55,7 @@ int BatteryInfo::capacity ``` int BatteryInfo::chargeCounter ``` - -**描述:** - +**描述:** 表示电池的充电次数。 @@ -71,9 +65,7 @@ int BatteryInfo::chargeCounter ``` int BatteryInfo::chargeState ``` - -**描述:** - +**描述:** 表示电池的充电状态。 @@ -83,9 +75,7 @@ int BatteryInfo::chargeState ``` int BatteryInfo::curAverage ``` - -**描述:** - +**描述:** 表示电池的平均电流。 @@ -95,9 +85,7 @@ int BatteryInfo::curAverage ``` int BatteryInfo::curNow ``` - -**描述:** - +**描述:** 表示电池的实时电流。 @@ -107,9 +95,7 @@ int BatteryInfo::curNow ``` int BatteryInfo::healthState ``` - -**描述:** - +**描述:** 表示电池的健康状态。 @@ -119,9 +105,7 @@ int BatteryInfo::healthState ``` int BatteryInfo::pluggedMaxCurrent ``` - -**描述:** - +**描述:** 表示电池的最大充电电流。 @@ -131,9 +115,7 @@ int BatteryInfo::pluggedMaxCurrent ``` int BatteryInfo::pluggedMaxVoltage ``` - -**描述:** - +**描述:** 表示电池的最大充电电压。 @@ -143,9 +125,7 @@ int BatteryInfo::pluggedMaxVoltage ``` int BatteryInfo::pluggedType ``` - -**描述:** - +**描述:** 表示电池的充电设备类型。 @@ -155,9 +135,7 @@ int BatteryInfo::pluggedType ``` byte BatteryInfo::present ``` - -**描述:** - +**描述:** 表示是否支持电池或者电池是否在位。 @@ -167,9 +145,7 @@ byte BatteryInfo::present ``` int BatteryInfo::remainEnergy ``` - -**描述:** - +**描述:** 表示电池的剩余容量。 @@ -179,9 +155,7 @@ int BatteryInfo::remainEnergy ``` String BatteryInfo::technology ``` - -**描述:** - +**描述:** 表示电池的技术型号。 @@ -191,10 +165,8 @@ String BatteryInfo::technology ``` int BatteryInfo::temperature ``` - -**描述:** - -表示电池的温度。 +**描述:** +表示电池的温度 ### totalEnergy @@ -203,9 +175,7 @@ int BatteryInfo::temperature ``` int BatteryInfo::totalEnergy ``` - -**描述:** - +**描述:** 表示电池的总容量。 @@ -215,7 +185,5 @@ int BatteryInfo::totalEnergy ``` int BatteryInfo::voltage ``` - -**描述:** - +**描述:** 表示电池的电压。 diff --git a/zh-cn/device-dev/reference/hdi-apis/battery_types_idl.md b/zh-cn/device-dev/reference/hdi-apis/_battery_types_8idl.md similarity index 82% rename from zh-cn/device-dev/reference/hdi-apis/battery_types_idl.md rename to zh-cn/device-dev/reference/hdi-apis/_battery_types_8idl.md index c44dc0dd1388dcb423b6b57ecb229727d40a01bf..f9f23474c2a99310f53ded859ae4964a09639dc5 100644 --- a/zh-cn/device-dev/reference/hdi-apis/battery_types_idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_battery_types_8idl.md @@ -1,17 +1,17 @@ # Types.idl -## **概述** +## 概述 电池信息相关数据类型。 电池信息中使用的数据类型,包括健康状态、充电状态、充电设备类型和电池信息结构。 -**Since**: +**Since:** 3.1 -**Version**: +**Version:** 1.0 @@ -20,14 +20,14 @@ [Battery](battery.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [BatteryInfo](_battery_info.md) | 电池相关信息。 | +| [BatteryInfo](_battery_info.md) | struct
电池相关信息。 | ### 枚举 @@ -35,7 +35,7 @@ | 名称 | 描述 | | -------- | -------- | | [BatteryHealthState](battery.md#batteryhealthstate) { BATTERY_HEALTH_UNKNOWN = 0, BATTERY_HEALTH_GOOD, BATTERY_HEALTH_OVERHEAT, BATTERY_HEALTH_OVERVOLTAGE,   BATTERY_HEALTH_COLD, BATTERY_HEALTH_DEAD, BATTERY_HEALTH_RESERVED } | 电池的健康状态。 | -| [BatteryChargeState](battery.md#batterychargestate) { CHARGE_STATE_NONE = 0, CHARGE_STATE_ENABLE, CHARGE_STATE_DISABLE, CHARGE_STATE_FULL,   CHARGE_STATE_RESERVED } | 电池的充电状态。 | +| [BatteryChargeState](battery.md#batterychargestate) { CHARGE_STATE_NONE = 0, CHARGE_STATE_ENABLE, CHARGE_STATE_DISABLE, CHARGE_STATE_FULL, CHARGE_STATE_RESERVED } | 电池的充电状态。 | | [BatteryPluggedType](battery.md#batterypluggedtype) { PLUGGED_TYPE_NONE = 0, PLUGGED_TYPE_AC, PLUGGED_TYPE_USB, PLUGGED_TYPE_WIRELESS,   PLUGGED_TYPE_BUTT } | 电池的充电设备类型。 | @@ -43,4 +43,4 @@ | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.battery.v1_0 | 电池模块接口的包路径 | +| package ohos.hdi.battery.v1_0 | 电池模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_bias_add.md b/zh-cn/device-dev/reference/hdi-apis/_bias_add.md new file mode 100644 index 0000000000000000000000000000000000000000..5ccc80a8c5910684d4d27e276472828a3097a421 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_bias_add.md @@ -0,0 +1,26 @@ +# BiasAdd + + +## 概述 + +对给出的输入张量上的各个维度方向上的数据进行偏置。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_BIAS_ADD。 + +输入: + +- x,n维tensor。 + +- bias,偏置值tensor。 + +输出: + +- 输出张量,根据输入中每个维度方向偏置之后的结果。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_buffer_data.md b/zh-cn/device-dev/reference/hdi-apis/_buffer_data.md index 4d24eb0e40a3453cec07111e758312f454407ddd..4d4c6ba2595b5495af2922fd6d0974c6cf75e9f4 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_buffer_data.md +++ b/zh-cn/device-dev/reference/hdi-apis/_buffer_data.md @@ -1,26 +1,21 @@ # BufferData -## **概述** +## 概述 定义一层的缓冲区数据,包括虚拟和物理内存地址。 -**所属模块:** +**相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [phyAddr](_display.md#phyaddr-13) | 物理内存地址。 | -| [virAddr](_display.md#viraddr-12) | 虚拟内存地址。 | - - -## **详细描述** - -定义一层的缓冲区数据,包括虚拟和物理内存地址。 +| [phyAddr](_display.md#phyaddr-13) | uint64_t
物理内存地址 | +| [virAddr](_display.md#viraddr-12) | void \*
虚拟内存地址 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_c_b_config_info.md b/zh-cn/device-dev/reference/hdi-apis/_c_b_config_info.md new file mode 100644 index 0000000000000000000000000000000000000000..8619419e574fc73b04533b75845d6bdb962c0f09 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_c_b_config_info.md @@ -0,0 +1,81 @@ +# CBConfigInfo + + +## 概述 + +GSM小区广播配置信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [mode](#mode) | int
是否激活  | +| [indicationType](#indicationtype) | int
响应类型 | +| [mids](#mids) | String
消息标识符组合  | +| [dcss](#dcss) | String
数据编码方案组合  | + + +## 类成员变量说明 + + +### dcss + + +``` +String CBConfigInfo::dcss +``` +**描述:** +数据编码方案组合 + + +### indicationType + + +``` +int CBConfigInfo::indicationType +``` +**描述:** +响应类型 + +- 0:查询上报 + +- 1:主动上报 + + +### mids + + +``` +String CBConfigInfo::mids +``` +**描述:** +消息标识符组合 + + +### mode + + +``` +int CBConfigInfo::mode +``` +**描述:** +是否激活 + + +### serial + + +``` +int CBConfigInfo::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_c_b_config_report_info.md b/zh-cn/device-dev/reference/hdi-apis/_c_b_config_report_info.md new file mode 100644 index 0000000000000000000000000000000000000000..9a74c2ec16e3d94eeefa69574d9f819203ff5cb9 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_c_b_config_report_info.md @@ -0,0 +1,125 @@ +# CBConfigReportInfo + + +## 概述 + +小区广播上报信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [indicationType](#indicationtype) | int
响应类型 | +| [sn](#sn) | int
小区广播序列号  | +| [mid](#mid) | int
消息标识符组合  | +| [page](#page) | int
小区广播页序号  | +| [pages](#pages) | int
小区广播总页数  | +| [length](#length) | int
pdu字节数  | +| [data](#data) | String
解码后的小区广播内容  | +| [dcs](#dcs) | String
数据编码方案组合  | +| [pdu](#pdu) | String
协议数据单元  | + + +## 类成员变量说明 + + +### data + + +``` +String CBConfigReportInfo::data +``` +**描述:** +解码后的小区广播内容 + + +### dcs + + +``` +String CBConfigReportInfo::dcs +``` +**描述:** +数据编码方案组合 + + +### indicationType + + +``` +int CBConfigReportInfo::indicationType +``` +**描述:** +响应类型 + +- 0:查询上报 + +- 1:主动上报 + + +### length + + +``` +int CBConfigReportInfo::length +``` +**描述:** +pdu字节数 + + +### mid + + +``` +int CBConfigReportInfo::mid +``` +**描述:** +消息标识符组合 + + +### page + + +``` +int CBConfigReportInfo::page +``` +**描述:** +小区广播页序号 + + +### pages + + +``` +int CBConfigReportInfo::pages +``` +**描述:** +小区广播总页数 + + +### pdu + + +``` +String CBConfigReportInfo::pdu +``` +**描述:** +协议数据单元 + + +### sn + + +``` +int CBConfigReportInfo::sn +``` +**描述:** +小区广播序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_forward_query_info_list.md b/zh-cn/device-dev/reference/hdi-apis/_call_forward_query_info_list.md new file mode 100644 index 0000000000000000000000000000000000000000..7fd8bff095cbe96216f38c2a86dfa8c510dea616 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_forward_query_info_list.md @@ -0,0 +1,55 @@ +# CallForwardQueryInfoList + + +## 概述 + +呼叫转移信息列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [callSize](#callsize) | int
总数  | +| [flag](#flag) | int
呼叫转移查询结果信息标识  | +| [calls](#calls) | List< struct [CallForwardQueryResult](_call_forward_query_result.md) >
呼叫转移查询结果信息  | + + +## 类成员变量说明 + + +### calls + + +``` +List CallForwardQueryInfoList::calls +``` +**描述:** +呼叫转移查询结果信息 + + +### callSize + + +``` +int CallForwardQueryInfoList::callSize +``` +**描述:** +总数 + + +### flag + + +``` +int CallForwardQueryInfoList::flag +``` +**描述:** +呼叫转移查询结果信息标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_forward_query_result.md b/zh-cn/device-dev/reference/hdi-apis/_call_forward_query_result.md new file mode 100644 index 0000000000000000000000000000000000000000..a4196991ec698efaa1489f8ef44795d4f2bf3637 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_forward_query_result.md @@ -0,0 +1,130 @@ +# CallForwardQueryResult + + +## 概述 + +呼叫转移查询结果信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [result](#result) | int
查询结果,具体查看[RilErrType](_ril.md#rilerrtype) | +| [status](#status) | int
状态 | +| [classx](#classx) | int
业务类别,参考3GPP TS 27.007  | +| [type](#type) | int
号码地址类型 | +| [reason](#reason) | int
呼叫转移类型 | +| [time](#time) | int
等待时长  | +| [number](#number) | String
电话号码  | + + +## 类成员变量说明 + + +### classx + + +``` +int CallForwardQueryResult::classx +``` +**描述:** +业务类别,参考3GPP TS 27.007 + + +### number + + +``` +String CallForwardQueryResult::number +``` +**描述:** +电话号码 + + +### reason + + +``` +int CallForwardQueryResult::reason +``` +**描述:** +呼叫转移类型 + +- 0:无条件转移 + +- 1:遇忙转移 + +- 2:无应答转移 + +- 3:不可达转移(无网络服务或者关机时) + +- 4:所有呼叫转移 + +- 5:所有条件转移 + + +### result + + +``` +int CallForwardQueryResult::result +``` +**描述:** +查询结果,具体查看[RilErrType](_ril.md#rilerrtype) + + +### serial + + +``` +int CallForwardQueryResult::serial +``` +**描述:** +请求的序列号 + + +### status + + +``` +int CallForwardQueryResult::status +``` +**描述:** +状态 + +- 0:未激活 + +- 1:激活 + + +### time + + +``` +int CallForwardQueryResult::time +``` +**描述:** +等待时长 + + +### type + + +``` +int CallForwardQueryResult::type +``` +**描述:** +号码地址类型 + +- 129:普通号码 + +- 145:国际号码 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_forward_set_info.md b/zh-cn/device-dev/reference/hdi-apis/_call_forward_set_info.md new file mode 100644 index 0000000000000000000000000000000000000000..a23c2ac4d6dd3d178d3e93da549af3852ef27704 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_forward_set_info.md @@ -0,0 +1,88 @@ +# CallForwardSetInfo + + +## 概述 + +呼叫转移信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [reason](#reason) | int
呼叫转移类型 | +| [mode](#mode) | int
呼叫转移的操作模式 | +| [classx](#classx) | int
业务类别,参考3GPP TS 27.007  | +| [number](#number) | String
电话号码  | + + +## 类成员变量说明 + + +### classx + + +``` +int CallForwardSetInfo::classx +``` +**描述:** +业务类别,参考3GPP TS 27.007 + + +### mode + + +``` +int CallForwardSetInfo::mode +``` +**描述:** +呼叫转移的操作模式 + +- 0:去激活 + +- 1:激活 + +- 2:状态查询 + +- 3:注册 + +- 4:删除 + + +### number + + +``` +String CallForwardSetInfo::number +``` +**描述:** +电话号码 + + +### reason + + +``` +int CallForwardSetInfo::reason +``` +**描述:** +呼叫转移类型 + +- 0:无条件转移 + +- 1:遇忙转移 + +- 2:无应答转移 + +- 3:不可达转移(无网络服务或者关机时) + +- 4:所有呼叫转移 + +- 5:所有条件转移 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_info.md b/zh-cn/device-dev/reference/hdi-apis/_call_info.md new file mode 100644 index 0000000000000000000000000000000000000000..92f7db3995927a24a35aa52ded5892f6bb8530fd --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_info.md @@ -0,0 +1,168 @@ +# CallInfo + + +## 概述 + +通话状态信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [index](#index) | int
呼叫标识  | +| [dir](#dir) | int
呼叫方向,0表示主叫,1表示被叫  | +| [state](#state) | int
呼叫状态 | +| [mode](#mode) | int
呼叫模式 | +| [mpty](#mpty) | int
多方通话状态 | +| [voiceDomain](#voicedomain) | int
语音电话的呼叫域 | +| [callType](#calltype) | int
通话类型,当前仅可为0,表示语音呼叫  | +| [type](#type) | int
码地址类型 | +| [number](#number) | String
电话号码  | +| [alpha](#alpha) | String
号码在电话本中对应的姓名  | + + +## 类成员变量说明 + + +### alpha + + +``` +String CallInfo::alpha +``` +**描述:** +号码在电话本中对应的姓名 + + +### callType + + +``` +int CallInfo::callType +``` +**描述:** +通话类型,当前仅可为0,表示语音呼叫 + + +### dir + + +``` +int CallInfo::dir +``` +**描述:** +呼叫方向,0表示主叫,1表示被叫 + + +### index + + +``` +int CallInfo::index +``` +**描述:** +呼叫标识 + + +### mode + + +``` +int CallInfo::mode +``` +**描述:** +呼叫模式 + +- 0:语音呼叫 + +- 1:数据呼叫 + +- 2:传真 + + +### mpty + + +``` +int CallInfo::mpty +``` +**描述:** +多方通话状态 + +- 0:不在多方通话中 + +- 1:在多方通话中 + + +### number + + +``` +String CallInfo::number +``` +**描述:** +电话号码 + + +### state + + +``` +int CallInfo::state +``` +**描述:** +呼叫状态 + +- 0:激活状态 + +- 1:呼叫保持状态 + +- 2:主叫,拨号状态 + +- 3:主叫,回铃音状态 + +- 4:被叫,来电状态 + +- 5:被叫,呼叫等待状态 + +- 6:挂断状态 + +- 7:正在挂断状态 + +- 8:空闲状态 + + +### type + + +``` +int CallInfo::type +``` +**描述:** +码地址类型 + +- 129:普通号码 + +- 145:国际号码 + + +### voiceDomain + + +``` +int CallInfo::voiceDomain +``` +**描述:** +语音电话的呼叫域 + +- 0:CS域电话 + +- 1:IP多媒体系统(IMS)域电话 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_info_list.md b/zh-cn/device-dev/reference/hdi-apis/_call_info_list.md new file mode 100644 index 0000000000000000000000000000000000000000..bad997048fd80cd2b886ccf2fd630cfb7f63bff3 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_info_list.md @@ -0,0 +1,55 @@ +# CallInfoList + + +## 概述 + +通话状态信息列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [callSize](#callsize) | int
总数  | +| [flag](#flag) | int
通话状态信息列表标识  | +| [calls](#calls) | List< struct [CallInfo](_call_info.md) >
通话状态信息列表  | + + +## 类成员变量说明 + + +### calls + + +``` +List CallInfoList::calls +``` +**描述:** +通话状态信息列表 + + +### callSize + + +``` +int CallInfoList::callSize +``` +**描述:** +总数 + + +### flag + + +``` +int CallInfoList::flag +``` +**描述:** +通话状态信息列表标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_restriction_info.md b/zh-cn/device-dev/reference/hdi-apis/_call_restriction_info.md new file mode 100644 index 0000000000000000000000000000000000000000..c77018abc6c39af4b523bd57fba0efd3143db89b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_restriction_info.md @@ -0,0 +1,59 @@ +# CallRestrictionInfo + + +## 概述 + +呼叫限制信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [mode](#mode) | int
操作模式 | +| [fac](#fac) | String
操作对象  | +| [password](#password) | String
密码  | + + +## 类成员变量说明 + + +### fac + + +``` +String CallRestrictionInfo::fac +``` +**描述:** +操作对象 + + +### mode + + +``` +int CallRestrictionInfo::mode +``` +**描述:** +操作模式 + +- 0:去激活 + +- 1:激活 + + +### password + + +``` +String CallRestrictionInfo::password +``` +**描述:** +密码 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_restriction_result.md b/zh-cn/device-dev/reference/hdi-apis/_call_restriction_result.md new file mode 100644 index 0000000000000000000000000000000000000000..3f72a824680e221db2325f485d94a4547ea41524 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_restriction_result.md @@ -0,0 +1,59 @@ +# CallRestrictionResult + + +## 概述 + +呼叫限制结果信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [result](#result) | int
查询结果,具体查看[RilErrType](_ril.md#rilerrtype) | +| [status](#status) | int
业务状态 | +| [classCw](#classcw) | int
业务类别,参考3GPP TS 27.007  | + + +## 类成员变量说明 + + +### classCw + + +``` +int CallRestrictionResult::classCw +``` +**描述:** +业务类别,参考3GPP TS 27.007 + + +### result + + +``` +int CallRestrictionResult::result +``` +**描述:** +查询结果,具体查看[RilErrType](_ril.md#rilerrtype) + + +### status + + +``` +int CallRestrictionResult::status +``` +**描述:** +业务状态 + +- 0:未激活 + +- 1:激活 diff --git a/zh-cn/device-dev/reference/hdi-apis/_call_wait_result.md b/zh-cn/device-dev/reference/hdi-apis/_call_wait_result.md new file mode 100644 index 0000000000000000000000000000000000000000..8c5a5883b786abd7856c0aeda314b6293deea691 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_call_wait_result.md @@ -0,0 +1,59 @@ +# CallWaitResult + + +## 概述 + +呼叫等待结果信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [result](#result) | int
查询结果,具体查看[RilErrType](_ril.md#rilerrtype) | +| [status](#status) | int
当前呼叫等待的业务状态 | +| [classCw](#classcw) | int
业务类别,参考3GPP TS 27.007  | + + +## 类成员变量说明 + + +### classCw + + +``` +int CallWaitResult::classCw +``` +**描述:** +业务类别,参考3GPP TS 27.007 + + +### result + + +``` +int CallWaitResult::result +``` +**描述:** +查询结果,具体查看[RilErrType](_ril.md#rilerrtype) + + +### status + + +``` +int CallWaitResult::status +``` +**描述:** +当前呼叫等待的业务状态 + +- 0:未激活 + +- 1:激活 diff --git a/zh-cn/device-dev/reference/hdi-apis/camera.md b/zh-cn/device-dev/reference/hdi-apis/_camera.md similarity index 84% rename from zh-cn/device-dev/reference/hdi-apis/camera.md rename to zh-cn/device-dev/reference/hdi-apis/_camera.md index 5b5de306eac29c4a6357dd4b8443981d69ffc592..56a90503a481fa6d29026b9962ae0b3e0e2fac89 100644 --- a/zh-cn/device-dev/reference/hdi-apis/camera.md +++ b/zh-cn/device-dev/reference/hdi-apis/_camera.md @@ -1,22 +1,22 @@ # Camera -## **概述** +## 概述 Camera模块接口定义。 Camera模块涉及相机设备的操作、流的操作、离线流的操作和各种回调等。 -**Since**: +**Since:** 3.2 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 @@ -30,25 +30,25 @@ Camera模块涉及相机设备的操作、流的操作、离线流的操作和 | [IOfflineStreamOperator.idl](_i_offline_stream_operator_8idl.md) | 离线流的操作接口。 | | [IStreamOperator.idl](_i_stream_operator_8idl.md) | 流的操作接口。 | | [IStreamOperatorCallback.idl](_i_stream_operator_callback_8idl.md) | [IStreamOperator](interface_i_stream_operator.md)相关的回调,这些回调均由调用者实现。 | -| [Types.idl](camera_2v1__0_2_types_8idl.md) | Camera模块HDI接口使用的数据类型。 | +| [Types.idl](_types_8idl.md) | Camera模块HDI接口使用的数据类型。 | ### 类 | 名称 | 描述 | | -------- | -------- | -| [ICameraDevice](interface_i_camera_device.md) | 定义Camera设备基本的操作。 | -| [ICameraDeviceCallback](interface_i_camera_device_callback.md) | 定义Camera设备回调操作。 | -| [ICameraHost](interface_i_camera_host.md) | 定义Camera设备功能操作。 | -| [ICameraHostCallback](interface_i_camera_host_callback.md) | 定义Camera设备功能回调操作。 | -| [IOfflineStreamOperator](interface_i_offline_stream_operator.md) | 定义Camera设备离线流操作。 | -| [IStreamOperator](interface_i_stream_operator.md) | 定义Camera设备流操作。 | -| [IStreamOperatorCallback](interface_i_stream_operator_callback.md) | 定义Camera设备流回调操作。 | -| [StreamInfo](_stream_info.md) | 流信息,用于创建流时传入相关的配置参数。 | -| [StreamAttribute](_stream_attribute.md) | 流的属性。 | -| [CaptureInfo](_capture_info.md) | 捕获请求的相关信息。 | -| [CaptureEndedInfo](_capture_ended_info.md) | 捕获结束相关信息,用于捕获结束回调[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)。 | -| [CaptureErrorInfo](_capture_error_info.md) | 流错误信息,用于回调[OnCaptureError](interface_i_stream_operator_callback.md#oncaptureerror)。 | +| [ICameraDevice](interface_i_camera_device.md) | interface
定义Camera设备基本的操作。 | +| [ICameraDeviceCallback](interface_i_camera_device_callback.md) | interface
定义Camera设备回调操作。 | +| [ICameraHost](interface_i_camera_host.md) | interface
定义Camera设备功能操作。 | +| [ICameraHostCallback](interface_i_camera_host_callback.md) | interface
定义Camera设备功能回调操作。 | +| [IOfflineStreamOperator](interface_i_offline_stream_operator.md) | interface
定义Camera设备离线流操作。 | +| [IStreamOperator](interface_i_stream_operator.md) | interface
定义Camera设备流操作。 | +| [IStreamOperatorCallback](interface_i_stream_operator_callback.md) | interface
定义Camera设备流回调操作。 | +| [StreamInfo](_stream_info.md) | struct
流信息,用于创建流时传入相关的配置参数。 | +| [StreamAttribute](_stream_attribute.md) | struct
流的属性。 | +| [CaptureInfo](_capture_info.md) | struct
捕获请求的相关信息。 | +| [CaptureEndedInfo](_capture_ended_info.md) | struct
捕获结束相关信息,用于捕获结束回调[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)。 | +| [CaptureErrorInfo](_capture_error_info.md) | struct
流错误信息,用于回调[OnCaptureError](interface_i_stream_operator_callback.md#oncaptureerror)。 | ### 枚举 @@ -76,7 +76,7 @@ Camera模块涉及相机设备的操作、流的操作、离线流的操作和 | sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable | ohos.hdi.camera.v1_0序列,可用缓冲区生成器。 | -## **枚举类型说明** +## 枚举类型说明 ### CameraEvent @@ -86,7 +86,7 @@ Camera模块涉及相机设备的操作、流的操作、离线流的操作和 enum CameraEvent ``` -**描述:** +**描述:** Camera事件。 @@ -103,7 +103,7 @@ Camera事件。 enum CameraStatus ``` -**描述:** +**描述:** Camera设备状态。 @@ -120,7 +120,7 @@ Camera设备状态。 enum CamRetCode ``` -**描述:** +**描述:** HDI接口的返回值。 @@ -143,7 +143,7 @@ HDI接口的返回值。 enum EncodeType ``` -**描述:** +**描述:** 流数据的编码类型。 @@ -162,7 +162,7 @@ enum EncodeType enum ErrorType ``` -**描述:** +**描述:** 设备错误类型,用于设备错误回调[OnError](interface_i_camera_device_callback.md#onerror)。 @@ -185,7 +185,7 @@ enum ErrorType enum FlashlightStatus ``` -**描述:** +**描述:** 闪光灯状态。 @@ -203,7 +203,7 @@ enum FlashlightStatus enum OperationMode ``` -**描述:** +**描述:** 流的使用模式。 @@ -219,7 +219,7 @@ enum OperationMode enum ResultCallbackMode ``` -**描述:** +**描述:** metadata的上报模式。 @@ -236,7 +236,7 @@ metadata的上报模式。 enum StreamError ``` -**描述:** +**描述:** 流错误类型,用于流错误类型[CaptureErrorInfo](_capture_error_info.md)。 @@ -253,7 +253,7 @@ enum StreamError enum StreamIntent ``` -**描述:** +**描述:** 流的类型。 @@ -274,7 +274,7 @@ enum StreamIntent enum StreamSupportType ``` -**描述:** +**描述:** 对动态配置流的支持类型,使用场景参考[IsStreamsSupported](interface_i_stream_operator.md#isstreamssupported)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_capture_ended_info.md b/zh-cn/device-dev/reference/hdi-apis/_capture_ended_info.md index d7e78cd69f34dee27853269c19d48b5589951e0d..82356349ddd22e19c6f9bd7bb98cdbdc613121e4 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_capture_ended_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_capture_ended_info.md @@ -1,27 +1,27 @@ # CaptureEndedInfo -## **概述** +## 概述 捕获结束相关信息,用于捕获结束回调[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [streamId_](#streamid) | 捕获的流ID。 | -| [frameCount_](#framecount) | 捕获结束时已经抓取的帧数。 | +| [streamId_](#streamid_) | int
捕获的流ID。 | +| [frameCount_](#framecount_) | int
捕获结束时已经抓取的帧数。 | -## **类成员变量说明** +## 类成员变量说明 ### frameCount_ @@ -31,7 +31,7 @@ int CaptureEndedInfo::frameCount_ ``` -**描述:** +**描述:** 捕获结束时已经抓取的帧数。 @@ -43,6 +43,6 @@ int CaptureEndedInfo::frameCount_ int CaptureEndedInfo::streamId_ ``` -**描述:** +**描述:** 捕获的流ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_capture_error_info.md b/zh-cn/device-dev/reference/hdi-apis/_capture_error_info.md index 76cda626af0b840ad2d2ebe5e8493c2bfa5714b2..8cda8f6afde4089c7fd140744ffc53fb4b28f0b6 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_capture_error_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_capture_error_info.md @@ -1,27 +1,27 @@ # CaptureErrorInfo -## **概述** +## 概述 流错误信息,用于回调[OnCaptureError](interface_i_stream_operator_callback.md#oncaptureerror)。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [streamId_](#streamid) | 流ID。 | -| [error_](#error) | 错误类型。 | +| [streamId_](#streamid_) | int
流Id。 | +| [error_](#error_) | enum [StreamError](_camera.md#streamerror)
错误类型。 | -## **类成员变量说明** +## 类成员变量说明 ### error_ @@ -31,7 +31,7 @@ enum StreamError CaptureErrorInfo::error_ ``` -**描述:** +**描述:** 错误类型。 @@ -43,6 +43,6 @@ enum StreamError CaptureErrorInfo::error_ int CaptureErrorInfo::streamId_ ``` -**描述:** +**描述:** -流ID。 +流Id。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_capture_info.md b/zh-cn/device-dev/reference/hdi-apis/_capture_info.md index b6b69fa0dc996f00361e19f6927c7a48ae7999dc..b41b819cfc3937e4a72d59a65be11f4ed045cde9 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_capture_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_capture_info.md @@ -1,28 +1,28 @@ # CaptureInfo -## **概述** +## 概述 捕获请求的相关信息。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [streamIds_](#streamids) | 捕获的流ID集合。 | -| [captureSetting_](#capturesetting) | 捕获的配置信息。 | -| [enableShutterCallback_](#enableshuttercallback) | 使能捕获回调。 | +| [streamIds_](#streamids_) | int[]
捕获的流ID集合。 | +| [captureSetting_](#capturesetting_) | unsigned char[]
捕获的配置信息。 | +| [enableShutterCallback_](#enableshuttercallback_) | boolean
使能捕获回调,每一次捕获后都会触发[OnFrameShutter](interface_i_stream_operator_callback.md#onframeshutter)。 | -## **类成员变量说明** +## 类成员变量说明 ### captureSetting_ @@ -32,7 +32,7 @@ unsigned char [] CaptureInfo::captureSetting_ ``` -**描述:** +**描述:** 捕获的配置信息。 @@ -44,7 +44,7 @@ unsigned char [] CaptureInfo::captureSetting_ boolean CaptureInfo::enableShutterCallback_ ``` -**描述:** +**描述:** 使能捕获回调,每一次捕获后都会触发[OnFrameShutter](interface_i_stream_operator_callback.md#onframeshutter)。 @@ -56,6 +56,6 @@ boolean CaptureInfo::enableShutterCallback_ int [] CaptureInfo::streamIds_ ``` -**描述:** +**描述:** 捕获的流ID集合。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_card_status_info.md b/zh-cn/device-dev/reference/hdi-apis/_card_status_info.md new file mode 100644 index 0000000000000000000000000000000000000000..8b66840b82fd1c0337568e54e9aa2afd0f4b7e84 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_card_status_info.md @@ -0,0 +1,75 @@ +# CardStatusInfo + + +## 概述 + +SIM卡状态信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [index](#index) | int
SIM卡索引  | +| [simType](#simtype) | int
SIM卡类型。 | +| [simState](#simstate) | int
SIM卡状态。 | + + +## 类成员变量说明 + + +### index + + +``` +int CardStatusInfo::index +``` +**描述:** +SIM卡索引 + + +### simState + + +``` +int CardStatusInfo::simState +``` +**描述:** +SIM卡状态。 + +- -1:未知。 + +- 0:SIM卡未插入。 + +- 1:正常识卡。 + +- 2:需要输入PIN码。 + +- 3:需要输入PUK码。 + +- 4:需要输入PIN2码。 + +- 5:需要输入PUK2码 + + +### simType + + +``` +int CardStatusInfo::simType +``` +**描述:** +SIM卡类型。 + +- 0:未知。 + +- 1:普通SIM卡。 + +- 2:USIM,支持4G网络 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cast.md b/zh-cn/device-dev/reference/hdi-apis/_cast.md new file mode 100644 index 0000000000000000000000000000000000000000..d0ef24c0d5ad484bed2d859738f8217ad97ec1b0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cast.md @@ -0,0 +1,26 @@ +# Cast + + +## 概述 + +根据输出张量的类型对张量数据类型进行转换。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_CAST。 + +输入: + +- x,n维tensor + +- type,输入转换目的的数据类型。 + +输出: + +- output,按照输出tensor的数据类型进行类型转换。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_cdma_c_b_config_info.md b/zh-cn/device-dev/reference/hdi-apis/_cdma_c_b_config_info.md new file mode 100644 index 0000000000000000000000000000000000000000..6564e7f18eed89bf988eaf91762a5b23f5e3cb11 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cdma_c_b_config_info.md @@ -0,0 +1,55 @@ +# CdmaCBConfigInfo + + +## 概述 + +CDMA小区广播配置信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [service](#service) | int
服务  | +| [language](#language) | int
语言  | +| [checked](#checked) | int
是否选中  | + + +## 类成员变量说明 + + +### checked + + +``` +int CdmaCBConfigInfo::checked +``` +**描述:** +是否选中 + + +### language + + +``` +int CdmaCBConfigInfo::language +``` +**描述:** +语言 + + +### service + + +``` +int CdmaCBConfigInfo::service +``` +**描述:** +服务 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cdma_c_b_config_info_list.md b/zh-cn/device-dev/reference/hdi-apis/_cdma_c_b_config_info_list.md new file mode 100644 index 0000000000000000000000000000000000000000..16317eaf70afa4c8eba63dfd26f153a5d2857133 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cdma_c_b_config_info_list.md @@ -0,0 +1,55 @@ +# CdmaCBConfigInfoList + + +## 概述 + +CDMA小区广播配置信息列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [size](#size) | int
总数  | +| [list](#list) | List< struct [CdmaCBConfigInfo](_cdma_c_b_config_info.md) >
CDMA小区广播配置信息列表  | + + +## 类成员变量说明 + + +### list + + +``` +List CdmaCBConfigInfoList::list +``` +**描述:** +CDMA小区广播配置信息列表 + + +### serial + + +``` +int CdmaCBConfigInfoList::serial +``` +**描述:** +请求的序列号 + + +### size + + +``` +int CdmaCBConfigInfoList::size +``` +**描述:** +总数 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cdma_rssi.md b/zh-cn/device-dev/reference/hdi-apis/_cdma_rssi.md new file mode 100644 index 0000000000000000000000000000000000000000..665af693cdff18e330a20a808f5f0f74c82d12aa --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cdma_rssi.md @@ -0,0 +1,44 @@ +# CdmaRssi + + +## 概述 + +CDMA信号强度。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [absoluteRssi](#absoluterssi) | int
信号强度的绝对值, 该值是实际信号强度值乘以-1  | +| [ecno](#ecno) | int
PN码(Pseudo-Noise Code)片的接收能量与总接收功率谱密度之比  | + + +## 类成员变量说明 + + +### absoluteRssi + + +``` +int CdmaRssi::absoluteRssi +``` +**描述:** +信号强度的绝对值, 该值是实际信号强度值乘以-1 + + +### ecno + + +``` +int CdmaRssi::ecno +``` +**描述:** +PN码(Pseudo-Noise Code)片的接收能量与总接收功率谱密度之比 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_current_info.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_current_info.md new file mode 100644 index 0000000000000000000000000000000000000000..eaa7ebc7ac6f5cc014f9abd51a7a3b6ec2f23392 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_current_info.md @@ -0,0 +1,44 @@ +# CellListCurrentInfo + + +## 概述 + +当前小区信息列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [itemNum](#itemnum) | int
小区信息数量  | +| [cellCurrentInfo](#cellcurrentinfo) | List< struct [CurrentCellInfo](_current_cell_info.md) >
当前小区信息  | + + +## 类成员变量说明 + + +### cellCurrentInfo + + +``` +List CellListCurrentInfo::cellCurrentInfo +``` +**描述:** +当前小区信息 + + +### itemNum + + +``` +int CellListCurrentInfo::itemNum +``` +**描述:** +小区信息数量 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_nearby_info.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_nearby_info.md new file mode 100644 index 0000000000000000000000000000000000000000..54568950529bca779579ce04d86b7d61f5439ae0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_nearby_info.md @@ -0,0 +1,44 @@ +# CellListNearbyInfo + + +## 概述 + +附近小区信息列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [itemNum](#itemnum) | int
编号  | +| [cellNearbyInfo](#cellnearbyinfo) | List< struct [CellNearbyInfo](_cell_nearby_info.md) >
附近小区信息列表  | + + +## 类成员变量说明 + + +### cellNearbyInfo + + +``` +List CellListNearbyInfo::cellNearbyInfo +``` +**描述:** +附近小区信息列表 + + +### itemNum + + +``` +int CellListNearbyInfo::itemNum +``` +**描述:** +编号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_cdma.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_cdma.md new file mode 100644 index 0000000000000000000000000000000000000000..cac4e6aaf9eee50b3f2a38ca6270d2250d730d0a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_cdma.md @@ -0,0 +1,121 @@ +# CellListRatCdma + + +## 概述 + +CDMA小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [systemId](#systemid) | int
系统标识  | +| [networkId](#networkid) | int
网络标识  | +| [baseId](#baseid) | int
基本标识  | +| [zoneId](#zoneid) | int
区域标识  | +| [pilotPn](#pilotpn) | int
PN导频序列  | +| [pilotStrength](#pilotstrength) | int
导频信号强度  | +| [channel](#channel) | int
信道  | +| [longitude](#longitude) | int
经度  | +| [latitude](#latitude) | int
纬度  | + + +## 类成员变量说明 + + +### baseId + + +``` +int CellListRatCdma::baseId +``` +**描述:** +基本标识 + + +### channel + + +``` +int CellListRatCdma::channel +``` +**描述:** +信道 + + +### latitude + + +``` +int CellListRatCdma::latitude +``` +**描述:** +纬度 + + +### longitude + + +``` +int CellListRatCdma::longitude +``` +**描述:** +经度 + + +### networkId + + +``` +int CellListRatCdma::networkId +``` +**描述:** +网络标识 + + +### pilotPn + + +``` +int CellListRatCdma::pilotPn +``` +**描述:** +PN导频序列 + + +### pilotStrength + + +``` +int CellListRatCdma::pilotStrength +``` +**描述:** +导频信号强度 + + +### systemId + + +``` +int CellListRatCdma::systemId +``` +**描述:** +系统标识 + + +### zoneId + + +``` +int CellListRatCdma::zoneId +``` +**描述:** +区域标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_gsm.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_gsm.md new file mode 100644 index 0000000000000000000000000000000000000000..6035145d7cd389ff0a3e5b81c75be6b5712d499c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_gsm.md @@ -0,0 +1,88 @@ +# CellListRatGsm + + +## 概述 + +GSM小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [band](#band) | int
小区的band信息  | +| [arfcn](#arfcn) | int
BCCH(Broadcast Control Channel)载频的绝对射频频道号,取值范围0~1023  | +| [bsic](#bsic) | int
基站识别码  | +| [cellId](#cellid) | int
小区信息标识  | +| [lac](#lac) | int
位置区号,取值范围0~0xFFFF  | +| [rxlev](#rxlev) | int
信号接收强度,取值范围-120~37  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellListRatGsm::arfcn +``` +**描述:** +BCCH(Broadcast Control Channel)载频的绝对射频频道号,取值范围0~1023 + + +### band + + +``` +int CellListRatGsm::band +``` +**描述:** +小区的band信息 + + +### bsic + + +``` +int CellListRatGsm::bsic +``` +**描述:** +基站识别码 + + +### cellId + + +``` +int CellListRatGsm::cellId +``` +**描述:** +小区信息标识 + + +### lac + + +``` +int CellListRatGsm::lac +``` +**描述:** +位置区号,取值范围0~0xFFFF + + +### rxlev + + +``` +int CellListRatGsm::rxlev +``` +**描述:** +信号接收强度,取值范围-120~37 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_lte.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_lte.md new file mode 100644 index 0000000000000000000000000000000000000000..7cefeebe4a8ffe902097abf1533486ecdacaf671 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_lte.md @@ -0,0 +1,77 @@ +# CellListRatLte + + +## 概述 + +LTE小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [arfcn](#arfcn) | int
BCCH载频的绝对射频频道号,取值范围0~1023  | +| [pci](#pci) | int
物理小区标识  | +| [rsrp](#rsrp) | int
信号接收功率,取值范围-140~-44  | +| [rsrq](#rsrq) | int
信号接收质量,取值范围-19~-3  | +| [rxlev](#rxlev) | int
信号接收强度,取值范围-120~37  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellListRatLte::arfcn +``` +**描述:** +BCCH载频的绝对射频频道号,取值范围0~1023 + + +### pci + + +``` +int CellListRatLte::pci +``` +**描述:** +物理小区标识 + + +### rsrp + + +``` +int CellListRatLte::rsrp +``` +**描述:** +信号接收功率,取值范围-140~-44 + + +### rsrq + + +``` +int CellListRatLte::rsrq +``` +**描述:** +信号接收质量,取值范围-19~-3 + + +### rxlev + + +``` +int CellListRatLte::rxlev +``` +**描述:** +信号接收强度,取值范围-120~37 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_nr.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_nr.md new file mode 100644 index 0000000000000000000000000000000000000000..c753daf0804498d40232fdba5b2c1b34e51cc4c9 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_nr.md @@ -0,0 +1,66 @@ +# CellListRatNr + + +## 概述 + +NR小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [nrArfcn](#nrarfcn) | int
BCCH载频的绝对射频频道号  | +| [pci](#pci) | int
物理小区标识  | +| [tac](#tac) | int
类型分配码  | +| [nci](#nci) | int
NR小区标识  | + + +## 类成员变量说明 + + +### nci + + +``` +int CellListRatNr::nci +``` +**描述:** +NR小区标识 + + +### nrArfcn + + +``` +int CellListRatNr::nrArfcn +``` +**描述:** +BCCH载频的绝对射频频道号 + + +### pci + + +``` +int CellListRatNr::pci +``` +**描述:** +物理小区标识 + + +### tac + + +``` +int CellListRatNr::tac +``` +**描述:** +类型分配码 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_tdscdma.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_tdscdma.md new file mode 100644 index 0000000000000000000000000000000000000000..6bbda4441b8328fd4f2b4d4674c860e17cc0f29c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_tdscdma.md @@ -0,0 +1,121 @@ +# CellListRatTdscdma + + +## 概述 + +TDSCDMA小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [arfcn](#arfcn) | int
BCCH载频的绝对射频频道号  | +| [syncId](#syncid) | int
同步标识  | +| [sc](#sc) | int
超级小区  | +| [cellId](#cellid) | int
小区标识  | +| [lac](#lac) | int
位置区号,取值范围0~0xFFFF  | +| [rscp](#rscp) | int
接收信号码功率  | +| [drx](#drx) | int
不连续接收周期长度  | +| [rac](#rac) | int
路由区域码  | +| [cpid](#cpid) | int
超级小区标识  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellListRatTdscdma::arfcn +``` +**描述:** +BCCH载频的绝对射频频道号 + + +### cellId + + +``` +int CellListRatTdscdma::cellId +``` +**描述:** +小区标识 + + +### cpid + + +``` +int CellListRatTdscdma::cpid +``` +**描述:** +超级小区标识 + + +### drx + + +``` +int CellListRatTdscdma::drx +``` +**描述:** +不连续接收周期长度 + + +### lac + + +``` +int CellListRatTdscdma::lac +``` +**描述:** +位置区号,取值范围0~0xFFFF + + +### rac + + +``` +int CellListRatTdscdma::rac +``` +**描述:** +路由区域码 + + +### rscp + + +``` +int CellListRatTdscdma::rscp +``` +**描述:** +接收信号码功率 + + +### sc + + +``` +int CellListRatTdscdma::sc +``` +**描述:** +超级小区 + + +### syncId + + +``` +int CellListRatTdscdma::syncId +``` +**描述:** +同步标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_wcdma.md b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_wcdma.md new file mode 100644 index 0000000000000000000000000000000000000000..0c986b141bf58f0bcd9fdc5007d7dc09dd67ccf0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_list_rat_wcdma.md @@ -0,0 +1,66 @@ +# CellListRatWcdma + + +## 概述 + +WCDMA小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [arfcn](#arfcn) | int
BCCH载频的绝对射频频道号,取值范围0~16383  | +| [psc](#psc) | int
主扰码, 取值范围0~511  | +| [rscp](#rscp) | int
接收信号码功率, 取值范围-120~25  | +| [ecno](#ecno) | int
每个调制比特的功率与噪声频谱密度之比, 取值范围-25~0  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellListRatWcdma::arfcn +``` +**描述:** +BCCH载频的绝对射频频道号,取值范围0~16383 + + +### ecno + + +``` +int CellListRatWcdma::ecno +``` +**描述:** +每个调制比特的功率与噪声频谱密度之比, 取值范围-25~0 + + +### psc + + +``` +int CellListRatWcdma::psc +``` +**描述:** +主扰码, 取值范围0~511 + + +### rscp + + +``` +int CellListRatWcdma::rscp +``` +**描述:** +接收信号码功率, 取值范围-120~25 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_nearby_info.md b/zh-cn/device-dev/reference/hdi-apis/_cell_nearby_info.md new file mode 100644 index 0000000000000000000000000000000000000000..aa9e7c1cb3bfd14abaf54d34d5bb74dbe7f1328b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_nearby_info.md @@ -0,0 +1,58 @@ +# CellNearbyInfo + + +## 概述 + +相邻小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [ratType](#rattype) | int
接入技术类型 | +| [serviceCells](#servicecells) | union [ServiceCellParas](union_service_cell_paras.md)
多种网络模式的小区信息  | + + +## 类成员变量说明 + + +### ratType + + +``` +int CellNearbyInfo::ratType +``` +**描述:** +接入技术类型 + +- 0:未知 + +- 1:GSM + +- 2:CDMA + +- 3:WCDMA + +- 4:TDSCDMA + +- 5:LTE + +- 6:NR + + +### serviceCells + + +``` +union ServiceCellParas CellNearbyInfo::serviceCells +``` +**描述:** +多种网络模式的小区信息 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_rat_cdma.md b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_cdma.md new file mode 100644 index 0000000000000000000000000000000000000000..5cb990d0fb15887f916bb59129973c44b7c01cc1 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_cdma.md @@ -0,0 +1,121 @@ +# CellRatCdma + + +## 概述 + +CDMA蜂窝信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [systemId](#systemid) | int
系统标识  | +| [networkId](#networkid) | int
网络标识  | +| [baseId](#baseid) | int
基础标识  | +| [zoneId](#zoneid) | int
区域标识  | +| [pilotPn](#pilotpn) | int
PN导频序列  | +| [pilotStrength](#pilotstrength) | int
导频信号强度  | +| [channel](#channel) | int
信道  | +| [longitude](#longitude) | int
经度  | +| [latitude](#latitude) | int
纬度  | + + +## 类成员变量说明 + + +### baseId + + +``` +int CellRatCdma::baseId +``` +**描述:** +基础标识 + + +### channel + + +``` +int CellRatCdma::channel +``` +**描述:** +信道 + + +### latitude + + +``` +int CellRatCdma::latitude +``` +**描述:** +纬度 + + +### longitude + + +``` +int CellRatCdma::longitude +``` +**描述:** +经度 + + +### networkId + + +``` +int CellRatCdma::networkId +``` +**描述:** +网络标识 + + +### pilotPn + + +``` +int CellRatCdma::pilotPn +``` +**描述:** +PN导频序列 + + +### pilotStrength + + +``` +int CellRatCdma::pilotStrength +``` +**描述:** +导频信号强度 + + +### systemId + + +``` +int CellRatCdma::systemId +``` +**描述:** +系统标识 + + +### zoneId + + +``` +int CellRatCdma::zoneId +``` +**描述:** +区域标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_rat_gsm.md b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_gsm.md new file mode 100644 index 0000000000000000000000000000000000000000..93e92a8be07784a191b9a32eb48f3f2a4d59d5e7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_gsm.md @@ -0,0 +1,110 @@ +# CellRatGsm + + +## 概述 + +GSM蜂窝信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [band](#band) | int
小区的band信息  | +| [arfcn](#arfcn) | int
BCCH载频的绝对射频频道号,取值范围0~1023  | +| [bsic](#bsic) | int
基站识别码  | +| [cellId](#cellid) | int
小区标识  | +| [lac](#lac) | int
位置区号,取值范围0~0xFFFF  | +| [rxlev](#rxlev) | int
信号接收强度,取值范围-120~37  | +| [rxQuality](#rxquality) | int
信号接收质量,取值范围0~7  | +| [ta](#ta) | int
取值范围0~63  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellRatGsm::arfcn +``` +**描述:** +BCCH载频的绝对射频频道号,取值范围0~1023 + + +### band + + +``` +int CellRatGsm::band +``` +**描述:** +小区的band信息 + + +### bsic + + +``` +int CellRatGsm::bsic +``` +**描述:** +基站识别码 + + +### cellId + + +``` +int CellRatGsm::cellId +``` +**描述:** +小区标识 + + +### lac + + +``` +int CellRatGsm::lac +``` +**描述:** +位置区号,取值范围0~0xFFFF + + +### rxlev + + +``` +int CellRatGsm::rxlev +``` +**描述:** +信号接收强度,取值范围-120~37 + + +### rxQuality + + +``` +int CellRatGsm::rxQuality +``` +**描述:** +信号接收质量,取值范围0~7 + + +### ta + + +``` +int CellRatGsm::ta +``` +**描述:** +取值范围0~63 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_rat_lte.md b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_lte.md new file mode 100644 index 0000000000000000000000000000000000000000..823fd16b943496d9d737015ac6122cb8bd7a3016 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_lte.md @@ -0,0 +1,99 @@ +# CellRatLte + + +## 概述 + +LTE蜂窝信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [arfcn](#arfcn) | int
BCCH载频的绝对射频频道号  | +| [cellId](#cellid) | int
小区标识  | +| [pci](#pci) | int
物理小区标识  | +| [tac](#tac) | int
类型分配码  | +| [rsrp](#rsrp) | int
信号接收功率,取值范围-140~-44  | +| [rsrq](#rsrq) | int
信号接收质量,取值范围-19~-3  | +| [rssi](#rssi) | int
接收信号强度dbm,-90~-25  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellRatLte::arfcn +``` +**描述:** +BCCH载频的绝对射频频道号 + + +### cellId + + +``` +int CellRatLte::cellId +``` +**描述:** +小区标识 + + +### pci + + +``` +int CellRatLte::pci +``` +**描述:** +物理小区标识 + + +### rsrp + + +``` +int CellRatLte::rsrp +``` +**描述:** +信号接收功率,取值范围-140~-44 + + +### rsrq + + +``` +int CellRatLte::rsrq +``` +**描述:** +信号接收质量,取值范围-19~-3 + + +### rssi + + +``` +int CellRatLte::rssi +``` +**描述:** +接收信号强度dbm,-90~-25 + + +### tac + + +``` +int CellRatLte::tac +``` +**描述:** +类型分配码 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_rat_nr.md b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_nr.md new file mode 100644 index 0000000000000000000000000000000000000000..d8a8dfac0a2e56a8015ae72d5cad8647ca8a7f17 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_nr.md @@ -0,0 +1,66 @@ +# CellRatNr + + +## 概述 + +NR蜂窝信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [nrArfcn](#nrarfcn) | int
BCCH载频的绝对射频频道号  | +| [pci](#pci) | int
物理小区标识  | +| [tac](#tac) | int
类型分配码  | +| [nci](#nci) | int
NR小区标识  | + + +## 类成员变量说明 + + +### nci + + +``` +int CellRatNr::nci +``` +**描述:** +NR小区标识 + + +### nrArfcn + + +``` +int CellRatNr::nrArfcn +``` +**描述:** +BCCH载频的绝对射频频道号 + + +### pci + + +``` +int CellRatNr::pci +``` +**描述:** +物理小区标识 + + +### tac + + +``` +int CellRatNr::tac +``` +**描述:** +类型分配码 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_rat_tdscdma.md b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_tdscdma.md new file mode 100644 index 0000000000000000000000000000000000000000..db882237525be99422fbfbb7b86749c6f65bcb24 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_tdscdma.md @@ -0,0 +1,121 @@ +# CellRatTdscdma + + +## 概述 + +TDSCDMA蜂窝信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [arfcn](#arfcn) | int
BCCH载频的绝对射频频道号  | +| [syncId](#syncid) | int
同步标识  | +| [sc](#sc) | int
超级小区  | +| [cellId](#cellid) | int
小区标识  | +| [lac](#lac) | int
地区区域码  | +| [rscp](#rscp) | int
接收信号码功率  | +| [drx](#drx) | int
不连续接收周期长度  | +| [rac](#rac) | int
路由区域码  | +| [cpid](#cpid) | int
超级小区标识  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellRatTdscdma::arfcn +``` +**描述:** +BCCH载频的绝对射频频道号 + + +### cellId + + +``` +int CellRatTdscdma::cellId +``` +**描述:** +小区标识 + + +### cpid + + +``` +int CellRatTdscdma::cpid +``` +**描述:** +超级小区标识 + + +### drx + + +``` +int CellRatTdscdma::drx +``` +**描述:** +不连续接收周期长度 + + +### lac + + +``` +int CellRatTdscdma::lac +``` +**描述:** +地区区域码 + + +### rac + + +``` +int CellRatTdscdma::rac +``` +**描述:** +路由区域码 + + +### rscp + + +``` +int CellRatTdscdma::rscp +``` +**描述:** +接收信号码功率 + + +### sc + + +``` +int CellRatTdscdma::sc +``` +**描述:** +超级小区 + + +### syncId + + +``` +int CellRatTdscdma::syncId +``` +**描述:** +同步标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_rat_wcdma.md b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_wcdma.md new file mode 100644 index 0000000000000000000000000000000000000000..e8b3cd7f3a75c002b4718fd416e6098c15b8f5cf --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_rat_wcdma.md @@ -0,0 +1,121 @@ +# CellRatWcdma + + +## 概述 + +WCDMA蜂窝信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [arfcn](#arfcn) | int
BCCH载频的绝对射频频道号,取值范围0~16383  | +| [psc](#psc) | int
主扰码,取值范围0~511  | +| [cellId](#cellid) | int
小区标识  | +| [lac](#lac) | int
位置区号,取值范围0~0xFFFF  | +| [rscp](#rscp) | int
信号接收功率dBm, 取值范围-140~-44  | +| [rxlev](#rxlev) | int
信号接收强度,取值范围-19~-3  | +| [ecno](#ecno) | int
接收信号强度dbm,取值范围-90~-25  | +| [drx](#drx) | int
不连续接收周期长度,取值范围6~9  | +| [ura](#ura) | int
UTRAN(UMTS Terrestrial Radio Access Network)注册区域标识  | + + +## 类成员变量说明 + + +### arfcn + + +``` +int CellRatWcdma::arfcn +``` +**描述:** +BCCH载频的绝对射频频道号,取值范围0~16383 + + +### cellId + + +``` +int CellRatWcdma::cellId +``` +**描述:** +小区标识 + + +### drx + + +``` +int CellRatWcdma::drx +``` +**描述:** +不连续接收周期长度,取值范围6~9 + + +### ecno + + +``` +int CellRatWcdma::ecno +``` +**描述:** +接收信号强度dbm,取值范围-90~-25 + + +### lac + + +``` +int CellRatWcdma::lac +``` +**描述:** +位置区号,取值范围0~0xFFFF + + +### psc + + +``` +int CellRatWcdma::psc +``` +**描述:** +主扰码,取值范围0~511 + + +### rscp + + +``` +int CellRatWcdma::rscp +``` +**描述:** +信号接收功率dBm, 取值范围-140~-44 + + +### rxlev + + +``` +int CellRatWcdma::rxlev +``` +**描述:** +信号接收强度,取值范围-19~-3 + + +### ura + + +``` +int CellRatWcdma::ura +``` +**描述:** +UTRAN(UMTS Terrestrial Radio Access Network)注册区域标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cell_trajectory_data.md b/zh-cn/device-dev/reference/hdi-apis/_cell_trajectory_data.md new file mode 100644 index 0000000000000000000000000000000000000000..4d4742b61b0a71795ab44cbd7ecb52ea4bbd2f05 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cell_trajectory_data.md @@ -0,0 +1,117 @@ +# CellTrajectoryData + + +## 概述 + +定义上报的基站轨迹数据的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [timeStampLow](#timestamplow) | unsigned int
时间戳的低32位 | +| [timeStampHigh](#timestamphigh) | unsigned int
时间戳的高32位 | +| [cid](#cid) | unsigned lone
基站号 | +| [lac](#lac) | unsigned int
小区号 | +| [rssi](#rssi) | unsigned short
信号接收强度 | +| [mcc](#mcc) | unsigned short
移动国家码 | +| [mnc](#mnc) | unsigned short
移动网络码 | + + +## 类成员变量说明 + + +### cid + + +``` +unsigned lone CellTrajectoryData::cid +``` + +**描述:** + +基站号 + + +### lac + + +``` +unsigned int CellTrajectoryData::lac +``` + +**描述:** + +小区号 + + +### mcc + + +``` +unsigned short CellTrajectoryData::mcc +``` + +**描述:** + +移动国家码 + + +### mnc + + +``` +unsigned short CellTrajectoryData::mnc +``` + +**描述:** + +移动网络码 + + +### rssi + + +``` +unsigned short CellTrajectoryData::rssi +``` + +**描述:** + +信号接收强度 + + +### timeStampHigh + + +``` +unsigned int CellTrajectoryData::timeStampHigh +``` + +**描述:** + +时间戳的高32位 + + +### timeStampLow + + +``` +unsigned int CellTrajectoryData::timeStampLow +``` + +**描述:** + +时间戳的低32位 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cellbatching_request.md b/zh-cn/device-dev/reference/hdi-apis/_cellbatching_request.md new file mode 100644 index 0000000000000000000000000000000000000000..3827f1c54c6c4eac97a15a0d0ab0606b3e170ca8 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cellbatching_request.md @@ -0,0 +1,52 @@ +# CellbatchingRequest + + +## 概述 + +定义设置基站轨迹数据上报功能的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [status](#status) | int
基站轨迹数据记录功能开关,详见[CellbatchingSwitch](_hdi_lpfence_cellbatching.md#cellbatchingswitch)。 | +| [interval](#interval) | int
设置modem接收基站数据的时间间隔,单位为秒,最小间隔30秒,最大间隔240秒。 | + + +## 类成员变量说明 + + +### interval + + +``` +int CellbatchingRequest::interval +``` + +**描述:** + +设置modem接收基站数据的时间间隔,单位为秒,最小间隔30秒,最大间隔240秒 + + +### status + + +``` +int CellbatchingRequest::status +``` + +**描述:** + +基站轨迹数据记录功能开关,详见[CellbatchingSwitch](_hdi_lpfence_cellbatching.md#cellbatchingswitch)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cellbatching_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_cellbatching_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..0b4ef5805b49e04b67d48ab2d48f02c1e69281a8 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cellbatching_types_8idl.md @@ -0,0 +1,43 @@ +# CellbatchingTypes.idl + + +## 概述 + +定义基站轨迹数据记录模块使用的数据类型。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [CellbatchingRequest](_cellbatching_request.md) | struct
定义设置基站轨迹数据上报功能的数据结构。 | +| [CellTrajectoryData](_cell_trajectory_data.md) | struct
定义上报的基站轨迹数据的数据结构。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [CellbatchingSwitch](_hdi_lpfence_cellbatching.md#cellbatchingswitch) { SWITCH_OFF = 0 , SWITCH_ON = 1 } | 枚举对基站轨迹数据记录的开关操作。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellbatching.v1_0 | 基站轨迹数据记录模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_cellfence_info.md b/zh-cn/device-dev/reference/hdi-apis/_cellfence_info.md new file mode 100644 index 0000000000000000000000000000000000000000..d7fddf991e50fe5232fb02fa3680a78ccda4b383 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cellfence_info.md @@ -0,0 +1,52 @@ +# CellfenceInfo + + +## 概述 + +定义基站基本信息的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [lac](#lac) | unsigned int
基站号 | +| [cid](#cid) | unsigned long
小区号 | + + +## 类成员变量说明 + + +### cid + + +``` +unsigned long CellfenceInfo::cid +``` + +**描述:** + +小区号 + + +### lac + + +``` +unsigned int CellfenceInfo::lac +``` + +**描述:** + +基站号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cellfence_request.md b/zh-cn/device-dev/reference/hdi-apis/_cellfence_request.md new file mode 100644 index 0000000000000000000000000000000000000000..295d730738f02bb96a3b02423d91eacd4de47a04 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cellfence_request.md @@ -0,0 +1,52 @@ +# CellfenceRequest + + +## 概述 + +定义添加基站围栏的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [cellfenceId](#cellfenceid) | int
基站围栏的ID号,用于标识某个基站围栏,不可重复添加相同ID号的围栏。 | +| [cellInfo](#cellinfo) | struct [CellfenceInfo](_cellfence_info.md)[]
基站围栏信息,详见[CellfenceInfo](_cellfence_info.md)。 | + + +## 类成员变量说明 + + +### cellfenceId + + +``` +int CellfenceRequest::cellfenceId +``` + +**描述:** + +基站围栏的ID号,用于标识某个基站围栏,不可重复添加相同ID号的围栏。 + + +### cellInfo + + +``` +struct CellfenceInfo [] CellfenceRequest::cellInfo +``` + +**描述:** + +基站围栏信息,详见[CellfenceInfo](_cellfence_info.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cellfence_size.md b/zh-cn/device-dev/reference/hdi-apis/_cellfence_size.md new file mode 100644 index 0000000000000000000000000000000000000000..812d1f3cb701870fbc1901cb31a441dd45782f40 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cellfence_size.md @@ -0,0 +1,52 @@ +# CellfenceSize + + +## 概述 + +定义基站围栏使用信息的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [maxNum](#maxnum) | unsigned int
设备支持的最大基站围栏个数。 | +| [usedNum](#usednum) | unsigned int
当前设备已添加的基站围栏个数。 | + + +## 类成员变量说明 + + +### maxNum + + +``` +unsigned int CellfenceSize::maxNum +``` + +**描述:** + +设备支持的最大基站围栏个数。 + + +### usedNum + + +``` +unsigned int CellfenceSize::usedNum +``` + +**描述:** + +当前设备已添加的基站围栏个数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cellfence_status.md b/zh-cn/device-dev/reference/hdi-apis/_cellfence_status.md new file mode 100644 index 0000000000000000000000000000000000000000..3483c44d2efc43f63dcbe6cc1a336be4e376702a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cellfence_status.md @@ -0,0 +1,52 @@ +# CellfenceStatus + + +## 概述 + +定义设备与基站围栏状态关系的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [cellfenceId](#cellfenceid) | int
基站围栏的ID号,用于标识某个基站围栏。 | +| [status](#status) | unsigned short
设备与该基站围栏的位置关系。详见[CellfenceTransition](_hdi_lpfence_cellfence.md#cellfencetransition)。 | + + +## 类成员变量说明 + + +### cellfenceId + + +``` +int CellfenceStatus::cellfenceId +``` + +**描述:** + +基站围栏的ID号,用于标识某个基站围栏。 + + +### status + + +``` +unsigned short CellfenceStatus::status +``` + +**描述:** + +设备与该基站围栏的位置关系。详见[CellfenceTransition](_hdi_lpfence_cellfence.md#cellfencetransition)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cellfence_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_cellfence_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..8679bb9e36bac509621fd7a63d432b8c88c77ba7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cellfence_types_8idl.md @@ -0,0 +1,45 @@ +# CellfenceTypes.idl + + +## 概述 + +定义基站围栏使用的数据类型。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [CellfenceInfo](_cellfence_info.md) | struct
定义基站基本信息的数据结构。 | +| [CellfenceRequest](_cellfence_request.md) | struct
定义添加基站围栏的数据结构。 | +| [CellfenceStatus](_cellfence_status.md) | struct
定义设备与基站围栏状态关系的数据结构。 | +| [CellfenceSize](_cellfence_size.md) | struct
定义基站围栏使用信息的数据结构。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [CellfenceTransition](_hdi_lpfence_cellfence.md#cellfencetransition) { FENCE_ENTER = 0 , FENCE_EXIT = 3 } | 枚举设备与基站围栏的位置关系。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellfence.v1_0 | 基站围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_channel_config_info_list.md b/zh-cn/device-dev/reference/hdi-apis/_channel_config_info_list.md new file mode 100644 index 0000000000000000000000000000000000000000..f730b55556bac7b44dbf651906931faee23d39a6 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_channel_config_info_list.md @@ -0,0 +1,55 @@ +# ChannelConfigInfoList + + +## 概述 + +通道配置信息列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [itemNum](#itemnum) | int
编号  | +| [channelConfigInfos](#channelconfiginfos) | List< struct [PhysicalChannelConfig](_physical_channel_config.md) >
物理通道配置  | +| [flag](#flag) | int
通道配置标识  | + + +## 类成员变量说明 + + +### channelConfigInfos + + +``` +List ChannelConfigInfoList::channelConfigInfos +``` +**描述:** +物理通道配置 + + +### flag + + +``` +int ChannelConfigInfoList::flag +``` +**描述:** +通道配置标识 + + +### itemNum + + +``` +int ChannelConfigInfoList::itemNum +``` +**描述:** +编号 diff --git a/zh-cn/device-dev/reference/hdi-apis/codec.md b/zh-cn/device-dev/reference/hdi-apis/_codec.md similarity index 55% rename from zh-cn/device-dev/reference/hdi-apis/codec.md rename to zh-cn/device-dev/reference/hdi-apis/_codec.md index 94f2cc468c9d22a470f36129b1b182ff16b7d5ba..4e4636bbe3503b66756636aa37ffb65d5cf34bfd 100644 --- a/zh-cn/device-dev/reference/hdi-apis/codec.md +++ b/zh-cn/device-dev/reference/hdi-apis/_codec.md @@ -1,69 +1,69 @@ # Codec -## **概述** +## 概述 Codec模块接口定义。 Codec模块涉及自定义类型、音视频编解码组件初始化、参数设置、数据的轮转和控制等。 -**Since**: +**Since:** 3.1 -**Version**: +**Version:** 2.0 -## **汇总** +## 汇总 ### 文件 | 名称 | 描述 | | -------- | -------- | -| [codec_callback_if.h](codec_callback_if_h.md) | 主要包括回调函数接口定义。 | -| [codec_common_type.h](codec_common_type_h.md) | Codec模块接口定义中使用的自定义数据类型。 | -| [codec_component_if.h](codec_component_if_h.md) | 主要包括Codec组件接口定义。 | -| [codec_component_manager.h](codec__component__manager_h.md) | 主要包括Codec组件管理类接口。 | -| [codec_component_type.h](codec__component__type_h.md) | Codec模块接口定义中使用的自定义数据类型。 | +| [codec_callback_if.h](codec__callback__if_8h.md) | 主要包括回调函数接口定义。 | +| [codec_common_type.h](codec__common__type_8h.md) | Codec模块接口定义中使用的自定义数据类型。 | +| [codec_component_if.h](codec__component__if_8h.md) | 主要包括Codec组件接口定义。 | +| [codec_component_manager.h](codec__component__manager_8h.md) | 主要包括Codec组件管理类接口。 | +| [codec_component_type.h](codec__component__type_8h.md) | Codec模块接口定义中使用的自定义数据类型。 | ### 类 | 名称 | 描述 | | -------- | -------- | -| [CodecCallbackType](_codec_callback_type.md) | Codec回调接口定义。 | -| [Alignment](_alignment.md) | 对齐结构定义,包含宽高的对齐值。 | -| [Rect](_rect.md) | 矩形的定义。 | -| [RangeValue](_range_value.md) | 取值范围的定义。 | -| [CodecComponentType](_codec_component_type.md) | Codec组件接口定义。 | -| [CodecComponentManager](_codec_component_manager.md) | Codec组件管理类接口定义。 | -| [VideoPortCap](_video_port_cap.md) | 定义视频编解码能力。 | -| [AudioPortCap](audio_portcap.md) | 定义音频编解码能力。 | -| [PortCap](union_port_cap.md) | 定义音视频编解码能力。 | -| [CodecCompCapability](_codec_comp_capability.md) | 定义Codec编解码能力。 | -| [OmxCodecBuffer](_omx_codec_buffer.md) | Codec buffer信息的定义。 | -| [CompVerInfo](_comp_ver_info.md) | 定义组件版本信息。 | -| [EventInfo](_event_info.md) | 定义事件上报信息。 | -| [SupportBufferType](_support_buffer_type.md) | SupportBuffer类型定义。 | -| [UseBufferType](_use_buffer_type.md) | UseBuffer类型定义。 | -| [GetBufferHandleUsageParams](_get_buffer_handle_usage_params.md) | BufferHandleUsage类型定义。 | +| [CodecCallbackType](_codec_callback_type.md) | struct
Codec回调接口定义。 | +| [Alignment](_alignment.md) | struct
对齐结构定义,包含宽高的对齐值。 | +| [Rect](_rect.md) | struct
矩形的定义。 | +| [RangeValue](_range_value.md) | struct
取值范围的定义。 | +| [CodecComponentType](_codec_component_type.md) | struct
Codec组件接口定义。 | +| [CodecComponentManager](_codec_component_manager.md) | struct
Codec组件管理类接口定义。 | +| [VideoPortCap](_video_port_cap.md) | struct
定义视频编解码能力。 | +| [AudioPortCap](_audio_port_cap.md) | struct
定义音频编解码能力。 | +| [PortCap](union_port_cap.md) | union
定义音视频编解码能力。 | +| [CodecCompCapability](_codec_comp_capability.md) | struct
定义Codec编解码能力。 | +| [OmxCodecBuffer](_omx_codec_buffer.md) | struct
Codec buffer信息的定义。 | +| [CompVerInfo](_comp_ver_info.md) | struct
定义组件版本信息。 | +| [EventInfo](_event_info.md) | struct
定义事件上报信息。 | +| [SupportBufferType](_support_buffer_type.md) | struct
SupportBuffer类型定义。 | +| [UseBufferType](_use_buffer_type.md) | struct
UseBuffer类型定义。 | +| [GetBufferHandleUsageParams](_get_buffer_handle_usage_params.md) | struct
BufferHandleUsage类型定义。 | ### 宏定义 | 名称 | 描述 | | -------- | -------- | -| SAMPLE_FMT_NUM    32 | 采样格式最大值。 | -| UUID_LENGTH    128 | 定义UUID长度。 | -| PIX_FORMAT_NUM    16 | 支持的像素格式数组大小。 | -| SAMPLE_FORMAT_NUM    12 | 支持的音频采样格式数组大小。 | -| SAMPLE_RATE_NUM    16 | 支持的音频采样率数组大小。 | -| CHANNEL_NUM    16 | 支持的音频通道数组大小。 | -| NAME_LENGTH    32 | 组件名称大小。 | -| PROFILE_NUM    256 | 支持的profile数组大小。 | +| [SAMPLE_FMT_NUM](#sample_fmt_num)   32 | 采样格式最大值。 | +| [UUID_LENGTH](#uuid_length)   128 | 定义UUID长度。 | +| [PIX_FORMAT_NUM](#pix_format_num)   16 | 支持的像素格式数组大小。 | +| [SAMPLE_FORMAT_NUM](#sample_format_num)   12 | 支持的音频采样格式数组大小。 | +| [SAMPLE_RATE_NUM](#sample_rate_num)   16 | 支持的音频采样率数组大小。 | +| [CHANNEL_NUM](#channel_num)   16 | 支持的音频通道数组大小。 | +| [NAME_LENGTH](#name_length)   32 | 组件名称大小。 | +| [PROFILE_NUM](#profile_num)   256 | 支持的profile数组大小。 | ### 枚举 @@ -75,9 +75,9 @@ Codec模块涉及自定义类型、音视频编解码组件初始化、参数设 | [AudioSampleRate](#audiosamplerate) { AUD_SAMPLE_RATE_8000 = 8000, AUD_SAMPLE_RATE_12000 = 12000, AUD_SAMPLE_RATE_11025 = 11025, AUD_SAMPLE_RATE_16000 = 16000,   AUD_SAMPLE_RATE_22050 = 22050, AUD_SAMPLE_RATE_24000 = 24000, AUD_SAMPLE_RATE_32000 = 32000, AUD_SAMPLE_RATE_44100 = 44100,   AUD_SAMPLE_RATE_48000 = 48000, AUD_SAMPLE_RATE_64000 = 64000, AUD_SAMPLE_RATE_96000 = 96000, AUD_SAMPLE_RATE_INVALID } | 枚举音频采样率。 | | [CodecCapsMask](#codeccapsmask) { CODEC_CAP_ADAPTIVE_PLAYBACK = 0x1, CODEC_CAP_SECURE_PLAYBACK = 0x2, CODEC_CAP_TUNNEL_PLAYBACK = 0x4, CODEC_CAP_MULTI_PLANE = 0x10000 } | 枚举播放能力。 | | [CodecProcessMode](#codecprocessmode) { PROCESS_BLOCKING_INPUT_BUFFER = 0X1, PROCESS_BLOCKING_OUTPUT_BUFFER = 0X2, PROCESS_BLOCKING_CONTROL_FLOW = 0X4, PROCESS_NONBLOCKING_INPUT_BUFFER = 0X100,   PROCESS_NONBLOCKING_OUTPUT_BUFFER = 0X200, PROCESS_NONBLOCKING_CONTROL_FLOW = 0X400 } | 枚举编解码处理模式。 | -| [AvCodecRole](#avcodecrole) {   MEDIA_ROLETYPE_IMAGE_JPEG = 0, MEDIA_ROLETYPE_VIDEO_AVC, MEDIA_ROLETYPE_VIDEO_HEVC, MEDIA_ROLETYPE_AUDIO_FIRST = 0x10000,   MEDIA_ROLETYPE_AUDIO_AAC = 0x10000, MEDIA_ROLETYPE_AUDIO_G711A, MEDIA_ROLETYPE_AUDIO_G711U, MEDIA_ROLETYPE_AUDIO_G726,   MEDIA_ROLETYPE_AUDIO_PCM, MEDIA_ROLETYPE_AUDIO_MP3, MEDIA_ROLETYPE_INVALID } | 枚举音视频编解码组件类型。 | -| [AudioSampleFormat](#audiosampleformat) {  AUDIO_SAMPLE_FORMAT_S8 = 0, AUDIO_SAMPLE_FORMAT_S8P = 1, AUDIO_SAMPLE_FORMAT_U8 = 2, AUDIO_SAMPLE_FORMAT_U8P = 3,   AUDIO_SAMPLE_FORMAT_S16 = 4, AUDIO_SAMPLE_FORMAT_S16P = 5, AUDIO_SAMPLE_FORMAT_U16 = 6, AUDIO_SAMPLE_FORMAT_U16P = 7,   AUDIO_SAMPLE_FORMAT_S24 = 8, AUDIO_SAMPLE_FORMAT_S24P = 9, AUDIO_SAMPLE_FORMAT_U24 = 10, AUDIO_SAMPLE_FORMAT_U24P = 11,   AUDIO_SAMPLE_FORMAT_S32 = 12, AUDIO_SAMPLE_FORMAT_S32P = 13, AUDIO_SAMPLE_FORMAT_U32 = 14, AUDIO_SAMPLE_FORMAT_U32P = 15,   AUDIO_SAMPLE_FORMAT_S64 = 16, AUDIO_SAMPLE_FORMAT_S64P = 17, AUDIO_SAMPLE_FORMAT_U64 = 18, AUDIO_SAMPLE_FORMAT_U64P = 19,   AUDIO_SAMPLE_FORMAT_F32 = 20, AUDIO_SAMPLE_FORMAT_F32P = 21, AUDIO_SAMPLE_FORMAT_F64 = 22, AUDIO_SAMPLE_FORMAT_F64P = 23,   AUDIO_SAMPLE_FMT_U8, AUDIO_SAMPLE_FMT_S16, AUDIO_SAMPLE_FMT_S32, AUDIO_SAMPLE_FMT_FLOAT,   AUDIO_SAMPLE_FMT_DOUBLE, AUDIO_SAMPLE_FMT_U8P, AUDIO_SAMPLE_FMT_S16P, AUDIO_SAMPLE_FMT_S32P,   AUDIO_SAMPLE_FMT_FLOATP, AUDIO_SAMPLE_FMT_DOUBLEP, AUDIO_SAMPLE_FMT_INVALID } | 枚举音频采样格式。 | -| [CodecBufferType](#codecbuffertype) {   CODEC_BUFFER_TYPE_INVALID = 0, CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, CODEC_BUFFER_TYPE_HANDLE = 0x4,   CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8 } | 定义buffer类型。 | +| [AvCodecRole](#avcodecrole) { MEDIA_ROLETYPE_IMAGE_JPEG = 0, MEDIA_ROLETYPE_VIDEO_AVC, MEDIA_ROLETYPE_VIDEO_HEVC, MEDIA_ROLETYPE_AUDIO_FIRST = 0x10000,   MEDIA_ROLETYPE_AUDIO_AAC = 0x10000, MEDIA_ROLETYPE_AUDIO_G711A, MEDIA_ROLETYPE_AUDIO_G711U, MEDIA_ROLETYPE_AUDIO_G726,   MEDIA_ROLETYPE_AUDIO_PCM, MEDIA_ROLETYPE_AUDIO_MP3, MEDIA_ROLETYPE_INVALID } | 枚举音视频编解码组件类型。 | +| [AudioSampleFormat](#audiosampleformat) {
AUDIO_SAMPLE_FMT_U8 , AUDIO_SAMPLE_FMT_S16 , AUDIO_SAMPLE_FMT_S32 , AUDIO_SAMPLE_FMT_FLOAT ,
AUDIO_SAMPLE_FMT_DOUBLE , AUDIO_SAMPLE_FMT_U8P , AUDIO_SAMPLE_FMT_S16P , AUDIO_SAMPLE_FMT_S32P ,
AUDIO_SAMPLE_FMT_FLOATP , AUDIO_SAMPLE_FMT_DOUBLEP , AUDIO_SAMPLE_FMT_INVALID
} | 枚举音频采样格式。 | +| [CodecBufferType](#codecbuffertype) { CODEC_BUFFER_TYPE_INVALID = 0, CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, CODEC_BUFFER_TYPE_HANDLE = 0x4,   CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8 } | 定义buffer类型。 | | [ShareMemTypes](#sharememtypes) { READ_WRITE_TYPE = 0x1, READ_ONLY_TYPE = 0x2 } | 枚举共享内存类型。 | | [OmxIndexCodecExType](#omxindexcodecextype) { OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, OMX_IndexParamSupportBufferType, OMX_IndexParamUseBufferType, OMX_IndexParamGetBufferHandleUsage } | 枚举Codec扩展index。 | | [OmxVideoExType](#omxvideoextype) { OMX_VIDEO_CodingHEVC = 11 } | 枚举Codec扩展编码类型。 | @@ -87,15 +87,114 @@ Codec模块涉及自定义类型、音视频编解码组件初始化、参数设 | 名称 | 描述 | | -------- | -------- | -| [CodecCallbackTypeGet](#codeccallbacktypeget) (struct HdfRemoteService \*remote) | 实例化CodecCallbackType对象。 | -| [CodecCallbackTypeRelease](#codeccallbacktyperelease) (struct [CodecCallbackType](_codec_callback_type.md) \*instance) | 释放CodecCallbackType对象。 | -| [CodecComponentTypeGet](#codeccomponenttypeget) (struct HdfRemoteService \*remote) | 实例化CodecComponentType对象。 | -| [CodecComponentTypeRelease](#codeccomponenttyperelease) (struct [CodecComponentType](_codec_component_type.md) \*instance) | 释放CodecComponentType对象。 | -| [GetCodecComponentManager](#getcodeccomponentmanager) (void) | 实例化CodecComponentManager对象。 | -| [CodecComponentManagerRelease](#codeccomponentmanagerrelease) (void) | 释放CodecComponentManager对象。 | +| [CodecCallbackTypeGet](#codeccallbacktypeget) (struct HdfRemoteService \*remote) | struct [CodecCallbackType](_codec_callback_type.md) \*
实例化CodecCallbackType对象。 | +| [CodecCallbackTypeRelease](#codeccallbacktyperelease) (struct [CodecCallbackType](_codec_callback_type.md) \*instance) | void
释放CodecCallbackType对象。 | +| [CodecComponentTypeGet](#codeccomponenttypeget) (struct HdfRemoteService \*remote) | struct [CodecComponentType](_codec_component_type.md) \*
实例化CodecComponentType对象。 | +| [CodecComponentTypeRelease](#codeccomponenttyperelease) (struct [CodecComponentType](_codec_component_type.md) \*instance) | void
释放CodecComponentType对象。 | +| [GetCodecComponentManager](#getcodeccomponentmanager) (void) | struct [CodecComponentManager](_codec_component_manager.md) \*
实例化CodecComponentManager对象。 | +| [CodecComponentManagerRelease](#codeccomponentmanagerrelease) (void) | void
释放CodecComponentManager对象。 | -## **枚举类型说明** +## 宏定义说明 + + +### CHANNEL_NUM + + +``` +#define CHANNEL_NUM 16 +``` + +**描述:** + +支持的音频通道数组大小。 + + +### NAME_LENGTH + + +``` +#define NAME_LENGTH 32 +``` + +**描述:** + +组件名称大小。 + + +### PIX_FORMAT_NUM + + +``` +#define PIX_FORMAT_NUM 16 +``` + +**描述:** + +支持的像素格式数组大小。 + + +### PROFILE_NUM + + +``` +#define PROFILE_NUM 256 +``` + +**描述:** + +支持的profile数组大小。 + + +### SAMPLE_FMT_NUM + + +``` +#define SAMPLE_FMT_NUM 32 +``` + +**描述:** + +采样格式最大值。 + + +### SAMPLE_FORMAT_NUM + + +``` +#define SAMPLE_FORMAT_NUM 12 +``` + +**描述:** + +支持的音频采样格式数组大小。 + + +### SAMPLE_RATE_NUM + + +``` +#define SAMPLE_RATE_NUM 16 +``` + +**描述:** + +支持的音频采样率数组大小。 + + +### UUID_LENGTH + + +``` +#define UUID_LENGTH 128 +``` + +**描述:** + +定义UUID长度。 + + +## 枚举类型说明 ### AudioSampleFormat @@ -105,48 +204,24 @@ Codec模块涉及自定义类型、音视频编解码组件初始化、参数设 enum AudioSampleFormat ``` -**描述:** +**描述:** 枚举音频采样格式。 -对于planar的采样格式,每个声道的数据是独立存储在data中;对于packed的采样格式,只使用第一个data,每个声道的数据是交错存储的。 +对于planar的采样格式,每个声道的数据是独立存储在data中; 对于packed的采样格式,只使用第一个data,每个声道的数据是交错存储的。 | 枚举值 | 描述 | | -------- | -------- | -| AUDIO_SAMPLE_FORMAT_S8 | 8bit位宽有符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_S8P | 8bit位宽有符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_U8 | 8bit位宽无符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_U8P | 8bit位宽无符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_S16 | 16bit位宽有符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_S16P | 16bit位宽有符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_U16 | 16bit位宽无符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_U16P | 16bit位宽无符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_S24 | 24bit位宽有符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_S24P | 24bit位宽有符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_U24 | 24bit位宽无符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_U24P | 24bit位宽无符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_S32 | 32bit位宽有符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_S32P | 32bit位宽有符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_U32 | 32bit位宽无符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_U32P | 32bit位宽无符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_S64 | 64bit位宽有符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_S64P | 64bit位宽有符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_U64 | 64bit位宽无符号交织样本。 | -| AUDIO_SAMPLE_FORMAT_U64P | 64bit位宽无符号非交织样本。 | -| AUDIO_SAMPLE_FORMAT_F32 | 32bit位宽浮点型交织样本。 | -| AUDIO_SAMPLE_FORMAT_F32P | 64bit位宽浮点型非交织样本。 | -| AUDIO_SAMPLE_FORMAT_F64 | 64bit位宽双精度浮点型交织样本。 | -| AUDIO_SAMPLE_FORMAT_F64P | 64bit位宽双精度浮点型非交织样本。 | | AUDIO_SAMPLE_FMT_U8 | 无符号8位整型,打包格式。 | -| AUDIO_SAMPLE_FMT_S16 | 带符号16位整型,打包格式。 | -| AUDIO_SAMPLE_FMT_S32 | 带符号32位整型,打包格式。 | -| AUDIO_SAMPLE_FMT_FLOAT | 浮点型,打包格式。 | -| AUDIO_SAMPLE_FMT_DOUBLE | 双精度浮点型,打包格式。 | -| AUDIO_SAMPLE_FMT_U8P | 无符号8位整型,平面格式。 | -| AUDIO_SAMPLE_FMT_S16P | 带符号16位整型,平面格式。 | -| AUDIO_SAMPLE_FMT_S32P | 带符号32位整型,平面格式。 | -| AUDIO_SAMPLE_FMT_FLOATP | 浮点型,平面格式。 | -| AUDIO_SAMPLE_FMT_DOUBLEP | 双精度浮点型,平面格式。 | +| AUDIO_SAMPLE_FMT_S16 | 带符号16位整型, 打包格式。 | +| AUDIO_SAMPLE_FMT_S32 | 带符号32位整型, 打包格式。 | +| AUDIO_SAMPLE_FMT_FLOAT | 浮点型, 打包格式。 | +| AUDIO_SAMPLE_FMT_DOUBLE | 双精度浮点型, 打包格式。 | +| AUDIO_SAMPLE_FMT_U8P | 无符号8位整型, 平面格式。 | +| AUDIO_SAMPLE_FMT_S16P | 带符号16位整型, 平面格式。 | +| AUDIO_SAMPLE_FMT_S32P | 带符号32位整型, 平面格式。 | +| AUDIO_SAMPLE_FMT_FLOATP | 浮点型, 平面格式。 | +| AUDIO_SAMPLE_FMT_DOUBLEP | 双精度浮点型, 平面格式。 | | AUDIO_SAMPLE_FMT_INVALID | 无效采样格式。 | @@ -157,7 +232,7 @@ enum AudioSampleFormat enum AudioSampleRate ``` -**描述:** +**描述:** 枚举音频采样率。 @@ -184,7 +259,7 @@ enum AudioSampleRate enum AvCodecRole ``` -**描述:** +**描述:** 枚举音视频编解码组件类型。 @@ -210,7 +285,7 @@ enum AvCodecRole enum CodecBufferType ``` -**描述:** +**描述:** 定义buffer类型。 @@ -230,7 +305,7 @@ enum CodecBufferType enum CodecCapsMask ``` -**描述:** +**描述:** 枚举播放能力。 @@ -249,7 +324,7 @@ enum CodecCapsMask enum CodecProcessMode ``` -**描述:** +**描述:** 枚举编解码处理模式。 @@ -270,7 +345,7 @@ enum CodecProcessMode enum CodecType ``` -**描述:** +**描述:** 枚举编解码的类型。 @@ -290,7 +365,7 @@ enum CodecType enum OmxIndexCodecExType ``` -**描述:** +**描述:** 枚举Codec扩展index。 @@ -309,7 +384,7 @@ enum OmxIndexCodecExType enum OmxVideoExType ``` -**描述:** +**描述:** 枚举Codec扩展编码类型。 @@ -325,7 +400,7 @@ enum OmxVideoExType enum Profile ``` -**描述:** +**描述:** 枚举Codec规格。 @@ -352,7 +427,7 @@ enum Profile enum ShareMemTypes ``` -**描述:** +**描述:** 枚举共享内存类型。 @@ -362,17 +437,17 @@ enum ShareMemTypes | READ_ONLY_TYPE | 可读的共享内存类型。 | -## **函数说明** +## 函数说明 ### CodecCallbackTypeGet() ``` -struct CodecCallbackType* CodecCallbackTypeGet (struct HdfRemoteService * remote) +struct CodecCallbackType * CodecCallbackTypeGet (struct HdfRemoteService * remote) ``` -**描述:** +**描述:** 实例化CodecCallbackType对象。 @@ -394,7 +469,7 @@ struct CodecCallbackType* CodecCallbackTypeGet (struct HdfRemoteService * remote void CodecCallbackTypeRelease (struct CodecCallbackType * instance) ``` -**描述:** +**描述:** 释放CodecCallbackType对象。 @@ -412,7 +487,7 @@ void CodecCallbackTypeRelease (struct CodecCallbackType * instance) void CodecComponentManagerRelease (void ) ``` -**描述:** +**描述:** 释放CodecComponentManager对象。 @@ -421,10 +496,10 @@ void CodecComponentManagerRelease (void ) ``` -struct CodecComponentType* CodecComponentTypeGet (struct HdfRemoteService * remote) +struct CodecComponentType * CodecComponentTypeGet (struct HdfRemoteService * remote) ``` -**描述:** +**描述:** 实例化CodecComponentType对象。 @@ -446,7 +521,7 @@ struct CodecComponentType* CodecComponentTypeGet (struct HdfRemoteService * remo void CodecComponentTypeRelease (struct CodecComponentType * instance) ``` -**描述:** +**描述:** 释放CodecComponentType对象。 @@ -461,10 +536,10 @@ void CodecComponentTypeRelease (struct CodecComponentType * instance) ``` -struct CodecComponentManager* GetCodecComponentManager (void ) +struct CodecComponentManager * GetCodecComponentManager (void ) ``` -**描述:** +**描述:** 实例化CodecComponentManager对象。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_codec_callback_type.md b/zh-cn/device-dev/reference/hdi-apis/_codec_callback_type.md index a8e953b4c83018037268342dcbe6d7abf7d5e3c5..b7c5baeae74657a068bace75bd33de7137152d9f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_codec_callback_type.md +++ b/zh-cn/device-dev/reference/hdi-apis/_codec_callback_type.md @@ -1,7 +1,7 @@ # CodecCallbackType -## **概述** +## 概述 Codec回调接口定义。 @@ -17,23 +17,23 @@ Codec回调接口定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [remote](#remote) | 指向HdfRemoteService的指针。 | -| ([EventHandler](#eventhandler) )(struct CodecCallbackType \*self, enum OMX_EVENTTYPE event, struct EventInfo \*info) | 事件上报。 | -| ([EmptyBufferDone](#emptybufferdone) )(struct CodecCallbackType \*self, int8_t \*appData, uint32_t appDataLen, const struct OmxCodecBuffer \*buffer) | 上报输入buffer编码或者解码处理完毕。 | -| ([FillBufferDone](#fillbufferdone) )(struct CodecCallbackType \*self, int8_t \*appData, uint32_t appDataLen, struct OmxCodecBuffer \*buffer) | 上报输出buffer填充完毕。 | +| [remote](#remote) | struct HdfRemoteService \*
指向HdfRemoteService的指针。 | +| (\* [EventHandler](#eventhandler) )(struct [CodecCallbackType](zh-cn_topic_0000001602431713.xml) \*self, enum OMX_EVENTTYPE event, struct [EventInfo](_event_info.md) \*info) | int32_t
事件上报。 | +| (\* [EmptyBufferDone](#emptybufferdone) )(struct [CodecCallbackType](zh-cn_topic_0000001602431713.xml) \*self, int8_t \*appData, uint32_t appDataLen, const struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer) | int32_t
上报输入buffer编码或者解码处理完毕。 | +| (\* [FillBufferDone](#fillbufferdone) )(struct [CodecCallbackType](zh-cn_topic_0000001602431713.xml) \*self, int8_t \*appData, uint32_t appDataLen, struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer) | int32_t
上报输出buffer填充完毕。 | -## **类成员变量说明** +## 类成员变量说明 ### EmptyBufferDone @@ -43,7 +43,7 @@ Codec回调接口定义。 int32_t(* CodecCallbackType::EmptyBufferDone) (struct CodecCallbackType *self, int8_t *appData, uint32_t appDataLen, const struct OmxCodecBuffer *buffer) ``` -**描述:** +**描述:** 上报输入buffer编码或者解码处理完毕。 @@ -76,7 +76,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,上报失败。 int32_t(* CodecCallbackType::EventHandler) (struct CodecCallbackType *self, enum OMX_EVENTTYPE event, struct EventInfo *info) ``` -**描述:** +**描述:** 事件上报。 @@ -120,7 +120,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,事件上报失败。 int32_t(* CodecCallbackType::FillBufferDone) (struct CodecCallbackType *self, int8_t *appData, uint32_t appDataLen, struct OmxCodecBuffer *buffer) ``` -**描述:** +**描述:** 上报输出buffer填充完毕。 @@ -153,6 +153,6 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,上报失败。 struct HdfRemoteService* CodecCallbackType::remote ``` -**描述:** +**描述:** 指向HdfRemoteService的指针。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_codec_comp_capability.md b/zh-cn/device-dev/reference/hdi-apis/_codec_comp_capability.md index 90cf2509f95cad1c5cfbb92dc82241320c9a1aa0..fc795d664b7a48c7d2f5c01806ad05f9f2a7ee9b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_codec_comp_capability.md +++ b/zh-cn/device-dev/reference/hdi-apis/_codec_comp_capability.md @@ -1,35 +1,35 @@ # CodecCompCapability -## **概述** +## 概述 定义Codec编解码能力。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [role](#role) | 媒体类型。 | -| [type](#type) | 编解码类型。 | -| [compName](#compname) [NAME_LENGTH] | 编解码组件名称。 | -| [supportProfiles](#supportprofiles) [PROFILE_NUM] | 支持的profiles。 | -| [maxInst](#maxinst) | 最大实例。 | -| [isSoftwareCodec](#issoftwarecodec) | 软件编解码还是硬件编解码。 | -| [processModeMask](#processmodemask) | 编解码处理模式掩码。 | -| [capsMask](#capsmask) | 编解码播放能力掩码。 | -| [bitRate](#bitrate) | 支持的码率范围。 | -| [port](#port) | 支持的音视频编解码能力。 | +| [role](#role) | [AvCodecRole](_codec.md#avcodecrole)
媒体类型。  | +| [type](#type) | [CodecType](_codec.md#codectype)
编解码类型。  | +| [compName](#compname) [[NAME_LENGTH](_codec.md#name_length)] | char
编解码组件名称。  | +| [supportProfiles](#supportprofiles) [[PROFILE_NUM](_codec.md#profile_num)] | int32_t
支持的profiles,详见[Profile](_codec.md#profile)。  | +| [maxInst](#maxinst) | int32_t
最大实例。  | +| [isSoftwareCodec](#issoftwarecodec) | bool
软件编解码还是硬件编解码。  | +| [processModeMask](#processmodemask) | int32_t
编解码处理模式掩码,详见[CodecProcessMode](_codec.md#codecprocessmode)。  | +| [capsMask](#capsmask) | uint32_t
编解码播放能力掩码,详见[CodecCapsMask](_codec.md#codeccapsmask)。  | +| [bitRate](#bitrate) | [RangeValue](_range_value.md)
支持的码率范围。  | +| [port](#port) | [PortCap](union_port_cap.md)
支持的音视频编解码能力。  | -## **类成员变量说明** +## 类成员变量说明 ### bitRate @@ -38,9 +38,7 @@ ``` RangeValue CodecCompCapability::bitRate ``` - -**描述:** - +**描述:** 支持的码率范围。 @@ -50,10 +48,8 @@ RangeValue CodecCompCapability::bitRate ``` uint32_t CodecCompCapability::capsMask ``` - -**描述:** - -编解码播放能力掩码,详见[CodecCapsMask](codec.md#codeccapsmask)。 +**描述:** +编解码播放能力掩码,详见[CodecCapsMask](_codec.md#codeccapsmask)。 ### compName @@ -62,9 +58,7 @@ uint32_t CodecCompCapability::capsMask ``` char CodecCompCapability::compName[NAME_LENGTH] ``` - -**描述:** - +**描述:** 编解码组件名称。 @@ -74,9 +68,7 @@ char CodecCompCapability::compName[NAME_LENGTH] ``` bool CodecCompCapability::isSoftwareCodec ``` - -**描述:** - +**描述:** 软件编解码还是硬件编解码。 @@ -86,9 +78,7 @@ bool CodecCompCapability::isSoftwareCodec ``` int32_t CodecCompCapability::maxInst ``` - -**描述:** - +**描述:** 最大实例。 @@ -98,9 +88,7 @@ int32_t CodecCompCapability::maxInst ``` PortCap CodecCompCapability::port ``` - -**描述:** - +**描述:** 支持的音视频编解码能力。 @@ -110,10 +98,8 @@ PortCap CodecCompCapability::port ``` int32_t CodecCompCapability::processModeMask ``` - -**描述:** - -编解码处理模式掩码,详见[CodecProcessMode](codec.md#codecprocessmode)。 +**描述:** +编解码处理模式掩码,详见[CodecProcessMode](_codec.md#codecprocessmode)。 ### role @@ -122,9 +108,7 @@ int32_t CodecCompCapability::processModeMask ``` AvCodecRole CodecCompCapability::role ``` - -**描述:** - +**描述:** 媒体类型。 @@ -134,10 +118,8 @@ AvCodecRole CodecCompCapability::role ``` int32_t CodecCompCapability::supportProfiles[PROFILE_NUM] ``` - -**描述:** - -支持的profiles,详见[Profile](codec.md#profile)。 +**描述:** +支持的profiles,详见[Profile](_codec.md#profile)。 ### type @@ -146,7 +128,5 @@ int32_t CodecCompCapability::supportProfiles[PROFILE_NUM] ``` CodecType CodecCompCapability::type ``` - -**描述:** - +**描述:** 编解码类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_codec_component_manager.md b/zh-cn/device-dev/reference/hdi-apis/_codec_component_manager.md index 00ea99f6b089455040d9aadc8234222404cabc28..665cc69a12d86e2e7c35b6b162c2f59f8e352f1e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_codec_component_manager.md +++ b/zh-cn/device-dev/reference/hdi-apis/_codec_component_manager.md @@ -1,7 +1,7 @@ # CodecComponentManager -## **概述** +## 概述 Codec组件管理类接口定义。 @@ -13,23 +13,23 @@ Codec组件管理类接口定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([GetComponentNum](#getcomponentnum) )() | 获取Codec编解码组件数量。 | -| ([GetComponentCapabilityList](#getcomponentcapabilitylist) )(CodecCompCapability \*capList, int32_t count) | 获取编解码能力集表。 | -| ([CreateComponent](#createcomponent) )(struct CodecComponentType \*\*component, char \*compName, void \*appData, int32_t appDataSize, struct CodecCallbackType \*callbacks) | 创建Codec组件实例。 | -| ([DestroyComponent](#destroycomponent) )(struct CodecComponentType \*component) | 销毁组件实例。 | +| (\* [GetComponentNum](#getcomponentnum) )() | int32_t
获取Codec编解码组件数量。 | +| (\* [GetComponentCapabilityList](#getcomponentcapabilitylist) )([CodecCompCapability](_codec_comp_capability.md) \*capList, int32_t count) | int32_t
获取编解码能力集表。 | +| (\* [CreateComponent](#createcomponent) )(struct [CodecComponentType](_codec_component_type.md) \*\*component, char \*compName, void \*appData, int32_t appDataSize, struct [CodecCallbackType](_codec_callback_type.md) \*callbacks) | int32_t
创建Codec组件实例。 | +| (\* [DestroyComponent](#destroycomponent) )(struct [CodecComponentType](_codec_component_type.md) \*component) | int32_t
销毁组件实例。 | -## **类成员变量说明** +## 类成员变量说明 ### CreateComponent @@ -39,7 +39,7 @@ Codec组件管理类接口定义。 int32_t(* CodecComponentManager::CreateComponent) (struct CodecComponentType **component, char *compName, void *appData, int32_t appDataSize, struct CodecCallbackType *callbacks) ``` -**描述:** +**描述:** 创建Codec组件实例。 @@ -73,7 +73,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,创建组件失败。 int32_t(* CodecComponentManager::DestroyComponent) (struct CodecComponentType *component) ``` -**描述:** +**描述:** 销毁组件实例。 @@ -103,7 +103,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,销毁组件失败。 int32_t(* CodecComponentManager::GetComponentCapabilityList) (CodecCompCapability *capList, int32_t count) ``` -**描述:** +**描述:** 获取编解码能力集表。 @@ -134,7 +134,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,获取能力集表失败。 int32_t(* CodecComponentManager::GetComponentNum) () ``` -**描述:** +**描述:** 获取Codec编解码组件数量。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_codec_component_type.md b/zh-cn/device-dev/reference/hdi-apis/_codec_component_type.md index 3840fc5721763eb96cff3ff7d070b3f85ed5fbeb..527429edcc47d8029c226698ce0acee383143a75 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_codec_component_type.md +++ b/zh-cn/device-dev/reference/hdi-apis/_codec_component_type.md @@ -1,57 +1,57 @@ # CodecComponentType -## **概述** +## 概述 Codec组件接口定义。 -主要提供以下功能: +主要提供以下功能: -- 获取组件的版本。 +- 获取组件的版本 -- 组件参数配置的获取和设置。 +- 组件参数配置的获取和设置 -- 发送命令至组件及获取组件状态。 +- 发送命令至组件及获取组件状态 -- 设置回调函数。 +- 设置回调函数 -- 设置/释放组件使用的buffer。 +- 设置/释放组件使用的buffer -- 编解码输入输出buffer处理 具体方法使用详见函数说明。 +- 编解码输入输出buffer处理,具体方法使用详见函数说明。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([GetComponentVersion](#getcomponentversion) )(struct CodecComponentType \*self, struct CompVerInfo \*verInfo) | 获取Codec组件版本号。 | -| ([SendCommand](#sendcommand) )(struct CodecComponentType \*self, enum OMX_COMMANDTYPE cmd, uint32_t param, int8_t \*cmdData, uint32_t cmdDataLen) | 发送命令给组件。 | -| ([GetParameter](#getparameter) )(struct CodecComponentType \*self, uint32_t paramIndex, int8_t \*paramStruct, uint32_t paramStructLen) | 获取组件参数设置。 | -| ([SetParameter](#setparameter) )(struct CodecComponentType \*self, uint32_t index, int8_t \*paramStruct, uint32_t paramStructLen) | 设置组件需要的参数。 | -| ([GetConfig](#getconfig) )(struct CodecComponentType \*self, uint32_t index, int8_t \*cfgStruct, uint32_t cfgStructLen) | 获取组件的配置结构。 | -| ([SetConfig](#setconfig) )(struct CodecComponentType \*self, uint32_t index, int8_t \*cfgStruct, uint32_t cfgStructLen) | 设置组件的配置。 | -| ([GetExtensionIndex](#getextensionindex) )(struct CodecComponentType \*self, const char \*paramName, uint32_t \*indexType) | 根据字符串获取组件的扩展索引。 | -| ([GetState](#getstate) )(struct CodecComponentType \*self, enum OMX_STATETYPE \*state) | 获取组件的当前状态。 | -| ([ComponentTunnelRequest](#componenttunnelrequest) )(struct CodecComponentType \*self, uint32_t port, int32_t tunneledComp, uint32_t tunneledPort, struct OMX_TUNNELSETUPTYPE \*tunnelSetup) | 设置组件采用Tunnel方式通信。 | -| ([UseBuffer](#usebuffer) )(struct CodecComponentType \*self, uint32_t portIndex, struct OmxCodecBuffer \*buffer) | 指定组件端口的buffer。 | -| ([AllocateBuffer](#allocatebuffer) )(struct CodecComponentType \*self, uint32_t portIndex, struct OmxCodecBuffer \*buffer) | 向组件申请端口buffer。 | -| ([FreeBuffer](#freebuffer) )(struct CodecComponentType \*self, uint32_t portIndex, const struct OmxCodecBuffer \*buffer) | 释放buffer。 | -| ([EmptyThisBuffer](#emptythisbuffer) )(struct CodecComponentType \*self, const struct OmxCodecBuffer \*buffer) | 编解码输入待处理buffer。 | -| ([FillThisBuffer](#fillthisbuffer) )(struct CodecComponentType \*self, const struct OmxCodecBuffer \*buffer) | 编解码输出填充buffer。 | -| ([SetCallbacks](#setcallbacks) )(struct CodecComponentType \*self, struct CodecCallbackType \*callback, int8_t \*appData, uint32_t appDataLen) | 设置Codec组件的回调函数。 | -| ([ComponentDeInit](#componentdeinit) )(struct CodecComponentType \*self) | 组件去初始化。 | -| ([UseEglImage](#useeglimage) )(struct CodecComponentType \*self, struct OmxCodecBuffer \*buffer, uint32_t portIndex, int8_t \*eglImage, uint32_t eglImageLen) | 使用已在EGL中申请的空间。 | -| ([ComponentRoleEnum](#componentroleenum) )(struct CodecComponentType \*self, uint8_t \*role, uint32_t roleLen, uint32_t index) | 获取组件角色。 | - - -## **类成员变量说明** +| (\* [GetComponentVersion](#getcomponentversion) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, struct [CompVerInfo](_comp_ver_info.md) \*verInfo) | int32_t
获取Codec组件版本号。 | +| (\* [SendCommand](#sendcommand) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, enum OMX_COMMANDTYPE cmd, uint32_t param, int8_t \*cmdData, uint32_t cmdDataLen) | int32_t
发送命令给组件。 | +| (\* [GetParameter](#getparameter) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t paramIndex, int8_t \*paramStruct, uint32_t paramStructLen) | int32_t
获取组件参数设置。 | +| (\* [SetParameter](#setparameter) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t index, int8_t \*paramStruct, uint32_t paramStructLen) | int32_t
设置组件需要的参数。 | +| (\* [GetConfig](#getconfig) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t index, int8_t \*cfgStruct, uint32_t cfgStructLen) | int32_t
获取组件的配置结构。 | +| (\* [SetConfig](#setconfig) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t index, int8_t \*cfgStruct, uint32_t cfgStructLen) | int32_t
设置组件的配置。 | +| (\* [GetExtensionIndex](#getextensionindex) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, const char \*paramName, uint32_t \*indexType) | int32_t
根据字符串获取组件的扩展索引。 | +| (\* [GetState](#getstate) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, enum OMX_STATETYPE \*state) | int32_t
获取组件的当前状态。 | +| (\* [ComponentTunnelRequest](#componenttunnelrequest) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t port, int32_t tunneledComp, uint32_t tunneledPort, struct OMX_TUNNELSETUPTYPE \*tunnelSetup) | int32_t
设置组件采用Tunnel方式通信。 | +| (\* [UseBuffer](#usebuffer) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t portIndex, struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer) | int32_t
指定组件端口的buffer。 | +| (\* [AllocateBuffer](#allocatebuffer) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t portIndex, struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer) | int32_t
向组件申请端口buffer。 | +| (\* [FreeBuffer](#freebuffer) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint32_t portIndex, const struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer) | int32_t
释放buffer。 | +| (\* [EmptyThisBuffer](#emptythisbuffer) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, const struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer) | int32_t
编解码输入待处理buffer。 | +| (\* [FillThisBuffer](#fillthisbuffer) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, const struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer) | int32_t
编解码输出填充buffer。 | +| (\* [SetCallbacks](#setcallbacks) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, struct [CodecCallbackType](_codec_callback_type.md) \*callback, int8_t \*appData, uint32_t appDataLen) | int32_t
设置Codec组件的回调函数。 | +| (\* [ComponentDeInit](#componentdeinit) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self) | int32_t
组件去初始化。 | +| (\* [UseEglImage](#useeglimage) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, struct [OmxCodecBuffer](_omx_codec_buffer.md) \*buffer, uint32_t portIndex, int8_t \*eglImage, uint32_t eglImageLen) | int32_t
使用已在EGL中申请的空间。 | +| (\* [ComponentRoleEnum](#componentroleenum) )(struct [CodecComponentType](zh-cn_topic_0000001602591461.xml) \*self, uint8_t \*role, uint32_t roleLen, uint32_t index) | int32_t
获取组件角色。 | + + +## 类成员变量说明 ### AllocateBuffer @@ -61,7 +61,7 @@ Codec组件接口定义。 int32_t(* CodecComponentType::AllocateBuffer) (struct CodecComponentType *self, uint32_t portIndex, struct OmxCodecBuffer *buffer) ``` -**描述:** +**描述:** 向组件申请端口buffer。 @@ -99,7 +99,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,申请buffer失败。 int32_t(* CodecComponentType::ComponentDeInit) (struct CodecComponentType *self) ``` -**描述:** +**描述:** 组件去初始化。 @@ -129,7 +129,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,去初始化失败。 int32_t(* CodecComponentType::ComponentRoleEnum) (struct CodecComponentType *self, uint8_t *role, uint32_t roleLen, uint32_t index) ``` -**描述:** +**描述:** 获取组件角色。 @@ -162,7 +162,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,获取角色失败。 int32_t(* CodecComponentType::ComponentTunnelRequest) (struct CodecComponentType *self, uint32_t port, int32_t tunneledComp, uint32_t tunneledPort, struct OMX_TUNNELSETUPTYPE *tunnelSetup) ``` -**描述:** +**描述:** 设置组件采用Tunnel方式通信。 @@ -176,7 +176,7 @@ int32_t(* CodecComponentType::ComponentTunnelRequest) (struct CodecComponentType | port | 输入参数,组件设置的端口。 | | tunneledComp | 输入参数,组件的tunnel handle。 | | tunneledPort | 输入参数,组件用来Tunnel通信的端口。 | -| tunnelSetup | 输入输出参数,指向Tunnel设置的结构体**OMX_TUNNELSETUPTYPE**指针。 | +| tunnelSetup | 输入输出参数,指向Tunnel设置的结构体OMX_TUNNELSETUPTYPE指针。 | **返回:** @@ -196,7 +196,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,设置失败。 int32_t(* CodecComponentType::EmptyThisBuffer) (struct CodecComponentType *self, const struct OmxCodecBuffer *buffer) ``` -**描述:** +**描述:** 编解码输入待处理buffer。 @@ -227,7 +227,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,输入buffer失败。 int32_t(* CodecComponentType::FillThisBuffer) (struct CodecComponentType *self, const struct OmxCodecBuffer *buffer) ``` -**描述:** +**描述:** 编解码输出填充buffer。 @@ -258,7 +258,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,填充buffer失败。 int32_t(* CodecComponentType::FreeBuffer) (struct CodecComponentType *self, uint32_t portIndex, const struct OmxCodecBuffer *buffer) ``` -**描述:** +**描述:** 释放buffer。 @@ -296,7 +296,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,释放buffer失败。 int32_t(* CodecComponentType::GetComponentVersion) (struct CodecComponentType *self, struct CompVerInfo *verInfo) ``` -**描述:** +**描述:** 获取Codec组件版本号。 @@ -327,7 +327,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,获取版本号失败。 int32_t(* CodecComponentType::GetConfig) (struct CodecComponentType *self, uint32_t index, int8_t *cfgStruct, uint32_t cfgStructLen) ``` -**描述:** +**描述:** 获取组件的配置结构。 @@ -338,7 +338,7 @@ int32_t(* CodecComponentType::GetConfig) (struct CodecComponentType *self, uint3 | 名称 | 描述 | | -------- | -------- | | self | 输入参数,指向要操作的Codec组件指针。 | -| index | 输入参数,待填充结构的索引,详见**OMX_INDEXTYPE**。 | +| index | 输入参数,待填充结构的索引,详见OMX_INDEXTYPE。 | | cfgStruct | 输入输出参数,指向由组件填充的应用程序分配的结构体指针。 | | cfgStructLen | 输入参数,上层传入的cfgStruct字节数。 | @@ -360,7 +360,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,获取配置失败。 int32_t(* CodecComponentType::GetExtensionIndex) (struct CodecComponentType *self, const char *paramName, uint32_t *indexType) ``` -**描述:** +**描述:** 根据字符串获取组件的扩展索引。 @@ -372,7 +372,7 @@ int32_t(* CodecComponentType::GetExtensionIndex) (struct CodecComponentType *sel | -------- | -------- | | self | 输入参数,指向要操作的Codec组件指针。 | | paramName | 输入参数,组件用来转换为配置索引的字符串。 | -| indexType | 输出参数,由paramName转换的配置索引,详见**OMX_INDEXTYPE**。 | +| indexType | 输出参数,由paramName转换的配置索引,详见OMX_INDEXTYPE。 | **返回:** @@ -392,7 +392,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,获取扩展索引失败。 int32_t(* CodecComponentType::GetParameter) (struct CodecComponentType *self, uint32_t paramIndex, int8_t *paramStruct, uint32_t paramStructLen) ``` -**描述:** +**描述:** 获取组件参数设置。 @@ -403,7 +403,7 @@ int32_t(* CodecComponentType::GetParameter) (struct CodecComponentType *self, ui | 名称 | 描述 | | -------- | -------- | | self | 输入参数,指向要操作的Codec组件指针。 | -| paramIndex | 输入参数,待填充结构的索引,详见**OMX_INDEXTYPE**。 | +| paramIndex | 输入参数,待填充结构的索引,详见OMX_INDEXTYPE。 | | paramStruct | 输入输出参数,指向由组件填充的应用程序分配的结构体指针。 | | paramStructLen | 输入参数,paramStruct字节数。 | @@ -425,18 +425,18 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,获取参数失败。 int32_t(* CodecComponentType::GetState) (struct CodecComponentType *self, enum OMX_STATETYPE *state) ``` -**描述:** +**描述:** 获取组件的当前状态。 -用户可调用此接口获取组件的当前状态,组件状态详见**OMX_STATETYPE**。 +用户可调用此接口获取组件的当前状态,组件状态详见OMX_STATETYPE。 **参数:** | 名称 | 描述 | | -------- | -------- | | self | 输入参数,指向要操作的Codec组件指针。 | -| state | 输出参数,指向获取到的状态指针,组件状态详见**OMX_STATETYPE**。 | +| state | 输出参数,指向获取到的状态指针,组件状态详见OMX_STATETYPE。 | **返回:** @@ -456,11 +456,11 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,获取状态失败。 int32_t(* CodecComponentType::SendCommand) (struct CodecComponentType *self, enum OMX_COMMANDTYPE cmd, uint32_t param, int8_t *cmdData, uint32_t cmdDataLen) ``` -**描述:** +**描述:** 发送命令给组件。 -当命令为设置状态时,会有事件回调通知结果给上层,其他命令则没有事件上报。 +发送命令给组件,当命令为设置状态时,会有事件回调通知结果给上层,其他命令则没有事件上报。 **参数:** @@ -490,7 +490,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,发送命令失败。 int32_t(* CodecComponentType::SetCallbacks) (struct CodecComponentType *self, struct CodecCallbackType *callback, int8_t *appData, uint32_t appDataLen) ``` -**描述:** +**描述:** 设置Codec组件的回调函数。 @@ -523,7 +523,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,设置回调失败。 int32_t(* CodecComponentType::SetConfig) (struct CodecComponentType *self, uint32_t index, int8_t *cfgStruct, uint32_t cfgStructLen) ``` -**描述:** +**描述:** 设置组件的配置。 @@ -534,7 +534,7 @@ int32_t(* CodecComponentType::SetConfig) (struct CodecComponentType *self, uint3 | 名称 | 描述 | | -------- | -------- | | self | 输入参数,指向要操作的Codec组件指针。 | -| index | 输入参数,要设置的结构索引,详见**OMX_INDEXTYPE**。 | +| index | 输入参数,要设置的结构索引,详见OMX_INDEXTYPE。 | | cfgStruct | 输入参数,指向组件用于初始化的应用程序分配结构的指针。 | | cfgStructLen | 输入参数,cfgStruct字节数。 | @@ -556,7 +556,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,设置失败。 int32_t(* CodecComponentType::SetParameter) (struct CodecComponentType *self, uint32_t index, int8_t *paramStruct, uint32_t paramStructLen) ``` -**描述:** +**描述:** 设置组件需要的参数。 @@ -567,7 +567,7 @@ int32_t(* CodecComponentType::SetParameter) (struct CodecComponentType *self, ui | 名称 | 描述 | | -------- | -------- | | self | 输入参数,指向要操作的Codec组件指针。 | -| index | 输入参数,要设置的结构索引,详见**OMX_INDEXTYPE**。 | +| index | 输入参数,要设置的结构索引,详见OMX_INDEXTYPE。 | | paramStruct | 输入参数,指向组件用于初始化的应用程序分配结构的指针。 | | paramStructLen | 输入参数,paramStruct字节数。 | @@ -589,7 +589,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,设置参数失败。 int32_t(* CodecComponentType::UseBuffer) (struct CodecComponentType *self, uint32_t portIndex, struct OmxCodecBuffer *buffer) ``` -**描述:** +**描述:** 指定组件端口的buffer。 @@ -627,7 +627,7 @@ HDF_ERR_MALLOC_FAIL 表示申请内存失败,指定失败。 int32_t(* CodecComponentType::UseEglImage) (struct CodecComponentType *self, struct OmxCodecBuffer *buffer, uint32_t portIndex, int8_t *eglImage, uint32_t eglImageLen) ``` -**描述:** +**描述:** 使用已在EGL中申请的空间。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_comp_ver_info.md b/zh-cn/device-dev/reference/hdi-apis/_comp_ver_info.md index debad98682d7b7c71cb85127947c7af43b5cb1e4..b23cb5a1ebd5ca0e4257078f4169dfd65183b79d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_comp_ver_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_comp_ver_info.md @@ -1,29 +1,29 @@ # CompVerInfo -## **概述** +## 概述 定义组件版本信息。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [compName](#compname) [[NAME_LENGTH](codec.md#gaf71324c57f05ff9e24bd384925dd6b17)] | 组件名称。 | -| [compUUID](#compuuid) [[UUID_LENGTH](codec.md#ga9226162b034cc837cd977f0fcf611c2c)] | 组件的UUID标识符。 | -| [compVersion](#compversion) | OMX组件版本信息。 | -| [specVersion](#specversion) | 构建组件所依据的规范的版本信息。 | +| [compName](#compname) [[NAME_LENGTH](_codec.md#name_length)] | char
组件名称。  | +| [compUUID](#compuuid) [[UUID_LENGTH](_codec.md#uuid_length)] | uint8_t
组件的UUID标识符。  | +| [compVersion](#compversion) | union OMX_VERSIONTYPE
OMX组件版本信息。  | +| [specVersion](#specversion) | union OMX_VERSIONTYPE
构建组件所依据的规范的版本信息。  | -## **类成员变量说明** +## 类成员变量说明 ### compName @@ -32,9 +32,7 @@ ``` char CompVerInfo::compName[NAME_LENGTH] ``` - -**描述:** - +**描述:** 组件名称。 @@ -44,9 +42,7 @@ char CompVerInfo::compName[NAME_LENGTH] ``` uint8_t CompVerInfo::compUUID[UUID_LENGTH] ``` - -**描述:** - +**描述:** 组件的UUID标识符。 @@ -56,9 +52,7 @@ uint8_t CompVerInfo::compUUID[UUID_LENGTH] ``` union OMX_VERSIONTYPE CompVerInfo::compVersion ``` - -**描述:** - +**描述:** OMX组件版本信息。 @@ -68,7 +62,5 @@ OMX组件版本信息。 ``` union OMX_VERSIONTYPE CompVerInfo::specVersion ``` - -**描述:** - +**描述:** 构建组件所依据的规范的版本信息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_concat.md b/zh-cn/device-dev/reference/hdi-apis/_concat.md new file mode 100644 index 0000000000000000000000000000000000000000..704039bf90f03299ddc707172ff722bf4280c5b8 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_concat.md @@ -0,0 +1,47 @@ +# Concat + + +## 概述 + +在指定轴上连接张量,将输入张量按给定的轴连接起来。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_CONCAT。 + +输入: + +- 多个维度相同的tensor。 + +输出: + +- output,多个张量按axis轴连接的结果。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long
拼接的轴,axis必须小于输入张量的维度数量。  | + + +## 类成员变量说明 + + +### axis + + +``` +long Concat::axis +``` +**描述:** +拼接的轴,axis必须小于输入张量的维度数量。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_conv2_d_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_conv2_d_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..2127cefcdf70c8361774b74db4a9bde4404fd173 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_conv2_d_fusion.md @@ -0,0 +1,141 @@ +# Conv2DFusion + + +## 概述 + +对将4维的tensor执行带有偏置的二维卷积运算。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_CONV2D_FUSION。 + +参数限制:当padMode==PAD_MODE_PAD时,padList的数值必须大于等于0。其他情况下padding的数值必须为0。 + +输入: + +- x,4维tensor,并按照NHWC进行排列。 + +- weight,卷积的权重,要求weight排布为[outChannel,kernelHeight,kernelWidth,inChannel/group], inChannel必须要能整除group。 + +- bias,卷积的偏置,是长度为[outChannel]的数组。在量化场景下,bias 参数不需要量化参数,其量化 版本要求输入 int32 类型数据,实际量化参数由 x 和 weight 共同决定。 + +输出: + +- output,卷积的输出。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [kernelSize](#kernelsize) | long[]
卷积核大小。  | +| [stride](#stride) | long[]
卷积核在height和weight上的步幅,是一个长度为2的int数组[strideHeight,strideWidth]。  | +| [dilation](#dilation) | long[]
表示扩张卷积在height和weight上的扩张率,是一个长度为2的int数组[dilationHeight,dilationWidth], 值必须大于或等于1,并且不能超过x的height和width。  | +| [padMode](#padmode) | enum [PadMode](_n_n_rt.md#padmode)
填充类型,详情请参考:[PadMode](_n_n_rt.md#padmode)。  | +| [padList](#padlist) | long[]
输入x周围的填充,是一个长度为4的int数组[top,bottom,left,right]。  | +| [group](#group) | long
group,将输入x按inChannel分组,int类型。 group等于1,这是常规卷积。 group等于inChannel,这是depthwiseConv2d,此时group==in_channel==out_channel。 group大于1且小于inChannel,这是分组卷积,此时out_channel==group。  | +| [inChannel](#inchannel) | long
输入通道数量。  | +| [outChannel](#outchannel) | long
输出通道数量。  | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType Conv2DFusion::activationType +``` +**描述:** +激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 + + +### dilation + + +``` +long [] Conv2DFusion::dilation +``` +**描述:** +表示扩张卷积在height和weight上的扩张率,是一个长度为2的int数组[dilationHeight,dilationWidth], 值必须大于或等于1,并且不能超过x的height和width。 + + +### group + + +``` +long Conv2DFusion::group +``` +**描述:** +group,将输入x按inChannel分组,int类型。 group等于1,这是常规卷积。 group等于inChannel,这是depthwiseConv2d,此时group==in_channel==out_channel。 group大于1且小于inChannel,这是分组卷积,此时out_channel==group。 + + +### inChannel + + +``` +long Conv2DFusion::inChannel +``` +**描述:** +输入通道数量。 + + +### kernelSize + + +``` +long [] Conv2DFusion::kernelSize +``` +**描述:** +卷积核大小。 + + +### outChannel + + +``` +long Conv2DFusion::outChannel +``` +**描述:** +输出通道数量。 + + +### padList + + +``` +long [] Conv2DFusion::padList +``` +**描述:** +输入x周围的填充,是一个长度为4的int数组[top,bottom,left,right]。 + + +### padMode + + +``` +enum PadMode Conv2DFusion::padMode +``` +**描述:** +填充类型,详情请参考:[PadMode](_n_n_rt.md#padmode)。 + + +### stride + + +``` +long [] Conv2DFusion::stride +``` +**描述:** +卷积核在height和weight上的步幅,是一个长度为2的int数组[strideHeight,strideWidth]。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_conv2d_transpose_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_conv2d_transpose_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..5391f07b062f39f2e29080a4bf944c2be8d47833 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_conv2d_transpose_fusion.md @@ -0,0 +1,152 @@ +# Conv2dTransposeFusion + + +## 概述 + +对一个4维的tensor执行带有偏置的二维反卷积。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_CONV2D_TRANSPOSE_FUSION。 + +参数限制:当padMode==PAD_MODE_PAD时,padList的数值必须大于等于0。其他情况下padding的数值必须为0。 + +输入: + +- x,4维tensor,并按照NHWC进行排列。 + +- weight,卷积的权重,要求weight排布为[outChannel,kernelHeight,kernelWidth,inChannel/group], inChannel必须要能整除group。 + +- bias,卷积的偏置,是长度为[outChannel]的数组。在量化场景下,bias 参数不需要量化参数,其量化 版本要求输入 int32 类型数据,实际量化参数由 x 和 weight 共同决定。 + +输出: + +- output,n维tensor。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [kernelSize](#kernelsize) | long[]
卷积核大小。  | +| [stride](#stride) | long[]
卷积核在height和weight上的步幅,是一个长度为2的int数组[strideHeight,strideWidth]。  | +| [dilation](#dilation) | long[]
表示扩张卷积在height和weight上的扩张率,是一个长度为2的int数组[dilationHeight,dilationWidth], 值必须大于或等于1,并且不能超过x的height和width。  | +| [padMode](#padmode) | enum [PadMode](_n_n_rt.md#padmode)
填充类型,详情请参考:[PadMode](_n_n_rt.md#padmode) | +| [padList](#padlist) | long[]
输入x周围的填充,是一个长度为4的int数组[top,bottom,left,right]。  | +| [group](#group) | long
group,将输入x按inChannel分组。 group等于1,这是常规卷积; group大于1且小于或等于inChannel,这是分组卷积。  | +| [inChannel](#inchannel) | long
输入通道数。  | +| [outChannel](#outchannel) | long
输出通道数。  | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。  | +| [outputPaddings](#outputpaddings) | long[]
一个长度为的2整数列表,指定沿输出张量的高度和宽度的填充量。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType Conv2dTransposeFusion::activationType +``` +**描述:** +激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 + + +### dilation + + +``` +long [] Conv2dTransposeFusion::dilation +``` +**描述:** +表示扩张卷积在height和weight上的扩张率,是一个长度为2的int数组[dilationHeight,dilationWidth], 值必须大于或等于1,并且不能超过x的height和width。 + + +### group + + +``` +long Conv2dTransposeFusion::group +``` +**描述:** +group,将输入x按inChannel分组。 group等于1,这是常规卷积; group大于1且小于或等于inChannel,这是分组卷积。 + + +### inChannel + + +``` +long Conv2dTransposeFusion::inChannel +``` +**描述:** +输入通道数。 + + +### kernelSize + + +``` +long [] Conv2dTransposeFusion::kernelSize +``` +**描述:** +卷积核大小。 + + +### outChannel + + +``` +long Conv2dTransposeFusion::outChannel +``` +**描述:** +输出通道数。 + + +### outputPaddings + + +``` +long [] Conv2dTransposeFusion::outputPaddings +``` +**描述:** +一个长度为的2整数列表,指定沿输出张量的高度和宽度的填充量。 + + +### padList + + +``` +long [] Conv2dTransposeFusion::padList +``` +**描述:** +输入x周围的填充,是一个长度为4的int数组[top,bottom,left,right]。 + + +### padMode + + +``` +enum PadMode Conv2dTransposeFusion::padMode +``` +**描述:** +填充类型,详情请参考:[PadMode](_n_n_rt.md#padmode) + + +### stride + + +``` +long [] Conv2dTransposeFusion::stride +``` +**描述:** +卷积核在height和weight上的步幅,是一个长度为2的int数组[strideHeight,strideWidth]。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_credential_info.md b/zh-cn/device-dev/reference/hdi-apis/_credential_info.md index 0d892d6244b3c69d8bef954895b02886b2f42271..b4d9cf5a2043499979978a61d41327d67154c81c 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_credential_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_credential_info.md @@ -1,39 +1,35 @@ # CredentialInfo -## **概述** +## 概述 认证凭据信息。 -**自动:** - +**Since:** 3.2 - -**Version:** - +**Version:** 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [credentialId](#credentialid) | 认证凭据ID。 | -| [index](#index) | 用户认证框架的执行器索引。 | -| [templateId](#templateid) | 认证凭据模版ID。 | -| [authType](#authtype) | 用户认证凭据类型。 | -| [executorMatcher](#executormatcher) | 执行器匹配器。 | -| [executorSensorHint](#executorsensorhint) | 既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 | +| [credentialId](#credentialid) | unsigned long
认证凭据ID。  | +| [index](#index) | unsigned long
用户认证框架的执行器索引。  | +| [templateId](#templateid) | unsigned long
认证凭据模版ID。  | +| [authType](#authtype) | enum [AuthType](_hdf_user_auth.md#authtype)
用户认证凭据类型AuthType}。  | +| [executorMatcher](#executormatcher) | unsigned int
执行器匹配器。  | +| [executorSensorHint](#executorsensorhint) | unsigned int
既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。  | -## **类成员变量说明** +## 类成员变量说明 ### authType @@ -42,10 +38,8 @@ ``` enum AuthType CredentialInfo::authType ``` - -**描述:** - -用户认证凭据类型。 +**描述:** +用户认证凭据类型AuthType}。 ### credentialId @@ -54,34 +48,28 @@ enum AuthType CredentialInfo::authType ``` unsigned long CredentialInfo::credentialId ``` - -**描述:** - +**描述:** 认证凭据ID。 -### executorSensorHint +### executorMatcher ``` -unsigned int CredentialInfo::executorSensorHint +unsigned int CredentialInfo::executorMatcher ``` - -**描述:** - -既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 +**描述:** +执行器匹配器。 -### executorMatcher +### executorSensorHint ``` -unsigned int CredentialInfo::executorMatcher +unsigned int CredentialInfo::executorSensorHint ``` - -**描述:** - -执行器匹配器。 +**描述:** +既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 ### index @@ -90,9 +78,7 @@ unsigned int CredentialInfo::executorMatcher ``` unsigned long CredentialInfo::index ``` - -**描述:** - +**描述:** 用户认证框架的执行器索引。 @@ -102,7 +88,5 @@ unsigned long CredentialInfo::index ``` unsigned long CredentialInfo::templateId ``` - -**描述:** - +**描述:** 认证凭据模版ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_cs_reg_status_info.md b/zh-cn/device-dev/reference/hdi-apis/_cs_reg_status_info.md new file mode 100644 index 0000000000000000000000000000000000000000..02b5d4c81b4a526a2fc059060517433df0a29703 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_cs_reg_status_info.md @@ -0,0 +1,94 @@ +# CsRegStatusInfo + + +## 概述 + +CS注册状态信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [notifyType](#notifytype) | int
通知类型 | +| [regStatus](#regstatus) | enum [RilRegStatus](_ril.md#rilregstatus)
注册状态,具体查看[RilRegStatus](_ril.md#rilregstatus) | +| [lacCode](#laccode) | int
地区区域码  | +| [cellId](#cellid) | int
小区标识  | +| [radioTechnology](#radiotechnology) | enum [RilRadioTech](_ril.md#rilradiotech)
语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) | +| [flag](#flag) | int
标志,由搜网管理在响应中使用  | + + +## 类成员变量说明 + + +### cellId + + +``` +int CsRegStatusInfo::cellId +``` +**描述:** +小区标识 + + +### flag + + +``` +int CsRegStatusInfo::flag +``` +**描述:** +标志,由搜网管理在响应中使用 + + +### lacCode + + +``` +int CsRegStatusInfo::lacCode +``` +**描述:** +地区区域码 + + +### notifyType + + +``` +int CsRegStatusInfo::notifyType +``` +**描述:** +通知类型 + +- 0:禁止主动上报 + +- 1:使用格式1上报,格式具体由芯片自定义 + +- 2:使用格式2上报,格式具体由芯片自定义 + + +### radioTechnology + + +``` +enum RilRadioTech CsRegStatusInfo::radioTechnology +``` +**描述:** +语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### regStatus + + +``` +enum RilRegStatus CsRegStatusInfo::regStatus +``` +**描述:** +注册状态,具体查看[RilRegStatus](_ril.md#rilregstatus) diff --git a/zh-cn/device-dev/reference/hdi-apis/_current_cell.md b/zh-cn/device-dev/reference/hdi-apis/_current_cell.md new file mode 100644 index 0000000000000000000000000000000000000000..676be6b526dfd542327578547a9cf9c09fe76f8e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_current_cell.md @@ -0,0 +1,123 @@ +# CurrentCell + + +## 概述 + +定义设备驻留的基站主区信息的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [cellId](#cellid) | long
小区号  | +| [lac](#lac) | int
基站号  | +| [mcc](#mcc) | unsigned short
移动国家码  | +| [mnc](#mnc) | unsigned short
移动网络码  | +| [rssi](#rssi) | short
信号接收强度  | +| [rat](#rat) | unsigned short
网络制式,1代表GSM,2代表WCDMA或TD-CDMA,3代表LTE,4代表5G NR。  | +| [pci](#pci) | unsigned int
物理小区识别码  | +| [bootTimeLow](#boottimelow) | int
时间戳的低32位  | +| [bootTimeHigh](#boottimehigh) | int
时间戳的高32位  | + + +## 类成员变量说明 + + +### bootTimeHigh + + +``` +int CurrentCell::bootTimeHigh +``` +**描述:** +时间戳的高32位 + + +### bootTimeLow + + +``` +int CurrentCell::bootTimeLow +``` +**描述:** +时间戳的低32位 + + +### cellId + + +``` +long CurrentCell::cellId +``` +**描述:** +小区号 + + +### lac + + +``` +int CurrentCell::lac +``` +**描述:** +基站号 + + +### mcc + + +``` +unsigned short CurrentCell::mcc +``` +**描述:** +移动国家码 + + +### mnc + + +``` +unsigned short CurrentCell::mnc +``` +**描述:** +移动网络码 + + +### pci + + +``` +unsigned int CurrentCell::pci +``` +**描述:** +物理小区识别码 + + +### rat + + +``` +unsigned short CurrentCell::rat +``` +**描述:** +网络制式,1代表GSM,2代表WCDMA或TD-CDMA,3代表LTE,4代表5G NR。 + + +### rssi + + +``` +short CurrentCell::rssi +``` +**描述:** +信号接收强度 diff --git a/zh-cn/device-dev/reference/hdi-apis/_current_cell_info.md b/zh-cn/device-dev/reference/hdi-apis/_current_cell_info.md new file mode 100644 index 0000000000000000000000000000000000000000..4d1b038ec2c4853ae63b0d4a4e9a923d049cfafa --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_current_cell_info.md @@ -0,0 +1,66 @@ +# CurrentCellInfo + + +## 概述 + +当前小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [ratType](#rattype) | int
语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) | +| [mcc](#mcc) | int
移动国家码  | +| [mnc](#mnc) | int
移动网络码  | +| [serviceCells](#servicecells) | union [CurrentServiceCellParas](union_current_service_cell_paras.md)
小区信息参数,具体查看[CurrentServiceCellParas](union_current_service_cell_paras.md) | + + +## 类成员变量说明 + + +### mcc + + +``` +int CurrentCellInfo::mcc +``` +**描述:** +移动国家码 + + +### mnc + + +``` +int CurrentCellInfo::mnc +``` +**描述:** +移动网络码 + + +### ratType + + +``` +int CurrentCellInfo::ratType +``` +**描述:** +语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### serviceCells + + +``` +union CurrentServiceCellParas CurrentCellInfo::serviceCells +``` +**描述:** +小区信息参数,具体查看[CurrentServiceCellParas](union_current_service_cell_paras.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_call_info.md b/zh-cn/device-dev/reference/hdi-apis/_data_call_info.md new file mode 100644 index 0000000000000000000000000000000000000000..766e4f8211a4ed6eb4eb9667f508d52d5031e3e1 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_call_info.md @@ -0,0 +1,88 @@ +# DataCallInfo + + +## 概述 + +数据业务信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [radioTechnology](#radiotechnology) | int
无线接入技术,具体查看[RilRadioTech](_ril.md#rilradiotech) | +| [modemCognitive](#modemcognitive) | boolean
是否modem设置PDP上下文  | +| [roamingAllowed](#roamingallowed) | boolean
是否允许漫游,true表示允许,false表示禁止  | +| [isRoaming](#isroaming) | boolean
是否漫游,true表示漫游,false表示非漫游  | +| [dataProfileInfo](#dataprofileinfo) | struct [DataProfileDataInfo](_data_profile_data_info.md)
PDP上下文信息  | + + +## 类成员变量说明 + + +### dataProfileInfo + + +``` +struct DataProfileDataInfo DataCallInfo::dataProfileInfo +``` +**描述:** +PDP上下文信息 + + +### isRoaming + + +``` +boolean DataCallInfo::isRoaming +``` +**描述:** +是否漫游,true表示漫游,false表示非漫游 + + +### modemCognitive + + +``` +boolean DataCallInfo::modemCognitive +``` +**描述:** +是否modem设置PDP上下文 + + +### radioTechnology + + +``` +int DataCallInfo::radioTechnology +``` +**描述:** +无线接入技术,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### roamingAllowed + + +``` +boolean DataCallInfo::roamingAllowed +``` +**描述:** +是否允许漫游,true表示允许,false表示禁止 + + +### serial + + +``` +int DataCallInfo::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_call_result_list.md b/zh-cn/device-dev/reference/hdi-apis/_data_call_result_list.md new file mode 100644 index 0000000000000000000000000000000000000000..28396727eab205068f8eb560e42b3bd8c0adfbef --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_call_result_list.md @@ -0,0 +1,44 @@ +# DataCallResultList + + +## 概述 + +数据业务激活结果列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [size](#size) | int
数据业务激活结果信息数量  | +| [dcList](#dclist) | List< struct [SetupDataCallResultInfo](_setup_data_call_result_info.md) >
数据业务激活结果列表  | + + +## 类成员变量说明 + + +### dcList + + +``` +List DataCallResultList::dcList +``` +**描述:** +数据业务激活结果列表 + + +### size + + +``` +int DataCallResultList::size +``` +**描述:** +数据业务激活结果信息数量 diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_link_bandwidth_info.md b/zh-cn/device-dev/reference/hdi-apis/_data_link_bandwidth_info.md new file mode 100644 index 0000000000000000000000000000000000000000..e8a38b82dffafc4d204b328310650ec4c6b8fbd5 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_link_bandwidth_info.md @@ -0,0 +1,132 @@ +# DataLinkBandwidthInfo + + +## 概述 + +网络频率信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [cid](#cid) | int
PDP上下文标识符  | +| [qi](#qi) | int
服务质量(QoS)类别指示  | +| [dlGfbr](#dlgfbr) | int
下行方向保证比特速率(GBR)  | +| [ulGfbr](#ulgfbr) | int
上行方向GBR  | +| [dlMfbr](#dlmfbr) | int
下行方向最大比特速率(MBR)  | +| [ulMfbr](#ulmfbr) | int
上行方向MBR  | +| [ulSambr](#ulsambr) | int
上行方向聚合最大比特速率(AMBR)  | +| [dlSambr](#dlsambr) | int
下行方向AMBR  | +| [averagingWindow](#averagingwindow) | int
时间单位  | + + +## 类成员变量说明 + + +### averagingWindow + + +``` +int DataLinkBandwidthInfo::averagingWindow +``` +**描述:** +时间单位 + + +### cid + + +``` +int DataLinkBandwidthInfo::cid +``` +**描述:** +PDP上下文标识符 + + +### dlGfbr + + +``` +int DataLinkBandwidthInfo::dlGfbr +``` +**描述:** +下行方向保证比特速率(GBR) + + +### dlMfbr + + +``` +int DataLinkBandwidthInfo::dlMfbr +``` +**描述:** +下行方向最大比特速率(MBR) + + +### dlSambr + + +``` +int DataLinkBandwidthInfo::dlSambr +``` +**描述:** +下行方向AMBR + + +### qi + + +``` +int DataLinkBandwidthInfo::qi +``` +**描述:** +服务质量(QoS)类别指示 + + +### serial + + +``` +int DataLinkBandwidthInfo::serial +``` +**描述:** +请求的序列号 + + +### ulGfbr + + +``` +int DataLinkBandwidthInfo::ulGfbr +``` +**描述:** +上行方向GBR + + +### ulMfbr + + +``` +int DataLinkBandwidthInfo::ulMfbr +``` +**描述:** +上行方向MBR + + +### ulSambr + + +``` +int DataLinkBandwidthInfo::ulSambr +``` +**描述:** +上行方向聚合最大比特速率(AMBR) diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_link_bandwidth_reporting_rule.md b/zh-cn/device-dev/reference/hdi-apis/_data_link_bandwidth_reporting_rule.md new file mode 100644 index 0000000000000000000000000000000000000000..91c7cb535fd20c0204c1020a19b2b52556549ac3 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_link_bandwidth_reporting_rule.md @@ -0,0 +1,121 @@ +# DataLinkBandwidthReportingRule + + +## 概述 + +网络频率上报规则。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [rat](#rat) | int
无线接入技术,具体查看[RilRadioTech](_ril.md#rilradiotech) | +| [delayMs](#delayms) | int
迟滞时间  | +| [delayUplinkKbps](#delayuplinkkbps) | int
上行迟滞  | +| [delayDownlinkKbps](#delaydownlinkkbps) | int
下行迟滞  | +| [maximumUplinkKbpsSize](#maximumuplinkkbpssize) | int
最大上行参数数量  | +| [maximumDownlinkKbpsSize](#maximumdownlinkkbpssize) | int
最大下行参数数量  | +| [maximumUplinkKbps](#maximumuplinkkbps) | List< int >
最大上行参数列表  | +| [maximumDownlinkKbps](#maximumdownlinkkbps) | List< int >
最大下行参数列表  | + + +## 类成员变量说明 + + +### delayDownlinkKbps + + +``` +int DataLinkBandwidthReportingRule::delayDownlinkKbps +``` +**描述:** +下行迟滞 + + +### delayMs + + +``` +int DataLinkBandwidthReportingRule::delayMs +``` +**描述:** +迟滞时间 + + +### delayUplinkKbps + + +``` +int DataLinkBandwidthReportingRule::delayUplinkKbps +``` +**描述:** +上行迟滞 + + +### maximumDownlinkKbps + + +``` +List DataLinkBandwidthReportingRule::maximumDownlinkKbps +``` +**描述:** +最大下行参数列表 + + +### maximumDownlinkKbpsSize + + +``` +int DataLinkBandwidthReportingRule::maximumDownlinkKbpsSize +``` +**描述:** +最大下行参数数量 + + +### maximumUplinkKbps + + +``` +List DataLinkBandwidthReportingRule::maximumUplinkKbps +``` +**描述:** +最大上行参数列表 + + +### maximumUplinkKbpsSize + + +``` +int DataLinkBandwidthReportingRule::maximumUplinkKbpsSize +``` +**描述:** +最大上行参数数量 + + +### rat + + +``` +int DataLinkBandwidthReportingRule::rat +``` +**描述:** +无线接入技术,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### serial + + +``` +int DataLinkBandwidthReportingRule::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_performance_info.md b/zh-cn/device-dev/reference/hdi-apis/_data_performance_info.md new file mode 100644 index 0000000000000000000000000000000000000000..6252096ab45adb8d6c0e8c3af408e3c850b0a364 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_performance_info.md @@ -0,0 +1,44 @@ +# DataPerformanceInfo + + +## 概述 + +数据业务性能模式。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [performanceEnable](#performanceenable) | int
开启性能模式  | +| [enforce](#enforce) | int
强制开启  | + + +## 类成员变量说明 + + +### enforce + + +``` +int DataPerformanceInfo::enforce +``` +**描述:** +强制开启 + + +### performanceEnable + + +``` +int DataPerformanceInfo::performanceEnable +``` +**描述:** +开启性能模式 diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_profile_data_info.md b/zh-cn/device-dev/reference/hdi-apis/_data_profile_data_info.md new file mode 100644 index 0000000000000000000000000000000000000000..32c13d31ced902c9efbff1d584fb3b6a4e754307 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_profile_data_info.md @@ -0,0 +1,116 @@ +# DataProfileDataInfo + + +## 概述 + +PDP上下文信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [profileId](#profileid) | int
数据业务类型号,0表示默认数据业务,1表示彩信数据业务  | +| [authenticationType](#authenticationtype) | int
鉴权类型 | +| [apn](#apn) | String
接入点名称  | +| [protocol](#protocol) | String
网际协议版本  | +| [roamingProtocol](#roamingprotocol) | String
漫游网际协议版本  | +| [userName](#username) | String
用户名  | +| [password](#password) | String
密码  | + + +## 类成员变量说明 + + +### apn + + +``` +String DataProfileDataInfo::apn +``` +**描述:** +接入点名称 + + +### authenticationType + + +``` +int DataProfileDataInfo::authenticationType +``` +**描述:** +鉴权类型 + +- 0:无 + +- 1:密码认证协议(PAP) + +- 2:质询握手认证协议(CHAP) + + +### password + + +``` +String DataProfileDataInfo::password +``` +**描述:** +密码 + + +### profileId + + +``` +int DataProfileDataInfo::profileId +``` +**描述:** +数据业务类型号,0表示默认数据业务,1表示彩信数据业务 + + +### protocol + + +``` +String DataProfileDataInfo::protocol +``` +**描述:** +网际协议版本 + + +### roamingProtocol + + +``` +String DataProfileDataInfo::roamingProtocol +``` +**描述:** +漫游网际协议版本 + + +### serial + + +``` +int DataProfileDataInfo::serial +``` +**描述:** +请求的序列号 + + +### userName + + +``` +String DataProfileDataInfo::userName +``` +**描述:** +用户名 diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_profiles_info.md b/zh-cn/device-dev/reference/hdi-apis/_data_profiles_info.md new file mode 100644 index 0000000000000000000000000000000000000000..2bd05f83b71a82b389349902b8df80f3d853fa89 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_profiles_info.md @@ -0,0 +1,66 @@ +# DataProfilesInfo + + +## 概述 + +PDP上下文信息列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [profilesSize](#profilessize) | int
PDP上下文数量  | +| [isRoaming](#isroaming) | boolean
是否漫游  | +| [profiles](#profiles) | List< struct [DataProfileDataInfo](_data_profile_data_info.md) >
PDP上下文信息列表  | + + +## 类成员变量说明 + + +### isRoaming + + +``` +boolean DataProfilesInfo::isRoaming +``` +**描述:** +是否漫游 + + +### profiles + + +``` +List DataProfilesInfo::profiles +``` +**描述:** +PDP上下文信息列表 + + +### profilesSize + + +``` +int DataProfilesInfo::profilesSize +``` +**描述:** +PDP上下文数量 + + +### serial + + +``` +int DataProfilesInfo::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_data_sleep_info.md b/zh-cn/device-dev/reference/hdi-apis/_data_sleep_info.md new file mode 100644 index 0000000000000000000000000000000000000000..195978fb94d67d3387bf7bc0472bdaf62b16f74b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_data_sleep_info.md @@ -0,0 +1,33 @@ +# DataSleepInfo + + +## 概述 + +数据业务睡眠模式。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [sleepEnable](#sleepenable) | int
开启睡眠模式  | + + +## 类成员变量说明 + + +### sleepEnable + + +``` +int DataSleepInfo::sleepEnable +``` +**描述:** +开启睡眠模式 diff --git a/zh-cn/device-dev/reference/hdi-apis/_device_funcs.md b/zh-cn/device-dev/reference/hdi-apis/_device_funcs.md index 4d03b1911cff0d4acde50b7e3379574ca1c454c7..57dd59ba0526839d91666cbac3bf7ed8e5ec8b66 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_device_funcs.md +++ b/zh-cn/device-dev/reference/hdi-apis/_device_funcs.md @@ -1,7 +1,7 @@ # DeviceFuncs -## **概述** +## 概述 显示设备控制接口结构体,定义显示设备控制接口函数指针。 @@ -10,53 +10,53 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([DeviceFuncs::RegHotPlugCallback](_display.md#reghotplugcallback) )(HotPlugCallback callback, void \*data) | 注册热插拔事件回调。 | -| ([DeviceFuncs::RegDisplayVBlankCallback](_display.md#regdisplayvblankcallback) )(uint32_t devId, VBlankCallback callback, void \*data) | 注册VBlank事件回调。 | -| ([DeviceFuncs::RegDisplayRefreshCallback](_display.md#regdisplayrefreshcallback) )(uint32_t devId, RefreshCallback callback, void \*data) | 刷新请求回调。 | -| ([DeviceFuncs::GetDisplayCapability](_display.md#getdisplaycapability) )(uint32_t devId, DisplayCapability \*info) | 获取显示设备能力集。 | -| ([DeviceFuncs::GetDisplaySupportedModes](_display.md#getdisplaysupportedmodes) )(uint32_t devId, uint32_t \*num, DisplayModeInfo \*modes) | 获取显示设备支持的显示模式信息。 | -| ([DeviceFuncs::GetDisplayMode](_display.md#getdisplaymode) )(uint32_t devId, uint32_t \*modeId) | 获取显示设备当前的显示模式。 | -| ([DeviceFuncs::SetDisplayMode](_display.md#setdisplaymode) )(uint32_t devId, uint32_t modeId) | 设置显示设备的显示模式。 | -| ([DeviceFuncs::GetDisplayPowerStatus](_display.md#getdisplaypowerstatus) )(uint32_t devId, DispPowerStatus \*status) | 获取显示设备当前的电源状态。 | -| ([DeviceFuncs::SetDisplayPowerStatus](_display.md#setdisplaypowerstatus) )(uint32_t devId, DispPowerStatus status) | 设置显示设备当前的电源状态。 | -| ([DeviceFuncs::GetDisplayBacklight](_display.md#getdisplaybacklight) )(uint32_t devId, uint32_t \*level) | 获取显示设备当前的背光值。 | -| ([DeviceFuncs::SetDisplayBacklight](_display.md#setdisplaybacklight) )(uint32_t devId, uint32_t level) | 设置显示设备当前的背光值。 | -| ([DeviceFuncs::GetDisplayProperty](_display.md#getdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t \*value) | 获取显示设备属性值。 | -| ([DeviceFuncs::SetDisplayProperty](_display.md#setdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t value) | 设置显示设备属性值。 | -| ([DeviceFuncs::PrepareDisplayLayers](_display.md#preparedisplaylayers) )(uint32_t devId, bool \*needFlushFb) | 显示设备合成前准备。 | -| ([DeviceFuncs::GetDisplayCompChange](_display.md#getdisplaycompchange) )(uint32_t devId, uint32_t \*num, uint32_t \*Layers, int32_t \*type) | 获取显示设备合成类型有变化的layer。 | -| ([DeviceFuncs::SetDisplayClientCrop](_display.md#setdisplayclientcrop) )(uint32_t devId, IRect \*rect) | 设置显示设备的裁剪区域。 | -| ([DeviceFuncs::SetDisplayClientDestRect](_display.md#setdisplayclientdestrect) )(uint32_t devId, IRect \*rect) | 设置显示设备的显示区域。 | -| ([DeviceFuncs::SetDisplayClientBuffer](_display.md#setdisplayclientbuffer) )(uint32_t devId, const BufferHandle \*buffer, int32_t fence) | 设置显示设备的显示缓存。 | -| ([DeviceFuncs::SetDisplayClientDamage](_display.md#setdisplayclientdamage) )(uint32_t devId, uint32_t num, IRect \*rect) | 设置显示设备的显示脏区。 | -| ([DeviceFuncs::SetDisplayVsyncEnabled](_display.md#setdisplayvsyncenabled) )(uint32_t devId, bool enabled) | 使能垂直同步信号。 | -| ([DeviceFuncs::GetDisplayReleaseFence](_display.md#getdisplayreleasefence) )(uint32_t devId, uint32_t \*num, uint32_t \*layers, int32_t \*fences) | 获取显示图层fence。 | -| ([DeviceFuncs::GetDisplaySupportedColorGamuts](_display.md#getdisplaysupportedcolorgamuts) )(uint32_t devId, uint32_t \*num, ColorGamut \*gamuts) | 获取显示设备支持的色域信息。 | -| ([DeviceFuncs::GetDisplayColorGamut](_display.md#getdisplaycolorgamut) )(uint32_t devId, ColorGamut \*gamut) | 获取显示设备当前的色域模式。 | -| ([DeviceFuncs::SetDisplayColorGamut](_display.md#setdisplaycolorgamut) )(uint32_t devId, ColorGamut gamut) | 设置显示设备当前的色域模式。 | -| ([DeviceFuncs::GetDisplayGamutMap](_display.md#getdisplaygamutmap) )(uint32_t devId, GamutMap \*gamutMap) | 获取显示设备当前的色域映射模式。 | -| ([DeviceFuncs::SetDisplayGamutMap](_display.md#setdisplaygamutmap) )(uint32_t devId, GamutMap gamutMap) | 设置显示设备当前的色域映射模式。 | -| ([DeviceFuncs::SetDisplayColorTransform](_display.md#setdisplaycolortransform) )(uint32_t devId, const float \*matrix) | 设置显示设备当前的4x4的颜色转换矩阵。 | -| ([DeviceFuncs::GetHDRCapabilityInfos](_display.md#gethdrcapabilityinfos) )(uint32_t devId, HDRCapability \*info) | 获取显示设备支持的HDR属性信息。 | -| ([DeviceFuncs::GetSupportedMetadataKey](_display.md#getsupportedmetadatakey) )(uint32_t devId, uint32_t \*num, DisplayInfo::widthHDRMetadataKey \*keys) | 获取显示设备支持的 HDRMetadataKey。 | -| ([DeviceFuncs::Commit](_display.md#commit) )(uint32_t devId, int32_t \*fence) | 提交合成送显请求。 | -| ([DeviceFuncs::InvokeDisplayCmd](_display.md#invokedisplaycmd) )(uint32_t devId,...) | 调用显示设备命令。 | -| ([DeviceFuncs::CreateVirtualDisplay](_display.md#createvirtualdisplay) )(uint32_t width, uint32_t height, int32_t \*format, uint32_t \*devId) | 创建虚拟显示设备。 | -| ([DeviceFuncs::DestroyVirtualDisplay](_display.md#destroyvirtualdisplay) )(uint32_t devId) | 销毁虚拟显示设备。 | -| ([DeviceFuncs::SetVirtualDisplayBuffer](_display.md#setvirtualdisplaybuffer) )(uint32_t devId, BufferHandle \*buffer, int32_t fence) | 设置虚拟屏的输出缓存。 | -| ([DeviceFuncs::GetWriteBackFrame](_display.md#getwritebackframe) )(uint32_t devId, BufferHandle \*buffer, int32_t \*fence) | 获取显示设备的回写帧。 | -| ([DeviceFuncs::CreateWriteBack](#createwriteback)DeviceFuncs::CreateWriteBack)(uint32_t \*devId, uint32_t width, uint32_t height, int32_t \*format) | PixelFormat, 接口实现层可以根据硬件需求,修改format并返回给图形服务。 | -| ([DeviceFuncs::DestroyWriteBack](#destroywriteback) )(uint32_t devId) | 销毁指定显示设备的回写点。 | - - -## **类成员变量说明** +| (\* [RegHotPlugCallback](_display.md#reghotplugcallback) )([HotPlugCallback](_display.md#hotplugcallback) callback, void \*data) | int32_t
注册热插拔事件回调。 | +| (\* [RegDisplayVBlankCallback](_display.md#regdisplayvblankcallback) )(uint32_t devId, [VBlankCallback](_display.md#vblankcallback) callback, void \*data) | int32_t
注册VBlank事件回调。 | +| (\* [RegDisplayRefreshCallback](_display.md#regdisplayrefreshcallback) )(uint32_t devId, [RefreshCallback](_display.md#refreshcallback) callback, void \*data) | int32_t
刷新请求回调。 | +| (\* [GetDisplayCapability](_display.md#getdisplaycapability) )(uint32_t devId, [DisplayCapability](_display_capability.md) \*info) | int32_t
获取显示设备能力集。 | +| (\* [GetDisplaySupportedModes](_display.md#getdisplaysupportedmodes) )(uint32_t devId, uint32_t \*num, [DisplayModeInfo](_display_mode_info.md) \*modes) | int32_t
获取显示设备支持的显示模式信息。 | +| (\* [GetDisplayMode](_display.md#getdisplaymode) )(uint32_t devId, uint32_t \*modeId) | int32_t
获取显示设备当前的显示模式。 | +| (\* [SetDisplayMode](_display.md#setdisplaymode) )(uint32_t devId, uint32_t modeId) | int32_t
设置显示设备的显示模式。 | +| (\* [GetDisplayPowerStatus](_display.md#getdisplaypowerstatus) )(uint32_t devId, [DispPowerStatus](_display.md#disppowerstatus) \*status) | int32_t
获取显示设备当前的电源状态。 | +| (\* [SetDisplayPowerStatus](_display.md#setdisplaypowerstatus) )(uint32_t devId, [DispPowerStatus](_display.md#disppowerstatus) status) | int32_t
设置显示设备当前的电源状态。 | +| (\* [GetDisplayBacklight](_display.md#getdisplaybacklight) )(uint32_t devId, uint32_t \*level) | int32_t
获取显示设备当前的背光值。 | +| (\* [SetDisplayBacklight](_display.md#setdisplaybacklight) )(uint32_t devId, uint32_t level) | int32_t
设置显示设备当前的背光值。 | +| (\* [GetDisplayProperty](_display.md#getdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t \*value) | int32_t
获取显示设备属性值。 | +| (\* [SetDisplayProperty](_display.md#setdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t value) | int32_t
设置显示设备属性值。 | +| (\* [PrepareDisplayLayers](_display.md#preparedisplaylayers) )(uint32_t devId, bool \*needFlushFb) | int32_t
显示设备合成前准备。 | +| (\* [GetDisplayCompChange](_display.md#getdisplaycompchange) )(uint32_t devId, uint32_t \*num, uint32_t \*Layers, int32_t \*type) | int32_t
获取显示设备合成类型有变化的layer。 | +| (\* [SetDisplayClientCrop](_display.md#setdisplayclientcrop) )(uint32_t devId, [IRect](_i_rect.md) \*rect) | int32_t
设置显示设备的裁剪区域。 | +| (\* [SetDisplayClientDestRect](_display.md#setdisplayclientdestrect) )(uint32_t devId, [IRect](_i_rect.md) \*rect) | int32_t
设置显示设备的显示区域。 | +| (\* [SetDisplayClientBuffer](_display.md#setdisplayclientbuffer) )(uint32_t devId, const BufferHandle \*buffer, int32_t fence) | int32_t
设置显示设备的显示缓存。 | +| (\* [SetDisplayClientDamage](_display.md#setdisplayclientdamage) )(uint32_t devId, uint32_t num, [IRect](_i_rect.md) \*rect) | int32_t
设置显示设备的显示脏区。 | +| (\* [SetDisplayVsyncEnabled](_display.md#setdisplayvsyncenabled) )(uint32_t devId, bool enabled) | int32_t
使能垂直同步信号。 | +| (\* [GetDisplayReleaseFence](_display.md#getdisplayreleasefence) )(uint32_t devId, uint32_t \*num, uint32_t \*layers, int32_t \*fences) | int32_t
获取显示图层fence。 | +| (\* [GetDisplaySupportedColorGamuts](_display.md#getdisplaysupportedcolorgamuts) )(uint32_t devId, uint32_t \*num, [ColorGamut](_display.md#colorgamut) \*gamuts) | int32_t
获取显示设备支持的色域信息。 | +| (\* [GetDisplayColorGamut](_display.md#getdisplaycolorgamut) )(uint32_t devId, [ColorGamut](_display.md#colorgamut) \*gamut) | int32_t
获取显示设备当前的色域模式。 | +| (\* [SetDisplayColorGamut](_display.md#setdisplaycolorgamut) )(uint32_t devId, [ColorGamut](_display.md#colorgamut) gamut) | int32_t
设置显示设备当前的色域模式。 | +| (\* [GetDisplayGamutMap](_display.md#getdisplaygamutmap) )(uint32_t devId, [GamutMap](_display.md#gamutmap) \*gamutMap) | int32_t
获取显示设备当前的色域映射模式。 | +| (\* [SetDisplayGamutMap](_display.md#setdisplaygamutmap) )(uint32_t devId, [GamutMap](_display.md#gamutmap) gamutMap) | int32_t
设置显示设备当前的色域映射模式。 | +| (\* [SetDisplayColorTransform](_display.md#setdisplaycolortransform) )(uint32_t devId, const float \*matrix) | int32_t
设置显示设备当前的4x4的颜色转换矩阵。 | +| (\* [GetHDRCapabilityInfos](_display.md#gethdrcapabilityinfos) )(uint32_t devId, [HDRCapability](_h_d_r_capability.md) \*info) | int32_t
获取显示设备支持的HDR属性信息。 | +| (\* [GetSupportedMetadataKey](_display.md#getsupportedmetadatakey) )(uint32_t devId, uint32_t \*num, [HDRMetadataKey](_display.md#hdrmetadatakey) \*keys) | int32_t
获取显示设备支持的 HDRMetadataKey。 | +| (\* [Commit](_display.md#commit) )(uint32_t devId, int32_t \*fence) | int32_t
提交合成送显请求。 | +| (\* [InvokeDisplayCmd](_display.md#invokedisplaycmd) )(uint32_t devId,...) | int32_t
调用显示设备命令。 | +| (\* [CreateVirtualDisplay](_display.md#createvirtualdisplay) )(uint32_t width, uint32_t height, int32_t \*format, uint32_t \*devId) | int32_t
创建虚拟显示设备。 | +| (\* [DestroyVirtualDisplay](_display.md#destroyvirtualdisplay) )(uint32_t devId) | int32_t
销毁虚拟显示设备。 | +| (\* [SetVirtualDisplayBuffer](_display.md#setvirtualdisplaybuffer) )(uint32_t devId, BufferHandle \*buffer, int32_t fence) | int32_t
设置虚拟屏的输出缓存。 | +| (\* [GetWriteBackFrame](_display.md#getwritebackframe) )(uint32_t devId, BufferHandle \*buffer, int32_t \*fence) | int32_t
获取显示设备的回写帧。 | +| (\* [CreateWriteBack](#createwriteback) )(uint32_t \*devId, uint32_t width, uint32_t height, int32_t \*format) | int32_t
PixelFormat, 接口实现层可以根据硬件需求,修改format并返回给图形服务。 | +| (\* [DestroyWriteBack](#destroywriteback) )(uint32_t devId) | int32_t
销毁指定显示设备的回写点。 | + + +## 类成员变量说明 ### CreateWriteBack @@ -66,19 +66,10 @@ int32_t(* DeviceFuncs::CreateWriteBack) (uint32_t *devId, uint32_t width, uint32_t height, int32_t *format) ``` -**描述:** +**描述:** PixelFormat, 接口实现层可以根据硬件需求,修改format并返回给图形服务。 -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| devId | 输入参数,指示需要操作的设备ID,接口实现层在创建完回写点后将回写点设备ID存放在该参数中返回给图形服务。 | -| width | 输入参数,回写像素宽度。 | -| height | 输入参数,回写像素高度。 | -| format | 输入参数,回写点数据格式,详情参考[PixelFormat](_display.md#pixelformat),接口实现层可以根据硬件需求,修改format并返回给图形服务。 | - **返回:** DISPLAY_SUCCESS 表示执行成功。 @@ -93,12 +84,10 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::DestroyWriteBack) (uint32_t devId) ``` -**描述:** +**描述:** 销毁指定显示设备的回写点。 -该接口用來销毁指定的回写点。 - **参数:** | 名称 | 描述 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_dial_info.md b/zh-cn/device-dev/reference/hdi-apis/_dial_info.md new file mode 100644 index 0000000000000000000000000000000000000000..176de00e66e0909b851642ccf7fafe28558a6822 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_dial_info.md @@ -0,0 +1,61 @@ +# DialInfo + + +## 概述 + +拨号信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [clir](#clir) | int
CLIR模式 | +| [address](#address) | String
电话号码  | + + +## 类成员变量说明 + + +### address + + +``` +String DialInfo::address +``` +**描述:** +电话号码 + + +### clir + + +``` +int DialInfo::clir +``` +**描述:** +CLIR模式 + +- 0:默认 + +- 1:开启 + +- 2:关闭 + + +### serial + + +``` +int DialInfo::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_display.md b/zh-cn/device-dev/reference/hdi-apis/_display.md index ec7e8d4bb789a1542ebe49aaadbbd2371f01d053..e20a8b6a276f572af59ef59508666afcb4bcd302 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_display.md +++ b/zh-cn/device-dev/reference/hdi-apis/_display.md @@ -1,24 +1,24 @@ # Display -## **汇总** - - -## **概述** +## 概述 显示模块驱动接口定义。 提供给图形系统使用的驱动接口,包括图层管理、设备控制、图形硬件加速、显示内存管理和回调接口等。 -**Since**: +**Since:** 1.0 -**Version**:。 +**Version:** 2.0 +## 汇总 + + ### 文件 | 名称 | 描述 | @@ -35,50 +35,50 @@ | 名称 | 描述 | | -------- | -------- | -| [DeviceFuncs](_device_funcs.md) | 显示设备控制接口结构体,定义显示设备控制接口函数指针。 | -| [GfxFuncs](_gfx_funcs.md) | 显示硬件加速驱动接口结构体,定义硬件加速驱动接口函数指针。 | -| [GrallocFuncs](_gralloc_funcs.md) | 显示内存驱动接口结构体,定义显示内存驱动接口函数指针。 | -| [LayerFuncs](_layer_funcs.md) | 显示图层驱动接口结构体,定义显示图层驱动接口函数指针。 | -| [DisplayInfo](_display_info.md) | 定义显示信息结构体 | -| [LayerInfo](_layer_info.md) | 定义图层信息结构体 | -| [LayerAlpha](_layer_alpha.md) | 定义图层Alpha信息的结构体 | -| [BufferData](_buffer_data.md) | 定义一层的缓冲区数据,包括虚拟和物理内存地址。 | -| [LayerBuffer](_layer_buffer.md) | 图层Buffer,用于存放图层数据。 | -| [IRect](_i_rect.md) | 定义矩形信息。 | -| [ISurface](_i_surface.md) | 用于存放窗口相关信息的结构体定义,提供给硬件加速使用,例如图像合成,位图搬移等操作。 | -| [ILine](_i_line.md) | 线条描述结构体定义,用于硬件加速绘制直线。 | -| [ICircle](_i_circle.md) | 圆形描述结构体定义,用于硬件加速绘制圆形。 | -| [Rectangle](_rectangle.md) | 矩形描述结构体定义,用于硬件加速绘制矩形。 | -| [GfxOpt](_gfx_opt.md) | 图像硬件加速相关的操作选项结构体定义,用于图像硬件加速时的操作选项。 | -| [PropertyObject](_property_object.md) | 定义包含名称、属性ID和值的属性对象。 | -| [DisplayCapability](_display_capability.md) | 定义输出性能。 | -| [DisplayModeInfo](_display_mode_info.md) | 定义输出模式信息。 | -| [AllocInfo](_alloc_info.md) | 定义关于要分配的内存的信息。 | -| [HDRCapability](_h_d_r_capability.md) | HDR属性结构体定义。 | -| [HDRMetaData](_h_d_r_meta_data.md) | HDR元数据结构体定义。 | -| [VerifyAllocInfo](_verify_alloc_info.md) | 用于验证内存分配信息的结构体定义。 | -| [PresentTimestamp](_present_timestamp.md) | 上屏时间戳结构体定义。 | -| [ExtDataHandle](_ext_data_handle.md) | 扩展数据句柄结构体定义。 | -| [YUVDescInfo](_yun_desc_info_.md) | YUV描述信息结构体定义。 | -| [VGUPoint](_v_g_u_point.md) | 坐标点对象。 | -| [VGURect](_v_g_u_rect.md) | 矩形对象。 | -| [VGUPath](_v_g_u_path.md) | 路径对象,存放路径命令和坐标数据。 | -| [VGUMatrix3](_v_g_u_matrix3.md) | 变换矩阵。 | -| [VGUBuffer](_v_g_u_buffer.md) | 硬件加速渲染位图缓存。 | -| [VGUMaskLayer](_v_g_u_mask_layer.md) | 定义蒙版图层。 | -| [VGUSurface](_v_g_u_surface.md) | 2D硬件加速绘制目标表面。 | -| [VGUColorStop](_v_g_u_color_stop.md) | 渐变颜色分布位置。 | -| [VGULinear](_v_g_u_linear.md) | 线性渐变。 | -| [VGURadial](_v_g_u_radial.md) | 辐射渐变。 | -| [VGUConic](_v_g_u_conic.md) | 圆锥渐变。 | -| [VGUImage](_v_g_u_image.md) | 图像对象。 | -| [VGUPattern](_v_g_u_pattern.md) | 图片模式对象。 | -| [VGUGradient](_v_g_u_gradient.md) | 渐变对象。 | -| [VGUSolid](_v_g_u_solid.md) | 颜色对象。 | -| [VGUPaintStyle](_v_g_u_paint_style.md) | 填充或描边路径的渲染风格。 | -| [VGUFillAttr](_v_g_u_fill_attr.md) | 填充路径的属性。 | -| [VGUStrokeAttr](_v_g_u_stroke_attr.md) | 描边路径的属性。 | -| [VGUFuncs](_v_g_u_funcs.md) | 定义2D硬件加速驱动函数。 | +| [DeviceFuncs](_device_funcs.md) | struct
显示设备控制接口结构体,定义显示设备控制接口函数指针。 | +| [ExtDataHandle](_ex_data_handle.md) | struct
扩展数据句柄结构体定义。 | +| [GfxFuncs](_gfx_funcs.md) | struct
显示硬件加速驱动接口结构体,定义硬件加速驱动接口函数指针。 | +| [GrallocFuncs](_gralloc_funcs.md) | struct
显示内存驱动接口结构体,定义显示内存驱动接口函数指针。 | +| [LayerFuncs](_layer_funcs.md) | struct
显示图层驱动接口结构体,定义显示图层驱动接口函数指针。 | +| [DisplayInfo](_display_info.md) | struct
定义显示信息结构体 | +| [LayerInfo](_layer_info.md) | struct
定义图层信息结构体 | +| [LayerAlpha](_layer_alpha.md) | struct
定义图层Alpha信息的结构体 | +| [BufferData](_buffer_data.md) | struct
定义一层的缓冲区数据,包括虚拟和物理内存地址。 | +| [LayerBuffer](_layer_buffer.md) | struct
图层Buffer,用于存放图层数据。 | +| [IRect](_i_rect.md) | struct
定义矩形信息 | +| [ISurface](_i_surface.md) | struct
用于存放窗口相关信息的结构体定义,提供给硬件加速使用,例如图像合成,位图搬移等操作。 | +| [ILine](_i_line.md) | struct
线条描述结构体定义,用于硬件加速绘制直线。 | +| [ICircle](_i_circle.md) | struct
圆形描述结构体定义,用于硬件加速绘制圆形。 | +| [Rectangle](_rectangle.md) | struct
矩形描述结构体定义,用于硬件加速绘制矩形。 | +| [GfxOpt](_gfx_opt.md) | struct
图像硬件加速相关的操作选项结构体定义,用于图像硬件加速时的操作选项。 | +| [PropertyObject](_property_object.md) | struct
定义包含名称、属性ID和值的属性对象。 | +| [DisplayCapability](_display_capability.md) | struct
定义输出性能。 | +| [DisplayModeInfo](_display_mode_info.md) | struct
定义输出模式信息。 | +| [AllocInfo](_alloc_info.md) | struct
定义关于要分配的内存的信息。 | +| [HDRCapability](_h_d_r_capability.md) | struct
HDR属性结构体定义 | +| [HDRMetaData](_h_d_r_meta_data.md) | struct
HDR元数据结构体定义 | +| [VerifyAllocInfo](_verify_alloc_info.md) | struct
用于验证内存分配信息的结构体定义 | +| [PresentTimestamp](_present_timestamp.md) | struct
上屏时间戳结构体定义 | +| [VGUPoint](_v_g_u_point.md) | struct
坐标点对象。 | +| [VGURect](_v_g_u_rect.md) | struct
矩形对象。 | +| [VGUPath](_v_g_u_path.md) | struct
路径对象,存放路径命令和坐标数据。 | +| [VGUMatrix3](_v_g_u_matrix3.md) | struct
变换矩阵。 | +| [VGUBuffer](_v_g_u_buffer.md) | struct
硬件加速渲染位图缓存。 | +| [VGUMaskLayer](_v_g_u_mask_layer.md) | struct
定义蒙版图层。 | +| [VGUSurface](_v_g_u_surface.md) | struct
2D硬件加速绘制目标表面。 | +| [VGUColorStop](_v_g_u_color_stop.md) | struct
渐变颜色分布位置。 | +| [VGULinear](_v_g_u_linear.md) | struct
线性渐变。 | +| [VGURadial](_v_g_u_radial.md) | struct
辐射渐变。 | +| [VGUConic](_v_g_u_conic.md) | struct
圆锥渐变。 | +| [VGUImage](_v_g_u_image.md) | struct
图像对象。 | +| [VGUPattern](_v_g_u_pattern.md) | struct
图片模式对象。 | +| [VGUGradient](_v_g_u_gradient.md) | struct
渐变对象。 | +| [VGUSolid](_v_g_u_solid.md) | struct
颜色对象 | +| [VGUPaintStyle](_v_g_u_paint_style.md) | struct
填充或描边路径的渲染风格。 | +| [VGUFillAttr](_v_g_u_fill_attr.md) | struct
填充路径的属性。 | +| [VGUStrokeAttr](_v_g_u_stroke_attr.md) | struct
描边路径的属性。 | +| [VGUFuncs](_v_g_u_funcs.md) | struct
定义2D硬件加速驱动函数。 | +| [YUVDescInfo](_yuv_desc_info.md) | struct
YUV描述信息结构体定义 | ### 宏定义 @@ -86,382 +86,340 @@ | 名称 | 描述 | | -------- | -------- | | [PROPERTY_NAME_LEN](#property_name_len)   50 | 属性名字长度。 | -| [HDI_VGU_SCALAR_IS_FLOAT](#hdi_vgu_scalar_is_float)   1 | VGU标量是否为浮点型 | +| [HDI_VGU_SCALAR_IS_FLOAT](#hdi_vgu_scalar_is_float)   1 | VGU标量是否为浮点型。 | ### 类型定义 | 名称 | 描述 | | -------- | -------- | -| ([HotPlugCallback](#hotplugcallback)) (uint32_t devId, bool connected, void \*data) | 热插拔事件回调 。 | -| ([VBlankCallback](#vblankcallback)) (unsigned int sequence, uint64_t ns, void \*data) | VBlank 事件回调。 | -| ([RefreshCallback](#refreshcallback)) (uint32_t devId, void \*data) | 刷新请求回调 。 | -| [VGUScalar](#vguscalar) | VGU标量。 | -| [VGUPixelFormat](#vgupixelformat) | 像素格式。 | -| [VGUBlendType](#vgublendtype) | 混合操作类型。 | +| (\* [HotPlugCallback](#hotplugcallback)) (uint32_t devId, bool connected, void \*data) | typedef void
热插拔事件回调 | +| (\* [VBlankCallback](#vblankcallback)) (unsigned int sequence, uint64_t ns, void \*data) | typedef void
VBlank事件回调。 | +| (\* [RefreshCallback](#refreshcallback)) (uint32_t devId, void \*data) | typedef void
刷新请求回调 | +| [VGUScalar](#vguscalar) | typedef float
VGU标量。 | +| [VGUPixelFormat](#vgupixelformat) | typedef [PixelFormat](#pixelformat)
像素格式。 | +| [VGUBlendType](#vgublendtype) | typedef [BlendType](#blendtype)
混合操作类型。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [DispErrCode](#disperrcode){ DISPLAY_SUCCESS = 0, DISPLAY_FAILURE = -1, DISPLAY_FD_ERR = -2, DISPLAY_PARAM_ERR = -3,   DISPLAY_NULL_PTR = -4, DISPLAY_NOT_SUPPORT = -5, DISPLAY_NOMEM = -6, DISPLAY_SYS_BUSY = -7,   DISPLAY_NOT_PERM = -8 } | 返回值类型定义。 | -| [LayerType](#layertype){ LAYER_TYPE_GRAPHIC, LAYER_TYPE_OVERLAY, LAYER_TYPE_SDIEBAND, LAYER_TYPE_CURSOR,   LAYER_TYPE_BUTT } | 图层类型定义。 | +| [DispErrCode](#disperrcode) { DISPLAY_SUCCESS = 0, DISPLAY_FAILURE = -1, DISPLAY_FD_ERR = -2, DISPLAY_PARAM_ERR = -3,   DISPLAY_NULL_PTR = -4, DISPLAY_NOT_SUPPORT = -5, DISPLAY_NOMEM = -6, DISPLAY_SYS_BUSY = -7,   DISPLAY_NOT_PERM = -8 } | 返回值类型定义。 | +| [LayerType](#layertype) { LAYER_TYPE_GRAPHIC, LAYER_TYPE_OVERLAY, LAYER_TYPE_SDIEBAND, LAYER_TYPE_CURSOR, LAYER_TYPE_BUTT } | 图层类型定义。 | | { HBM_USE_CPU_READ = (1 << 0), HBM_USE_CPU_WRITE = (1 << 1), HBM_USE_MEM_MMZ = (1 << 2), HBM_USE_MEM_DMA = (1 << 3),   HBM_USE_MEM_SHARE = (1 << 4), HBM_USE_MEM_MMZ_CACHE = (1 << 5), HBM_USE_MEM_FB = (1 << 6), HBM_USE_ASSIGN_SIZE = (1 << 7) } | 定义缓冲区使用。 | -| [PixelFormat](#pixelformat){ PIXEL_FMT_CLUT8 = 0, PIXEL_FMT_CLUT1, PIXEL_FMT_CLUT4, PIXEL_FMT_RGB_565,   PIXEL_FMT_RGBA_5658, PIXEL_FMT_RGBX_4444, PIXEL_FMT_RGBA_4444, PIXEL_FMT_RGB_444,   PIXEL_FMT_RGBX_5551, PIXEL_FMT_RGBA_5551, PIXEL_FMT_RGB_555, PIXEL_FMT_RGBX_8888,   PIXEL_FMT_RGBA_8888, PIXEL_FMT_RGB_888, PIXEL_FMT_BGR_565, PIXEL_FMT_BGRX_4444,   PIXEL_FMT_BGRA_4444, PIXEL_FMT_BGRX_5551, PIXEL_FMT_BGRA_5551, PIXEL_FMT_BGRX_8888,   PIXEL_FMT_BGRA_8888, PIXEL_FMT_YUV_422_I, PIXEL_FMT_YCBCR_422_SP, PIXEL_FMT_YCRCB_422_SP,   PIXEL_FMT_YCBCR_420_SP, PIXEL_FMT_YCRCB_420_SP, PIXEL_FMT_YCBCR_422_P, PIXEL_FMT_YCRCB_422_P,   PIXEL_FMT_YCBCR_420_P, PIXEL_FMT_YCRCB_420_P, PIXEL_FMT_YUYV_422_PKG, PIXEL_FMT_UYVY_422_PKG,   PIXEL_FMT_YVYU_422_PKG, PIXEL_FMT_VYUY_422_PKG, PIXEL_FMT_VENDER_MASK = 0X7FFF0000, PIXEL_FMT_BUTT = 0X7FFFFFFF } | 像素格式类型定义。 | -| [TransformType](#transformtype){ ROTATE_NONE = 0, ROTATE_90, ROTATE_180, ROTATE_270,   ROTATE_BUTT } | 图层变换类型定义。 | -| [BlendType](#blendtype){ BLEND_NONE = 0, BLEND_CLEAR, BLEND_SRC, BLEND_SRCOVER,   BLEND_DSTOVER, BLEND_SRCIN, BLEND_DSTIN, BLEND_SRCOUT,   BLEND_DSTOUT, BLEND_SRCATOP, BLEND_DSTATOP, BLEND_ADD,   BLEND_XOR, BLEND_DST, BLEND_AKS, BLEND_AKD,   BLEND_BUTT } | 支持的图像混合类型。 | -| [RopType](#roptype){ ROP_BLACK = 0, ROP_NOTMERGEPEN, ROP_MASKNOTPEN, ROP_NOTCOPYPEN,   ROP_MASKPENNOT, ROP_NOT, ROP_XORPEN, ROP_NOTMASKPEN,   ROP_MASKPEN, ROP_NOTXORPEN, ROP_NOP, ROP_MERGENOTPEN,   ROP_COPYPE, ROP_MERGEPENNOT, ROP_MERGEPEN, ROP_WHITE,   ROP_BUTT } | 硬件加速支持的ROP操作类型。 | +| [PixelFormat](#pixelformat) { PIXEL_FMT_CLUT8 = 0, PIXEL_FMT_CLUT1, PIXEL_FMT_CLUT4, PIXEL_FMT_RGB_565,   PIXEL_FMT_RGBA_5658, PIXEL_FMT_RGBX_4444, PIXEL_FMT_RGBA_4444, PIXEL_FMT_RGB_444,   PIXEL_FMT_RGBX_5551, PIXEL_FMT_RGBA_5551, PIXEL_FMT_RGB_555, PIXEL_FMT_RGBX_8888,   PIXEL_FMT_RGBA_8888, PIXEL_FMT_RGB_888, PIXEL_FMT_BGR_565, PIXEL_FMT_BGRX_4444,   PIXEL_FMT_BGRA_4444, PIXEL_FMT_BGRX_5551, PIXEL_FMT_BGRA_5551, PIXEL_FMT_BGRX_8888,   PIXEL_FMT_BGRA_8888, PIXEL_FMT_YUV_422_I, PIXEL_FMT_YCBCR_422_SP, PIXEL_FMT_YCRCB_422_SP,   PIXEL_FMT_YCBCR_420_SP, PIXEL_FMT_YCRCB_420_SP, PIXEL_FMT_YCBCR_422_P, PIXEL_FMT_YCRCB_422_P,   PIXEL_FMT_YCBCR_420_P, PIXEL_FMT_YCRCB_420_P, PIXEL_FMT_YUYV_422_PKG, PIXEL_FMT_UYVY_422_PKG,   PIXEL_FMT_YVYU_422_PKG, PIXEL_FMT_VYUY_422_PKG, PIXEL_FMT_VENDER_MASK = 0X7FFF0000, PIXEL_FMT_BUTT = 0X7FFFFFFF } | 像素格式类型定义。 | +| [TransformType](#transformtype) { ROTATE_NONE = 0, ROTATE_90, ROTATE_180, ROTATE_270, ROTATE_BUTT } | 图层变换类型定义。 | +| [BlendType](#blendtype) { BLEND_NONE = 0, BLEND_CLEAR, BLEND_SRC, BLEND_SRCOVER,   BLEND_DSTOVER, BLEND_SRCIN, BLEND_DSTIN, BLEND_SRCOUT,   BLEND_DSTOUT, BLEND_SRCATOP, BLEND_DSTATOP, BLEND_ADD,   BLEND_XOR, BLEND_DST, BLEND_AKS, BLEND_AKD,   BLEND_BUTT } | 支持的图像混合类型。 | +| [RopType](#roptype) { ROP_BLACK = 0, ROP_NOTMERGEPEN, ROP_MASKNOTPEN, ROP_NOTCOPYPEN,   ROP_MASKPENNOT, ROP_NOT, ROP_XORPEN, ROP_NOTMASKPEN,   ROP_MASKPEN, ROP_NOTXORPEN, ROP_NOP, ROP_MERGENOTPEN,   ROP_COPYPE, ROP_MERGEPENNOT, ROP_MERGEPEN, ROP_WHITE,   ROP_BUTT } | 硬件加速支持的ROP操作类型。 | | [ColorKey](#colorkey) { CKEY_NONE = 0, CKEY_SRC, CKEY_DST, CKEY_BUTT } | Color key操作类型定义,即硬件加速支持的Color key操作类型。 | -| [MirrorType](#mirrortype){ MIRROR_NONE = 0, MIRROR_LR, MIRROR_TB, MIRROR_BUTT } | 硬件加速支持的镜像操作类型定义。 | -| [Connection](#connection){ CON_INVALID = 0, CONNECTED, DISCONNECTED } | 热插拔连接类型定义。 | -| [InterfaceType](#interfacetype){ DISP_INTF_HDMI = 0, DISP_INTF_LCD, DISP_INTF_BT1120, DISP_INTF_BT656,   DISP_INTF_YPBPR, DISP_INTF_RGB, DISP_INTF_CVBS, DISP_INTF_SVIDEO,   DISP_INTF_VGA, DISP_INTF_MIPI, DISP_INTF_PANEL, DISP_INTF_BUTT } | 枚举接口类型。 | -| [DispPowerStatus](#disppowerstatus){ POWER_STATUS_ON, POWER_STATUS_STANDBY, POWER_STATUS_SUSPEND, POWER_STATUS_OFF,   POWER_STATUS_BUTT } | 枚举显示状态。 | -| [CompositionType](#compositiontype){ COMPOSITION_CLIENT, COMPOSITION_DEVICE, COMPOSITION_CURSOR, COMPOSITION_VIDEO,   COMPOSITION_DEVICE_CLEAR, COMPOSITION_CLIENT_CLEAR, COMPOSITION_TUNNEL, COMPOSITION_BUTT } | 枚举特殊层的组合类型。 | -| [ColorGamut](#colorgamut){ COLOR_GAMUT_INVALID = -1, COLOR_GAMUT_NATIVE = 0, COLOR_GAMUT_SATNDARD_BT601 = 1, COLOR_GAMUT_STANDARD_BT709 = 2,   COLOR_GAMUT_DCI_P3 = 3, COLOR_GAMUT_SRGB = 4, COLOR_GAMUT_ADOBE_RGB = 5, COLOR_GAMUT_DISPLAY_P3 = 6,   COLOR_GAMUT_BT2020 = 7, COLOR_GAMUT_BT2100_PQ = 8, COLOR_GAMUT_BT2100_HLG = 9, COLOR_GAMUT_DISPLAY_BT2020 = 10 } | 色域类型枚举值。 | -| [GamutMap](#gamutmap){ GAMUT_MAP_CONSTANT = 0, GAMUT_MAP_EXPANSION = 1, GAMUT_MAP_HDR_CONSTANT = 2, GAMUT_MAP_HDR_EXPANSION = 3 } | 枚举色域的映射类型。 | -| [ColorDataSpace](#colordataspace){  COLOR_DATA_SPACE_UNKNOWN = 0, GAMUT_BT601 = 0x00000001, GAMUT_BT709 = 0x00000002, GAMUT_DCI_P3 = 0x00000003,   GAMUT_SRGB = 0x00000004, GAMUT_ADOBE_RGB = 0x00000005, GAMUT_DISPLAY_P3 = 0x00000006, GAMUT_BT2020 = 0x00000007,   GAMUT_BT2100_PQ = 0x00000008, GAMUT_BT2100_HLG = 0x00000009, GAMUT_DISPLAY_BT2020 = 0x0000000a, TRANSFORM_FUNC_UNSPECIFIED = 0x00000100,   TRANSFORM_FUNC_LINEAR = 0x00000200, TRANSFORM_FUNC_SRGB = 0x00000300, TRANSFORM_FUNC_SMPTE_170M = 0x00000400, TRANSFORM_FUNC_GM2_2 = 0x00000500,   TRANSFORM_FUNC_GM2_6 = 0x00000600, TRANSFORM_FUNC_GM2_8 = 0x00000700, TRANSFORM_FUNC_ST2084 = 0x00000800, TRANSFORM_FUNC_HLG = 0x00000900,   PRECISION_UNSPECIFIED = 0x00010000, PRECISION_FULL = 0x00020000, PRESION_LIMITED = 0x00030000, PRESION_EXTENDED = 0x00040000,   BT601_SMPTE170M_FULL = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT601_SMPTE170M_LIMITED = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, BT709_LINEAR_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT709_LINEAR_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRESION_EXTENDED,   BT709_SRGB_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT709_SRGB_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRESION_EXTENDED, BT709_SMPTE170M_LIMITED = GAMUT_BT709 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, DCI_P3_LINEAR_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL,   DCI_P3_GAMMA26_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_GM2_6 \| PRECISION_FULL, DISPLAY_P3_LINEAR_FULL = GAMUT_DISPLAY_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, DCI_P3_SRGB_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, ADOBE_RGB_GAMMA22_FULL = GAMUT_ADOBE_RGB \| TRANSFORM_FUNC_GM2_2 \| PRECISION_FULL,   BT2020_LINEAR_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT2020_SRGB_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT2020_SMPTE170M_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT2020_ST2084_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRECISION_FULL,   BT2020_HLG_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_HLG \| PRECISION_FULL, BT2020_ST2084_LIMITED = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRESION_LIMITED } | 枚举颜色空间的类型。 | -| [HDRFormat](#hdrformat){ NOT_SUPPORT_HDR = 0, DOLBY_VISION = 1, HDR10 = 2, HLG = 3,   HDR10_PLUS = 4, HDR_VIVID = 5 } | 枚举HDR格式。 | -| [HDRMetadataKey](#hdrmetadatakey){  MATAKEY_RED_PRIMARY_X = 0, MATAKEY_RED_PRIMARY_Y = 1, MATAKEY_GREEN_PRIMARY_X = 2, MATAKEY_GREEN_PRIMARY_Y = 3,   MATAKEY_BLUE_PRIMARY_X = 4, MATAKEY_BLUE_PRIMARY_Y = 5, MATAKEY_WHITE_PRIMARY_X = 6, MATAKEY_WHITE_PRIMARY_Y = 7,   MATAKEY_MAX_LUMINANCE = 8, MATAKEY_MIN_LUMINANCE = 9, MATAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, MATAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,   MATAKEY_HDR10_PLUS = 12, MATAKEY_HDR_VIVID = 13 } | 枚举HDR元数据关键字。 | -| [PresentTimestampType](#presenttimestamptype){ HARDWARE_DISPLAY_PTS_UNSUPPORTED = 0, HARDWARE_DISPLAY_PTS_DELAY = 1 << 0, HARDWARE_DISPLAY_PTS_TIMESTAMP = 1 << 1 } | 上屏时间戳类型枚举值。 | -| [VGUPathDataType](#vgupathdatatype){ VGU_DATA_TYPE_S16 = 0, VGU_DATA_TYPE_S32, VGU_DATA_TYPE_F32 } | 路径坐标数据类型。 | -| [VGUCapability](#vgucapability){ VGU_CAP_BLIT = (1 << 0), VGU_CAP_BLIT_NUM = (1 << 1), VGU_CAP_PATH = (1 << 2), VGU_CAP_FILTER_BLUR = (1 << 3) } | 硬件加速能力。 | -| [VGUResult](#vguresult){   VGU_SUCCESS = 0, VGU_NO_SUPPORT = -1, VGU_OPERATION_FAILED = -2, VGU_OUT_OF_MEMORY = -3,   VGU_TIMEOUT = -4, VGU_INVALID_PARAMETER = -5, VGU_BUSY = -6, VGU_NO_CONTEXT = -7 } | 错误码定义。 | -| [VGULineCap](#vgulinecap){ VGU_LINECAP_BUTT = 0, VGU_LINECAP_ROUND, VGU_LINECAP_SQUARE } | 线帽。 | -| [VGUJointType](#vgujointtype){ VGU_LINE_JOIN_MITER = 0, VGU_LINE_JOIN_ROUND, VGU_LINE_JOIN_BEVEL, VGU_LINE_JOIN_BUTT } | 联接类型。 | -| [VGUFilter](#vgufilter){ VGU_FILTER_BILINEAR = 0, VGU_FILTER_NEAREST, VGU_FILTER_LINEAR, VGU_FILTER_BUTT } | 图像滤波类型。 | -| [VGUFillRule](#vgufillrule){ VGU_RULE_WINDING = 0, VGU_RULE_EVEN_ODD, VGU_RULE_BUTT } | 填充规则定义。 | -| [VGUFillSpread](#vgufillspread){ VGU_SPREAD_PAD = 0, VGU_SPREAD_REFLECT, VGU_SPREAD_REPEAT, VGU_SPREAD_BUTT } | 渐变填充区域外的延展类型。 | -| [VGUWrapType](#vguwraptype){ VGU_WRAP_REFLECT = 0, VGU_WRAP_REPEAT, VGU_WRAP_BUTT } | 图像模式填充延展类型。 | -| [VGUPathCmd](#vgupathcmd){   VGU_PATH_CMD_CLOSE = 0, VGU_PATH_CMD_MOVE, VGU_PATH_CMD_LINE, VGU_PATH_CMD_HLINE,   VGU_PATH_CMD_VLINE, VGU_PATH_CMD_QUAD, VGU_PATH_CMD_CUBIC, VGU_PATH_CMD_SQUAD,   VGU_PATH_CMD_SCUBIC, VGU_PATH_CMD_BUTT } | 路径绘制指令类型。 | -| [VGUTransformType](#vgutransformtype){ VGU_TRANSFORM_TRANSLATE = (1 << 0), VGU_TRANSFORM_SCALE = (1 << 1), VGU_TRANSFORM_ROTATE_90 = (1 << 2), VGU_TRANSFORM_ROTATE_180 = (1 << 3),   VGU_TRANSFORM_ROTATE_270 = (1 << 4), VGU_TRANSFORM_OTHER = (1 << 16) } | 变换类型。 | -| [VGUClipType](#vgucliptype){ VGU_CLIP_RECT = 0, VGU_CLIP_PATH, VGU_CLIP_BUTT } | 绘制表面剪切类型。 | -| [VGUGradientType](#vgugradienttype){ VGU_GRADIENT_LINEAR = 0, VGU_GRADIENT_RADIAL, VGU_GRADIENT_CONIC, VGU_GRADIENT_BUTT } | 渐变类型。 | -| [VGUPaintType](#vgupainttype){ VGU_PAINT_SOLID = 0, VGU_PAINT_GRADIENT, VGU_PAINT_PATTERN, VGU_PAINT_BUTT } | 渲染对象。 | +| [MirrorType](#mirrortype) { MIRROR_NONE = 0, MIRROR_LR, MIRROR_TB, MIRROR_BUTT } | 硬件加速支持的镜像操作类型定义 | +| [Connection](#connection) { CON_INVALID = 0, CONNECTED, DISCONNECTED } | 热插拔连接类型定义 | +| [InterfaceType](#interfacetype) { DISP_INTF_HDMI = 0, DISP_INTF_LCD, DISP_INTF_BT1120, DISP_INTF_BT656,   DISP_INTF_YPBPR, DISP_INTF_RGB, DISP_INTF_CVBS, DISP_INTF_SVIDEO,   DISP_INTF_VGA, DISP_INTF_MIPI, DISP_INTF_PANEL, DISP_INTF_BUTT } | 枚举接口类型。 | +| [DispPowerStatus](#disppowerstatus) { POWER_STATUS_ON, POWER_STATUS_STANDBY, POWER_STATUS_SUSPEND, POWER_STATUS_OFF,   POWER_STATUS_BUTT } | 枚举显示状态 | +| [CompositionType](#compositiontype) { COMPOSITION_CLIENT, COMPOSITION_DEVICE, COMPOSITION_CURSOR, COMPOSITION_VIDEO,   COMPOSITION_DEVICE_CLEAR, COMPOSITION_CLIENT_CLEAR, COMPOSITION_TUNNEL, COMPOSITION_BUTT } | 枚举特殊层的组合类型。 | +| [ColorGamut](#colorgamut) { COLOR_GAMUT_INVALID = -1, COLOR_GAMUT_NATIVE = 0, COLOR_GAMUT_SATNDARD_BT601 = 1, COLOR_GAMUT_STANDARD_BT709 = 2,   COLOR_GAMUT_DCI_P3 = 3, COLOR_GAMUT_SRGB = 4, COLOR_GAMUT_ADOBE_RGB = 5, COLOR_GAMUT_DISPLAY_P3 = 6,   COLOR_GAMUT_BT2020 = 7, COLOR_GAMUT_BT2100_PQ = 8, COLOR_GAMUT_BT2100_HLG = 9, COLOR_GAMUT_DISPLAY_BT2020 = 10 } | 色域类型枚举值 | +| [GamutMap](#gamutmap) { GAMUT_MAP_CONSTANT = 0, GAMUT_MAP_EXPANSION = 1, GAMUT_MAP_HDR_CONSTANT = 2, GAMUT_MAP_HDR_EXPANSION = 3 } | 枚举色域的映射类型 | +| [ColorDataSpace](#colordataspace) { COLOR_DATA_SPACE_UNKNOWN = 0, GAMUT_BT601 = 0x00000001, GAMUT_BT709 = 0x00000002, GAMUT_DCI_P3 = 0x00000003,   GAMUT_SRGB = 0x00000004, GAMUT_ADOBE_RGB = 0x00000005, GAMUT_DISPLAY_P3 = 0x00000006, GAMUT_BT2020 = 0x00000007,   GAMUT_BT2100_PQ = 0x00000008, GAMUT_BT2100_HLG = 0x00000009, GAMUT_DISPLAY_BT2020 = 0x0000000a, TRANSFORM_FUNC_UNSPECIFIED = 0x00000100,   TRANSFORM_FUNC_LINEAR = 0x00000200, TRANSFORM_FUNC_SRGB = 0x00000300, TRANSFORM_FUNC_SMPTE_170M = 0x00000400, TRANSFORM_FUNC_GM2_2 = 0x00000500,   TRANSFORM_FUNC_GM2_6 = 0x00000600, TRANSFORM_FUNC_GM2_8 = 0x00000700, TRANSFORM_FUNC_ST2084 = 0x00000800, TRANSFORM_FUNC_HLG = 0x00000900,   PRECISION_UNSPECIFIED = 0x00010000, PRECISION_FULL = 0x00020000, PRESION_LIMITED = 0x00030000, PRESION_EXTENDED = 0x00040000,   BT601_SMPTE170M_FULL = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT601_SMPTE170M_LIMITED = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, BT709_LINEAR_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT709_LINEAR_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRESION_EXTENDED,   BT709_SRGB_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT709_SRGB_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRESION_EXTENDED, BT709_SMPTE170M_LIMITED = GAMUT_BT709 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, DCI_P3_LINEAR_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL,   DCI_P3_GAMMA26_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_GM2_6 \| PRECISION_FULL, DISPLAY_P3_LINEAR_FULL = GAMUT_DISPLAY_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, DCI_P3_SRGB_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, ADOBE_RGB_GAMMA22_FULL = GAMUT_ADOBE_RGB \| TRANSFORM_FUNC_GM2_2 \| PRECISION_FULL,   BT2020_LINEAR_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT2020_SRGB_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT2020_SMPTE170M_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT2020_ST2084_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRECISION_FULL,   BT2020_HLG_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_HLG \| PRECISION_FULL, BT2020_ST2084_LIMITED = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRESION_LIMITED } | 枚举颜色空间的类型 | +| [HDRFormat](#hdrformat) { NOT_SUPPORT_HDR = 0, DOLBY_VISION = 1, HDR10 = 2, HLG = 3,   HDR10_PLUS = 4, HDR_VIVID = 5 } | 枚举HDR格式 | +| [HDRMetadataKey](#hdrmetadatakey) { MATAKEY_RED_PRIMARY_X = 0, MATAKEY_RED_PRIMARY_Y = 1, MATAKEY_GREEN_PRIMARY_X = 2, MATAKEY_GREEN_PRIMARY_Y = 3,   MATAKEY_BLUE_PRIMARY_X = 4, MATAKEY_BLUE_PRIMARY_Y = 5, MATAKEY_WHITE_PRIMARY_X = 6, MATAKEY_WHITE_PRIMARY_Y = 7,   MATAKEY_MAX_LUMINANCE = 8, MATAKEY_MIN_LUMINANCE = 9, MATAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, MATAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,   MATAKEY_HDR10_PLUS = 12, MATAKEY_HDR_VIVID = 13 } | 枚举HDR元数据关键字 | +| [PresentTimestampType](#presenttimestamptype) { HARDWARE_DISPLAY_PTS_UNSUPPORTED = 0, HARDWARE_DISPLAY_PTS_DELAY = 1 << 0, HARDWARE_DISPLAY_PTS_TIMESTAMP = 1 << 1 } | 上屏时间戳类型枚举值 | +| [VGUPathDataType](#vgupathdatatype) { VGU_DATA_TYPE_S16 = 0, VGU_DATA_TYPE_S32, VGU_DATA_TYPE_F32 } | 路径坐标数据类型。 | +| [VGUCapability](#vgucapability) { VGU_CAP_BLIT = (1 << 0), VGU_CAP_BLIT_NUM = (1 << 1), VGU_CAP_PATH = (1 << 2), VGU_CAP_FILTER_BLUR = (1 << 3) } | 硬件加速能力。 | +| [VGUResult](#vguresult) { VGU_SUCCESS = 0, VGU_NO_SUPPORT = -1, VGU_OPERATION_FAILED = -2, VGU_OUT_OF_MEMORY = -3,   VGU_TIMEOUT = -4, VGU_INVALID_PARAMETER = -5, VGU_BUSY = -6, VGU_NO_CONTEXT = -7 } | 错误码定义。 | +| [VGULineCap](#vgulinecap) { VGU_LINECAP_BUTT = 0, VGU_LINECAP_ROUND, VGU_LINECAP_SQUARE } | 线帽。 | +| [VGUJointType](#vgujointtype) { VGU_LINE_JOIN_MITER = 0, VGU_LINE_JOIN_ROUND, VGU_LINE_JOIN_BEVEL, VGU_LINE_JOIN_BUTT } | 联接类型。 | +| [VGUFilter](#vgufilter) { VGU_FILTER_BILINEAR = 0, VGU_FILTER_NEAREST, VGU_FILTER_LINEAR, VGU_FILTER_BUTT } | 图像滤波类型。 | +| [VGUFillRule](#vgufillrule) { VGU_RULE_WINDING = 0, VGU_RULE_EVEN_ODD, VGU_RULE_BUTT } | 填充规则定义。 | +| [VGUFillSpread](#vgufillspread) { VGU_SPREAD_PAD = 0, VGU_SPREAD_REFLECT, VGU_SPREAD_REPEAT, VGU_SPREAD_BUTT } | 渐变填充区域外的延展类型。 | +| [VGUWrapType](#vguwraptype) { VGU_WRAP_REFLECT = 0, VGU_WRAP_REPEAT, VGU_WRAP_BUTT } | 图像模式填充延展类型。 | +| [VGUPathCmd](#vgupathcmd) { VGU_PATH_CMD_CLOSE = 0, VGU_PATH_CMD_MOVE, VGU_PATH_CMD_LINE, VGU_PATH_CMD_HLINE,   VGU_PATH_CMD_VLINE, VGU_PATH_CMD_QUAD, VGU_PATH_CMD_CUBIC, VGU_PATH_CMD_SQUAD,   VGU_PATH_CMD_SCUBIC, VGU_PATH_CMD_BUTT } | 路径绘制指令类型。 | +| [VGUTransformType](#vgutransformtype) { VGU_TRANSFORM_TRANSLATE = (1 << 0), VGU_TRANSFORM_SCALE = (1 << 1), VGU_TRANSFORM_ROTATE_90 = (1 << 2), VGU_TRANSFORM_ROTATE_180 = (1 << 3),   VGU_TRANSFORM_ROTATE_270 = (1 << 4), VGU_TRANSFORM_OTHER = (1 << 16) } | 变换类型。 | +| [VGUClipType](#vgucliptype) { VGU_CLIP_RECT = 0, VGU_CLIP_PATH, VGU_CLIP_BUTT } | 绘制表面剪切类型。 | +| [VGUGradientType](#vgugradienttype) { VGU_GRADIENT_LINEAR = 0, VGU_GRADIENT_RADIAL, VGU_GRADIENT_CONIC, VGU_GRADIENT_BUTT } | 渐变类型。 | +| [VGUPaintType](#vgupainttype) { VGU_PAINT_SOLID = 0, VGU_PAINT_GRADIENT, VGU_PAINT_PATTERN, VGU_PAINT_BUTT } | 渲染对象 | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [DeviceInitialize](#deviceinitialize)(DeviceFuncs \*\*funcs) | 实现显示设备控制接口的初始化,申请操作显示设备控制接口的资源,并获取对应的操作接口。 | -| [DeviceUninitialize](#deviceuninitialize)(DeviceFuncs \*funcs) | 取消显示设备控制接口的初始化,释放控制接口使用到的资源。 | -| [GfxInitialize](#gfxinitialize)(GfxFuncs \*\*funcs) | 获取硬件加速相关的操作接口指针。 | -| [GfxUninitialize](#gfxuninitialize)(GfxFuncs \*funcs) | 释放硬件加速相关的操作接口指针。 | -| [GrallocInitialize](#grallocinitialize)(GrallocFuncs \*\*funcs) | 初始化内存模块,并获取内存提供的操作接口。 | -| [GrallocUninitialize](#grallocuninitialize)(GrallocFuncs \*funcs) | 取消初始化内存模块,并释放内存操作接口指针。 | -| [LayerInitialize](#layerinitialize)(LayerFuncs \*\*funcs) | 实现图层初始化功能,申请图层使用的资源,并获取图层提供的操作接口。 | -| [LayerUninitialize](#layeruninitialize)(LayerFuncs \*funcs) | 取消图层初始化功能,释放图层使用到的资源,并释放图层操作接口指针。 | -| [VGUPathInit](#vgupathinit)(VGUPath \*path, VGUPathDataType type, const uint8_t \*segments, int numSegments, const uint8_t \*data, bool enAlias, VGURect boundBox) | 初始化路径对象。 | -| [VGUPathAppend](#vgupathappend)(VGUPath \*path, const VGUPath \*subpath) | 添加子路径到当前路径中。 | -| [VGUPathClear](#vgupathclear)(VGUPath \*path) | 清除路径对象内存。 | -| [VGUMatrixIdentity](#vgumatrixidentity)(VGUMatrix3 \*matrix) | 初始化矩阵对象为单位矩阵。 | -| [VGUMatrixScale](#vgumatrixscale)(VGUMatrix3 \*matrix, float xScale, float yScale) | 矩阵变换缩放。 | -| [VGUMatrixRotate](#vgumatrixrotate)(VGUMatrix3 \*matrix, float degree) | 矩阵变换旋转。 | -| [VGUMatrixTranslate](#vgumatrixtranslate)(VGUMatrix3 \*matrix, float x, float y) | 矩阵变换平移。 | -| [VGUGradientColorStop](#vgugradientcolorstop)(VGUGradient \*gradient, const VGUColorStop \*colorStop, uint32_t count) | 对渐变添加ColorStop。 | -| [VGUGradientClearStop](#vgugradientclearstop)(VGUGradient \*gradient) | 清除ColorStop。 | -| [VGUGradientMatrix](#vgugradientmatrix)(VGUGradient \*gradient, const VGUMatrix3 \*matrix) | 设置渐变对象的变换矩阵。 | -| [VGUGradientLinear](#vgugradientlinear)(VGUGradient \*gradient, const VGUPoint \*p1, const VGUPoint \*p2) | 创建线性渐变对象。 | -| [VGUGradientRadial](#vgugradientradial)(VGUGradient \*gradient, const VGUPoint \*p1, VGUScalar r1, const VGUPoint \*p2, VGUScalar r2) | 创建辐射渐变对象 | -| [VGUGradientConic](#vgugradientconic)(VGUGradient \*gradient, VGUScalar cx, VGUScalar cy) | 创建圆锥渐变对象。 | -| [VGUInitialize](#vguinitialize)(VGUFuncs \*\*funcs) | 获取硬件加速相关的操作接口指针。 | -| [VGUUninitialize](#vguuninitialize)(VGUFuncs \*funcs) | 去初始化硬件加速模块,同时释放硬件加速模块操作函数指针。 | +| [DeviceInitialize](#deviceinitialize) ([DeviceFuncs](_device_funcs.md) \*\*funcs) | int32_t
实现显示设备控制接口的初始化,申请操作显示设备控制接口的资源,并获取对应的操作接口。 | +| [DeviceUninitialize](#deviceuninitialize) ([DeviceFuncs](_device_funcs.md) \*funcs) | int32_t
取消显示设备控制接口的初始化,释放控制接口使用到的资源。 | +| [GfxInitialize](#gfxinitialize) ([GfxFuncs](_gfx_funcs.md) \*\*funcs) | int32_t
获取硬件加速相关的操作接口指针。 | +| [GfxUninitialize](#gfxuninitialize) ([GfxFuncs](_gfx_funcs.md) \*funcs) | int32_t
释放硬件加速相关的操作接口指针。 | +| [GrallocInitialize](#grallocinitialize) ([GrallocFuncs](_gralloc_funcs.md) \*\*funcs) | int32_t
初始化内存模块,并获取内存提供的操作接口。 | +| [GrallocUninitialize](#grallocuninitialize) ([GrallocFuncs](_gralloc_funcs.md) \*funcs) | int32_t
取消初始化内存模块,并释放内存操作接口指针。 | +| [LayerInitialize](#layerinitialize) ([LayerFuncs](_layer_funcs.md) \*\*funcs) | int32_t
实现图层初始化功能,申请图层使用的资源,并获取图层提供的操作接口。 | +| [LayerUninitialize](#layeruninitialize) ([LayerFuncs](_layer_funcs.md) \*funcs) | int32_t
取消图层初始化功能,释放图层使用到的资源,并释放图层操作接口指针。 | +| [VGUPathInit](#vgupathinit) ([VGUPath](_v_g_u_path.md) \*path, [VGUPathDataType](#vgupathdatatype) type, const uint8_t \*segments, int numSegments, const uint8_t \*data, bool enAlias, [VGURect](_v_g_u_rect.md) boundBox) | [VGUResult](#vguresult)
初始化路径对象。 | +| [VGUPathAppend](#vgupathappend) ([VGUPath](_v_g_u_path.md) \*path, const [VGUPath](_v_g_u_path.md) \*subpath) | [VGUResult](#vguresult)
添加子路径到当前路径中。 | +| [VGUPathClear](#vgupathclear) ([VGUPath](_v_g_u_path.md) \*path) | [VGUResult](#vguresult)
清除路径对象内存。 | +| [VGUMatrixIdentity](#vgumatrixidentity) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix) | [VGUResult](#vguresult)
初始化矩阵对象为单位矩阵。 | +| [VGUMatrixScale](#vgumatrixscale) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float xScale, float yScale) | [VGUResult](#vguresult)
矩阵变换缩放。 | +| [VGUMatrixRotate](#vgumatrixrotate) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float degree) | [VGUResult](#vguresult)
矩阵变换旋转。 | +| [VGUMatrixTranslate](#vgumatrixtranslate) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float x, float y) | [VGUResult](#vguresult)
矩阵变换平移。 | +| [VGUGradientColorStop](#vgugradientcolorstop) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUColorStop](_v_g_u_color_stop.md) \*colorStop, uint32_t count) | [VGUResult](#vguresult)
对渐变添加ColorStop。 | +| [VGUGradientClearStop](#vgugradientclearstop) ([VGUGradient](_v_g_u_gradient.md) \*gradient) | [VGUResult](#vguresult)
清除ColorStop。 | +| [VGUGradientMatrix](#vgugradientmatrix) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUMatrix3](_v_g_u_matrix3.md) \*matrix) | [VGUResult](#vguresult)
设置渐变对象的变换矩阵。 | +| [VGUGradientLinear](#vgugradientlinear) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUPoint](_v_g_u_point.md) \*p1, const [VGUPoint](_v_g_u_point.md) \*p2) | [VGUResult](#vguresult)
创建线性渐变对象。 | +| [VGUGradientRadial](#vgugradientradial) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUPoint](_v_g_u_point.md) \*p1, [VGUScalar](#vguscalar) r1, const [VGUPoint](_v_g_u_point.md) \*p2, [VGUScalar](#vguscalar) r2) | [VGUResult](#vguresult)
创建辐射渐变对象 | +| [VGUGradientConic](#vgugradientconic) ([VGUGradient](_v_g_u_gradient.md) \*gradient, [VGUScalar](#vguscalar) cx, [VGUScalar](#vguscalar) cy) | [VGUResult](#vguresult)
创建圆锥渐变对象。 | +| [VGUInitialize](#vguinitialize) ([VGUFuncs](_v_g_u_funcs.md) \*\*funcs) | [VGUResult](#vguresult)
获取硬件加速相关的操作接口指针。 | +| [VGUUninitialize](#vguuninitialize) ([VGUFuncs](_v_g_u_funcs.md) \*funcs) | [VGUResult](#vguresult)
去初始化硬件加速模块,同时释放硬件加速模块操作函数指针。 | ### 变量 | 名称 | 描述 | | -------- | -------- | -| ([DeviceFuncs::RegHotPlugCallback](#reghotplugcallback) )(HotPlugCallback callback, void \*data) | 注册热插拔事件回调。 | -| ([DeviceFuncs::RegDisplayVBlankCallback](#regdisplayvblankcallback) )(uint32_t devId, VBlankCallback callback, void \*data) | 注册VBlank事件回调。 | -| ([DeviceFuncs::RegDisplayRefreshCallback](#regdisplayrefreshcallback) )(uint32_t devId, RefreshCallback callback, void \*data) | 刷新请求回调。 | -| ([DeviceFuncs::GetDisplayCapability](#getdisplaycapability) )(uint32_t devId, DisplayCapability \*info) | 获取显示设备能力集。 | -| ([DeviceFuncs::GetDisplaySupportedModes](#getdisplaysupportedmodes) )(uint32_t devId, uint32_t \*num, DisplayModeInfo \*modes) | 获取显示设备支持的显示模式信息。 | -| ([DeviceFuncs::GetDisplayMode](#getdisplaymode) )(uint32_t devId, uint32_t \*modeId) | 获取显示设备当前的显示模式。 | -| ([DeviceFuncs::SetDisplayMode](#setdisplaymode) )(uint32_t devId, uint32_t modeId) | 设置显示设备的显示模式。 | -| ([DeviceFuncs::GetDisplayPowerStatus](#getdisplaypowerstatus) )(uint32_t devId, DispPowerStatus \*status) | 获取显示设备当前的电源状态。 | -| ([DeviceFuncs::SetDisplayPowerStatus](#setdisplaypowerstatus) )(uint32_t devId, DispPowerStatus status) | 设置显示设备当前的电源状态。 | -| ([DeviceFuncs::GetDisplayBacklight](#getdisplaybacklight) )(uint32_t devId, uint32_t \*level) | 获取显示设备当前的背光值。 | -| ([DeviceFuncs::SetDisplayBacklight](#setdisplaybacklight) )(uint32_t devId, uint32_t level) | 设置显示设备当前的背光值。 | -| ([DeviceFuncs::GetDisplayProperty](#getdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t \*value) | 获取显示设备属性值。 | -| ([DeviceFuncs::SetDisplayProperty](#setdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t value) | 设置显示设备属性值。 | -| ([DeviceFuncs::PrepareDisplayLayers](#preparedisplaylayers) )(uint32_t devId, bool \*needFlushFb) | 显示设备合成前准备。 | -| ([DeviceFuncs::GetDisplayCompChange](#getdisplaycompchange) )(uint32_t devId, uint32_t \*num, uint32_t \*Layers, int32_t \*type) | 获取显示设备合成类型有变化的layer。 | -| ([DeviceFuncs::SetDisplayClientCrop](#setdisplayclientcrop) )(uint32_t devId, IRect \*rect) | 设置显示设备的裁剪区域。 | -| ([DeviceFuncs::SetDisplayClientDestRect](#setdisplayclientdestrect) )(uint32_t devId, IRect \*rect) | 设置显示设备的显示区域。 | -| ([DeviceFuncs::SetDisplayClientBuffer](#setdisplayclientbuffer) )(uint32_t devId, const BufferHandle \*buffer, int32_t fence) | 设置显示设备的显示缓存。 | -| ([DeviceFuncs::SetDisplayClientDamage](#setdisplayclientdamage) )(uint32_t devId, uint32_t num, IRect \*rect) | 设置显示设备的显示脏区。 | -| ([DeviceFuncs::SetDisplayVsyncEnabled](#setdisplayvsyncenabled) )(uint32_t devId, bool enabled) | 使能垂直同步信号。 | -| ([DeviceFuncs::GetDisplayReleaseFence](#getdisplayreleasefence) )(uint32_t devId, uint32_t \*num, uint32_t \*layers, int32_t \*fences) | 获取显示图层fence。 | -| ([DeviceFuncs::GetDisplaySupportedColorGamuts](#getdisplaysupportedcolorgamuts) )(uint32_t devId, uint32_t \*num, ColorGamut \*gamuts) | 获取显示设备支持的色域信息。 | -| ([DeviceFuncs::GetDisplayColorGamut](#getdisplaycolorgamut) )(uint32_t devId, ColorGamut \*gamut) | 获取显示设备当前的色域模式。 | -| ([DeviceFuncs::SetDisplayColorGamut](#setdisplaycolorgamut) )(uint32_t devId, ColorGamut gamut) | 设置显示设备当前的色域模式。 | -| ([DeviceFuncs::GetDisplayGamutMap](#getdisplaygamutmap) )(uint32_t devId, GamutMap \*gamutMap) | 获取显示设备当前的色域映射模式。 | -| ([DeviceFuncs::SetDisplayGamutMap](#setdisplaygamutmap) )(uint32_t devId, GamutMap gamutMap) | 设置显示设备当前的色域映射模式。 | -| ([DeviceFuncs::SetDisplayColorTransform](#setdisplaycolortransform) )(uint32_t devId, const float \*matrix) | 设置显示设备当前的4x4的颜色转换矩阵。 | -| ([DeviceFuncs::GetHDRCapabilityInfos](#gethdrcapabilityinfos) )(uint32_t devId, HDRCapability \*info) | 获取显示设备支持的HDR属性信息。 | -| ([DeviceFuncs::GetSupportedMetadataKey](#getsupportedmetadatakey) )(uint32_t devId, uint32_t \*num, DisplayInfo::widthHDRMetadataKey \*keys) | 获取显示设备支持的 HDRMetadataKey。 | -| ([DeviceFuncs::Commit](#commit) )(uint32_t devId, int32_t \*fence) | 提交合成送显请求。 | -| ([DeviceFuncs::InvokeDisplayCmd](#invokedisplaycmd) )(uint32_t devId,...) | 调用显示设备命令。 | -| ([DeviceFuncs::CreateVirtualDisplay](#createvirtualdisplay) )(uint32_t width, uint32_t height, int32_t \*format, uint32_t \*devId) | 创建虚拟显示设备。 | -| ([DeviceFuncs::DestroyVirtualDisplay](#destroyvirtualdisplay) )(uint32_t devId) | 销毁虚拟显示设备。 | -| ([DeviceFuncs::SetVirtualDisplayBuffer](#setvirtualdisplaybuffer) )(uint32_t devId, BufferHandle \*buffer, int32_t fence) | 设置虚拟屏的输出缓存。 | -| ([DeviceFuncs::GetWriteBackFrame](#getwritebackframe) )(uint32_t devId, BufferHandle \*buffer, int32_t \*fence) | 获取显示设备的回写帧。 | -| [DisplayInfo::width](#width-19) | 显示屏宽度 | -| [DisplayInfo::height](#height-18) | 显示屏高度 | -| [DisplayInfo::rotAngle](#rotangle) | 显示屏旋转角度 | -| [LayerInfo::width](#width-29) | 图层宽度 | -| [LayerInfo::height](#height-28) | 图层高度 | -| [LayerInfo::type](#type-17) | 图层类型,包括图形层、视频层和媒体播放模式。 | -| [LayerInfo::bpp](#bpp) | 每像素所占bit数 | -| [LayerInfo::pixFormat](#pixformat-12) | 图层像素格式 | -| [LayerAlpha::enGlobalAlpha](#englobalalpha-12) | 全局Alpha使能标志 | -| [LayerAlpha::enPixelAlpha](#enpixelalpha-12) | 像素Alpha使能标志 | -| [LayerAlpha::alpha0](#alpha0-12) | Alpha0值,取值范围:[0, 255] | -| [LayerAlpha::alpha1](#alpha1-12) | Alpha1值,取值范围:[0, 255] | -| [LayerAlpha::gAlpha](#galpha) | 全局alpha值,取值范围:[0, 255] | -| [BufferData::phyAddr](#phyaddr-13) | 物理内存地址 | -| [BufferData::virAddr](#viraddr-12) | 虚拟内存地址 | -| [LayerBuffer::fenceId](#fenceid) | buffer 的fence号 | -| [LayerBuffer::width](#width-39) | buffer宽度 | -| [LayerBuffer::height](#height-38) | buffer高度 | -| [LayerBuffer::pitch](#pitch) | 一行数据所占字节数 | -| [LayerBuffer::pixFormat](#pixformat-22) | buffer像素格式 | -| [LayerBuffer::data](#data-12) | 图层buffer数据 | -| [LayerBuffer::hdl](#hdl) | 图层buffer句柄 | -| [IRect::x](#x-14) | 矩形框起始x坐标 | -| [IRect::y](#y-14) | 矩形框起始y坐标 | -| [IRect::w](#w-12) | 矩形框宽度 | -| [IRect::h](#h-12) | 矩形框高度 | -| [ISurface::phyAddr](#phyaddr-23) | 图像首地址 | -| [ISurface::height](#height-48) | 图像高度 | -| [ISurface::width](#width-49) | 图像宽度 | -| [ISurface::stride](#stride-12) | 图像跨度 | -| [ISurface::enColorFmt](#encolorfmt) | 图像格式 | -| [ISurface::bYCbCrClut](#bycbcrclut) | CLUT表是否位于YCbCr 空间 | -| [ISurface::bAlphaMax255](#balphamax255) | 图像Alpha最大值为255还是128 | -| [ISurface::bAlphaExt1555](#balphaext1555) | 是否使能1555的Alpha扩展 | -| [ISurface::alpha0](#alpha0-22) | Alpha0值,取值范围:[0,255] | -| [ISurface::alpha1](#alpha1-22) | Alpha1值,取值范围:[0,255] | -| [ISurface::cbcrPhyAddr](#clutphyaddr) | CbCr分量地址 | -| [ISurface::cbcrStride](#cbcrstride) | CbCr分量跨度 | -| [ISurface::clutPhyAddr](#clutphyaddr) | CLUT表首地址,用作颜色扩展或颜色校正。 | -| [ILine::x0](#x0-12) | 线条起点的x坐标 | -| [ILine::y0](#y0-12) | 线条起点的y坐标 | -| [ILine::x1](#x1-13) | 线条终点的x坐标 | -| [ILine::y1](#y1-13) | 线条终点的y坐标 | -| [ILine::color](#color-15) | 线条颜色 | -| [ICircle::x](#x-24) | 圆心x坐标 | -| [ICircle::y](#y-24) | 圆心y坐标r | -| [ICircle::r](#r) | 圆的半径 | -| [ICircle::color](#color-25) | 圆的颜色 | -| [Rectangle::rect](#rect-13) | 矩形区域 | -| [Rectangle::color](#color-35) | 矩形颜色 | -| [GfxOpt::enGlobalAlpha](#englobalalpha-22) | 全局Alpha使能位 | -| [GfxOpt::globalAlpha](#globalalpha) | 全局Alpha的值 | -| [GfxOpt::enPixelAlpha](#enpixelalpha-22) | 像素Alpha使能位 | -| [GfxOpt::blendType](#blendtype) | 混合方式 | -| [GfxOpt::colorKeyFrom](#colorkeyfrom) | 色键模式 | -| [GfxOpt::enableRop](#enablerop) | Rop功能使能位 | -| [GfxOpt::colorRopType](#colorroptype) | 颜色的Rop类型 | -| [GfxOpt::alphaRopType](#alpharoptype) | Alpha的Rop类型 | -| [GfxOpt::enableScale](#enablescale) | 缩放功能使能位 | -| [GfxOpt::rotateType](#rotatetype) | 旋转类型 | -| [GfxOpt::mirrorType](#mirrortype) | 镜像类型 | -| [PropertyObject::name](#name-12) | 属性名称 | -| [PropertyObject::propId](#propid) | 属性ID | -| [PropertyObject::value](#value-12) | 属性值 | -| [DisplayCapability::name](#name-22) | 显示设备名称 | -| [DisplayCapability::type](#type-27) | 显示屏接口类型 | -| [DisplayCapability::phyWidth](#phywidth) | 物理宽度 | -| [DisplayCapability::phyHeight](#phyheight) | 物理高度 | -| [DisplayCapability::supportLayers](#supportlayers) | 支持的图层数 | -| [DisplayCapability::virtualDispCount](#virtualdispcount) | 支持的虚拟屏数 | -| [DisplayCapability::supportWriteBack](#supportwriteback) | 是否支持回写 | -| [DisplayCapability::propertyCount](#propertycount) | 属性数组大小 | -| [DisplayCapability::props](#props) | 属性数组 | -| [DisplayModeInfo::width](#width-59) | 像素宽度 | -| [DisplayModeInfo::height](#height-58) | 像素高度 | -| [DisplayModeInfo::freshRate](#freshrate) | 刷新速率 | -| [DisplayModeInfo::id](#id) | 模式ID | -| [AllocInfo::width](#width-69) | 申请内存宽度 | -| [AllocInfo::height](#height-68) | 申请内存高度 | -| [AllocInfo::usage](#usage-12) | 申请内存的使用场景 | -| [AllocInfo::format](#format-12) | 申请内存格式 | -| [AllocInfo::expectedSize](#expectedsize) | 申请内存大小 | -| [HDRCapability::formatCount](#formatcount) | 支持的HDR格式的数量 | -| [HDRCapability::formats](#formats) | 支持的HDR格式的数组首地址 | -| [HDRCapability::maxLum](#maxlum) | 最大的光亮度luminance值 | -| [HDRCapability::maxAverageLum](#maxaveragelum) | 最大的平均光亮度luminance值 | -| [HDRCapability::minLum](#minlum) | 最小的光亮度luminance值 | -| [HDRMetaData::key](#key) | HDR元数据关键字 | -| [HDRMetaData::value](#value-22) | 关键字对应的值 | -| [VerifyAllocInfo::width](#width-79) | 分配内存的宽度 | -| [VerifyAllocInfo::height](#height-78) | 分配内存的高度 | -| [VerifyAllocInfo::usage](#usage-22) | 内存的用处 | -| [VerifyAllocInfo::format](#format-22) | 分配内存的像素格式 | -| [PresentTimestamp::type](#type-37) | 上屏时间戳类型 | -| [PresentTimestamp::time](#time) | 类型对应的值 | -| [ExtDataHandle::fd](#fd) | 句柄 fd,-1代表不支持 | -| [ExtDataHandle::reserveInts](#reserveints) | reserve数组的个数 | -| [ExtDataHandle::reserve](#reserve) [0] | reserve数组 | -| [YUVDescInfo::baseAddr](#baseaddr) | 内存的初始地址 | -| [YUVDescInfo::yOffset](#yoffset) | Y的偏移量 | -| [YUVDescInfo::uOffset](#uoffset) | U的偏移量 | -| [YUVDescInfo::vOffset](#voffset) | V的偏移量 | -| [YUVDescInfo::yStride](#ystride) | Y的stride信息 | -| [YUVDescInfo::uvStride](#uvstride) | UV的stride信息 | -| [YUVDescInfo::uvStep](#uvstep) | UV的step信息 | -| [VGUPoint::x](#x-34) | 点水平坐标 | -| [VGUPoint::y](#y-34) | 点垂直坐标 | -| [VGURect::x](#x-44) | 矩形水平起始坐标 | -| [VGURect::y](#y-44) | 矩形垂直起始坐标 | -| [VGURect::w](#w-22) | 矩形宽度 | -| [VGURect::h](#h-22) | 矩形高度 | -| [VGUPath::segment](#segment) | 存放路径命令数据 | -| [VGUPath::numSegments](#numsegments) | 路径命令总数 | -| [VGUPath::data](#data-22) | 存放路径命令对应坐标数据 | -| [VGUPath::type](#type-47) | 路径数据存储类型 | -| [VGUPath::enAlias](#enalias) | 抗锯齿开关 | -| [VGUPath::boundBox](#boundbox) | 路径最大边界 | -| [VGUMatrix3::m](#m) [3][3] | 3x3变换矩阵 | -| [VGUMatrix3::type](#type-57) | 矩阵变换类型,简单变换为缩放,平移,90度倍数旋转。 | -| [VGUBuffer::pixelFormat](#pixelformat) | 像素格式 | -| [VGUBuffer::width](#width-89) | 位图宽度 | -| [VGUBuffer::height](#height-88) | 位图高度 | -| [VGUBuffer::stride](#stride-22) | 位图stride | -| [VGUBuffer::virAddr](#viraddr-22) | 位图缓存的虚拟地址 | -| [VGUBuffer::phyAddr](#phyaddr-33) | 位图缓存的物理地址 | -| [VGUMaskLayer::buffer](#buffer-13) | 蒙版缓存 | -| [VGUMaskLayer::rect](#rect-23) | 蒙版矩形 | -| [VGUSurface::buffer](#buffer-23) | 位图缓存 | -| [VGUSurface::clipRect](#cliprect) | 矩形剪切域,如果为空,整个表面直接渲染。 | -| [VGUSurface::clipPath](#clippath) | 路径剪切域,如果为空,整个表面直接渲染。 | -| [VGUSurface::clipType](#cliptype) | 表面剪切类型 | -| [VGUSurface::mask](#mask) | 蒙版图层, 可以为空。 | -| [VGUSurface::blend](#blend) | 混合叠加模式 | -| [VGUSurface::filter](#filter) | 图像滤波类型 | -| [VGUColorStop::stop](#stop) | 颜色偏移位置, 值范围是 0.0 ~ 1.0。 | -| [VGUColorStop::color](#color-45) | 偏移位置对应颜色 | -| [VGULinear::x1](#x1-23) | 线性渐变起点水平坐标 | -| [VGULinear::y1](#y1-23) | 线性渐变起点垂直坐标 | -| [VGULinear::x2](#x2) | 线性渐变终点水平坐标 | -| [VGULinear::y2](#y2) | 线性渐变起点垂直坐标 | -| [VGURadial::x0](#x0-22) | 内圈圆心水平坐标 | -| [VGURadial::y0](#y0-22) | 内圈圆心垂直坐标 | -| [VGURadial::r0](#r0) | 内圈圆半径 | -| [VGURadial::x1](#x1-33) | 外圈圆心水平坐标 | -| [VGURadial::y1](#y1-33) | 外圈圆心垂直坐标 | -| [VGURadial::r1](#r1) | 外圈圆半径 | -| [VGUConic::cx](#cx) | 圆弧中心x坐标 | -| [VGUConic::cy](#cy) | 圆弧中心y坐标 | -| [VGUImage::buffer](#buffer-33) | 图像存储缓存 | -| [VGUImage::matrix](#matrix-12) | 图像矩阵变换,该参数为空,则内部使用单位变换矩阵。 | -| [VGUImage::rect](#rect-33) | 图像截取矩形,该参数为空,则截取整个图像。 | -| [VGUImage::opacity](#opacity-13) | 透明度,范围0~255。 | -| [VGUPattern::image](#image) | 图像对象 | -| [VGUPattern::wrapx](#wrapx) | 图像水平方向平铺类型 | -| [VGUPattern::wrapy](#wrapy) | 图像垂直方向平铺类型 | -| [VGUGradient::matrix](#matrix-22) | 针对渐变对象的变换矩阵 | -| [VGUGradient::colorStops](#colorstops) | 渐变停止颜色数组指针 | -| [VGUGradient::stopCount](#stopcount) | 渐变停止颜色个数 | -| [VGUGradient::linear](#linear) | 线性渐变对象 | -| [VGUGradient::radial](#radial) | 辐射渐变对象 | -| [VGUGradient::conic](#conic) | 圆锥渐变对象 | -| [VGUGradient::type](#type-67) | 渐变类型 | -| [VGUGradient::spread](#spread) | 渐变延伸模式 | -| [VGUGradient::opacity](#opacity-23) | 透明度,范围0~255。 | -| [VGUSolid::color](#color-55) | 颜色值 | -| [VGUSolid::opacity](#opacity-33) | 透明度. 值范围 0 ~ 255。 | -| [VGUPaintStyle::gradient](#gradient) | 渐变对象 | -| [VGUPaintStyle::pattern](#pattern) | 图片模式对象 | -| [VGUPaintStyle::solid](#solid) | 颜色对象 | -| [VGUPaintStyle::type](#type-77) | 渲染类型 | -| [VGUFillAttr::rule](#rule) | 填充规格 | -| [VGUStrokeAttr::cap](#cap) | 线帽类型 | -| [VGUStrokeAttr::join](#join) | 联结类型 | -| [VGUStrokeAttr::miterLimit](#miterlimit) | 最大斜切长度 | -| [VGUStrokeAttr::width](#width-99) | 线宽 | -| ([VGUFuncs::InitVgu](#initvgu) )(void) | 初始化硬件加速。 | -| ([VGUFuncs::DeinitVgu](#deinitvgu) )(void) | 去初始化硬件加速。 | -| ([VGUFuncs::QueryCapability](#querycapability))(uint32_t cap) | 查询硬件能力集。 | -| ([VGUFuncs::RenderFill](#renderfill))(VGUSurface \*target, const VGUPath \*path, const VGUMatrix3 \*matrix, const VGUFillAttr \*attr, const VGUPaintStyle \*style) | 使用指定的渲染对象来填充路径。 | -| ([VGUFuncs::RenderStroke](#renderstroke) )(VGUSurface \*target, const VGUPath \*path, const VGUMatrix3 \*matrix, const VGUStrokeAttr \*attr, const VGUPaintStyle \*style) | 使用指定的渲染对象来描边路径。 | -| ([VGUFuncs::RenderBlur](#renderblur) )(VGUSurface \*target, uint16_t blur) | 对目标表面进行模糊处理。 | -| ([VGUFuncs::RenderBlit](#renderblit) )(VGUSurface \*target, const VGUImage \*src, uint32_t color) | 对图像进行搬移操作。 | -| ([VGUFuncs::RenderBlitN](#renderblitn) )(VGUSurface \*target, const VGUImage \*src, uint16_t count, uint32_t color) | 对多个源图像进行叠加操作。 | -| ([VGUFuncs::RenderClearRect](#renderclearrect) )(VGUSurface \*target, const VGURect \*rect, uint32_t color, uint8_t opacity) | 对指定矩形进行颜色清除操作。 | -| ([VGUFuncs::RenderCancel](#rendercancel) )() | 取消硬件加速渲染。 | -| ([VGUFuncs::RenderSync](#rendersync) )(int32_t timeOut) | 同步硬件加速模块绘制或搬移操作。 | - - -## **宏定义说明** - - -### PROPERTY_NAME_LEN - - -``` -#define PROPERTY_NAME_LEN 50 -``` - -**描述:** - -属性名称长度 - -### HDI_VGU_SCALAR_IS_FLOAT +| (\* [DeviceFuncs::RegHotPlugCallback](#reghotplugcallback) )([HotPlugCallback](#hotplugcallback) callback, void \*data) | int32_t
注册热插拔事件回调。 | +| (\* [DeviceFuncs::RegDisplayVBlankCallback](#regdisplayvblankcallback) )(uint32_t devId, [VBlankCallback](#vblankcallback) callback, void \*data) | int32_t
注册VBlank事件回调。 | +| (\* [DeviceFuncs::RegDisplayRefreshCallback](#regdisplayrefreshcallback) )(uint32_t devId, [RefreshCallback](#refreshcallback) callback, void \*data) | int32_t
刷新请求回调。 | +| (\* [DeviceFuncs::GetDisplayCapability](#getdisplaycapability) )(uint32_t devId, [DisplayCapability](_display_capability.md) \*info) | int32_t
获取显示设备能力集。 | +| (\* [DeviceFuncs::GetDisplaySupportedModes](#getdisplaysupportedmodes) )(uint32_t devId, uint32_t \*num, [DisplayModeInfo](_display_mode_info.md) \*modes) | int32_t
获取显示设备支持的显示模式信息。 | +| (\* [DeviceFuncs::GetDisplayMode](#getdisplaymode) )(uint32_t devId, uint32_t \*modeId) | int32_t
获取显示设备当前的显示模式。 | +| (\* [DeviceFuncs::SetDisplayMode](#setdisplaymode) )(uint32_t devId, uint32_t modeId) | int32_t
设置显示设备的显示模式。 | +| (\* [DeviceFuncs::GetDisplayPowerStatus](#getdisplaypowerstatus) )(uint32_t devId, [DispPowerStatus](#disppowerstatus) \*status) | int32_t
获取显示设备当前的电源状态。 | +| (\* [DeviceFuncs::SetDisplayPowerStatus](#setdisplaypowerstatus) )(uint32_t devId, [DispPowerStatus](#disppowerstatus) status) | int32_t
设置显示设备当前的电源状态。 | +| (\* [DeviceFuncs::GetDisplayBacklight](#getdisplaybacklight) )(uint32_t devId, uint32_t \*level) | int32_t
获取显示设备当前的背光值。 | +| (\* [DeviceFuncs::SetDisplayBacklight](#setdisplaybacklight) )(uint32_t devId, uint32_t level) | int32_t
设置显示设备当前的背光值。 | +| (\* [DeviceFuncs::GetDisplayProperty](#getdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t \*value) | int32_t
获取显示设备属性值。 | +| (\* [DeviceFuncs::SetDisplayProperty](#setdisplayproperty) )(uint32_t devId, uint32_t id, uint64_t value) | int32_t
设置显示设备属性值。 | +| (\* [DeviceFuncs::PrepareDisplayLayers](#preparedisplaylayers) )(uint32_t devId, bool \*needFlushFb) | int32_t
显示设备合成前准备。 | +| (\* [DeviceFuncs::GetDisplayCompChange](#getdisplaycompchange) )(uint32_t devId, uint32_t \*num, uint32_t \*Layers, int32_t \*type) | int32_t
获取显示设备合成类型有变化的layer。 | +| (\* [DeviceFuncs::SetDisplayClientCrop](#setdisplayclientcrop) )(uint32_t devId, [IRect](_i_rect.md) \*rect) | int32_t
设置显示设备的裁剪区域。 | +| (\* [DeviceFuncs::SetDisplayClientDestRect](#setdisplayclientdestrect) )(uint32_t devId, [IRect](_i_rect.md) \*rect) | int32_t
设置显示设备的显示区域。 | +| (\* [DeviceFuncs::SetDisplayClientBuffer](#setdisplayclientbuffer) )(uint32_t devId, const BufferHandle \*buffer, int32_t fence) | int32_t
设置显示设备的显示缓存。 | +| (\* [DeviceFuncs::SetDisplayClientDamage](#setdisplayclientdamage) )(uint32_t devId, uint32_t num, [IRect](_i_rect.md) \*rect) | int32_t
设置显示设备的显示脏区。 | +| (\* [DeviceFuncs::SetDisplayVsyncEnabled](#setdisplayvsyncenabled) )(uint32_t devId, bool enabled) | int32_t
使能垂直同步信号。 | +| (\* [DeviceFuncs::GetDisplayReleaseFence](#getdisplayreleasefence) )(uint32_t devId, uint32_t \*num, uint32_t \*layers, int32_t \*fences) | int32_t
获取显示图层fence。 | +| (\* [DeviceFuncs::GetDisplaySupportedColorGamuts](#getdisplaysupportedcolorgamuts) )(uint32_t devId, uint32_t \*num, [ColorGamut](#colorgamut) \*gamuts) | int32_t
获取显示设备支持的色域信息。 | +| (\* [DeviceFuncs::GetDisplayColorGamut](#getdisplaycolorgamut) )(uint32_t devId, [ColorGamut](#colorgamut) \*gamut) | int32_t
获取显示设备当前的色域模式。 | +| (\* [DeviceFuncs::SetDisplayColorGamut](#setdisplaycolorgamut) )(uint32_t devId, [ColorGamut](#colorgamut) gamut) | int32_t
设置显示设备当前的色域模式。 | +| (\* [DeviceFuncs::GetDisplayGamutMap](#getdisplaygamutmap) )(uint32_t devId, [GamutMap](#gamutmap) \*gamutMap) | int32_t
获取显示设备当前的色域映射模式。 | +| (\* [DeviceFuncs::SetDisplayGamutMap](#setdisplaygamutmap) )(uint32_t devId, [GamutMap](#gamutmap) gamutMap) | int32_t
设置显示设备当前的色域映射模式。 | +| (\* [DeviceFuncs::SetDisplayColorTransform](#setdisplaycolortransform) )(uint32_t devId, const float \*matrix) | int32_t
设置显示设备当前的4x4的颜色转换矩阵。 | +| (\* [DeviceFuncs::GetHDRCapabilityInfos](#gethdrcapabilityinfos) )(uint32_t devId, [HDRCapability](_h_d_r_capability.md) \*info) | int32_t
获取显示设备支持的HDR属性信息。 | +| (\* [DeviceFuncs::GetSupportedMetadataKey](#getsupportedmetadatakey) )(uint32_t devId, uint32_t \*num, [HDRMetadataKey](#hdrmetadatakey) \*keys) | int32_t
获取显示设备支持的HDRMetadataKey。 | +| (\* [DeviceFuncs::Commit](#commit) )(uint32_t devId, int32_t \*fence) | int32_t
提交合成送显请求。 | +| (\* [DeviceFuncs::InvokeDisplayCmd](#invokedisplaycmd) )(uint32_t devId,...) | int32_t
调用显示设备命令。 | +| (\* [DeviceFuncs::CreateVirtualDisplay](#createvirtualdisplay) )(uint32_t width, uint32_t height, int32_t \*format, uint32_t \*devId) | int32_t
创建虚拟显示设备。 | +| (\* [DeviceFuncs::DestroyVirtualDisplay](#destroyvirtualdisplay) )(uint32_t devId) | int32_t
销毁虚拟显示设备。 | +| (\* [DeviceFuncs::SetVirtualDisplayBuffer](#setvirtualdisplaybuffer) )(uint32_t devId, BufferHandle \*buffer, int32_t fence) | int32_t
设置虚拟屏的输出缓存。 | +| (\* [DeviceFuncs::GetWriteBackFrame](#getwritebackframe) )(uint32_t devId, BufferHandle \*buffer, int32_t \*fence) | int32_t
获取显示设备的回写帧。 | +| [DisplayInfo::width](#width-19) | uint32_t
显示屏宽度 | +| [DisplayInfo::height](#height-18) | uint32_t
显示屏高度 | +| [DisplayInfo::rotAngle](#rotangle) | int32_t
显示屏旋转角度 | +| [LayerInfo::width](#width-29) | int32_t
图层宽度 | +| [LayerInfo::height](#height-28) | int32_t
图层高度 | +| [LayerInfo::type](#type-17) | [LayerType](#layertype)
图层类型,包括图形层、视频层和媒体播放模式 | +| [LayerInfo::bpp](#bpp) | int32_t
每像素所占bit数 | +| [LayerInfo::pixFormat](#pixformat-12) | [PixelFormat](#pixelformat)
图层像素格式 | +| [LayerAlpha::enGlobalAlpha](#englobalalpha-12) | bool
全局alpha使能标志 | +| [LayerAlpha::enPixelAlpha](#enpixelalpha-12) | bool
像素alpha使能标志 | +| [LayerAlpha::alpha0](#alpha0-12) | uint8_t
alpha0值,取值范围:[0, 255] | +| [LayerAlpha::alpha1](#alpha1-12) | uint8_t
alpha1值,取值范围:[0, 255] | +| [LayerAlpha::gAlpha](#galpha) | uint8_t
全局alpha值,取值范围:[0, 255] | +| [BufferData::phyAddr](#phyaddr-13) | uint64_t
物理内存地址 | +| [BufferData::virAddr](#viraddr-12) | void \*
虚拟内存地址 | +| [LayerBuffer::fenceId](#fenceid) | int32_t
buffer的fence号 | +| [LayerBuffer::width](#width-39) | int32_t
buffer宽度 | +| [LayerBuffer::height](#height-38) | int32_t
buffer高度 | +| [LayerBuffer::pitch](#pitch) | int32_t
一行数据所占字节数 | +| [LayerBuffer::pixFormat](#pixformat-22) | [PixelFormat](#pixelformat)
buffer像素格式r | +| [LayerBuffer::data](#data-12) | [BufferData](_buffer_data.md)
图层buffer数据 | +| [LayerBuffer::hdl](#hdl) | BufferHandle \*
图层buffer句柄 | +| [IRect::x](#x-14) | int32_t
矩形框起始x坐标 | +| [IRect::y](#y-14) | int32_t
矩形框起始y坐标 | +| [IRect::w](#w-12) | int32_t
矩形框宽度 | +| [IRect::h](#h-12) | int32_t
矩形框高度 | +| [ISurface::phyAddr](#phyaddr-23) | uint64_t
图像首地址 | +| [ISurface::height](#height-48) | int32_t
图像高度 | +| [ISurface::width](#width-49) | int32_t
图像宽度 | +| [ISurface::stride](#stride-12) | int32_t
图像跨度 | +| [ISurface::enColorFmt](#encolorfmt) | [PixelFormat](#pixelformat)
图像格式 | +| [ISurface::bYCbCrClut](#bycbcrclut) | bool
CLUT表是否位于 YCbCr 空间 | +| [ISurface::bAlphaMax255](#balphamax255) | bool
图像alpha最大值为255还是128 | +| [ISurface::bAlphaExt1555](#balphaext1555) | bool
是否使能1555的Alpha扩展 | +| [ISurface::alpha0](#alpha0-22) | uint8_t
Alpha0值,取值范围:[0,255] | +| [ISurface::alpha1](#alpha1-22) | uint8_t
Alpha1值,取值范围:[0,255] | +| [ISurface::cbcrPhyAddr](#cbcrphyaddr) | uint64_t
CbCr分量地址 | +| [ISurface::cbcrStride](#cbcrstride) | int32_t
CbCr分量跨度 | +| [ISurface::clutPhyAddr](#clutphyaddr) | uint64_t
Clut表首地址,用作颜色扩展或颜色校正 | +| [ILine::x0](#x0-12) | int32_t
线条起点的x坐标 | +| [ILine::y0](#y0-12) | int32_t
线条起点的y坐标 | +| [ILine::x1](#x1-13) | int32_t
线条终点的x坐标 | +| [ILine::y1](#y1-13) | int32_t
线条终点的y坐标 | +| [ILine::color](#color-15) | uint32_t
线条颜色 | +| [ICircle::x](#x-24) | int32_t
圆心x坐标 | +| [ICircle::y](#y-24) | int32_t
圆心y坐标r | +| [ICircle::r](#r) | int32_t
圆的半径 | +| [ICircle::color](#color-25) | uint32_t
圆的颜色 | +| [Rectangle::rect](#rect-13) | [IRect](_i_rect.md)
矩形区域 | +| [Rectangle::color](#color-35) | uint32_t
矩形颜色 | +| [GfxOpt::enGlobalAlpha](#englobalalpha-22) | bool
全局alpha使能位 | +| [GfxOpt::globalAlpha](#globalalpha) | uint32_t
全局alpha的值 | +| [GfxOpt::enPixelAlpha](#enpixelalpha-22) | bool
像素alpha使能位 | +| [GfxOpt::blendType](#blendtype) | [BlendType](#blendtype)
混合方式 | +| [GfxOpt::colorKeyFrom](#colorkeyfrom) | [ColorKey](#colorkey)
色键模式 | +| [GfxOpt::enableRop](#enablerop) | bool
Rop功能使能位 | +| [GfxOpt::colorRopType](#colorroptype) | [RopType](#roptype)
颜色的Rop类型 | +| [GfxOpt::alphaRopType](#alpharoptype) | [RopType](#roptype)
Alpha的Rop类型 | +| [GfxOpt::enableScale](#enablescale) | bool
缩放功能使能位 | +| [GfxOpt::rotateType](#rotatetype) | [TransformType](#transformtype)
旋转类型 | +| [GfxOpt::mirrorType](#mirrortype) | [MirrorType](#mirrortype)
镜像类型 | +| [PropertyObject::name](#name-12) [[PROPERTY_NAME_LEN](#property_name_len)] | char
属性名称 | +| [PropertyObject::propId](#propid) | uint32_t
属性ID | +| [PropertyObject::value](#value-12) | uint64_t
属性值 | +| [DisplayCapability::name](#name-22) [[PROPERTY_NAME_LEN](#property_name_len)] | char
显示设备名称 | +| [DisplayCapability::type](#type-27) | [InterfaceType](#interfacetype)
显示屏接口类型 | +| [DisplayCapability::phyWidth](#phywidth) | uint32_t
物理宽度 | +| [DisplayCapability::phyHeight](#phyheight) | uint32_t
物理高度 | +| [DisplayCapability::supportLayers](#supportlayers) | uint32_t
支持的图层数 | +| [DisplayCapability::virtualDispCount](#virtualdispcount) | uint32_t
支持的虚拟屏数 | +| [DisplayCapability::supportWriteBack](#supportwriteback) | bool
是否支持回写 | +| [DisplayCapability::propertyCount](#propertycount) | uint32_t
属性数组大小 | +| [DisplayCapability::props](#props) | [PropertyObject](_property_object.md) \*
属性数组 | +| [DisplayModeInfo::width](#width-59) | int32_t
像素宽度 | +| [DisplayModeInfo::height](#height-58) | int32_t
像素高度 | +| [DisplayModeInfo::freshRate](#freshrate) | uint32_t
刷新速率 | +| [DisplayModeInfo::id](#id) | int32_t
模式ID | +| [AllocInfo::width](#width-69) | uint32_t
申请内存宽度 | +| [AllocInfo::height](#height-68) | uint32_t
申请内存高度 | +| [AllocInfo::usage](#usage-12) | uint64_t
申请内存的使用场景 | +| [AllocInfo::format](#format-12) | [PixelFormat](#pixelformat)
申请内存格式 | +| [AllocInfo::expectedSize](#expectedsize) | uint32_t
申请内存大小 | +| [HDRCapability::formatCount](#formatcount) | uint32_t
支持的HDR格式的数量 | +| [HDRCapability::formats](#formats) | [HDRFormat](#hdrformat) \*
支持的HDR格式的数组首地址 | +| [HDRCapability::maxLum](#maxlum) | float
最大的光亮度luminance值 | +| [HDRCapability::maxAverageLum](#maxaveragelum) | float
最大的平均光亮度luminance值 | +| [HDRCapability::minLum](#minlum) | float
最小的光亮度luminance值 | +| [HDRMetaData::key](#key) | [HDRMetadataKey](#hdrmetadatakey)
HDR元数据关键字 | +| [HDRMetaData::value](#value-22) | float
关键字对应的值 | +| [VerifyAllocInfo::width](#width-79) | uint32_t
分配内存的宽度 | +| [VerifyAllocInfo::height](#height-78) | uint32_t
分配内存的高度 | +| [VerifyAllocInfo::usage](#usage-22) | uint64_t
内存的用处 | +| [VerifyAllocInfo::format](#format-22) | [PixelFormat](#pixelformat)
分配内存的像素格式 | +| [PresentTimestamp::type](#type-37) | [PresentTimestampType](#presenttimestamptype)
上屏时间戳类型 | +| [PresentTimestamp::time](#time) | int64_t
类型对应的值 | +| [ExtDataHandle::fd](#fd) | int32_t
句柄 fd, -1代表不支持 | +| [ExtDataHandle::reserveInts](#reserveints) | uint32_t
reserve数组的个数 | +| [ExtDataHandle::reserve[0]](#reserve0) | int32_t
reserve数组 | +| [YUVDescInfo::baseAddr](#baseaddr) | void \*
内存的初始地址 | +| [YUVDescInfo::yOffset](#yoffset) | size_t
Y的偏移量 | +| [YUVDescInfo::uOffset](#uoffset) | size_t
U的偏移量 | +| [YUVDescInfo::vOffset](#voffset) | size_t
V的偏移量 | +| [YUVDescInfo::yStride](#ystride) | size_t
Y的stride信息 | +| [YUVDescInfo::uvStride](#uvstride) | size_t
UV的stride信息 | +| [YUVDescInfo::uvStep](#uvstep) | size_t
UV的step信息 | +| [VGUPoint::x](#x-34) | [VGUScalar](#vguscalar)
点水平坐标 | +| [VGUPoint::y](#y-34) | [VGUScalar](#vguscalar)
点垂直坐标 | +| [VGURect::x](#x-44) | [VGUScalar](#vguscalar)
矩形水平起始坐标 | +| [VGURect::y](#y-44) | [VGUScalar](#vguscalar)
矩形垂直起始坐标 | +| [VGURect::w](#w-22) | [VGUScalar](#vguscalar)
矩形宽度 | +| [VGURect::h](#h-22) | [VGUScalar](#vguscalar)
矩形高度 | +| [VGUPath::segment](#segment) | uint8_t \*
存放路径命令数据 | +| [VGUPath::numSegments](#numsegments) | int32_t
路径命令总数 | +| [VGUPath::data](#data-22) | uint8_t \*
存放路径命令对应坐标数据 | +| [VGUPath::type](#type-47) | [VGUPathDataType](#vgupathdatatype)
路径数据存储类型 | +| [VGUPath::enAlias](#enalias) | bool
抗锯齿开关 | +| [VGUPath::boundBox](#boundbox) | [VGURect](_v_g_u_rect.md)
路径最大边界 | +| [VGUMatrix3::m](#m) [3][3] | float
3x3变换矩阵 | +| [VGUMatrix3::type](#type-57) | uint32_t
矩阵变换类型,简单变换为缩放,平移,90度倍数旋转 | +| [VGUBuffer::pixelFormat](#pixelformat) | [VGUPixelFormat](#pixelformat)
像素格式 | +| [VGUBuffer::width](#width-89) | uint32_t
位图宽度 | +| [VGUBuffer::height](#height-88) | uint32_t
位图高度 | +| [VGUBuffer::stride](#stride-22) | uint32_t
位图stride | +| [VGUBuffer::virAddr](#viraddr-22) | void \*
位图缓存的虚拟地址 | +| [VGUBuffer::phyAddr](#phyaddr-33) | uint64_t
位图缓存的物理地址 | +| [VGUMaskLayer::buffer](#buffer-13) | [VGUBuffer](_v_g_u_buffer.md) \*
蒙版缓存 | +| [VGUMaskLayer::rect](#rect-23) | [VGURect](_v_g_u_rect.md) \*
蒙版矩形 | +| [VGUSurface::buffer](#buffer-23) | [VGUBuffer](_v_g_u_buffer.md) \*
位图缓存 | +| [VGUSurface::clipRect](#cliprect) | [VGURect](_v_g_u_rect.md) \*
矩形剪切域,如果为空,整个表面直接渲染。 | +| [VGUSurface::clipPath](#clippath) | [VGUPath](_v_g_u_path.md) \*
路径剪切域,如果为空,整个表面直接渲染。 | +| [VGUSurface::clipType](#cliptype) | [VGUClipType](#vgucliptype)
表面剪切类型 | +| [VGUSurface::mask](#mask) | [VGUMaskLayer](_v_g_u_mask_layer.md) \*
蒙版图层, 可以为空 | +| [VGUSurface::blend](#blend) | [VGUBlendType](#blendtype)
混合叠加模式 | +| [VGUSurface::filter](#filter) | [VGUFilter](#vgufilter)
图像滤波类型 | +| [VGUColorStop::stop](#stop) | float
颜色偏移位置,值范围是 0.0 ~ 1.0 | +| [VGUColorStop::color](#color-45) | uint32_t
偏移位置对应颜色 | +| [VGULinear::x1](#x1-23) | [VGUScalar](#vguscalar)
线性渐变起点水平坐标 | +| [VGULinear::y1](#y1-23) | [VGUScalar](#vguscalar)
线性渐变起点垂直坐标 | +| [VGULinear::x2](#x2) | [VGUScalar](#vguscalar)
线性渐变终点水平坐标 | +| [VGULinear::y2](#y2) | [VGUScalar](#vguscalar)
线性渐变终点垂直坐标 | +| [VGURadial::x0](#x0-22) | [VGUScalar](#vguscalar)
内圈圆心水平坐标 | +| [VGURadial::y0](#y0-22) | [VGUScalar](#vguscalar)
内圈圆心垂直坐标 | +| [VGURadial::r0](#r0) | [VGUScalar](#vguscalar)
内圈圆半径 | +| [VGURadial::x1](#x1-33) | [VGUScalar](#vguscalar)
外圈圆心水平坐标 | +| [VGURadial::y1](#y1-33) | [VGUScalar](#vguscalar)
外圈圆心垂直坐标 | +| [VGURadial::r1](#r1) | [VGUScalar](#vguscalar)
外圈圆半径 | +| [VGUConic::cx](#cx) | [VGUScalar](#vguscalar)
圆弧中心x坐标 | +| [VGUConic::cy](#cy) | [VGUScalar](#vguscalar)
圆弧中心y坐标 | +| [VGUImage::buffer](#buffer-33) | [VGUBuffer](_v_g_u_buffer.md) \*
图像存储缓存 | +| [VGUImage::matrix](#matrix-12) | [VGUMatrix3](_v_g_u_matrix3.md) \*
图像矩阵变换,该参数为空,则内部使用单位变换矩阵 | +| [VGUImage::rect](#rect-33) | [VGURect](_v_g_u_rect.md) \*
图像截取矩形,该参数为空,则截取整个图像 | +| [VGUImage::opacity](#opacity-13) | uint8_t
透明度,范围0~255 | +| [VGUPattern::image](#image) | [VGUImage](_v_g_u_image.md) \*
图像对象 | +| [VGUPattern::wrapx](#wrapx) | [VGUWrapType](#vguwraptype)
图像水平方向平铺类型 | +| [VGUPattern::wrapy](#wrapy) | [VGUWrapType](#vguwraptype)
图像垂直方向平铺类型 | +| [VGUGradient::matrix](#matrix-22) | [VGUMatrix3](_v_g_u_matrix3.md) \*
针对渐变对象的变换矩阵 | +| [VGUGradient::colorStops](#colorstops) | [VGUColorStop](_v_g_u_color_stop.md) \*
渐变停止颜色数组指针 | +| [VGUGradient::stopCount](#stopcount) | uint16_t
渐变停止颜色个数 | +| [VGUGradient::linear](#linear) | [VGULinear](_v_g_u_linear.md)
线性渐变对象 | +| [VGUGradient::radial](#radial) | [VGURadial](_v_g_u_radial.md)
辐射渐变对象 | +| [VGUGradient::conic](#conic) | [VGUConic](_v_g_u_conic.md)
圆锥渐变对象 | +| [VGUGradient::type](#type-67) | [VGUGradientType](#vgugradienttype)
渐变类型 | +| [VGUGradient::spread](#spread) | [VGUFillSpread](#vgufillspread)
渐变延伸模式 | +| [VGUGradient::opacity](#opacity-23) | uint8_t
透明度,范围0~255 | +| [VGUSolid::color](#color-55) | uint32_t
颜色值 | +| [VGUSolid::opacity](#opacity-33) | uint8_t
透明度. 值范围 0 ~ 255 | +| [VGUPaintStyle::gradient](#gradient) | [VGUGradient](_v_g_u_gradient.md) \*
渐变对象 | +| [VGUPaintStyle::pattern](#pattern) | [VGUPattern](_v_g_u_pattern.md) \*
图片模式对象 | +| [VGUPaintStyle::solid](#solid) | [VGUSolid](_v_g_u_solid.md) \*
颜色对象 | +| [VGUPaintStyle::type](#type-77) | [VGUPaintType](#vgupainttype)
渲染类型 | +| [VGUFillAttr::rule](#rule) | [VGUFillRule](#vgufillrule)
填充规格 | +| [VGUStrokeAttr::cap](#cap) | [VGULineCap](#vgulinecap)
线帽类型 | +| [VGUStrokeAttr::join](#join) | [VGUJointType](#vgujointtype)
联结类型 | +| [VGUStrokeAttr::miterLimit](#miterlimit) | float
最大斜切长度 | +| [VGUStrokeAttr::width](#width-99) | float
线宽 | +| (\* [VGUFuncs::InitVgu](#initvgu) )(void) | [VGUResult](#vguresult)
初始化硬件加速。 | +| (\* [VGUFuncs::DeinitVgu](#deinitvgu) )(void) | [VGUResult](#vguresult)
去初始化硬件加速。 | +| (\* [VGUFuncs::QueryCapability](#querycapability) )(uint32_t cap) | int32_t
查询硬件能力集。 | +| (\* [VGUFuncs::RenderFill](#renderfill) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUPath](_v_g_u_path.md) \*path, const [VGUMatrix3](_v_g_u_matrix3.md) \*matrix, const [VGUFillAttr](_v_g_u_fill_attr.md) \*attr, const [VGUPaintStyle](_v_g_u_paint_style.md) \*style) | [VGUResult](#vguresult)
使用指定的渲染对象来填充路径。 | +| (\* [VGUFuncs::RenderStroke](#renderstroke) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUPath](_v_g_u_path.md) \*path, const [VGUMatrix3](_v_g_u_matrix3.md) \*matrix, const [VGUStrokeAttr](_v_g_u_stroke_attr.md) \*attr, const [VGUPaintStyle](_v_g_u_paint_style.md) \*style) | [VGUResult](#vguresult)
使用指定的渲染对象来描边路径。 | +| (\* [VGUFuncs::RenderBlur](#renderblur) )([VGUSurface](_v_g_u_surface.md) \*target, uint16_t blur) | [VGUResult](#vguresult)
对目标表面进行模糊处理。 | +| (\* [VGUFuncs::RenderBlit](#renderblit) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUImage](_v_g_u_image.md) \*src, uint32_t color) | [VGUResult](#vguresult)
对图像进行搬移操作。 | +| (\* [VGUFuncs::RenderBlitN](#renderblitn) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUImage](_v_g_u_image.md) \*src, uint16_t count, uint32_t color) | [VGUResult](#vguresult)
对多个源图像进行叠加操作。 | +| (\* [VGUFuncs::RenderClearRect](#renderclearrect) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGURect](_v_g_u_rect.md) \*rect, uint32_t color, uint8_t opacity) | [VGUResult](#vguresult)
对指定矩形进行颜色清除操作。 | +| (\* [VGUFuncs::RenderCancel](#rendercancel) )() | [VGUResult](#vguresult)
取消硬件加速渲染。 | +| (\* [VGUFuncs::RenderSync](#rendersync) )(int32_t timeOut) | [VGUResult](#vguresult)
同步硬件加速模块绘制或搬移操作。 | + + +## 宏定义说明 + + +### HDI_VGU_SCALAR_IS_FLOAT ``` #define HDI_VGU_SCALAR_IS_FLOAT 1 ``` -**描述:** - -VGU标量是否为浮点型 - - -## **类型定义说明** - - -### VGUPixelFormat - - -``` -typedef PixelFormat VGUPixelFormat; -``` - -**描述:** - -像素格式 - -### VGUBlendType +### PROPERTY_NAME_LEN ``` -typedef BlendType VGUBlendType; +#define PROPERTY_NAME_LEN 50 ``` -**描述:** - -混合操作类型 +**描述:** -### VGUScalar - - -``` -#ifdef HDI_VGU_SCALAR_IS_FLOAT -typedef float VGUScalar; -#else -typedef int32_t VGUScalar; -#endif -``` +属性名称长度 -**描述:** -VGU标量 +## 类型定义说明 ### HotPlugCallback @@ -471,9 +429,9 @@ VGU标量 typedef void(* HotPlugCallback) (uint32_t devId, bool connected, void *data) ``` -**描述:** +**描述:** -热插拔事件回调。 +热插拔事件回调 当有热插拔事件发生时,会回调该接口,需要通过[RegHotPlugCallback](#reghotplugcallback)注册该回调接口。 @@ -482,8 +440,8 @@ typedef void(* HotPlugCallback) (uint32_t devId, bool connected, void *data) | 名称 | 描述 | | -------- | -------- | | devId | 输入参数,显示设备ID,此ID由HDI实现层生成,并通过当前回调接口传递给图形服务使用,用以标记当前连接的显示设备。 | -| connected | 输入参数,指明设备的连接状态,true代表连接,false代表断开。 | -| data | 输出参数,图形服务携带的私有数据,该参数携带的是[RegHotPlugCallback](#reghotplugcallback)接口注册时传递的私有数据地址。 | +| connected | 输入参数,指明设备的连接状态,ture代表连接,false代表断开。 | +| data | 输出参数,图形服务携带的私有数据,该参数携带的是RegHotPlugCallback接口注册时传递的私有数据地址, 详情参考[RegHotPlugCallback](#reghotplugcallback)接口注册时传递的地址。 | ### RefreshCallback @@ -493,9 +451,9 @@ typedef void(* HotPlugCallback) (uint32_t devId, bool connected, void *data) typedef void(* RefreshCallback) (uint32_t devId, void *data) ``` -**描述:** +**描述:** -刷新请求回调。 +刷新请求回调 当接口实现层需要图形服务刷新数据帧时会回调该接口,需要通过[RegDisplayRefreshCallback](#regdisplayrefreshcallback)注册该回调接口。 @@ -514,7 +472,7 @@ typedef void(* RefreshCallback) (uint32_t devId, void *data) typedef void(* VBlankCallback) (unsigned int sequence, uint64_t ns, void *data) ``` -**描述:** +**描述:** VBlank 事件回调。 @@ -529,7 +487,31 @@ VBlank 事件回调。 | data | 输出参数,图形服务携带的私有数据,该参数携带的是[RegDisplayVBlankCallback](#regdisplayvblankcallback)接口注册时传递的地址。 | -## **枚举类型说明** +### VGUBlendType + + +``` +typedef BlendTypeVGUBlendType +``` + + +### VGUPixelFormat + + +``` +typedef PixelFormatVGUPixelFormat +``` + + +### VGUScalar + + +``` +typedef float VGUScalar +``` + + +## 枚举类型说明 ### anonymous enum @@ -539,7 +521,7 @@ VBlank 事件回调。 anonymous enum ``` -**描述:** +**描述:** 定义缓冲区使用。 @@ -562,7 +544,7 @@ anonymous enum enum BlendType ``` -**描述:** +**描述:** 支持的图像混合类型。 @@ -596,7 +578,7 @@ enum BlendType enum ColorDataSpace ``` -**描述:** +**描述:** 枚举颜色空间的类型 @@ -653,7 +635,7 @@ enum ColorDataSpace enum ColorGamut ``` -**描述:** +**描述:** 色域类型枚举值 @@ -680,7 +662,7 @@ enum ColorGamut enum ColorKey ``` -**描述:** +**描述:** Color key操作类型定义,即硬件加速支持的Color key操作类型。 @@ -699,20 +681,20 @@ Color key操作类型定义,即硬件加速支持的Color key操作类型。 enum CompositionType ``` -**描述:** +**描述:** 枚举特殊层的组合类型。 | 枚举值 | 描述 | | -------- | -------- | -| COMPOSITION_CLIENT | Client 合成类型,使用CPU或者GPU合成 | -| COMPOSITION_DEVICE | Device 合成类型,使用Device合成 | +| COMPOSITION_CLIENT | Client 合成类型,使用CPU或者GPU合成 | +| COMPOSITION_DEVICE | Device合成类型,使用Device合成 | | COMPOSITION_CURSOR | Cursor合成类型,用于光标合成 | | COMPOSITION_VIDEO | Video合成类型,用于视频层合成 | -| COMPOSITION_DEVICE_CLEAR | Device clear 合成类型,device会清除目标区域 | -| COMPOSITION_CLIENT_CLEAR | Client clear 合成类型,service会清除目标区域 | -| COMPOSITION_TUNNEL | Tunnel 合成类型,用于tunnel | -| COMPOSITION_BUTT | 合成类型,一个不可用类型,用于默认初始化 | +| COMPOSITION_DEVICE_CLEAR | Device clear 合成类型, device会清除目标区域 | +| COMPOSITION_CLIENT_CLEAR | Client clear 合成类型, service会清除目标区域 | +| COMPOSITION_TUNNEL | Tunnel 合成类型, 用于tunnel. | +| COMPOSITION_BUTT | 合成类型, 一个不可用类型, 用于默认初始化 | ### Connection @@ -722,7 +704,7 @@ enum CompositionType enum Connection ``` -**描述:** +**描述:** 热插拔连接类型定义 @@ -740,7 +722,7 @@ enum Connection enum DispErrCode ``` -**描述:** +**描述:** 返回值类型定义。 @@ -764,7 +746,7 @@ enum DispErrCode enum DispPowerStatus ``` -**描述:** +**描述:** 枚举显示状态 @@ -784,7 +766,7 @@ enum DispPowerStatus enum GamutMap ``` -**描述:** +**描述:** 枚举色域的映射类型 @@ -793,7 +775,7 @@ enum GamutMap | GAMUT_MAP_CONSTANT | 不变 | | GAMUT_MAP_EXPANSION | 映射增强 | | GAMUT_MAP_HDR_CONSTANT | 不变,用于HDR | -| GAMUT_MAP_HDR_EXPANSION | 映射增强,用于HDR | +| GAMUT_MAP_HDR_EXPANSION | 映射增强, 用于HDR | ### HDRFormat @@ -803,7 +785,7 @@ enum GamutMap enum HDRFormat ``` -**描述:** +**描述:** 枚举HDR格式 @@ -824,7 +806,7 @@ enum HDRFormat enum HDRMetadataKey ``` -**描述:** +**描述:** 枚举HDR元数据关键字 @@ -853,7 +835,7 @@ enum HDRMetadataKey enum InterfaceType ``` -**描述:** +**描述:** 枚举接口类型。 @@ -870,7 +852,7 @@ enum InterfaceType | DISP_INTF_VGA | VGA 接口 | | DISP_INTF_MIPI | MIPI 接口 | | DISP_INTF_PANEL | PANEL 接口 | -| DISP_INTF_BUTT | BUTT 接口,一个不可用类型,用于默认初始化。 | +| DISP_INTF_BUTT | BUTT 接口, 一个不可用类型, 用于默认初始化 | ### LayerType @@ -880,7 +862,7 @@ enum InterfaceType enum LayerType ``` -**描述:** +**描述:** 图层类型定义。 @@ -900,7 +882,7 @@ enum LayerType enum MirrorType ``` -**描述:** +**描述:** 硬件加速支持的镜像操作类型定义 @@ -919,7 +901,7 @@ enum MirrorType enum PixelFormat ``` -**描述:** +**描述:** 像素格式类型定义。 @@ -970,7 +952,7 @@ enum PixelFormat enum PresentTimestampType ``` -**描述:** +**描述:** 上屏时间戳类型枚举值 @@ -988,11 +970,11 @@ enum PresentTimestampType enum RopType ``` -**描述:** +**描述:** 硬件加速支持的ROP操作类型。 -硬件加速支持的ROP操作类型,在将前景位图的RGB颜色分量和Alpha分量值与背景位图的RGB颜色分量值和Alpha分量值进行按位的布尔运算(包括按位与,按位或等),将结果输出。 +在将前景位图的RGB颜色分量和Alpha分量值与背景位图的RGB颜色分量值和Alpha分量值进行按位的布尔运算(包括按位与,按位或等),将结果输出。 | 枚举值 | 描述 | | -------- | -------- | @@ -1022,7 +1004,7 @@ enum RopType enum TransformType ``` -**描述:** +**描述:** 图层变换类型定义。 @@ -1042,7 +1024,7 @@ enum TransformType enum VGUCapability ``` -**描述:** +**描述:** 硬件加速能力。 @@ -1061,7 +1043,7 @@ enum VGUCapability enum VGUClipType ``` -**描述:** +**描述:** 绘制表面剪切类型。 @@ -1079,7 +1061,7 @@ enum VGUClipType enum VGUFillRule ``` -**描述:** +**描述:** 填充规则定义。 @@ -1097,7 +1079,7 @@ enum VGUFillRule enum VGUFillSpread ``` -**描述:** +**描述:** 渐变填充区域外的延展类型。 @@ -1116,7 +1098,7 @@ enum VGUFillSpread enum VGUFilter ``` -**描述:** +**描述:** 图像滤波类型。 @@ -1135,7 +1117,7 @@ enum VGUFilter enum VGUGradientType ``` -**描述:** +**描述:** 渐变类型。 @@ -1154,7 +1136,7 @@ enum VGUGradientType enum VGUJointType ``` -**描述:** +**描述:** 联接类型。 @@ -1173,7 +1155,7 @@ enum VGUJointType enum VGULineCap ``` -**描述:** +**描述:** 线帽。 @@ -1191,7 +1173,7 @@ enum VGULineCap enum VGUPaintType ``` -**描述:** +**描述:** 渲染对象 @@ -1210,21 +1192,21 @@ enum VGUPaintType enum VGUPathCmd ``` -**描述:** +**描述:** 路径绘制指令类型。 | 枚举值 | 描述 | | -------- | -------- | -| VGU_PATH_CMD_CLOSE | 线段关闭,坐标数据:none | -| VGU_PATH_CMD_MOVE | 移动到指定位置,坐标数据:x0, y0 | -| VGU_PATH_CMD_LINE | 线条,坐标数据:x0, y0 | -| VGU_PATH_CMD_HLINE | 水平线,坐标数据:x0 | -| VGU_PATH_CMD_VLINE | 垂直线,坐标数据:y0 | -| VGU_PATH_CMD_QUAD | 二次贝塞尔曲线,坐标数据:x0, y0, x1, y1 | -| VGU_PATH_CMD_CUBIC | 三次贝塞尔曲线,坐标数据:x0, y0, x1, y1, x2, y2 | -| VGU_PATH_CMD_SQUAD | 平滑二次贝塞尔曲线,坐标数据:x1, y1 | -| VGU_PATH_CMD_SCUBIC | 平滑三次贝塞尔曲线,坐标数据:x1, y1, x2, y2 | +| VGU_PATH_CMD_CLOSE | 线段关闭,坐标数据: none | +| VGU_PATH_CMD_MOVE | 移动到指定位置,坐标数据: x0, y0 | +| VGU_PATH_CMD_LINE | 线条,坐标数据: x0, y0 | +| VGU_PATH_CMD_HLINE | 水平线,坐标数据: x0 | +| VGU_PATH_CMD_VLINE | 垂直线,坐标数据: y0 | +| VGU_PATH_CMD_QUAD | 二次贝塞尔曲线,坐标数据: x0, y0, x1, y1 | +| VGU_PATH_CMD_CUBIC | 三次贝塞尔曲线,坐标数据: x0, y0, x1, y1, x2, y2 | +| VGU_PATH_CMD_SQUAD | 平滑二次贝塞尔曲线,坐标数据: x1, y1 | +| VGU_PATH_CMD_SCUBIC | 平滑三次贝塞尔曲线,坐标数据: x1, y1, x2, y2 | | VGU_PATH_CMD_BUTT | 无效定义 | @@ -1235,7 +1217,7 @@ enum VGUPathCmd enum VGUPathDataType ``` -**描述:** +**描述:** 路径坐标数据类型。 @@ -1253,7 +1235,7 @@ enum VGUPathDataType enum VGUResult ``` -**描述:** +**描述:** 错误码定义。 @@ -1276,7 +1258,7 @@ enum VGUResult enum VGUTransformType ``` -**描述:** +**描述:** 变换类型。 @@ -1297,7 +1279,7 @@ enum VGUTransformType enum VGUWrapType ``` -**描述:** +**描述:** 图像模式填充延展类型。 @@ -1308,7 +1290,7 @@ enum VGUWrapType | VGU_WRAP_BUTT | 无效定义 | -## **函数说明** +## 函数说明 ### DeviceInitialize() @@ -1318,7 +1300,7 @@ enum VGUWrapType int32_t DeviceInitialize (DeviceFuncs ** funcs) ``` -**描述:** +**描述:** 实现显示设备控制接口的初始化,申请操作显示设备控制接口的资源,并获取对应的操作接口。 @@ -1342,7 +1324,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t DeviceUninitialize (DeviceFuncs * funcs) ``` -**描述:** +**描述:** 取消显示设备控制接口的初始化,释放控制接口使用到的资源。 @@ -1366,7 +1348,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t GfxInitialize (GfxFuncs ** funcs) ``` -**描述:** +**描述:** 获取硬件加速相关的操作接口指针。 @@ -1390,7 +1372,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t GfxUninitialize (GfxFuncs * funcs) ``` -**描述:** +**描述:** 释放硬件加速相关的操作接口指针。 @@ -1414,7 +1396,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t GrallocInitialize (GrallocFuncs ** funcs) ``` -**描述:** +**描述:** 初始化内存模块,并获取内存提供的操作接口。 @@ -1438,7 +1420,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t GrallocUninitialize (GrallocFuncs * funcs) ``` -**描述:** +**描述:** 取消初始化内存模块,并释放内存操作接口指针。 @@ -1462,7 +1444,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t LayerInitialize (LayerFuncs ** funcs) ``` -**描述:** +**描述:** 实现图层初始化功能,申请图层使用的资源,并获取图层提供的操作接口。 @@ -1490,7 +1472,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t LayerUninitialize (LayerFuncs * funcs) ``` -**描述:** +**描述:** 取消图层初始化功能,释放图层使用到的资源,并释放图层操作接口指针。 @@ -1518,7 +1500,7 @@ DISPLAY_SUCCESS 表示执行成功。 VGUResult VGUGradientClearStop (VGUGradient * gradient) ``` -**描述:** +**描述:** 清除ColorStop。 @@ -1542,7 +1524,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUGradientColorStop (VGUGradient * gradient, const VGUColorStop * colorStop, uint32_t count ) ``` -**描述:** +**描述:** 对渐变添加ColorStop。 @@ -1568,7 +1550,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUGradientConic (VGUGradient * gradient, VGUScalar cx, VGUScalar cy ) ``` -**描述:** +**描述:** 创建圆锥渐变对象。 @@ -1594,7 +1576,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUGradientLinear (VGUGradient * gradient, const VGUPoint * p1, const VGUPoint * p2 ) ``` -**描述:** +**描述:** 创建线性渐变对象。 @@ -1620,7 +1602,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUGradientMatrix (VGUGradient * gradient, const VGUMatrix3 * matrix ) ``` -**描述:** +**描述:** 设置渐变对象的变换矩阵。 @@ -1645,7 +1627,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUGradientRadial (VGUGradient * gradient, const VGUPoint * p1, VGUScalar r1, const VGUPoint * p2, VGUScalar r2 ) ``` -**描述:** +**描述:** 创建辐射渐变对象 @@ -1673,7 +1655,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUInitialize (VGUFuncs ** funcs) ``` -**描述:** +**描述:** 获取硬件加速相关的操作接口指针。 @@ -1697,7 +1679,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUMatrixIdentity (VGUMatrix3 * matrix) ``` -**描述:** +**描述:** 初始化矩阵对象为单位矩阵。 @@ -1721,7 +1703,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUMatrixRotate (VGUMatrix3 * matrix, float degree ) ``` -**描述:** +**描述:** 矩阵变换旋转。 @@ -1746,7 +1728,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUMatrixScale (VGUMatrix3 * matrix, float xScale, float yScale ) ``` -**描述:** +**描述:** 矩阵变换缩放。 @@ -1772,7 +1754,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUMatrixTranslate (VGUMatrix3 * matrix, float x, float y ) ``` -**描述:** +**描述:** 矩阵变换平移。 @@ -1798,7 +1780,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUPathAppend (VGUPath * path, const VGUPath * subpath ) ``` -**描述:** +**描述:** 添加子路径到当前路径中。 @@ -1823,7 +1805,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUPathClear (VGUPath * path) ``` -**描述:** +**描述:** 清除路径对象内存。 @@ -1847,7 +1829,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUPathInit (VGUPath * path, VGUPathDataType type, const uint8_t * segments, int numSegments, const uint8_t * data, bool enAlias, VGURect boundBox ) ``` -**描述:** +**描述:** 初始化路径对象。 @@ -1877,7 +1859,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult VGUUninitialize (VGUFuncs * funcs) ``` -**描述:** +**描述:** 去初始化硬件加速模块,同时释放硬件加速模块操作函数指针。 @@ -1894,7 +1876,7 @@ VGU_SUCCESS 表示执行成功。 其他值表示执行失败,具体错误码查看[VGUResult](#vguresult)。 -## **变量说明** +## 变量说明 ### alpha0 [1/2] @@ -1904,7 +1886,7 @@ VGU_SUCCESS 表示执行成功。 uint8_t LayerAlpha::alpha0 ``` -**描述:** +**描述:** alpha0值,取值范围:[0, 255] @@ -1916,7 +1898,7 @@ alpha0值,取值范围:[0, 255] uint8_t ISurface::alpha0 ``` -**描述:** +**描述:** Alpha0值,取值范围:[0,255] @@ -1928,7 +1910,7 @@ Alpha0值,取值范围:[0,255] uint8_t LayerAlpha::alpha1 ``` -**描述:** +**描述:** alpha1值,取值范围:[0, 255] @@ -1940,7 +1922,7 @@ alpha1值,取值范围:[0, 255] uint8_t ISurface::alpha1 ``` -**描述:** +**描述:** Alpha1值,取值范围:[0,255] @@ -1952,7 +1934,7 @@ Alpha1值,取值范围:[0,255] RopType GfxOpt::alphaRopType ``` -**描述:** +**描述:** Alpha的Rop类型 @@ -1964,7 +1946,7 @@ Alpha的Rop类型 bool ISurface::bAlphaExt1555 ``` -**描述:** +**描述:** 是否使能1555的Alpha扩展 @@ -1976,7 +1958,7 @@ bool ISurface::bAlphaExt1555 bool ISurface::bAlphaMax255 ``` -**描述:** +**描述:** 图像alpha最大值为255还是128 @@ -1988,7 +1970,7 @@ bool ISurface::bAlphaMax255 void* YUVDescInfo::baseAddr ``` -**描述:** +**描述:** 内存的初始地址 @@ -2000,7 +1982,7 @@ void* YUVDescInfo::baseAddr VGUBlendType VGUSurface::blend ``` -**描述:** +**描述:** 混合叠加模式 @@ -2012,7 +1994,7 @@ VGUBlendType VGUSurface::blend BlendType GfxOpt::blendType ``` -**描述:** +**描述:** 混合方式 @@ -2024,7 +2006,7 @@ BlendType GfxOpt::blendType VGURect VGUPath::boundBox ``` -**描述:** +**描述:** 路径最大边界 @@ -2036,7 +2018,7 @@ VGURect VGUPath::boundBox int32_t LayerInfo::bpp ``` -**描述:** +**描述:** 每像素所占bit数 @@ -2048,7 +2030,7 @@ int32_t LayerInfo::bpp VGUBuffer* VGUMaskLayer::buffer ``` -**描述:** +**描述:** 蒙版缓存 @@ -2060,12 +2042,10 @@ VGUBuffer* VGUMaskLayer::buffer VGUBuffer* VGUSurface::buffer ``` -**描述:** +**描述:** 位图缓存 -VGUSurface::clipRect - ### buffer [3/3] @@ -2074,7 +2054,7 @@ VGUSurface::clipRect VGUBuffer* VGUImage::buffer ``` -**描述:** +**描述:** 图像存储缓存 @@ -2086,7 +2066,7 @@ VGUBuffer* VGUImage::buffer bool ISurface::bYCbCrClut ``` -**描述:** +**描述:** CLUT表是否位于 YCbCr 空间 @@ -2098,7 +2078,7 @@ CLUT表是否位于 YCbCr 空间 VGULineCap VGUStrokeAttr::cap ``` -**描述:** +**描述:** 线帽类型 @@ -2110,7 +2090,7 @@ VGULineCap VGUStrokeAttr::cap uint64_t ISurface::cbcrPhyAddr ``` -**描述:** +**描述:** CbCr分量地址 @@ -2122,7 +2102,7 @@ CbCr分量地址 int32_t ISurface::cbcrStride ``` -**描述:** +**描述:** CbCr分量跨度 @@ -2134,7 +2114,7 @@ CbCr分量跨度 VGUPath* VGUSurface::clipPath ``` -**描述:** +**描述:** 路径剪切域,如果为空,整个表面直接渲染 @@ -2146,7 +2126,7 @@ VGUPath* VGUSurface::clipPath VGURect* VGUSurface::clipRect ``` -**描述:** +**描述:** 矩形剪切域,如果为空,整个表面直接渲染 @@ -2158,7 +2138,7 @@ VGURect* VGUSurface::clipRect VGUClipType VGUSurface::clipType ``` -**描述:** +**描述:** 表面剪切类型 @@ -2170,7 +2150,7 @@ VGUClipType VGUSurface::clipType uint64_t ISurface::clutPhyAddr ``` -**描述:** +**描述:** Clut表首地址,用作颜色扩展或颜色校正 @@ -2182,7 +2162,7 @@ Clut表首地址,用作颜色扩展或颜色校正 uint32_t ILine::color ``` -**描述:** +**描述:** 线条颜色 @@ -2194,7 +2174,7 @@ uint32_t ILine::color uint32_t ICircle::color ``` -**描述:** +**描述:** 圆的颜色 @@ -2206,7 +2186,7 @@ uint32_t ICircle::color uint32_t Rectangle::color ``` -**描述:** +**描述:** 矩形颜色 @@ -2218,7 +2198,7 @@ uint32_t Rectangle::color uint32_t VGUColorStop::color ``` -**描述:** +**描述:** 偏移位置对应颜色 @@ -2230,7 +2210,7 @@ uint32_t VGUColorStop::color uint32_t VGUSolid::color ``` -**描述:** +**描述:** 颜色值 @@ -2242,7 +2222,7 @@ uint32_t VGUSolid::color ColorKey GfxOpt::colorKeyFrom ``` -**描述:** +**描述:** 色键模式 @@ -2254,7 +2234,7 @@ ColorKey GfxOpt::colorKeyFrom RopType GfxOpt::colorRopType ``` -**描述:** +**描述:** 颜色的Rop类型 @@ -2266,7 +2246,7 @@ RopType GfxOpt::colorRopType VGUColorStop* VGUGradient::colorStops ``` -**描述:** +**描述:** 渐变停止颜色数组指针 @@ -2278,7 +2258,7 @@ VGUColorStop* VGUGradient::colorStops int32_t(* DeviceFuncs::Commit) (uint32_t devId, int32_t *fence) ``` -**描述:** +**描述:** 提交合成送显请求。 @@ -2305,7 +2285,7 @@ DISPLAY_SUCCESS 表示执行成功。 VGUConic VGUGradient::conic ``` -**描述:** +**描述:** 圆锥渐变对象 @@ -2317,7 +2297,7 @@ VGUConic VGUGradient::conic int32_t(* DeviceFuncs::CreateVirtualDisplay) (uint32_t width, uint32_t height, int32_t *format, uint32_t *devId) ``` -**描述:** +**描述:** 创建虚拟显示设备。 @@ -2346,7 +2326,7 @@ DISPLAY_SUCCESS 表示执行成功。 VGUScalar VGUConic::cx ``` -**描述:** +**描述:** 圆弧中心x坐标 @@ -2358,7 +2338,7 @@ VGUScalar VGUConic::cx VGUScalar VGUConic::cy ``` -**描述:** +**描述:** 圆弧中心y坐标 @@ -2370,7 +2350,7 @@ VGUScalar VGUConic::cy BufferData LayerBuffer::data ``` -**描述:** +**描述:** 图层buffer数据 @@ -2382,7 +2362,7 @@ BufferData LayerBuffer::data uint8_t* VGUPath::data ``` -**描述:** +**描述:** 存放路径命令对应坐标数据 @@ -2394,7 +2374,7 @@ uint8_t* VGUPath::data VGUResult(* VGUFuncs::DeinitVgu) (void) ``` -**描述:** +**描述:** 去初始化硬件加速。 @@ -2416,7 +2396,7 @@ VGU_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::DestroyVirtualDisplay) (uint32_t devId) ``` -**描述:** +**描述:** 销毁虚拟显示设备。 @@ -2442,7 +2422,7 @@ DISPLAY_SUCCESS 表示执行成功。 bool GfxOpt::enableRop ``` -**描述:** +**描述:** Rop功能使能位 @@ -2454,7 +2434,7 @@ Rop功能使能位 bool GfxOpt::enableScale ``` -**描述:** +**描述:** 缩放功能使能位 @@ -2466,7 +2446,7 @@ bool GfxOpt::enableScale bool VGUPath::enAlias ``` -**描述:** +**描述:** 抗锯齿开关 @@ -2478,7 +2458,7 @@ bool VGUPath::enAlias PixelFormat ISurface::enColorFmt ``` -**描述:** +**描述:** 图像格式 @@ -2490,7 +2470,7 @@ PixelFormat ISurface::enColorFmt bool LayerAlpha::enGlobalAlpha ``` -**描述:** +**描述:** 全局alpha使能标志 @@ -2502,7 +2482,7 @@ bool LayerAlpha::enGlobalAlpha bool GfxOpt::enGlobalAlpha ``` -**描述:** +**描述:** 全局alpha使能位 @@ -2514,7 +2494,7 @@ bool GfxOpt::enGlobalAlpha bool LayerAlpha::enPixelAlpha ``` -**描述:** +**描述:** 像素alpha使能标志 @@ -2526,7 +2506,7 @@ bool LayerAlpha::enPixelAlpha bool GfxOpt::enPixelAlpha ``` -**描述:** +**描述:** 像素alpha使能位 @@ -2538,7 +2518,7 @@ bool GfxOpt::enPixelAlpha uint32_t AllocInfo::expectedSize ``` -**描述:** +**描述:** 申请内存大小 @@ -2550,7 +2530,7 @@ uint32_t AllocInfo::expectedSize int32_t ExtDataHandle::fd ``` -**描述:** +**描述:** 句柄 fd, -1代表不支持 @@ -2562,9 +2542,9 @@ int32_t ExtDataHandle::fd int32_t LayerBuffer::fenceId ``` -**描述:** +**描述:** -buffer 的fence号r +buffer 的fence号。 ### filter @@ -2574,7 +2554,7 @@ buffer 的fence号r VGUFilter VGUSurface::filter ``` -**描述:** +**描述:** 图像滤波类型 @@ -2586,7 +2566,7 @@ VGUFilter VGUSurface::filter PixelFormat AllocInfo::format ``` -**描述:** +**描述:** 申请内存格式 @@ -2598,7 +2578,7 @@ PixelFormat AllocInfo::format PixelFormat VerifyAllocInfo::format ``` -**描述:** +**描述:** 分配内存的像素格式 @@ -2610,7 +2590,7 @@ PixelFormat VerifyAllocInfo::format uint32_t HDRCapability::formatCount ``` -**描述:** +**描述:** 支持的HDR格式的数量 @@ -2622,7 +2602,7 @@ uint32_t HDRCapability::formatCount HDRFormat* HDRCapability::formats ``` -**描述:** +**描述:** 支持的HDR格式的数组首地址 @@ -2634,7 +2614,7 @@ HDRFormat* HDRCapability::formats uint32_t DisplayModeInfo::freshRate ``` -**描述:** +**描述:** 刷新速率 @@ -2646,7 +2626,7 @@ uint32_t DisplayModeInfo::freshRate uint8_t LayerAlpha::gAlpha ``` -**描述:** +**描述:** 全局alpha值,取值范围:[0, 255] @@ -2658,7 +2638,7 @@ uint8_t LayerAlpha::gAlpha int32_t(* DeviceFuncs::GetDisplayBacklight) (uint32_t devId, uint32_t *level) ``` -**描述:** +**描述:** 获取显示设备当前的背光值。 @@ -2685,7 +2665,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayCapability) (uint32_t devId, DisplayCapability *info) ``` -**描述:** +**描述:** 获取显示设备能力集。 @@ -2696,7 +2676,7 @@ int32_t(* DeviceFuncs::GetDisplayCapability) (uint32_t devId, DisplayCapability | 名称 | 描述 | | -------- | -------- | | devId | 输入参数,指示需要操作的设备ID。 | -| info | 输出参数,设备支持的能力级信息,详情参考[DisplayCapability](_display_capability.md)。 | +| info | 输出参数,设备支持的能力级信息,详情参考 [DisplayCapability](_display_capability.md)。 | **返回:** @@ -2712,7 +2692,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayColorGamut) (uint32_t devId, ColorGamut *gamut) ``` -**描述:** +**描述:** 获取显示设备当前的色域模式。 @@ -2737,7 +2717,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayCompChange) (uint32_t devId, uint32_t *num, uint32_t *Layers, int32_t *type) ``` -**描述:** +**描述:** 获取显示设备合成类型有变化的layer。 @@ -2766,7 +2746,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayGamutMap) (uint32_t devId, GamutMap *gamutMap) ``` -**描述:** +**描述:** 获取显示设备当前的色域映射模式。 @@ -2791,7 +2771,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayMode) (uint32_t devId, uint32_t *modeId) ``` -**描述:** +**描述:** 获取显示设备当前的显示模式。 @@ -2818,7 +2798,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayPowerStatus) (uint32_t devId, DispPowerStatus *status) ``` -**描述:** +**描述:** 获取显示设备当前的电源状态。 @@ -2845,7 +2825,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayProperty) (uint32_t devId, uint32_t id, uint64_t *value) ``` -**描述:** +**描述:** 获取显示设备属性值。 @@ -2873,7 +2853,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplayReleaseFence) (uint32_t devId, uint32_t *num, uint32_t *layers, int32_t *fences) ``` -**描述:** +**描述:** 获取显示图层fence。 @@ -2902,7 +2882,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplaySupportedColorGamuts) (uint32_t devId, uint32_t *num, ColorGamut *gamuts) ``` -**描述:** +**描述:** 获取显示设备支持的色域信息。 @@ -2928,7 +2908,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetDisplaySupportedModes) (uint32_t devId, uint32_t *num, DisplayModeInfo *modes) ``` -**描述:** +**描述:** 获取显示设备支持的显示模式信息。 @@ -2956,7 +2936,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetHDRCapabilityInfos) (uint32_t devId, HDRCapability *info) ``` -**描述:** +**描述:** 获取显示设备支持的HDR属性信息。 @@ -2981,7 +2961,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetSupportedMetadataKey) (uint32_t devId, uint32_t *num, HDRMetadataKey *keys) ``` -**描述:** +**描述:** 获取显示设备支持的 HDRMetadataKey。 @@ -2991,7 +2971,7 @@ int32_t(* DeviceFuncs::GetSupportedMetadataKey) (uint32_t devId, uint32_t *num, | -------- | -------- | | devId | 输入参数,指示需要操作的设备ID。 | | num | 输出参数,设备支持的HDRMetadataKey数组个数。 | -| keys | 输出参数,HDRMetadataKey首地址, 指向HDRMetadataKey数组首地址。 | +| keys | 输出参数,HDRMetadataKey首地址,指向HDRMetadataKey数组首地址。 | **返回:** @@ -3007,7 +2987,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::GetWriteBackFrame) (uint32_t devId, BufferHandle *buffer, int32_t *fence) ``` -**描述:** +**描述:** 获取显示设备的回写帧。 @@ -3035,7 +3015,7 @@ DISPLAY_SUCCESS 表示执行成功。 uint32_t GfxOpt::globalAlpha ``` -**描述:** +**描述:** 全局alpha的值 @@ -3047,7 +3027,7 @@ uint32_t GfxOpt::globalAlpha VGUGradient* VGUPaintStyle::gradient ``` -**描述:** +**描述:** 渐变对象 @@ -3059,7 +3039,7 @@ VGUGradient* VGUPaintStyle::gradient int32_t IRect::h ``` -**描述:** +**描述:** 矩形框高度 @@ -3071,7 +3051,7 @@ int32_t IRect::h VGUScalar VGURect::h ``` -**描述:** +**描述:** 矩形高度 @@ -3083,7 +3063,7 @@ VGUScalar VGURect::h BufferHandle* LayerBuffer::hdl ``` -**描述:** +**描述:** 图层buffer句柄 @@ -3095,7 +3075,7 @@ BufferHandle* LayerBuffer::hdl uint32_t DisplayInfo::height ``` -**描述:** +**描述:** 显示屏高度 @@ -3107,7 +3087,7 @@ uint32_t DisplayInfo::height int32_t LayerInfo::height ``` -**描述:** +**描述:** 图层高度 @@ -3119,7 +3099,7 @@ int32_t LayerInfo::height int32_t LayerBuffer::height ``` -**描述:** +**描述:** buffer高度 @@ -3131,7 +3111,7 @@ buffer高度 int32_t ISurface::height ``` -**描述:** +**描述:** 图像高度 @@ -3143,7 +3123,7 @@ int32_t ISurface::height int32_t DisplayModeInfo::height ``` -**描述:** +**描述:** 像素高度 @@ -3155,7 +3135,7 @@ int32_t DisplayModeInfo::height uint32_t AllocInfo::height ``` -**描述:** +**描述:** 申请内存高度 @@ -3167,7 +3147,7 @@ uint32_t AllocInfo::height uint32_t VerifyAllocInfo::height ``` -**描述:** +**描述:** 分配内存的高度 @@ -3179,7 +3159,7 @@ uint32_t VerifyAllocInfo::height uint32_t VGUBuffer::height ``` -**描述:** +**描述:** 位图高度 @@ -3191,7 +3171,7 @@ uint32_t VGUBuffer::height int32_t DisplayModeInfo::id ``` -**描述:** +**描述:** 模式ID @@ -3203,7 +3183,7 @@ int32_t DisplayModeInfo::id VGUImage* VGUPattern::image ``` -**描述:** +**描述:** 图像对象 @@ -3215,7 +3195,7 @@ VGUImage* VGUPattern::image VGUResult(* VGUFuncs::InitVgu) (void) ``` -**描述:** +**描述:** 初始化硬件加速。 @@ -3237,11 +3217,11 @@ VGU_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::InvokeDisplayCmd) (uint32_t devId,...) ``` -**描述:** +**描述:** 调用显示设备命令。 -该接口用于图形服务和接口实现层之间的接口扩展,如果由临时接口新增可以通过该接口进行扩展,不用增加新的接口定义。 +该接口用于图形服务和接口实现层之间的的接口扩展,如果由临时接口新增可以通过该接口进行扩展,不用增加新的接口定义。 **参数:** @@ -3263,7 +3243,7 @@ DISPLAY_SUCCESS 表示执行成功。 VGUJointType VGUStrokeAttr::join ``` -**描述:** +**描述:** 联结类型 @@ -3275,7 +3255,7 @@ VGUJointType VGUStrokeAttr::join HDRMetadataKey HDRMetaData::key ``` -**描述:** +**描述:** HDR元数据关键字 @@ -3287,7 +3267,7 @@ HDR元数据关键字 VGULinear VGUGradient::linear ``` -**描述:** +**描述:** 线性渐变对象 @@ -3299,7 +3279,7 @@ VGULinear VGUGradient::linear float VGUMatrix3::m[3][3] ``` -**描述:** +**描述:** 3x3变换矩阵 @@ -3311,7 +3291,7 @@ float VGUMatrix3::m[3][3] VGUMaskLayer* VGUSurface::mask ``` -**描述:** +**描述:** 蒙版图层,可以为空 @@ -3323,7 +3303,7 @@ VGUMaskLayer* VGUSurface::mask VGUMatrix3* VGUImage::matrix ``` -**描述:** +**描述:** 图像矩阵变换,该参数为空,则内部使用单位变换矩阵 @@ -3335,7 +3315,7 @@ VGUMatrix3* VGUImage::matrix VGUMatrix3* VGUGradient::matrix ``` -**描述:** +**描述:** 针对渐变对象的变换矩阵 @@ -3347,7 +3327,7 @@ VGUMatrix3* VGUGradient::matrix float HDRCapability::maxAverageLum ``` -**描述:** +**描述:** 最大的平均光亮度luminance值 @@ -3359,7 +3339,7 @@ float HDRCapability::maxAverageLum float HDRCapability::maxLum ``` -**描述:** +**描述:** 最大的光亮度luminance值 @@ -3371,7 +3351,7 @@ float HDRCapability::maxLum float HDRCapability::minLum ``` -**描述:** +**描述:** 最小的光亮度luminance值 @@ -3383,7 +3363,7 @@ float HDRCapability::minLum MirrorType GfxOpt::mirrorType ``` -**描述:** +**描述:** 镜像类型 @@ -3395,7 +3375,7 @@ MirrorType GfxOpt::mirrorType float VGUStrokeAttr::miterLimit ``` -**描述:** +**描述:** 最大斜切长度 @@ -3407,7 +3387,7 @@ float VGUStrokeAttr::miterLimit char PropertyObject::name[PROPERTY_NAME_LEN] ``` -**描述:** +**描述:** 属性名称 @@ -3419,7 +3399,7 @@ char PropertyObject::name[PROPERTY_NAME_LEN] char DisplayCapability::name[PROPERTY_NAME_LEN] ``` -**描述:** +**描述:** 显示设备名称 @@ -3431,7 +3411,7 @@ char DisplayCapability::name[PROPERTY_NAME_LEN] int32_t VGUPath::numSegments ``` -**描述:** +**描述:** 路径命令总数 @@ -3443,7 +3423,7 @@ int32_t VGUPath::numSegments uint8_t VGUImage::opacity ``` -**描述:** +**描述:** 透明度,范围0~255 @@ -3455,7 +3435,7 @@ uint8_t VGUImage::opacity uint8_t VGUGradient::opacity ``` -**描述:** +**描述:** 透明度,范围0~255 @@ -3467,9 +3447,9 @@ uint8_t VGUGradient::opacity uint8_t VGUSolid::opacity ``` -**描述:** +**描述:** -透明度,取值范围 0 ~ 255。 +透明度,值范围 0 ~ 255 ### pattern @@ -3479,7 +3459,7 @@ uint8_t VGUSolid::opacity VGUPattern* VGUPaintStyle::pattern ``` -**描述:** +**描述:** 图片模式对象 @@ -3491,7 +3471,7 @@ VGUPattern* VGUPaintStyle::pattern uint64_t BufferData::phyAddr ``` -**描述:** +**描述:** 物理内存地址 @@ -3503,7 +3483,7 @@ uint64_t BufferData::phyAddr uint64_t ISurface::phyAddr ``` -**描述:** +**描述:** 图像首地址 @@ -3515,7 +3495,7 @@ uint64_t ISurface::phyAddr uint64_t VGUBuffer::phyAddr ``` -**描述:** +**描述:** 位图缓存的物理地址 @@ -3527,7 +3507,7 @@ uint64_t VGUBuffer::phyAddr uint32_t DisplayCapability::phyHeight ``` -**描述:** +**描述:** 物理高度 @@ -3539,7 +3519,7 @@ uint32_t DisplayCapability::phyHeight uint32_t DisplayCapability::phyWidth ``` -**描述:** +**描述:** 物理宽度 @@ -3551,7 +3531,7 @@ uint32_t DisplayCapability::phyWidth int32_t LayerBuffer::pitch ``` -**描述:** +**描述:** 一行数据所占字节数 @@ -3563,7 +3543,7 @@ int32_t LayerBuffer::pitch VGUPixelFormat VGUBuffer::pixelFormat ``` -**描述:** +**描述:** 像素格式 @@ -3575,7 +3555,7 @@ VGUPixelFormat VGUBuffer::pixelFormat PixelFormat LayerInfo::pixFormat ``` -**描述:** +**描述:** 图层像素格式 @@ -3587,7 +3567,7 @@ PixelFormat LayerInfo::pixFormat PixelFormat LayerBuffer::pixFormat ``` -**描述:** +**描述:** buffer像素格式r @@ -3599,7 +3579,7 @@ buffer像素格式r int32_t(* DeviceFuncs::PrepareDisplayLayers) (uint32_t devId, bool *needFlushFb) ``` -**描述:** +**描述:** 显示设备合成前准备。 @@ -3626,7 +3606,7 @@ DISPLAY_SUCCESS 表示执行成功。 uint32_t DisplayCapability::propertyCount ``` -**描述:** +**描述:** 属性数组大小 @@ -3638,7 +3618,7 @@ uint32_t DisplayCapability::propertyCount uint32_t PropertyObject::propId ``` -**描述:** +**描述:** 属性ID @@ -3650,7 +3630,7 @@ uint32_t PropertyObject::propId PropertyObject* DisplayCapability::props ``` -**描述:** +**描述:** 属性数组 @@ -3662,7 +3642,7 @@ PropertyObject* DisplayCapability::props int32_t(* VGUFuncs::QueryCapability) (uint32_t cap) ``` -**描述:** +**描述:** 查询硬件能力集。 @@ -3670,7 +3650,7 @@ int32_t(* VGUFuncs::QueryCapability) (uint32_t cap) | 名称 | 描述 | | -------- | -------- | -| cap | 输入参数,待查询能力。该参数类型定义参考 [VGUCapability](#vgucapability)。 | +| cap | 输入参数,待查询能力。该参数类型定义参考[VGUCapability](#vgucapability)。 | **返回:** @@ -3686,7 +3666,7 @@ VGU_SUCCESS 表示执行成功。 int32_t ICircle::r ``` -**描述:** +**描述:** 圆的半径 @@ -3698,7 +3678,7 @@ int32_t ICircle::r VGUScalar VGURadial::r0 ``` -**描述:** +**描述:** 内圈圆半径 @@ -3710,7 +3690,7 @@ VGUScalar VGURadial::r0 VGUScalar VGURadial::r1 ``` -**描述:** +**描述:** 外圈圆半径 @@ -3722,7 +3702,7 @@ VGUScalar VGURadial::r1 VGURadial VGUGradient::radial ``` -**描述:** +**描述:** 辐射渐变对象 @@ -3734,7 +3714,7 @@ VGURadial VGUGradient::radial IRect Rectangle::rect ``` -**描述:** +**描述:** 矩形区域 @@ -3746,7 +3726,7 @@ IRect Rectangle::rect VGURect* VGUMaskLayer::rect ``` -**描述:** +**描述:** 蒙版矩形 @@ -3758,7 +3738,7 @@ VGURect* VGUMaskLayer::rect VGURect* VGUImage::rect ``` -**描述:** +**描述:** 图像截取矩形,该参数为空,则截取整个图像 @@ -3770,7 +3750,7 @@ VGURect* VGUImage::rect int32_t(* DeviceFuncs::RegDisplayRefreshCallback) (uint32_t devId, RefreshCallback callback, void *data) ``` -**描述:** +**描述:** 刷新请求回调。 @@ -3798,7 +3778,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::RegDisplayVBlankCallback) (uint32_t devId, VBlankCallback callback, void *data) ``` -**描述:** +**描述:** 注册VBlank事件回调。 @@ -3826,7 +3806,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::RegHotPlugCallback) (HotPlugCallback callback, void *data) ``` -**描述:** +**描述:** 注册热插拔事件回调。 @@ -3853,7 +3833,7 @@ DISPLAY_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderBlit) (VGUSurface *target, const VGUImage *src, uint32_t color) ``` -**描述:** +**描述:** 对图像进行搬移操作。 @@ -3881,14 +3861,15 @@ VGU_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderBlitN) (VGUSurface *target, const VGUImage *src, uint16_t count, uint32_t color) ``` -**描述:** +**描述:** 对多个源图像进行叠加操作。 -搬移过程中同时进行颜色空间转换,矩阵变换操作。该接口支持多个源图形同时叠加到目标表面, 对于硬件支持源图像数目可以通过[QueryCapability](#querycapability)接口查询**。** +搬移过程中同时进行颜色空间转换,矩阵变换操作。该接口支持多个源图形同时叠加到目标表面, -**参数**: +对于硬件支持源图像数目可以通过[QueryCapability](#querycapability)接口查询。 +**参数:** | 名称 | 描述 | | -------- | -------- | @@ -3897,13 +3878,10 @@ VGUResult(* VGUFuncs::RenderBlitN) (VGUSurface *target, const VGUImage *src, uin | count | 输入参数,待叠加源图像个数。 | | color | 输入参数,参与混合的颜色值。如果颜色值为0,则不参与混合操作。 | - -**返回**: - +**返回:** VGU_SUCCESS 表示执行成功。 - 其他值表示执行失败,具体错误码查看[VGUResult](#vguresult)。 @@ -3914,7 +3892,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderBlur) (VGUSurface *target, uint16_t blur) ``` -**描述:** +**描述:** 对目标表面进行模糊处理。 @@ -3939,7 +3917,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderCancel) () ``` -**描述:** +**描述:** 取消硬件加速渲染。 @@ -3957,7 +3935,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderClearRect) (VGUSurface *target, const VGURect *rect, uint32_t color, uint8_t opacity) ``` -**描述:** +**描述:** 对指定矩形进行颜色清除操作。 @@ -3984,7 +3962,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderFill) (VGUSurface *target, const VGUPath *path, const VGUMatrix3 *matrix, const VGUFillAttr *attr, const VGUPaintStyle *style) ``` -**描述:** +**描述:** 使用指定的渲染对象来填充路径。 @@ -4012,7 +3990,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderStroke) (VGUSurface *target, const VGUPath *path, const VGUMatrix3 *matrix, const VGUStrokeAttr *attr, const VGUPaintStyle *style) ``` -**描述:** +**描述:** 使用指定的渲染对象来描边路径。 @@ -4040,7 +4018,7 @@ VGU_SUCCESS 表示执行成功。 VGUResult(* VGUFuncs::RenderSync) (int32_t timeOut) ``` -**描述:** +**描述:** 同步硬件加速模块绘制或搬移操作。 @@ -4059,14 +4037,14 @@ VGU_SUCCESS 表示执行成功。 其他值表示执行失败,具体错误码查看[VGUResult](#vguresult)。 -### reserve +### reserve[0] ``` int32_t ExtDataHandle::reserve[0] ``` -**描述:** +**描述:** reserve数组 @@ -4078,7 +4056,7 @@ reserve数组 uint32_t ExtDataHandle::reserveInts ``` -**描述:** +**描述:** reserve数组的个数 @@ -4090,7 +4068,7 @@ reserve数组的个数 int32_t DisplayInfo::rotAngle ``` -**描述:** +**描述:** 显示屏旋转角度 @@ -4102,7 +4080,7 @@ int32_t DisplayInfo::rotAngle TransformType GfxOpt::rotateType ``` -**描述:** +**描述:** 旋转类型 @@ -4114,7 +4092,7 @@ TransformType GfxOpt::rotateType VGUFillRule VGUFillAttr::rule ``` -**描述:** +**描述:** 填充规格 @@ -4126,7 +4104,7 @@ VGUFillRule VGUFillAttr::rule uint8_t* VGUPath::segment ``` -**描述:** +**描述:** 存放路径命令数据 @@ -4138,7 +4116,7 @@ uint8_t* VGUPath::segment int32_t(* DeviceFuncs::SetDisplayBacklight) (uint32_t devId, uint32_t level) ``` -**描述:** +**描述:** 设置显示设备当前的背光值。 @@ -4165,7 +4143,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayClientBuffer) (uint32_t devId, const BufferHandle *buffer, int32_t fence) ``` -**描述:** +**描述:** 设置显示设备的显示缓存。 @@ -4193,7 +4171,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayClientCrop) (uint32_t devId, IRect *rect) ``` -**描述:** +**描述:** 设置显示设备的裁剪区域。 @@ -4220,7 +4198,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayClientDamage) (uint32_t devId, uint32_t num, IRect *rect) ``` -**描述:** +**描述:** 设置显示设备的显示脏区。 @@ -4248,7 +4226,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayClientDestRect) (uint32_t devId, IRect *rect) ``` -**描述:** +**描述:** 设置显示设备的显示区域。 @@ -4275,7 +4253,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayColorGamut) (uint32_t devId, ColorGamut gamut) ``` -**描述:** +**描述:** 设置显示设备当前的色域模式。 @@ -4300,7 +4278,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayColorTransform) (uint32_t devId, const float *matrix) ``` -**描述:** +**描述:** 设置显示设备当前的4x4的颜色转换矩阵。 @@ -4325,7 +4303,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayGamutMap) (uint32_t devId, GamutMap gamutMap) ``` -**描述:** +**描述:** 设置显示设备当前的色域映射模式。 @@ -4350,7 +4328,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayMode) (uint32_t devId, uint32_t modeId) ``` -**描述:** +**描述:** 设置显示设备的显示模式。 @@ -4377,7 +4355,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayPowerStatus) (uint32_t devId, DispPowerStatus status) ``` -**描述:** +**描述:** 设置显示设备当前的电源状态。 @@ -4404,7 +4382,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayProperty) (uint32_t devId, uint32_t id, uint64_t value) ``` -**描述:** +**描述:** 设置显示设备属性值。 @@ -4432,7 +4410,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetDisplayVsyncEnabled) (uint32_t devId, bool enabled) ``` -**描述:** +**描述:** 使能垂直同步信号。 @@ -4459,7 +4437,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* DeviceFuncs::SetVirtualDisplayBuffer) (uint32_t devId, BufferHandle *buffer, int32_t fence) ``` -**描述:** +**描述:** 设置虚拟屏的输出缓存。 @@ -4487,7 +4465,7 @@ DISPLAY_SUCCESS 表示执行成功。 VGUSolid* VGUPaintStyle::solid ``` -**描述:** +**描述:** 颜色对象 @@ -4499,7 +4477,7 @@ VGUSolid* VGUPaintStyle::solid VGUFillSpread VGUGradient::spread ``` -**描述:** +**描述:** 渐变延伸模式 @@ -4511,9 +4489,9 @@ VGUFillSpread VGUGradient::spread float VGUColorStop::stop ``` -**描述:** +**描述:** -颜色偏移位置,取值范围是 0.0 ~ 1.0。 +颜色偏移位置,值范围是 0.0 ~ 1.0 ### stopCount @@ -4523,7 +4501,7 @@ float VGUColorStop::stop uint16_t VGUGradient::stopCount ``` -**描述:** +**描述:** 渐变停止颜色个数 @@ -4535,7 +4513,7 @@ uint16_t VGUGradient::stopCount int32_t ISurface::stride ``` -**描述:** +**描述:** 图像跨度 @@ -4547,7 +4525,7 @@ int32_t ISurface::stride uint32_t VGUBuffer::stride ``` -**描述:** +**描述:** 位图stride @@ -4559,7 +4537,7 @@ uint32_t VGUBuffer::stride uint32_t DisplayCapability::supportLayers ``` -**描述:** +**描述:** 支持的图层数 @@ -4571,7 +4549,7 @@ uint32_t DisplayCapability::supportLayers bool DisplayCapability::supportWriteBack ``` -**描述:** +**描述:** 是否支持回写 @@ -4583,7 +4561,7 @@ bool DisplayCapability::supportWriteBack int64_t PresentTimestamp::time ``` -**描述:** +**描述:** 类型对应的值 @@ -4595,7 +4573,7 @@ int64_t PresentTimestamp::time LayerType LayerInfo::type ``` -**描述:** +**描述:** 图层类型,包括图形层、视频层和媒体播放模式 @@ -4607,7 +4585,7 @@ LayerType LayerInfo::type InterfaceType DisplayCapability::type ``` -**描述:** +**描述:** 显示屏接口类型 @@ -4619,7 +4597,7 @@ InterfaceType DisplayCapability::type PresentTimestampType PresentTimestamp::type ``` -**描述:** +**描述:** 上屏时间戳类型 @@ -4631,7 +4609,7 @@ PresentTimestampType PresentTimestamp::type VGUPathDataType VGUPath::type ``` -**描述:** +**描述:** 路径数据存储类型 @@ -4643,7 +4621,7 @@ VGUPathDataType VGUPath::type uint32_t VGUMatrix3::type ``` -**描述:** +**描述:** 矩阵变换类型,简单变换为缩放,平移,90度倍数旋转 @@ -4655,7 +4633,7 @@ uint32_t VGUMatrix3::type VGUGradientType VGUGradient::type ``` -**描述:** +**描述:** 渐变类型 @@ -4667,7 +4645,7 @@ VGUGradientType VGUGradient::type VGUPaintType VGUPaintStyle::type ``` -**描述:** +**描述:** 渲染类型 @@ -4679,7 +4657,7 @@ VGUPaintType VGUPaintStyle::type size_t YUVDescInfo::uOffset ``` -**描述:** +**描述:** U的偏移量 @@ -4691,7 +4669,7 @@ U的偏移量 uint64_t AllocInfo::usage ``` -**描述:** +**描述:** 申请内存的使用场景 @@ -4703,7 +4681,7 @@ uint64_t AllocInfo::usage uint64_t VerifyAllocInfo::usage ``` -**描述:** +**描述:** 内存的用处 @@ -4715,7 +4693,7 @@ uint64_t VerifyAllocInfo::usage size_t YUVDescInfo::uvStep ``` -**描述:** +**描述:** UV的step信息 @@ -4724,10 +4702,10 @@ UV的step信息 ``` -size_t __attribute__::uvStride +size_t YUVDescInfo::uvStride ``` -**描述:** +**描述:** UV的stride信息 @@ -4739,7 +4717,7 @@ UV的stride信息 uint64_t PropertyObject::value ``` -**描述:** +**描述:** 属性值 @@ -4751,7 +4729,7 @@ uint64_t PropertyObject::value float HDRMetaData::value ``` -**描述:** +**描述:** 关键字对应的值 @@ -4763,7 +4741,7 @@ float HDRMetaData::value void* BufferData::virAddr ``` -**描述:** +**描述:** 虚拟内存地址 @@ -4775,7 +4753,7 @@ void* BufferData::virAddr void* VGUBuffer::virAddr ``` -**描述:** +**描述:** 位图缓存的虚拟地址 @@ -4787,7 +4765,7 @@ void* VGUBuffer::virAddr uint32_t DisplayCapability::virtualDispCount ``` -**描述:** +**描述:** 支持的虚拟屏数 @@ -4799,7 +4777,7 @@ uint32_t DisplayCapability::virtualDispCount size_t YUVDescInfo::vOffset ``` -**描述:** +**描述:** V的偏移量 @@ -4811,7 +4789,7 @@ V的偏移量 int32_t IRect::w ``` -**描述:** +**描述:** 矩形框宽度 @@ -4823,7 +4801,7 @@ int32_t IRect::w VGUScalar VGURect::w ``` -**描述:** +**描述:** 矩形宽度 @@ -4835,7 +4813,7 @@ VGUScalar VGURect::w uint32_t DisplayInfo::width ``` -**描述:** +**描述:** 显示屏宽度 @@ -4847,7 +4825,7 @@ uint32_t DisplayInfo::width int32_t LayerInfo::width ``` -**描述:** +**描述:** 图层宽度 @@ -4859,7 +4837,7 @@ int32_t LayerInfo::width int32_t LayerBuffer::width ``` -**描述:** +**描述:** buffer宽度 @@ -4871,7 +4849,7 @@ buffer宽度 int32_t ISurface::width ``` -**描述:** +**描述:** 图像宽度 @@ -4883,7 +4861,7 @@ int32_t ISurface::width int32_t DisplayModeInfo::width ``` -**描述:** +**描述:** 像素宽度 @@ -4895,7 +4873,7 @@ int32_t DisplayModeInfo::width uint32_t AllocInfo::width ``` -**描述:** +**描述:** 申请内存宽度 @@ -4907,7 +4885,7 @@ uint32_t AllocInfo::width uint32_t VerifyAllocInfo::width ``` -**描述:** +**描述:** 分配内存的宽度 @@ -4919,7 +4897,7 @@ uint32_t VerifyAllocInfo::width uint32_t VGUBuffer::width ``` -**描述:** +**描述:** 位图宽度 @@ -4931,7 +4909,7 @@ uint32_t VGUBuffer::width float VGUStrokeAttr::width ``` -**描述:** +**描述:** 线宽 @@ -4943,7 +4921,7 @@ float VGUStrokeAttr::width VGUWrapType VGUPattern::wrapx ``` -**描述:** +**描述:** 图像水平方向平铺类型 @@ -4955,7 +4933,7 @@ VGUWrapType VGUPattern::wrapx VGUWrapType VGUPattern::wrapy ``` -**描述:** +**描述:** 图像垂直方向平铺类型 @@ -4967,7 +4945,7 @@ VGUWrapType VGUPattern::wrapy int32_t IRect::x ``` -**描述:** +**描述:** 矩形框起始x坐标 @@ -4979,7 +4957,7 @@ int32_t IRect::x int32_t ICircle::x ``` -**描述:** +**描述:** 圆心x坐标 @@ -4991,7 +4969,7 @@ int32_t ICircle::x VGUScalar VGUPoint::x ``` -**描述:** +**描述:** 点水平坐标 @@ -5003,7 +4981,7 @@ VGUScalar VGUPoint::x VGUScalar VGURect::x ``` -**描述:** +**描述:** 矩形水平起始坐标 @@ -5015,7 +4993,7 @@ VGUScalar VGURect::x int32_t ILine::x0 ``` -**描述:** +**描述:** 线条起点的x坐标 @@ -5027,7 +5005,7 @@ int32_t ILine::x0 VGUScalar VGURadial::x0 ``` -**描述:** +**描述:** 内圈圆心水平坐标 @@ -5039,7 +5017,7 @@ VGUScalar VGURadial::x0 int32_t ILine::x1 ``` -**描述:** +**描述:** 线条终点的x坐标 @@ -5051,7 +5029,7 @@ int32_t ILine::x1 VGUScalar VGULinear::x1 ``` -**描述:** +**描述:** 线性渐变起点水平坐标 @@ -5063,7 +5041,7 @@ VGUScalar VGULinear::x1 VGUScalar VGURadial::x1 ``` -**描述:** +**描述:** 外圈圆心水平坐标 @@ -5075,7 +5053,7 @@ VGUScalar VGURadial::x1 VGUScalar VGULinear::x2 ``` -**描述:** +**描述:** 线性渐变终点水平坐标 @@ -5087,7 +5065,7 @@ VGUScalar VGULinear::x2 int32_t IRect::y ``` -**描述:** +**描述:** 矩形框起始y坐标 @@ -5099,7 +5077,7 @@ int32_t IRect::y int32_t ICircle::y ``` -**描述:** +**描述:** 圆心y坐标r @@ -5111,7 +5089,7 @@ int32_t ICircle::y VGUScalar VGUPoint::y ``` -**描述:** +**描述:** 点垂直坐标 @@ -5123,7 +5101,7 @@ VGUScalar VGUPoint::y VGUScalar VGURect::y ``` -**描述:** +**描述:** 矩形垂直起始坐标 @@ -5135,7 +5113,7 @@ VGUScalar VGURect::y int32_t ILine::y0 ``` -**描述:** +**描述:** 线条起点的y坐标 @@ -5147,7 +5125,7 @@ int32_t ILine::y0 VGUScalar VGURadial::y0 ``` -**描述:** +**描述:** 内圈圆心垂直坐标 @@ -5159,7 +5137,7 @@ VGUScalar VGURadial::y0 int32_t ILine::y1 ``` -**描述:** +**描述:** 线条终点的y坐标 @@ -5171,7 +5149,7 @@ int32_t ILine::y1 VGUScalar VGULinear::y1 ``` -**描述:** +**描述:** 线性渐变起点垂直坐标 @@ -5183,7 +5161,7 @@ VGUScalar VGULinear::y1 VGUScalar VGURadial::y1 ``` -**描述:** +**描述:** 外圈圆心垂直坐标 @@ -5195,7 +5173,7 @@ VGUScalar VGURadial::y1 VGUScalar VGULinear::y2 ``` -**描述:** +**描述:** 线性渐变终点垂直坐标 @@ -5207,7 +5185,7 @@ VGUScalar VGULinear::y2 size_t YUVDescInfo::yOffset ``` -**描述:** +**描述:** Y的偏移量 @@ -5219,6 +5197,6 @@ Y的偏移量 size_t YUVDescInfo::yStride ``` -**描述:** +**描述:** Y的stride信息 diff --git a/zh-cn/device-dev/reference/hdi-apis/_display_capability.md b/zh-cn/device-dev/reference/hdi-apis/_display_capability.md index dc9fb8e076741b999ee98f403c7c5e563d2e7ffc..e7e4a9706e83a16cf37c9a4de0e44dee26b8a39e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_display_capability.md +++ b/zh-cn/device-dev/reference/hdi-apis/_display_capability.md @@ -1,7 +1,7 @@ # DisplayCapability -## **概述** +## 概述 定义输出性能。 @@ -10,19 +10,19 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [name [PROPERTY_NAME_LEN]](_display.md#name-22) | 显示设备名称 | -| [type](_display.md#type-27) | 显示屏接口类型 | -| [phyWidth](_display.md#phywidth) | 物理宽度 | -| [phyHeight](_display.md#phyheight) | 物理高度 | -| [supportLayers](_display.md#supportlayers) | 支持的图层数 | -| [virtualDispCount](_display.md#virtualdispcount) | 支持的虚拟屏数 | -| [supportWriteBack](_display.md#supportwriteback) | 是否支持回写 | -| [propertyCount](_display.md#propertycount) | 属性数组大小 | -| [props](_display.md#props) | 属性数组 | +| [name](_display.md#name-22) [[PROPERTY_NAME_LEN](_display.md#property_name_len)] | char
显示设备名称 | +| [type](_display.md#type-27) | [InterfaceType](_display.md#interfacetype)
显示屏接口类型 | +| [phyWidth](_display.md#phywidth) | uint32_t
物理宽度 | +| [phyHeight](_display.md#phyheight) | uint32_t
物理高度 | +| [supportLayers](_display.md#supportlayers) | uint32_t
支持的图层数 | +| [virtualDispCount](_display.md#virtualdispcount) | uint32_t
支持的虚拟屏数 | +| [supportWriteBack](_display.md#supportwriteback) | bool
是否支持回写 | +| [propertyCount](_display.md#propertycount) | uint32_t
属性数组大小 | +| [props](_display.md#props) | [PropertyObject](_property_object.md) \*
属性数组 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_display_info.md b/zh-cn/device-dev/reference/hdi-apis/_display_info.md index daaa760ad656a45a7877199274a37ddf1b369f11..956de749039a198cc898eac85236ade0c368bf0e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_display_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_display_info.md @@ -1,22 +1,22 @@ # DisplayInfo -## **概述** +## 概述 -定义显示信息结构体。 +定义显示信息结构体 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [width](_display.md#width-19) | 显示屏宽度 | -| [height](_display.md#height-18) | 显示屏高度 | -| [rotAngle](_display.md#rotangle) | 显示屏旋转角度 | +| [width](_display.md#width-19) | uint32_t
显示屏宽度 | +| [height](_display.md#height-18) | uint32_t
显示屏高度 | +| [rotAngle](_display.md#rotangle) | int32_t
显示屏旋转角度 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_display_mode_info.md b/zh-cn/device-dev/reference/hdi-apis/_display_mode_info.md index a89c6e0ff77a5b9bf8d183a17539c9ea4f651919..2573c915996568b4597b84d499e5c6eee11c9736 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_display_mode_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_display_mode_info.md @@ -1,7 +1,7 @@ # DisplayModeInfo -## **概述** +## 概述 定义输出模式信息。 @@ -10,14 +10,14 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [width](_display.md#width-59) | 像素宽度 | -| [height](_display.md#height-58) | 像素高度 | -| [freshRate](_display.md#freshrate) | 刷新速率 | -| [id](_display.md#id) | 模式ID | +| [width](_display.md#width-59) | int32_t
像素宽度 | +| [height](_display.md#height-58) | int32_t
像素高度 | +| [freshRate](_display.md#freshrate) | uint32_t
刷新速率 | +| [id](_display.md#id) | int32_t
模式ID | diff --git a/zh-cn/device-dev/reference/hdi-apis/_div_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_div_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..80f6ab5e158a9e2d92cdaeede7782fd8c5c4b767 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_div_fusion.md @@ -0,0 +1,49 @@ +# DivFusion + + +## 概述 + +将两个tensor执行除法运算。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_DIV_FUSION。 + +输入: + +- x1,int或float类型的张量。 + +- x2,int或float类型的张量。 + +输出: + +- output, 输出两输入相除后的结果。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数类型,详情请参考:[Activation](_activation.md)。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType DivFusion::activationType +``` +**描述:** +激活函数类型,详情请参考:[Activation](_activation.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_dtmf_info.md b/zh-cn/device-dev/reference/hdi-apis/_dtmf_info.md new file mode 100644 index 0000000000000000000000000000000000000000..17c2945f4f7cf063cc426e5deba9a4563bbdc77c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_dtmf_info.md @@ -0,0 +1,77 @@ +# DtmfInfo + + +## 概述 + +发送双音多频(DTMF)信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [callId](#callid) | int
呼叫 ID  | +| [onLength](#onlength) | int
DTMF音播放的时长  | +| [offLength](#offlength) | int
DTMF发送的间隔  | +| [stringLength](#stringlength) | int
DTMF字符串长度  | +| [dtmfKey](#dtmfkey) | String
DTMF关键字  | + + +## 类成员变量说明 + + +### callId + + +``` +int DtmfInfo::callId +``` +**描述:** +呼叫 ID + + +### dtmfKey + + +``` +String DtmfInfo::dtmfKey +``` +**描述:** +DTMF关键字 + + +### offLength + + +``` +int DtmfInfo::offLength +``` +**描述:** +DTMF发送的间隔 + + +### onLength + + +``` +int DtmfInfo::onLength +``` +**描述:** +DTMF音播放的时长 + + +### stringLength + + +``` +int DtmfInfo::stringLength +``` +**描述:** +DTMF字符串长度 diff --git a/zh-cn/device-dev/reference/hdi-apis/_eltwise.md b/zh-cn/device-dev/reference/hdi-apis/_eltwise.md new file mode 100644 index 0000000000000000000000000000000000000000..692f87e77cff8d8ea25e4ba248ae70224207516f --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_eltwise.md @@ -0,0 +1,49 @@ +# Eltwise + + +## 概述 + +元素级别操作的算子。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_ELTWISE。 + +输入: + +- x1,第一个输入张量。 + +- x2,第二个输入张量。 + +输出: + +- output,与x1有相同的数据类型和形状。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [mode](#mode) | enum [EltwiseMode](_n_n_rt.md#eltwisemode)
元素级别操作的类型,详情请参考:[EltwiseMode](_n_n_rt.md#eltwisemode)。  | + + +## 类成员变量说明 + + +### mode + + +``` +enum EltwiseMode Eltwise::mode +``` +**描述:** +元素级别操作的类型,详情请参考:[EltwiseMode](_n_n_rt.md#eltwisemode)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_emergency_call.md b/zh-cn/device-dev/reference/hdi-apis/_emergency_call.md new file mode 100644 index 0000000000000000000000000000000000000000..7ae78e8c2c5968a59432cc815c9c82e96b6f8c5c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_emergency_call.md @@ -0,0 +1,99 @@ +# EmergencyCall + + +## 概述 + +紧急呼叫号码。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [index](#index) | int
号码条数索引  | +| [total](#total) | int
号码总条数  | +| [eccNum](#eccnum) | String
号码  | +| [mcc](#mcc) | String
国家码  | +| [eccType](#ecctype) | enum [EccType](_ril.md#ecctype)
紧急呼叫类型,具体查看[EccType](_ril.md#ecctype) | +| [simpresent](#simpresent) | enum [SimpresentType](_ril.md#simpresenttype)
表示号码是有卡时生效还是无卡生效,具体查看[SimpresentType](_ril.md#simpresenttype) | +| [abnormalService](#abnormalservice) | enum [AbnormalServiceType](_ril.md#abnormalservicetype)
表示号码有效性是否区分CS域非正常服务状态,具体查看**AbnormalService** | + + +## 类成员变量说明 + + +### abnormalService + + +``` +enum AbnormalServiceType EmergencyCall::abnormalService +``` +**描述:** +表示号码有效性是否区分CS域非正常服务状态,具体查看**AbnormalService** + + +### eccNum + + +``` +String EmergencyCall::eccNum +``` +**描述:** +号码 + + +### eccType + + +``` +enum EccType EmergencyCall::eccType +``` +**描述:** +紧急呼叫类型,具体查看[EccType](_ril.md#ecctype) + + +### index + + +``` +int EmergencyCall::index +``` +**描述:** +号码条数索引 + + +### mcc + + +``` +String EmergencyCall::mcc +``` +**描述:** +国家码 + + +### simpresent + + +``` +enum SimpresentType EmergencyCall::simpresent +``` +**描述:** +表示号码是有卡时生效还是无卡生效,具体查看[SimpresentType](_ril.md#simpresenttype) + + +### total + + +``` +int EmergencyCall::total +``` +**描述:** +号码总条数 diff --git a/zh-cn/device-dev/reference/hdi-apis/_emergency_info_list.md b/zh-cn/device-dev/reference/hdi-apis/_emergency_info_list.md new file mode 100644 index 0000000000000000000000000000000000000000..ace398558a4ec449c6fe4472ba314a8989b0c7ad --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_emergency_info_list.md @@ -0,0 +1,55 @@ +# EmergencyInfoList + + +## 概述 + +紧急呼叫号码列表。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [callSize](#callsize) | int
总数  | +| [flag](#flag) | int
号码列表标识  | +| [calls](#calls) | List< struct [EmergencyCall](_emergency_call.md) >
号码列表  | + + +## 类成员变量说明 + + +### calls + + +``` +List EmergencyInfoList::calls +``` +**描述:** +号码列表 + + +### callSize + + +``` +int EmergencyInfoList::callSize +``` +**描述:** +总数 + + +### flag + + +``` +int EmergencyInfoList::flag +``` +**描述:** +号码列表标识 diff --git a/zh-cn/device-dev/reference/hdi-apis/_enroll_param.md b/zh-cn/device-dev/reference/hdi-apis/_enroll_param.md index df3fc98fbc8e6a2a2938fc0d6435ac6459b38677..0bdf64c814a2434c0036c85593bacd8d4970a798 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_enroll_param.md +++ b/zh-cn/device-dev/reference/hdi-apis/_enroll_param.md @@ -1,36 +1,32 @@ # EnrollParam -## **概述** +## 概述 -录入结果信息。 - -**Since:** +注册认证凭据参数。 +**Since:** 3.2 - -**Version:** - +**Version:** 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [authType](#authtype) | 用户认证凭据类型。 | -| [executorType](#executortype) | 执行器类型。 | -| [executorSensorHint](#executorsensorhint) | 既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 | +| [authType](#authtype) | enum [AuthType](_hdf_user_auth.md#authtype)
用户认证凭据类型AuthType}。  | +| [executorType](#executortype) | unsigned int
执行器类型。  | +| [executorSensorHint](#executorsensorhint) | unsigned int
既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。  | -## **类成员变量说明** +## 类成员变量说明 ### authType @@ -39,10 +35,8 @@ ``` enum AuthType EnrollParam::authType ``` - -**描述:** - -用户认证凭据类型。 +**描述:** +用户认证凭据类型AuthType}。 ### executorSensorHint @@ -51,9 +45,7 @@ enum AuthType EnrollParam::authType ``` unsigned int EnrollParam::executorSensorHint ``` - -**描述:** - +**描述:** 既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 @@ -63,7 +55,5 @@ unsigned int EnrollParam::executorSensorHint ``` unsigned int EnrollParam::executorType ``` - -**描述:** - +**描述:** 执行器类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_enroll_result_info.md b/zh-cn/device-dev/reference/hdi-apis/_enroll_result_info.md new file mode 100644 index 0000000000000000000000000000000000000000..45242651b033c2b78a2d6b770bbd73cf00ad5701 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_enroll_result_info.md @@ -0,0 +1,59 @@ +# EnrollResultInfo + + +## 概述 + +录入结果信息。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[HdfUserAuth](_hdf_user_auth.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [credentialId](#credentialid) | unsigned long
认证凭据ID  | +| [oldInfo](#oldinfo) | struct [CredentialInfo](_credential_info.md)
旧凭据信息[CredentialInfo](_credential_info.md)。  | +| [rootSecret](#rootsecret) | unsigned char[]
保护文件加密密钥的密钥。  | + + +## 类成员变量说明 + + +### credentialId + + +``` +unsigned long EnrollResultInfo::credentialId +``` +**描述:** +认证凭据ID + + +### oldInfo + + +``` +struct CredentialInfo EnrollResultInfo::oldInfo +``` +**描述:** +旧凭据信息[CredentialInfo](_credential_info.md)。 + + +### rootSecret + + +``` +unsigned char [] EnrollResultInfo::rootSecret +``` +**描述:** +保护文件加密密钥的密钥。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_enroll_resultinfo.md b/zh-cn/device-dev/reference/hdi-apis/_enroll_resultinfo.md deleted file mode 100644 index c16294b124fd10052766e2eec171eefcc2c388d8..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_enroll_resultinfo.md +++ /dev/null @@ -1,69 +0,0 @@ -# EnrollResultInfo - - -## **概述** - -注册认证凭据参数。 - -**Since:** - -3.2 - -**Version:** - -1.0 - -**所属模块:** - -[HdfUserAuth](_hdf_user_auth.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [credentialId](#credentialid) | 认证凭据ID。 | -| [oldInfo](#oldinfo) | 旧凭据信息。 | -| [rootSecret](#rootsecret) | 保护文件加密密钥的密钥。 | - - -## **类成员变量说明** - - -### credentialId - - -``` -unsigned long EnrollResultInfo::credentialId -``` - -**描述:** - -认证凭据ID。 - - -### oldInfo - - -``` -struct CredentialInfo EnrollParam::oldInfo -``` - -**描述:** - -旧凭据信息[CredentialInfo](_credential_info.md)。 - - -### rootSecret - - -``` -unsigned char[] EnrollParam::rootSecret -``` - -**描述:** - -保护文件加密密钥的密钥。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_enrolled_info.md b/zh-cn/device-dev/reference/hdi-apis/_enrolled_info.md index 63fe13082c82824a84d862b0c6ce7acd0798553f..421e72fb52260dd2b1723cd2b97b9a76b65b0f09 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_enrolled_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_enrolled_info.md @@ -1,35 +1,31 @@ # EnrolledInfo -## **概述** +## 概述 注册信息。 -**Since:** - +**Since:** 3.2 - -**Version:** - +**Version:** 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [enrolledId](#enrolledid) | 注册ID,用户注册新的认证凭据时会更新注册ID。 | -| [authType](#authtype) | 用户认证凭据类型。 | +| [enrolledId](#enrolledid) | unsigned long
注册ID,用户注册新的认证凭据时会更新注册ID。  | +| [authType](#authtype) | enum [AuthType](_hdf_user_auth.md#authtype)
用户认证凭据类型AuthType}。  | -## **类成员变量说明** +## 类成员变量说明 ### authType @@ -38,10 +34,8 @@ ``` enum AuthType EnrolledInfo::authType ``` - -**描述:** - -用户认证凭据类型[AuthType](_hdf_user_auth.md#authtype)。 +**描述:** +用户认证凭据类型AuthType}。 ### enrolledId @@ -50,7 +44,5 @@ enum AuthType EnrolledInfo::authType ``` unsigned long EnrolledInfo::enrolledId ``` - -**描述:** - +**描述:** 注册ID,用户注册新的认证凭据时会更新注册ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_event_info.md b/zh-cn/device-dev/reference/hdi-apis/_event_info.md index 93032444d007f364a50ec8e287d948efa8702e38..8681bb54e77682cbc653554b59544ef218b3a299 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_event_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_event_info.md @@ -1,31 +1,31 @@ # EventInfo -## **概述** +## 概述 定义事件上报信息。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [appData](#appdata) | 设置回调时给入的上层实例。 | -| [appDataLen](#appdatalen) | appData字节数。 | -| [data1](#data1) | 事件上报携带的数据1。 | -| [data2](#data2) | 事件上报携带的数据2。 | -| [eventData](#eventdata) | 事件上报携带的数据信息。 | -| [eventDataLen](#eventdatalen) | eventData字节数。 | +| [appData](#appdata) | int8_t \*
设置回调时给入的上层实例。  | +| [appDataLen](#appdatalen) | uint32_t
appData字节数。  | +| [data1](#data1) | uint32_t
事件上报携带的数据1。  | +| [data2](#data2) | uint32_t
事件上报携带的数据2。  | +| [eventData](#eventdata) | int8_t \*
事件上报携带的数据信息。  | +| [eventDataLen](#eventdatalen) | uint32_t
eventData字节数。  | -## **类成员变量说明** +## 类成员变量说明 ### appData @@ -34,9 +34,7 @@ ``` int8_t* EventInfo::appData ``` - -**描述:** - +**描述:** 设置回调时给入的上层实例。 @@ -46,9 +44,7 @@ int8_t* EventInfo::appData ``` uint32_t EventInfo::appDataLen ``` - -**描述:** - +**描述:** appData字节数。 @@ -58,9 +54,7 @@ appData字节数。 ``` uint32_t EventInfo::data1 ``` - -**描述:** - +**描述:** 事件上报携带的数据1。 @@ -70,9 +64,7 @@ uint32_t EventInfo::data1 ``` uint32_t EventInfo::data2 ``` - -**描述:** - +**描述:** 事件上报携带的数据2。 @@ -82,9 +74,7 @@ uint32_t EventInfo::data2 ``` int8_t* EventInfo::eventData ``` - -**描述:** - +**描述:** 事件上报携带的数据信息。 @@ -94,7 +84,5 @@ int8_t* EventInfo::eventData ``` uint32_t EventInfo::eventDataLen ``` - -**描述:** - +**描述:** eventData字节数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_ex_data_handle.md b/zh-cn/device-dev/reference/hdi-apis/_ex_data_handle.md new file mode 100644 index 0000000000000000000000000000000000000000..c5a731ea5e761a1549f4bc25cfd7366a615ca62e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ex_data_handle.md @@ -0,0 +1,22 @@ +# ExtDataHandle + + +## 概述 + +扩展数据句柄结构体定义 + +**相关模块:** + +[Display](_display.md) + + +## 汇总 + + +### Public 属性 + +| 名称 | 描述 | +| -------- | -------- | +| [fd](_display.md#fd) | int32_t
句柄 fd,-1代表不支持 | +| [reserveInts](_display.md#reserveints) | uint32_t
reserve数组的个数 | +| [reserve[0]](_display.md#reserve0) | int32_t
reserve数组 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_executor_info.md b/zh-cn/device-dev/reference/hdi-apis/_executor_info.md deleted file mode 100644 index c67700a04747ebc6a061cf7cb6cab70699090524..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_executor_info.md +++ /dev/null @@ -1,147 +0,0 @@ -# ExecutorInfo - - -## **概述** - -执行器信息。 - -**Since:** - -3.2 - -**Version:** - -1.0 - -**所属模块:** - -[HdfFaceAuth](_hdf_face_auth.md) | [HdfPinAuth](_hdf_pin_auth.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [sensorId](#sensorid) | 传感器ID,不同传感器在人脸/口令认证驱动内的唯一标识。 | -| [executorType](#executortype) | 执行器类型,根据执行器支持的能力/算法类型进行分类。 | -| [index](#index) | 用户认证框架的执行器索引。 | -| [executorRole](#executorrole) | 执行器角色。 | -| [authType](#authtype) | 用户认证凭据类型。 | -| [esl](#esl) | 执行器安全等级。 | -| [publicKey](#publickey) | 执行器公钥,用于校验该执行器私钥签名的信息。 | -| [extraInfo](#extrainfo) | 其他相关信息,用于支持信息扩展。 | -| [info](#info) | 执行器注册信息。 | - - -## **类成员变量说明** - - -### authType - - -``` -enum AuthType ExecutorInfo::authType -``` - -**描述:** - -用户认证凭据类型。 - - -### esl - - -``` -enum ExecutorSecureLevel ExecutorInfo::esl -``` - -**描述:** - -执行器安全等级[ExecutorSecureLevel](_hdf_face_auth.md#executorsecurelevel)。 - - -### executorRole - - -``` -enum ExecutorRole ExecutorInfo::executorRole -``` - -**描述:** - -执行器角色[ExecutorRole](_hdf_face_auth.md#executorrole)。 - - -### executorType - - -``` -unsigned int ExecutorInfo::executorType -``` - -**描述:** - -执行器类型,根据执行器支持的能力/算法类型进行分类。 - - -### extraInfo - - -``` -unsigned char [] ExecutorInfo::extraInfo -``` - -**描述:** - -其他相关信息,用于支持信息扩展。 - - -### index - - -``` -unsigned long ExecutorInfo::index -``` - -**描述:** - -用户认证框架的执行器索引。 - - -### info - - -``` -struct ExecutorRegisterInfo ExecutorInfo::info -``` - -**描述:** - -执行器注册信息ExecutorRegisterInfo。 - - -### publicKey - - -``` -unsigned char [] ExecutorInfo::publicKey -``` - -**描述:** - -执行器公钥,用于校验该执行器私钥签名的信息。 - - -### sensorId - - -``` -unsigned short ExecutorInfo::sensorId -``` - -**描述:** - -传感器ID,不同传感器在人脸认证驱动、口令认证驱动内的唯一标识。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_executor_info_faceauth.md b/zh-cn/device-dev/reference/hdi-apis/_executor_info_faceauth.md new file mode 100644 index 0000000000000000000000000000000000000000..86a02978abcdf8b7f4a300d068cc4d05b35b3b03 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_executor_info_faceauth.md @@ -0,0 +1,121 @@ +# ExecutorInfo + + +## 概述 + +执行器信息。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[HdfFaceAuth](_hdf_face_auth.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [sensorId](#sensorid) | unsigned short
传感器ID,不同传感器在人脸认证驱动内的唯一标识。 | +| [executorType](#executortype) | unsigned int
执行器类型,根据执行器支持的能力进行分类。 | +| [executorRole](#executorrole) | enum [ExecutorRole](_hdf_face_auth.md#executorrole)
执行器角色ExecutorRole}。 | +| [authType](#authtype) | enum [AuthType](_hdf_face_auth.md#authtype)
用户认证凭据类型。 | +| [esl](#esl) | enum [ExecutorSecureLevel](_hdf_face_auth.md#executorsecurelevel)
执行器安全等级。 | +| [publicKey](#publickey) | unsigned char[]
执行器公钥,用于校验该执行器私钥签名的信息。 | +| [extraInfo](#extrainfo) | unsigned char[]
其他相关信息,用于支持信息扩展。 | + + +## 类成员变量说明 + + +### authType + + +``` +enum AuthType ExecutorInfo::authType +``` + +**描述:** + +用户认证凭据类型[AuthType](_hdf_face_auth.md#authtype)。 + + +### esl + + +``` +enum ExecutorSecureLevel ExecutorInfo::esl +``` + +**描述:** + +执行器安全等级[ExecutorSecureLevel](_hdf_face_auth.md#executorsecurelevel)。 + + +### executorRole + + +``` +enum ExecutorRole ExecutorInfo::executorRole +``` + +**描述:** + +执行器角色[ExecutorRole](_hdf_face_auth.md#executorrole)。 + + +### executorType + + +``` +unsigned int ExecutorInfo::executorType +``` + +**描述:** + +执行器类型,根据执行器支持的能力进行分类。 + + +### extraInfo + + +``` +unsigned char [] ExecutorInfo::extraInfo +``` + +**描述:** + +其他相关信息,用于支持信息扩展。 + + +### publicKey + + +``` +unsigned char [] ExecutorInfo::publicKey +``` + +**描述:** + +执行器公钥,用于校验该执行器私钥签名的信息。 + + +### sensorId + + +``` +unsigned short ExecutorInfo::sensorId +``` + +**描述:** + +传感器ID,不同传感器在人脸认证驱动内的唯一标识。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_executor_info_pinauth.md b/zh-cn/device-dev/reference/hdi-apis/_executor_info_pinauth.md new file mode 100644 index 0000000000000000000000000000000000000000..9e190484ae621b08ebb349c8097d90e2db867e8e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_executor_info_pinauth.md @@ -0,0 +1,121 @@ +# ExecutorInfo + + +## 概述 + +执行器信息。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[HdfPinAuth](_hdf_pin_auth.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [sensorId](#sensorid) | unsigned short
传感器ID,不同传感器在口令认证驱动内的唯一标识。 | +| [executorType](#executortype) | unsigned int
执行器类型,根据执行器支持的算法类型进行分类。 | +| [executorRole](#executorrole) | enum [ExecutorRole](_hdf_pin_auth.md#executorrole)
执行器角色。 | +| [authType](#authtype) | enum [AuthType](_hdf_pin_auth.md#authtype)
用户认证凭据类型。 | +| [esl](#esl) | enum [ExecutorSecureLevel](_hdf_pin_auth.md#executorsecurelevel)
执行器安全等级。 | +| [publicKey](#publickey) | unsigned char[]
执行器公钥,用于校验该执行器私钥签名的信息。 | +| [extraInfo](#extrainfo) | unsigned char[]
其他相关信息,用户支持信息扩展。 | + + +## 类成员变量说明 + + +### authType + + +``` +enum AuthType ExecutorInfo::authType +``` + +**描述:** + +用户认证凭据类型[AuthType](_hdf_pin_auth.md#authtype)。 + + +### esl + + +``` +enum ExecutorSecureLevel ExecutorInfo::esl +``` + +**描述:** + +执行器安全等级[ExecutorSecureLevel](_hdf_pin_auth.md#executorsecurelevel)。 + + +### executorRole + + +``` +enum ExecutorRole ExecutorInfo::executorRole +``` + +**描述:** + +执行器角色[ExecutorRole](_hdf_pin_auth.md#executorrole)。 + + +### executorType + + +``` +unsigned int ExecutorInfo::executorType +``` + +**描述:** + +执行器类型,根据执行器支持的算法类型进行分类。 + + +### extraInfo + + +``` +unsigned char [] ExecutorInfo::extraInfo +``` + +**描述:** + +其他相关信息,用户支持信息扩展。 + + +### publicKey + + +``` +unsigned char [] ExecutorInfo::publicKey +``` + +**描述:** + +执行器公钥,用于校验该执行器私钥签名的信息。 + + +### sensorId + + +``` +unsigned short ExecutorInfo::sensorId +``` + +**描述:** + +传感器ID,不同传感器在口令认证驱动内的唯一标识。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_executor_info_userauth.md b/zh-cn/device-dev/reference/hdi-apis/_executor_info_userauth.md new file mode 100644 index 0000000000000000000000000000000000000000..bba0bb7fcf8135720d0456301d8dcf0cb0c35bb5 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_executor_info_userauth.md @@ -0,0 +1,56 @@ +# ExecutorInfo + + +## 概述 + +执行器信息。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[HdfUserAuth](_hdf_user_auth.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [executorIndex](#executorindex) | unsigned long
用户认证框架的执行器索引。 | +| [info](#info) | struct [ExecutorRegisterInfo](_executor_register_info.md)
执行器注册信息ExecutorRegisterInfo}。 | + + +## 类成员变量说明 + + +### executorIndex + + +``` +unsigned long ExecutorInfo::executorIndex +``` + +**描述:** + +用户认证框架的执行器索引。 + + +### info + + +``` +struct ExecutorRegisterInfo ExecutorInfo::info +``` + +**描述:** + +执行器注册信息ExecutorRegisterInfo}。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_executor_register_info.md b/zh-cn/device-dev/reference/hdi-apis/_executor_register_info.md index a0ee3deb5f7e7e0ae97a1c5f3ce6db95bd42bc88..44c727b4973c35369348e2421f044f24fb532a50 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_executor_register_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_executor_register_info.md @@ -1,39 +1,39 @@ # ExecutorRegisterInfo -## **概述** +## 概述 执行器注册信息。 -**Since:** +**Since:** 3.2 -**Version:** +**Version:** 1.0 -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [authType](#authtype) | 用户认证凭据类型。 | -| [executorRole](#executorrole) | 执行器角色。 | -| [executorSensorHint](#executorsensorhint) | 既定用户认证凭据类型的执行器ID。 | -| [executorMatcher](#executormatcher) | 执行器类型,根据执行器支持的认证能力进行分类。 | -| [esl](#esl) | 执行器安全等级。 | -| [publicKey](#publickey) | 执行器公钥,用于校验该执行器私钥签名的信息。 | +| [authType](#authtype) | enum [AuthType](_hdf_user_auth.md#authtype)
用户认证凭据类型。 | +| [executorRole](#executorrole) | enum [ExecutorRole](_hdf_user_auth.md#executorrole)
执行器角色。 | +| [executorSensorHint](#executorsensorhint) | unsigned int
既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 | +| [executorMatcher](#executormatcher) | unsigned int
执行器匹配器,根据执行器支持的认证能力进行分类。 | +| [esl](#esl) | enum [ExecutorSecureLevel](_hdf_user_auth.md#executorsecurelevel)
执行器安全等级。 | +| [publicKey](#publickey) | unsigned char[]
执行器公钥,用于校验该执行器私钥签名的信息。 | -## **类成员变量说明** +## 类成员变量说明 ### authType @@ -43,9 +43,9 @@ enum AuthType ExecutorRegisterInfo::authType ``` -**描述:** +**描述:** -用户认证凭据类型。 +用户认证凭据类型[AuthType](_hdf_user_auth.md#authtype)。 ### esl @@ -55,21 +55,21 @@ enum AuthType ExecutorRegisterInfo::authType enum ExecutorSecureLevel ExecutorRegisterInfo::esl ``` -**描述:** +**描述:** 执行器安全等级[ExecutorSecureLevel](_hdf_user_auth.md#executorsecurelevel)。 -### executorSensorHint +### executorMatcher ``` -unsigned int ExecutorRegisterInfo::executorSensorHint +unsigned int ExecutorRegisterInfo::executorMatcher ``` -**描述:** +**描述:** -既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 +执行器匹配器,根据执行器支持的认证能力进行分类。 ### executorRole @@ -79,21 +79,21 @@ unsigned int ExecutorRegisterInfo::executorSensorHint enum ExecutorRole ExecutorRegisterInfo::executorRole ``` -**描述:** +**描述:** 执行器角色[ExecutorRole](_hdf_user_auth.md#executorrole)。 -### executorMatcher +### executorSensorHint ``` -unsigned int ExecutorRegisterInfo::executorMatcher +unsigned int ExecutorRegisterInfo::executorSensorHint ``` -**描述:** +**描述:** -执行器匹配器,根据执行器支持的认证能力进行分类。 +既定用户认证凭据类型的执行器传感器提示,用于找到对应认证方式的传感器。 ### publicKey @@ -103,6 +103,6 @@ unsigned int ExecutorRegisterInfo::executorMatcher unsigned char [] ExecutorRegisterInfo::publicKey ``` -**描述:** +**描述:** 执行器公钥,用于校验该执行器私钥签名的信息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_executor_send_msg.md b/zh-cn/device-dev/reference/hdi-apis/_executor_send_msg.md index ba9ea1bf58db81a19ebdff5a34eb0a5e0031563f..415e5d0da81e31f64ec9c5b92636a2cc64ca868a 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_executor_send_msg.md +++ b/zh-cn/device-dev/reference/hdi-apis/_executor_send_msg.md @@ -1,60 +1,52 @@ # ExecutorSendMsg -## **概述** +## 概述 执行器发送的消息。 -**Since:** - +**Since:** 3.2 - -**Version:** - +**Version:** 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [executorIndex](#executorindex) | 用户认证框架的执行器索引。 | -| [commandId](#commandid) | 消息命令ID。 | -| [msg](#msg) | 执行器发送的消息。 | +| [executorIndex](#executorindex) | unsigned long
用户认证框架的执行器索引。  | +| [commandId](#commandid) | int
消息命令ID。  | +| [msg](#msg) | unsigned char[]
执行器发送的消息。  | -## **类成员变量说明** +## 类成员变量说明 -### executorIndex +### commandId ``` -unsigned long ExecutorSendMsg::executorIndex +int ExecutorSendMsg::commandId ``` - -**描述:** - -用户认证框架的执行器索引。 +**描述:** +消息命令ID。 -### commandId +### executorIndex ``` -unsigned int ExecutorSendMsg::commandId +unsigned long ExecutorSendMsg::executorIndex ``` - -**描述:** - -消息命令ID。 +**描述:** +用户认证框架的执行器索引。 ### msg @@ -63,7 +55,5 @@ unsigned int ExecutorSendMsg::commandId ``` unsigned char [] ExecutorSendMsg::msg ``` - -**描述:** - +**描述:** 执行器发送的消息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_expand_dims.md b/zh-cn/device-dev/reference/hdi-apis/_expand_dims.md new file mode 100644 index 0000000000000000000000000000000000000000..132202d7620c4a91eb0ce4c2d215248e695927d7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_expand_dims.md @@ -0,0 +1,26 @@ +# ExpandDims + + +## 概述 + +在给定轴上为tensor添加一个额外的维度。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_EXPAND_DIMS。 + +输入: + +- x,n维tensor + +- axis,需要添加的维度的index,int32_t类型,值必须在[-dim-1,dim],且只允许常量值。 + +输出: + +- output,给定轴上添加了额外额度的算子。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_ext_data_handle.md b/zh-cn/device-dev/reference/hdi-apis/_ext_data_handle.md deleted file mode 100644 index eb120bcd201dd27759e96c7dd73872c7f004b28e..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_ext_data_handle.md +++ /dev/null @@ -1,22 +0,0 @@ -# ExtDataHandle - - -## **概述** - -扩展数据句柄结构体定义。 - -**相关模块:** - -[Display](_display.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [fd](_display.md#fd) | 句柄fd,-1代表不支持。 | -| [reserveInts](_display.md#reserveints) | reserve数组的个数。 | -| [reserve](_display.md#reserve) [0] | reserve数组。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_face_auth_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_face_auth_types_8idl.md index 580e403779f4246547b52d2e90534a6c230ad0ae..77e033bd74b7bb7b716e1ae314f7f7c69530f882 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_face_auth_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_face_auth_types_8idl.md @@ -1,43 +1,43 @@ # FaceAuthTypes.idl -## **概述** +## 概述 定义人脸认证驱动的枚举类和数据结构。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfFaceAuth](_hdf_face_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ExecutorInfo](_executor_info.md) | 执行器信息。 | -| [TemplateInfo](_template_info.md) | 凭据模版信息。 | +| [ExecutorInfo](_executor_info_faceauth.md) | struct
执行器信息。 | +| [TemplateInfo](_template_info_faceauth.md) | struct
凭据模版信息。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [AuthType](_hdf_face_auth.md#authtype): int { PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | -| [ExecutorRole](_hdf_face_auth.md#executorrole): int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | -| [ExecutorSecureLevel](_hdf_face_auth.md#executorsecurelevel): int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | -| [CommandId](_hdf_face_auth.md#commandid): int { LOCK_TEMPLATE = 1, UNLOCK_TEMPLATE = 2, VENDOR_COMMAND_BEGIN = 10000 } | 枚举人脸认证功能相关操作命令。 | -| [FaceTipsCode](_hdf_face_auth.md#facetipscode): int { FACE_AUTH_TIP_TOO_BRIGHT = 1, FACE_AUTH_TIP_TOO_DARK = 2, FACE_AUTH_TIP_TOO_CLOSE = 3, FACE_AUTH_TIP_TOO_FAR = 4,   FACE_AUTH_TIP_TOO_HIGH = 5, FACE_AUTH_TIP_TOO_LOW = 6, FACE_AUTH_TIP_TOO_RIGHT = 7, FACE_AUTH_TIP_TOO_LEFT = 8,   FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, FACE_AUTH_TIP_POOR_GAZE = 10, FACE_AUTH_TIP_NOT_DETECTED = 11, VENDOR_FACE_AUTH_TIP_BEGIN = 10000 } | 枚举提示信息编码。 | +| [AuthType](_hdf_face_auth.md#authtype) : int { PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | +| [ExecutorRole](_hdf_face_auth.md#executorrole) : int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | +| [ExecutorSecureLevel](_hdf_face_auth.md#executorsecurelevel) : int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | +| [CommandId](_hdf_face_auth.md#commandid) : int { LOCK_TEMPLATE = 1, UNLOCK_TEMPLATE = 2, VENDOR_COMMAND_BEGIN = 10000 } | 枚举人脸认证功能相关操作命令。 | +| [FaceTipsCode](_hdf_face_auth.md#facetipscode) : int { FACE_AUTH_TIP_TOO_BRIGHT = 1, FACE_AUTH_TIP_TOO_DARK = 2, FACE_AUTH_TIP_TOO_CLOSE = 3, FACE_AUTH_TIP_TOO_FAR = 4,   FACE_AUTH_TIP_TOO_HIGH = 5, FACE_AUTH_TIP_TOO_LOW = 6, FACE_AUTH_TIP_TOO_RIGHT = 7, FACE_AUTH_TIP_TOO_LEFT = 8,   FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, FACE_AUTH_TIP_POOR_GAZE = 10, FACE_AUTH_TIP_NOT_DETECTED = 11, VENDOR_FACE_AUTH_TIP_BEGIN = 10000 } | 枚举提示信息编码。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径 | +| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_fill.md b/zh-cn/device-dev/reference/hdi-apis/_fill.md new file mode 100644 index 0000000000000000000000000000000000000000..fd04cd8d974358b4331af9b838cd38f3188b5688 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_fill.md @@ -0,0 +1,30 @@ +# Fill + + +## 概述 + +根据指定的维度,创建由一个标量填充的tensor。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_FILL。 + +输入: + +- value,填充的标量。 + +- shape,指定创建张量的维度。 + +输出: + +- output,填充之后的tensor。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_full_connection.md b/zh-cn/device-dev/reference/hdi-apis/_full_connection.md new file mode 100644 index 0000000000000000000000000000000000000000..d94d7bc5eccffedc80a95eeea1030a5bace3eabc --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_full_connection.md @@ -0,0 +1,98 @@ +# FullConnection + + +## 概述 + +对输入数据做全连接。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_FULL_CONNECTION。 + +参数限制:useAxis为true的时候axis必须设置,useAxis为false的时候axis为0。 + +输入: + +- x,n维tensor + +- weight,全连接的权重张量。 + +- bias,全连接的偏置,在量化场景下不需要量化参数,其量化版本要求输入 int32 类型数据,实际量化参数由 x 和 weight 共同决定。 + +输出: + +- output,输出运算后的张量。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [hasBias](#hasbias) | boolean
是否使用bias。 | +| [useAxis](#useaxis) | boolean
是否使用轴。 | +| [axis](#axis) | long
指定输入张量做全连接的轴,从指定轴axis开始,将axis和axis之后的轴展开成1维张量之后再做全连接。 | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType FullConnection::activationType +``` + +**描述:** + +激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 + + +### axis + + +``` +long FullConnection::axis +``` + +**描述:** + +指定输入张量做全连接的轴,从指定轴axis开始,将axis和axis之后的轴展开成1维张量之后再做全连接。 + + +### hasBias + + +``` +boolean FullConnection::hasBias +``` + +**描述:** + +是否使用bias。 + + +### useAxis + + +``` +boolean FullConnection::useAxis +``` + +**描述:** + +是否使用轴。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_fused_batch_norm.md b/zh-cn/device-dev/reference/hdi-apis/_fused_batch_norm.md new file mode 100644 index 0000000000000000000000000000000000000000..a0d68de8b4900329f26e84aae1aa08b1a75a65c1 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_fused_batch_norm.md @@ -0,0 +1,55 @@ +# FusedBatchNorm + + +## 概述 + +对一个tensor进行批标准化的运算。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_FUSED_BATCH_NORM。 + +输入: + +- x,n维tensor,要求形状为[N,...,C],即第n维是通道数(channel)。 + +- scale,缩放因子的1D张量,用于缩放归一化的第一个张量。 + +- offset,用于偏移的1D张量,以移动到归一化的第一个张量。 + +- mean,总体均值的一维张量,仅用于推理;对于训练,必须为空。 + +- variance,用于总体方差的一维张量。仅用于推理;对于训练,必须为空。 + +输出: + +- output,输出运算后的张量。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [epsilon](#epsilon) | float
趋于零的极小值,用于保证除数不为0。  | + + +## 类成员变量说明 + + +### epsilon + + +``` +float FusedBatchNorm::epsilon +``` +**描述:** +趋于零的极小值,用于保证除数不为0。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_gather.md b/zh-cn/device-dev/reference/hdi-apis/_gather.md new file mode 100644 index 0000000000000000000000000000000000000000..1d314e4b5a18709989a7624079ca406815bbdfef --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_gather.md @@ -0,0 +1,28 @@ +# Gather + + +## 概述 + +根据指定的索引和轴返回输入tensor的切片。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_GATHER。 + +输入: + +- x,n维tensor。 + +- inputIndices,指定输入x在axis上的索引,是一个int类型的数组,值必须在[0,x.shape[axis])范围内。 + +- axis,指定x被切片的轴,int32_t类型的数组,数组长度为1。 + +输出: + +- output,输出切片后的tensor。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_geo_location_info.md b/zh-cn/device-dev/reference/hdi-apis/_geo_location_info.md new file mode 100644 index 0000000000000000000000000000000000000000..062cef440bd0b4f8a6bb9fbee64b38737b447191 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_geo_location_info.md @@ -0,0 +1,112 @@ +# GeoLocationInfo + + +## 概述 + +定义设备具体位置信息的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [flags](#flags) | unsigned short
bit0表示经纬度是否有效,bit5表示精度是否有效。0表示无效,1表示有效。  | +| [latitude](#latitude) | double
纬度  | +| [longitude](#longitude) | double
经度  | +| [altitude](#altitude) | double
海拔高度,单位米  | +| [accuracy](#accuracy) | float
精度,单位米  | +| [speed](#speed) | float
移动速度,单位米/秒  | +| [bearing](#bearing) | float
导向  | +| [timeStamp](#timestamp) | long
时间戳,单位纳秒  | + + +## 类成员变量说明 + + +### accuracy + + +``` +float GeoLocationInfo::accuracy +``` +**描述:** +精度,单位米 + + +### altitude + + +``` +double GeoLocationInfo::altitude +``` +**描述:** +海拔高度,单位米 + + +### bearing + + +``` +float GeoLocationInfo::bearing +``` +**描述:** +导向 + + +### flags + + +``` +unsigned short GeoLocationInfo::flags +``` +**描述:** +bit0表示经纬度是否有效,bit5表示精度是否有效。0表示无效,1表示有效。 + + +### latitude + + +``` +double GeoLocationInfo::latitude +``` +**描述:** +纬度 + + +### longitude + + +``` +double GeoLocationInfo::longitude +``` +**描述:** +经度 + + +### speed + + +``` +float GeoLocationInfo::speed +``` +**描述:** +移动速度,单位米/秒 + + +### timeStamp + + +``` +long GeoLocationInfo::timeStamp +``` +**描述:** +时间戳,单位纳秒 diff --git a/zh-cn/device-dev/reference/hdi-apis/_geofence_cell_info.md b/zh-cn/device-dev/reference/hdi-apis/_geofence_cell_info.md new file mode 100644 index 0000000000000000000000000000000000000000..50dafd2ba54be30f7235d181f347507500f44291 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_geofence_cell_info.md @@ -0,0 +1,52 @@ +# GeofenceCellInfo + + +## 概述 + +定义设备驻留的基站小区信息的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [cell](#cell) | struct [CurrentCell](_current_cell.md)
设备驻留的基站主区信息。详见[CurrentCell](_current_cell.md)。 | +| [neighborCells](#neighborcells) | struct [NeighborCell](_neighbor_cell.md)[]
设备驻留的基站邻区信息。详见[NeighborCell](_neighbor_cell.md)。 | + + +## 类成员变量说明 + + +### cell + + +``` +struct CurrentCell GeofenceCellInfo::cell +``` + +**描述:** + +设备驻留的基站主区信息。详见[CurrentCell](_current_cell.md)。 + + +### neighborCells + + +``` +struct NeighborCell [] GeofenceCellInfo::neighborCells +``` + +**描述:** + +设备驻留的基站邻区信息。详见[NeighborCell](_neighbor_cell.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_geofence_circle_request.md b/zh-cn/device-dev/reference/hdi-apis/_geofence_circle_request.md new file mode 100644 index 0000000000000000000000000000000000000000..999f5ae0c22535e48540aa2884f5b82a8f02dcca --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_geofence_circle_request.md @@ -0,0 +1,117 @@ +# GeofenceCircleRequest + + +## 概述 + +定义添加圆形地理围栏的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [geofenceId](#geofenceid) | int
地理围栏的ID号,用于标识某个地理围栏,不可重复添加相同ID号的围栏。 | +| [point](#point) | struct [Point](_point.md)
圆形地理围栏的中心点坐标。详见[Point](_point.md)。 | +| [radius](#radius) | double
圆形地理围栏的半径,单位为米。 | +| [accuracy](#accuracy) | unsigned short
圆形地理围栏的精度。详见[GeofenceAccuracy](_hdi_lpfence_geofence.md#geofenceaccuracy)。 | +| [loiterTimeMs](#loitertimems) | unsigned int
徘徊时间,单位为毫秒,需关注[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。若设备在圆形围栏内徘徊时间达到该值,则上报[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。 | +| [monitorTransitions](#monitortransitions) | unsigned char
关注的圆形围栏事件,若设备满足关注的事件则会进行上报。详见[GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition)。 | +| [attribute](#attribute) | unsigned int
设置圆形地理围栏。详见[GeofenceAttribute](_hdi_lpfence_geofence.md#geofenceattribute)。 | + + +## 类成员变量说明 + + +### accuracy + + +``` +unsigned short GeofenceCircleRequest::accuracy +``` + +**描述:** + +圆形地理围栏的精度。详见[GeofenceAccuracy](_hdi_lpfence_geofence.md#geofenceaccuracy)。 + + +### attribute + + +``` +unsigned int GeofenceCircleRequest::attribute +``` + +**描述:** + +设置圆形地理围栏。详见[GeofenceAttribute](_hdi_lpfence_geofence.md#geofenceattribute)。 + + +### geofenceId + + +``` +int GeofenceCircleRequest::geofenceId +``` + +**描述:** + +地理围栏的ID号,用于标识某个地理围栏,不可重复添加相同ID号的围栏。 + + +### loiterTimeMs + + +``` +unsigned int GeofenceCircleRequest::loiterTimeMs +``` + +**描述:** + +徘徊时间,单位为毫秒,需关注[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。若设备在圆形围栏内徘徊时间达到该值,则上报[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。 + + +### monitorTransitions + + +``` +unsigned char GeofenceCircleRequest::monitorTransitions +``` + +**描述:** + +关注的圆形围栏事件,若设备满足关注的事件则会进行上报。详见[GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition)。 + + +### point + + +``` +struct Point GeofenceCircleRequest::point +``` + +**描述:** + +圆形地理围栏的中心点坐标。详见[Point](_point.md)。 + + +### radius + + +``` +double GeofenceCircleRequest::radius +``` + +**描述:** + +圆形地理围栏的半径,单位为米。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_geofence_polygon_request.md b/zh-cn/device-dev/reference/hdi-apis/_geofence_polygon_request.md new file mode 100644 index 0000000000000000000000000000000000000000..001ed2293689e838aca6913b46f0f76eb038e3b4 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_geofence_polygon_request.md @@ -0,0 +1,104 @@ +# GeofencePolygonRequest + + +## 概述 + +定义添加多边形地理围栏的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [geofenceId](#geofenceid) | int
地理围栏的ID号,用于标识某个地理围栏,不可重复添加相同ID号的围栏。 | +| [points](#points) | struct [Point](_point.md)[]
多边形地理围栏的边界坐标,仅支持凸多边形。详见[Point](_point.md)。 | +| [accuracy](#accuracy) | unsigned short
多边形地理围栏的精度。详见[GeofenceAccuracy](_hdi_lpfence_geofence.md#geofenceaccuracy)。 | +| [loiterTimeMs](#loitertimems) | unsigned int
徘徊时间,单位为毫秒,需关注[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。若设备在多边形围栏内徘徊时间达到该值,则上报[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。 | +| [monitorTransitions](#monitortransitions) | unsigned char
关注的多边形围栏事件,若设备满足关注的事件则会进行上报。详见[GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition)。 | +| [attribute](#attribute) | unsigned int
设置多边形地理围栏。详见[GeofenceAttribute](_hdi_lpfence_geofence.md#geofenceattribute)。 | + + +## 类成员变量说明 + + +### accuracy + + +``` +unsigned short GeofencePolygonRequest::accuracy +``` + +**描述:** + +多边形地理围栏的精度。详见[GeofenceAccuracy](_hdi_lpfence_geofence.md#geofenceaccuracy)。 + + +### attribute + + +``` +unsigned int GeofencePolygonRequest::attribute +``` + +**描述:** + +设置多边形地理围栏。详见[GeofenceAttribute](_hdi_lpfence_geofence.md#geofenceattribute)。 + + +### geofenceId + + +``` +int GeofencePolygonRequest::geofenceId +``` + +**描述:** + +地理围栏的ID号,用于标识某个地理围栏,不可重复添加相同ID号的围栏。 + + +### loiterTimeMs + + +``` +unsigned int GeofencePolygonRequest::loiterTimeMs +``` + +**描述:** + +徘徊时间,单位为毫秒,需关注[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。若设备在多边形围栏内徘徊时间达到该值,则上报[GEOFENCE_TRANSITION_DWELL](_hdi_lpfence_geofence.md#geofencetransition)事件。 + + +### monitorTransitions + + +``` +unsigned char GeofencePolygonRequest::monitorTransitions +``` + +**描述:** + +关注的多边形围栏事件,若设备满足关注的事件则会进行上报。详见[GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition)。 + + +### points + + +``` +struct Point [] GeofencePolygonRequest::points +``` + +**描述:** + +多边形地理围栏的边界坐标,仅支持凸多边形。详见[Point](_point.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_geofence_result.md b/zh-cn/device-dev/reference/hdi-apis/_geofence_result.md new file mode 100644 index 0000000000000000000000000000000000000000..cff40f4929c0828c94b8855c9708754f0b0cb649 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_geofence_result.md @@ -0,0 +1,46 @@ +# GeofenceResult + + +## 概述 + +定义添加或删除地理围栏执行结果的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [geofenceId](#geofenceid) | int
地理围栏的ID号。  | +| [result](#result) | int
返回值。0表示操作成功,负数表示操作失败。  | + + +## 类成员变量说明 + + +### geofenceId + + +``` +int GeofenceResult::geofenceId +``` +**描述:** +地理围栏的ID号。 + + +### result + + +``` +int GeofenceResult::result +``` +**描述:** +返回值。0表示操作成功,负数表示操作失败。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_geofence_size.md b/zh-cn/device-dev/reference/hdi-apis/_geofence_size.md new file mode 100644 index 0000000000000000000000000000000000000000..477d8a345ffa45ea455d957365a572a5e5746e38 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_geofence_size.md @@ -0,0 +1,68 @@ +# GeofenceSize + + +## 概述 + +定义地理围栏使用信息的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [circleMaxNum](#circlemaxnum) | unsigned int
设备支持添加圆形围栏的最大个数。  | +| [polygonMaxNum](#polygonmaxnum) | unsigned int
设备支持添加多边形围栏的最大个数。  | +| [circleUsedNum](#circleusednum) | unsigned int
设备当前已添加的圆形围栏个数。  | +| [polygonUsedNum](#polygonusednum) | unsigned int
设备当前已添加的多边形围栏个数。  | + + +## 类成员变量说明 + + +### circleMaxNum + + +``` +unsigned int GeofenceSize::circleMaxNum +``` +**描述:** +设备支持添加圆形围栏的最大个数。 + + +### circleUsedNum + + +``` +unsigned int GeofenceSize::circleUsedNum +``` +**描述:** +设备当前已添加的圆形围栏个数。 + + +### polygonMaxNum + + +``` +unsigned int GeofenceSize::polygonMaxNum +``` +**描述:** +设备支持添加多边形围栏的最大个数。 + + +### polygonUsedNum + + +``` +unsigned int GeofenceSize::polygonUsedNum +``` +**描述:** +设备当前已添加的多边形围栏个数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_geofence_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_geofence_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..98122f104b5fc80780f9f4c7967c0bdb8a0231cf --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_geofence_types_8idl.md @@ -0,0 +1,56 @@ +# GeofenceTypes.idl + + +## 概述 + +定义地理围栏使用的数据类型。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [Point](_point.md) | struct
定义位置坐标的数据结构。 | +| [GeofenceCircleRequest](_geofence_circle_request.md) | struct
定义添加圆形地理围栏的数据结构。 | +| [GeofencePolygonRequest](_geofence_polygon_request.md) | struct
定义添加多边形地理围栏的数据结构。 | +| [GeofenceResult](_geofence_result.md) | struct
定义添加或删除地理围栏执行结果的数据结构。 | +| [OfflineDb](_offline_db.md) | struct
定义下发基站离线数据库的数据结构。 | +| [GeoLocationInfo](_geo_location_info.md) | struct
定义设备具体位置信息的数据结构。 | +| [GeofenceSize](_geofence_size.md) | struct
定义地理围栏使用信息的数据结构。 | +| [CurrentCell](_current_cell.md) | struct
定义设备驻留的基站主区信息的数据结构。 | +| [NeighborCell](_neighbor_cell.md) | struct
定义设备驻留的基站邻区信息的数据结构。 | +| [GeofenceCellInfo](_geofence_cell_info.md) | struct
定义设备驻留的基站小区信息的数据结构。 | +| [RequestCellDb](_request_cell_db.md) | struct
定义请求基站离线数据库数据的数据结构。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition) {
GEOFENCE_TRANSITION_ENTERED = (1 << 0) , GEOFENCE_TRANSITION_EXITED = (1 << 1) , GEOFENCE_TRANSITION_UNCERTAIN = (1 << 2) , GEOFENCE_TRANSITION_DWELL = (1 << 3) ,
GEOFENCE_TRANSITION_INDOOR = (1 << 4) , GEOFENCE_TRANSITION_OUTDOOR = (1 << 5)
} | 枚举可关注的地理围栏状态事件。 | +| [GeofenceAttribute](_hdi_lpfence_geofence.md#geofenceattribute) { GEOFENCE_ATTRI_COORDINATE_WGS84 = 16 } | 枚举地理围栏支持的设置项。 | +| [GeofenceAccuracy](_hdi_lpfence_geofence.md#geofenceaccuracy) { ACCURACY_FINE = 1 , ACCURACY_BALANCE = 2 , ACCURACY_COARSE = 3 } | 枚举地理围栏支持的精度模式。 | +| [GeofenceCellType](_hdi_lpfence_geofence.md#geofencecelltype) { GEOFENCE_CELL_G4 = 0 , GEOFENCE_CELL_NR = 1 } | 枚举移动通信技术代。 | +| [GeofenceLocSource](_hdi_lpfence_geofence.md#geofencelocsource) {
GEOFENCE_GNSS = 1 , GEOFENCE_WIFI = 2 , GEOFENCE_SENSOR = 4 , GEOFENCE_CELL = 8 ,
GEOFENCE_BT = 16
} | 枚举位置信息来源。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.geofence.v1_0 | 地理围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_get_buffer_handle_usage_params.md b/zh-cn/device-dev/reference/hdi-apis/_get_buffer_handle_usage_params.md index da5ba0c838ea4dd4d13bf64034bddf6e2697a401..89ce997b4a305094ee25c2b027ad3f93d0b3e2ca 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_get_buffer_handle_usage_params.md +++ b/zh-cn/device-dev/reference/hdi-apis/_get_buffer_handle_usage_params.md @@ -1,29 +1,29 @@ # GetBufferHandleUsageParams -## **概述** +## 概述 BufferHandleUsage类型定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [size](#size) | 结构体大小。 | -| [version](#version) | 组件版本信息。 | -| [portIndex](#portindex) | 端口索引。 | -| [usage](#usage) | 申请内存的使用场景。 | +| [size](#size) | uint32_t
结构体大小。  | +| [version](#version) | union OMX_VERSIONTYPE
组件版本信息。  | +| [portIndex](#portindex) | uint32_t
端口索引。  | +| [usage](#usage) | uint32_t
申请内存的使用场景。  | -## **类成员变量说明** +## 类成员变量说明 ### portIndex @@ -32,9 +32,7 @@ BufferHandleUsage类型定义。 ``` uint32_t GetBufferHandleUsageParams::portIndex ``` - -**描述:** - +**描述:** 端口索引。 @@ -44,9 +42,7 @@ uint32_t GetBufferHandleUsageParams::portIndex ``` uint32_t GetBufferHandleUsageParams::size ``` - -**描述:** - +**描述:** 结构体大小。 @@ -56,9 +52,7 @@ uint32_t GetBufferHandleUsageParams::size ``` uint32_t GetBufferHandleUsageParams::usage ``` - -**描述:** - +**描述:** 申请内存的使用场景。 @@ -68,7 +62,5 @@ uint32_t GetBufferHandleUsageParams::usage ``` union OMX_VERSIONTYPE GetBufferHandleUsageParams::version ``` - -**描述:** - +**描述:** 组件版本信息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_get_clip_result.md b/zh-cn/device-dev/reference/hdi-apis/_get_clip_result.md new file mode 100644 index 0000000000000000000000000000000000000000..b97df3b0a7a28830ba6d6ef2fc0bd7a9700a2b55 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_get_clip_result.md @@ -0,0 +1,61 @@ +# GetClipResult + + +## 概述 + +主叫号码显示结果信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [result](#result) | int
查询结果,具体查看[RilErrType](_ril.md#rilerrtype) | +| [action](#action) | int
禁止或使能CLIP(Calling line Identification Presentation Supplementary Service)功能  | +| [clipStat](#clipstat) | int
CLIP业务在网络的签约状态 | + + +## 类成员变量说明 + + +### action + + +``` +int GetClipResult::action +``` +**描述:** +禁止或使能CLIP(Calling line Identification Presentation Supplementary Service)功能 + + +### clipStat + + +``` +int GetClipResult::clipStat +``` +**描述:** +CLIP业务在网络的签约状态 + +- 0:CLIP业务未提供 + +- 1:CLIP业务已提供 + +- 2:未知(网络原因) + + +### result + + +``` +int GetClipResult::result +``` +**描述:** +查询结果,具体查看[RilErrType](_ril.md#rilerrtype) diff --git a/zh-cn/device-dev/reference/hdi-apis/_get_clir_result.md b/zh-cn/device-dev/reference/hdi-apis/_get_clir_result.md new file mode 100644 index 0000000000000000000000000000000000000000..d127bb94cb44893cc3f56034bddabea05d1bc19c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_get_clir_result.md @@ -0,0 +1,65 @@ +# GetClirResult + + +## 概述 + +主叫号码显示限制结果信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [result](#result) | int
查询结果,具体查看[RilErrType](_ril.md#rilerrtype) | +| [action](#action) | int
禁止或使能CLIR功能  | +| [clirStat](#clirstat) | int
CLIR业务在网络的签约状态。 | + + +## 类成员变量说明 + + +### action + + +``` +int GetClirResult::action +``` +**描述:** +禁止或使能CLIR功能 + + +### clirStat + + +``` +int GetClirResult::clirStat +``` +**描述:** +CLIR业务在网络的签约状态。 + +- 0:CLIR业务未提供 + +- 1:CLIR业务以永久模式提供 + +- 2:未知(网络原因) + +- 3:CLIR业务临时限制 + +- 4:CLIR业务临时允许 + + +### result + + +``` +int GetClirResult::result +``` +**描述:** +查询结果,具体查看[RilErrType](_ril.md#rilerrtype) diff --git a/zh-cn/device-dev/reference/hdi-apis/_gfx_funcs.md b/zh-cn/device-dev/reference/hdi-apis/_gfx_funcs.md index fcc1c2a22e5cb89102134fe227a7c38a29c82ac2..00d762d69650981dd67e427bb83b281387114b40 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_gfx_funcs.md +++ b/zh-cn/device-dev/reference/hdi-apis/_gfx_funcs.md @@ -1,7 +1,7 @@ # GfxFuncs -## **概述** +## 概述 显示硬件加速驱动接口结构体,定义硬件加速驱动接口函数指针。 @@ -10,24 +10,24 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([InitGfx](#initgfx))(void) | 初始化硬件加速。 | -| ([DeinitGfx](#deinitgfx))(void) | 去初始化硬件加速。 | -| ([FillRect](#fillrect))(ISurface \*surface, IRect \*rect, uint32_t color, GfxOpt \*opt) | 填充矩形,用一种颜色填充画布上指定矩形区域的矩形框。 | -| ([DrawRectangle](#drawrectangle))(ISurface \*surface, Rectangle \*rect, uint32_t color, GfxOpt \*opt) | 绘制矩形框,用一种颜色在画布上绘制指定区域的矩形框。 | -| ([DrawLine](#drawline))(ISurface \*surface, ILine \*line, GfxOpt \*opt) | 绘制直线,使用一种颜色在画布上绘制一条直线。 | -| ([DrawCircle](#drawcircle))(ISurface \*surface, ICircle \*circle, GfxOpt \*opt) | 绘制圆形,使用一种颜色在画布上绘制指定圆心和半径的圆。 | -| ([Blit](#blit))(ISurface \*srcSurface, IRect \*srcRect, ISurface \*dstSurface, IRect \*dstRect, GfxOpt \*opt) | 位图搬移 | -| ([Sync](#sync))(int32_t timeOut) | 硬件加速同步。 | +| (\* [InitGfx](#initgfx) )(void) | int32_t
初始化硬件加速。 | +| (\* [DeinitGfx](#deinitgfx) )(void) | int32_t
去初始化硬件加速。 | +| (\* [FillRect](#fillrect) )([ISurface](_i_surface.md) \*surface, [IRect](_i_rect.md) \*rect, uint32_t color, [GfxOpt](_gfx_opt.md) \*opt) | int32_t
填充矩形,用一种颜色填充画布上指定矩形区域的矩形框。 | +| (\* [DrawRectangle](#drawrectangle) )([ISurface](_i_surface.md) \*surface, [Rectangle](_rectangle.md) \*rect, uint32_t color, [GfxOpt](_gfx_opt.md) \*opt) | int32_t
绘制矩形框,用一种颜色在画布上绘制指定区域的矩形框。 | +| (\* [DrawLine](#drawline) )([ISurface](_i_surface.md) \*surface, [ILine](_i_line.md) \*line, [GfxOpt](_gfx_opt.md) \*opt) | int32_t
绘制直线,使用一种颜色在画布上绘制一条直线。 | +| (\* [DrawCircle](#drawcircle) )([ISurface](_i_surface.md) \*surface, [ICircle](_i_circle.md) \*circle, [GfxOpt](_gfx_opt.md) \*opt) | int32_t
绘制圆形,使用一种颜色在画布上绘制指定圆心和半径的圆。 | +| (\* [Blit](#blit) )([ISurface](_i_surface.md) \*srcSurface, [IRect](_i_rect.md) \*srcRect, [ISurface](_i_surface.md) \*dstSurface, [IRect](_i_rect.md) \*dstRect, [GfxOpt](_gfx_opt.md) \*opt) | int32_t
位图搬移 | +| (\* [Sync](#sync) )(int32_t timeOut) | int32_t
硬件加速同步。 | -## **类成员变量说明** +## 类成员变量说明 ### Blit @@ -37,9 +37,9 @@ int32_t(* GfxFuncs::Blit) (ISurface *srcSurface, IRect *srcRect, ISurface *dstSurface, IRect *dstRect, GfxOpt *opt) ``` -**描述:** +**描述:** -位图搬移。 +位图搬移 在位图搬移过程中,可以实现色彩空间转换、缩放、旋转等功能。 @@ -67,7 +67,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GfxFuncs::DeinitGfx) (void) ``` -**描述:** +**描述:** 去初始化硬件加速。 @@ -89,7 +89,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GfxFuncs::DrawCircle) (ISurface *surface, ICircle *circle, GfxOpt *opt) ``` -**描述:** +**描述:** 绘制圆形,使用一种颜色在画布上绘制指定圆心和半径的圆。 @@ -115,7 +115,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GfxFuncs::DrawLine) (ISurface *surface, ILine *line, GfxOpt *opt) ``` -**描述:** +**描述:** 绘制直线,使用一种颜色在画布上绘制一条直线。 @@ -141,7 +141,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GfxFuncs::DrawRectangle) (ISurface *surface, Rectangle *rect, uint32_t color, GfxOpt *opt) ``` -**描述:** +**描述:** 绘制矩形框,用一种颜色在画布上绘制指定区域的矩形框。 @@ -168,7 +168,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GfxFuncs::FillRect) (ISurface *surface, IRect *rect, uint32_t color, GfxOpt *opt) ``` -**描述:** +**描述:** 填充矩形,用一种颜色填充画布上指定矩形区域的矩形框。 @@ -195,7 +195,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GfxFuncs::InitGfx) (void) ``` -**描述:** +**描述:** 初始化硬件加速。 @@ -217,7 +217,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GfxFuncs::Sync) (int32_t timeOut) ``` -**描述:** +**描述:** 硬件加速同步。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_gfx_opt.md b/zh-cn/device-dev/reference/hdi-apis/_gfx_opt.md index a278028b82892474e27285b6f08fcfc9a72c3cd4..8857c31f6fdd1793fc4d570fd4d02e0fc6640ca0 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_gfx_opt.md +++ b/zh-cn/device-dev/reference/hdi-apis/_gfx_opt.md @@ -1,7 +1,7 @@ # GfxOpt -## **概述** +## 概述 图像硬件加速相关的操作选项结构体定义,用于图像硬件加速时的操作选项。 @@ -10,21 +10,21 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [enGlobalAlpha](_display.md#englobalalpha-22) | 全局Alpha使能标志 | -| [globalAlpha](_display.md#globalalpha) | 全局Alpha的值 | -| [enPixelAlpha](_display.md#enpixelalpha-22) | 像素Alpha使能标志 | -| [blendType](_display.md#blendtype) | 混合方式 | -| [colorKeyFrom](_display.md#colorkeyfrom) | 色键模式 | -| [enableRop](_display.md#enablerop) | Rop功能使能位 | -| [colorRopType](_display.md#colorroptype) | 颜色的Rop类型 | -| [alphaRopType](_display.md#alpharoptype) | Alpha的Rop类型 | -| [enableScale](_display.md#enablescale) | 缩放功能使能位 | -| [rotateType](_display.md#rotatetype) | 旋转类型 | -| [mirrorType](_display.md#mirrortype) | 镜像类型 | +| [enGlobalAlpha](_display.md#englobalalpha-22) | bool
全局alpha使能位 | +| [globalAlpha](_display.md#globalalpha) | uint32_t
全局alpha的值 | +| [enPixelAlpha](_display.md#enpixelalpha-22) | bool
像素alpha使能位 | +| [blendType](_display.md#blendtype) | [BlendType](_display.md#blendtype)
混合方式 | +| [colorKeyFrom](_display.md#colorkeyfrom) | [ColorKey](_display.md#colorkey)
色键模式 | +| [enableRop](_display.md#enablerop) | bool
Rop功能使能位 | +| [colorRopType](_display.md#colorroptype) | [RopType](_display.md#roptype)
颜色的Rop类型 | +| [alphaRopType](_display.md#alpharoptype) | [RopType](_display.md#roptype)
Alpha的Rop类型 | +| [enableScale](_display.md#enablescale) | bool
缩放功能使能位 | +| [rotateType](_display.md#rotatetype) | [TransformType](_display.md#transformtype)
旋转类型 | +| [mirrorType](_display.md#mirrortype) | [MirrorType](_display.md#mirrortype)
镜像类型 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_gralloc_funcs.md b/zh-cn/device-dev/reference/hdi-apis/_gralloc_funcs.md index db86f4424e237c419c2860fd1e64b4f50feeb2b1..92de3a807fc81dcfb677a9d56ca93bb79d76c7fb 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_gralloc_funcs.md +++ b/zh-cn/device-dev/reference/hdi-apis/_gralloc_funcs.md @@ -1,7 +1,7 @@ # GrallocFuncs -## **概述** +## 概述 显示内存驱动接口结构体,定义显示内存驱动接口函数指针。 @@ -10,26 +10,26 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([AllocMem](#allocmem))(const AllocInfo \*info, BufferHandle \*\*handle) | 显示内存分配。 | -| ([FreeMem](#freemem))(BufferHandle \*handle) | 显示内存释放。 | -| ([Mmap](#mmap))(BufferHandle \*handle) | 显示内存映射,将内存映射到对应的进程地址空间中。 | -| ([MmapYUV](#mmapyuv))(BufferHandle \*handle, YUVDescInfo \*info) | YUV 内存映射。 | -| ([MmapCache](#mmapcache))(BufferHandle \*handle) | 显示内存映射,将内映射为cache内存到对应的进程地址空间中。 | -| ([Unmap](#unmap))(BufferHandle \*handle) | 内存反映射,将内存进行反映射。 | -| ([FlushCache](#flushcache))(BufferHandle \*handle) | 刷新cache,刷新cache里的内容到内存并且使cache里的内容无效。 | -| ([FlushMCache](#flushmcache))(BufferHandle \*handle) | 刷新Mmap映射的cache,刷新Mmap映射的cache里的内容到内存并且使cache里的内容无效。 | -| ([InvalidateCache](#invalidatecache))(BufferHandle \*handle) | 使cache中的内容无效用以存储更新内存内容。 | -| ([IsSupportedAlloc](#issupportedalloc))(uint32_t num, const VerifyAllocInfo \*infos, bool \*supporteds) | 检测给定的VerifyAllocInfo数组信息能否申请内存成功。 | +| (\* [AllocMem](#allocmem) )(const [AllocInfo](_alloc_info.md) \*info, BufferHandle \*\*handle) | int32_t
显示内存分配。 | +| (\* [FreeMem](#freemem) )(BufferHandle \*handle) | void
显示内存释放。 | +| (\* [Mmap](#mmap) )(BufferHandle \*handle) | void \*
显示内存映射,将内存映射到对应的进程地址空间中。 | +| (\* [MmapYUV](#mmapyuv) )(BufferHandle \*handle, YUVDescInfo \*info) | void \*
YUV 内存映射。 | +| (\* [MmapCache](#mmapcache) )(BufferHandle \*handle) | void \*
显示内存映射,将内存映射为 cache 内存到对应的进程地址空间中。 | +| (\* [Unmap](#unmap) )(BufferHandle \*handle) | int32_t
内存反映射,将内存进行反映射。 | +| (\* [FlushCache](#flushcache) )(BufferHandle \*handle) | int32_t
刷新cache,刷新cache里的内容到内存并且使cache里的内容无效。 | +| (\* [FlushMCache](#flushmcache) )(BufferHandle \*handle) | int32_t
刷新Mmap映射的cache,刷新Mmap映射的cache里的内容到内存并且使cache里的内容无效。 | +| (\* [InvalidateCache](#invalidatecache) )(BufferHandle \*handle) | int32_t
使cache中的内容无效用以存储更新内存内容。 | +| (\* [IsSupportedAlloc](#issupportedalloc) )(uint32_t num, const [VerifyAllocInfo](_verify_alloc_info.md) \*infos, bool \*supporteds) | int32_t
检测给定的VerifyAllocInfo数组信息能否申请内存成功。 | -## **类成员变量说明** +## 类成员变量说明 ### AllocMem @@ -39,7 +39,7 @@ int32_t(* GrallocFuncs::AllocMem) (const AllocInfo *info, BufferHandle **handle) ``` -**描述:** +**描述:** 显示内存分配。 @@ -66,7 +66,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GrallocFuncs::FlushCache) (BufferHandle *handle) ``` -**描述:** +**描述:** 刷新cache,刷新cache里的内容到内存并且使cache里的内容无效。 @@ -90,7 +90,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GrallocFuncs::FlushMCache) (BufferHandle *handle) ``` -**描述:** +**描述:** 刷新Mmap映射的cache,刷新Mmap映射的cache里的内容到内存并且使cache里的内容无效。 @@ -114,7 +114,7 @@ DISPLAY_SUCCESS 表示执行成功。 void(* GrallocFuncs::FreeMem) (BufferHandle *handle) ``` -**描述:** +**描述:** 显示内存释放。 @@ -136,7 +136,7 @@ void(* GrallocFuncs::FreeMem) (BufferHandle *handle) int32_t(* GrallocFuncs::InvalidateCache) (BufferHandle *handle) ``` -**描述:** +**描述:** 使cache中的内容无效用以存储更新内存内容。 @@ -160,7 +160,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* GrallocFuncs::IsSupportedAlloc) (uint32_t num, const VerifyAllocInfo *infos, bool *supporteds) ``` -**描述:** +**描述:** 检测给定的VerifyAllocInfo数组信息能否申请内存成功。 @@ -168,8 +168,8 @@ int32_t(* GrallocFuncs::IsSupportedAlloc) (uint32_t num, const VerifyAllocInfo * | 名称 | 描述 | | -------- | -------- | -| num | 输入参数,[VerifyAllocInfo](_verify_alloc_info.md)数组个数。 | -| infos | 输出参数,[VerifyAllocInfo](_verify_alloc_info.md)数组首地址。 | +| num | 输入参数,VerifyAllocInfo数组个数。 | +| infos | 输出参数,VerifyAllocInfo数组首地址。 | | supporteds | 输出参数,supporteds数组首地址, 表示能否申请成功。 | **返回:** @@ -183,10 +183,10 @@ DISPLAY_SUCCESS 表示执行成功。 ``` -void*(* GrallocFuncs::Mmap) (BufferHandle *handle) +void *(* GrallocFuncs::Mmap) (BufferHandle *handle) ``` -**描述:** +**描述:** 显示内存映射,将内存映射到对应的进程地址空间中。 @@ -205,10 +205,10 @@ void*(* GrallocFuncs::Mmap) (BufferHandle *handle) ``` -void*(* GrallocFuncs::MmapCache) (BufferHandle *handle) +void *(* GrallocFuncs::MmapCache) (BufferHandle *handle) ``` -**描述:** +**描述:** 显示内存映射,将内存映射为 cache 内存到对应的进程地址空间中。 @@ -227,10 +227,10 @@ void*(* GrallocFuncs::MmapCache) (BufferHandle *handle) ``` -void*(* GrallocFuncs::MmapYUV) (BufferHandle *handle, YUVDescInfo *info) +void *(* GrallocFuncs::MmapYUV) (BufferHandle *handle, YUVDescInfo *info) ``` -**描述:** +**描述:** YUV 内存映射。 @@ -239,7 +239,7 @@ YUV 内存映射。 | 名称 | 描述 | | -------- | -------- | | handle | 输出参数,指示内存映射的输出缓存。 | -| info | 输出参数,指示内存映射的[YUVDescInfo](_yun_desc_info_.md)信息。 | +| info | 输出参数,指示内存映射的YUVDescInfo信息。 | **返回:** @@ -253,7 +253,7 @@ YUV 内存映射。 int32_t(* GrallocFuncs::Unmap) (BufferHandle *handle) ``` -**描述:** +**描述:** 内存反映射,将内存进行反映射。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_gsm_rssi.md b/zh-cn/device-dev/reference/hdi-apis/_gsm_rssi.md new file mode 100644 index 0000000000000000000000000000000000000000..be0afa4dff064c2e0d1847bc460bca0fa2682a4e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_gsm_rssi.md @@ -0,0 +1,44 @@ +# GsmRssi + + +## 概述 + +GSM信号强度。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [rxlev](#rxlev) | int
信号接收强度,取值范围0~31  | +| [ber](#ber) | int
误码率,取值范围0~7  | + + +## 类成员变量说明 + + +### ber + + +``` +int GsmRssi::ber +``` +**描述:** +误码率,取值范围0~7 + + +### rxlev + + +``` +int GsmRssi::rxlev +``` +**描述:** +信号接收强度,取值范围0~31 diff --git a/zh-cn/device-dev/reference/hdi-apis/_gsm_sms_message_info.md b/zh-cn/device-dev/reference/hdi-apis/_gsm_sms_message_info.md new file mode 100644 index 0000000000000000000000000000000000000000..b139805bc61f0e5801b64325d27e168dd6374d0a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_gsm_sms_message_info.md @@ -0,0 +1,66 @@ +# GsmSmsMessageInfo + + +## 概述 + +发送GSM短信信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [state](#state) | int
状态  | +| [smscPdu](#smscpdu) | String
短信业务中心  | +| [pdu](#pdu) | String
协议数据单元  | + + +## 类成员变量说明 + + +### pdu + + +``` +String GsmSmsMessageInfo::pdu +``` +**描述:** +协议数据单元 + + +### serial + + +``` +int GsmSmsMessageInfo::serial +``` +**描述:** +请求的序列号 + + +### smscPdu + + +``` +String GsmSmsMessageInfo::smscPdu +``` +**描述:** +短信业务中心 + + +### state + + +``` +int GsmSmsMessageInfo::state +``` +**描述:** +状态 diff --git a/zh-cn/device-dev/reference/hdi-apis/_h_d_r_capability.md b/zh-cn/device-dev/reference/hdi-apis/_h_d_r_capability.md index a82e3058421ea0160df98b4cfcadb2c127dbf3ea..072d545829576b7ae0e0a15aa0557ca7a7b0d94e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_h_d_r_capability.md +++ b/zh-cn/device-dev/reference/hdi-apis/_h_d_r_capability.md @@ -1,24 +1,24 @@ # HDRCapability -## **概述** +## 概述 -HDR属性结构体定义。 +HDR属性结构体定义 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [formatCount](_display.md#formatcount) | 支持的HDR格式的数量 | -| [formats](_display.md#formats) | 支持的HDR格式的数组首地址 | -| [maxLum](_display.md#maxlum) | 最大的光亮度luminance值 | -| [maxAverageLum](_display.md#maxaveragelum) | 最大的平均光亮度luminance值 | -| [minLum](_display.md#minlum) | 最小的光亮度luminance值 | +| [formatCount](_display.md#formatcount) | uint32_t
支持的HDR格式的数量 | +| [formats](_display.md#formats) | [HDRFormat](_display.md#hdrformat) \*
支持的HDR格式的数组首地址 | +| [maxLum](_display.md#maxlum) | float
最大的光亮度luminance值 | +| [maxAverageLum](_display.md#maxaveragelum) | float
最大的平均光亮度luminance值 | +| [minLum](_display.md#minlum) | float
最小的光亮度luminance值 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_h_d_r_meta_data.md b/zh-cn/device-dev/reference/hdi-apis/_h_d_r_meta_data.md index 44610a551845f6df58cf94c74cf994c9dcd40e27..da86e1fa62a23b57680218416d2e1e7f7d47f360 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_h_d_r_meta_data.md +++ b/zh-cn/device-dev/reference/hdi-apis/_h_d_r_meta_data.md @@ -1,21 +1,21 @@ # HDRMetaData -## **概述** +## 概述 -HDR元数据结构体定义。 +HDR元数据结构体定义 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [key](_display.md#key) | HDR元数据关键字。 | -| [value](_display.md#value-22) | 关键字对应的值。 | +| [key](_display.md#key) | [HDRMetadataKey](_display.md#hdrmetadatakey)
HDR元数据关键字 | +| [value](_display.md#value-22) | float
关键字对应的值 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_face_auth.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_face_auth.md index 7ef609b97adf64a1cc7546e0e84012a6a6ce0f0b..83f3ff65b01826ea1ce481c69ee064fcec493ec9 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_face_auth.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_face_auth.md @@ -1,18 +1,18 @@ # HdfFaceAuth -## **概述** +## 概述 提供人脸认证驱动的标准API接口。 -人脸认证驱动为人脸认证服务提供统一的访问接口。获取人脸认证驱动代理后,人脸认证服务可以调用相关接口获取执行器,获取人脸认证执行器后, 人脸认证服务可以调用相关接口获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 +人脸认证驱动为人脸认证服务提供统一的访问接口。获取人脸认证驱动代理后,人脸认证服务可以调用相关接口获取执行器,获取人脸认证执行器后,人脸认证服务可以调用相关接口获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 -**Since:** +**Since:** 3.2 -## **汇总** +## 汇总 ### 文件 @@ -20,8 +20,8 @@ | 名称 | 描述 | | -------- | -------- | | [FaceAuthTypes.idl](_face_auth_types_8idl.md) | 定义人脸认证驱动的枚举类和数据结构。 | -| [IExecutor.idl](face__auth_2_i_executor_8idl.md) | 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 | -| [IExecutorCallback.idl](face__auth_2_i_executor_callback_8idl.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。 | +| [IExecutor.idl](_i_executor_8idl_faceauth.md) | 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 | +| [IExecutorCallback.idl](_i_executor_callback_8idl_faceauth.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。 | | [IFaceAuthInterface.idl](_i_face_auth_interface_8idl.md) | 定义获取人脸认证驱动的执行器列表接口,用于从人脸认证驱动获取执行器对象列表。 | @@ -29,32 +29,32 @@ | 名称 | 描述 | | -------- | -------- | -| [ExecutorInfo](_executor_info.md) | 执行器信息。 | -| [TemplateInfo](_template_info.md) | 凭据模版信息。 | -| [IExecutor](interface_i_executor.md) | 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 | -| [IExecutorCallback](interface_i_executor_callback.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。使用细节见[IExecutor](interface_i_executor.md)。 | -| [IFaceAuthInterface](interface_i_face_auth_interface.md) | 定义获取人脸认证驱动的执行器列表接口。 | +| [ExecutorInfo](_executor_info_faceauth.md) | struct
执行器信息。 | +| [TemplateInfo](_template_info_faceauth.md) | struct
凭据模版信息。 | +| [IExecutor](interface_i_executor_faceauth.md) | interface
定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 | +| [IExecutorCallback](interface_i_executor_callback_faceauth.md) | interface
定义异步API接口回调,用于返回异步接口的请求处理结果和信息。使用细节见[IExecutor](interface_i_executor_faceauth.md)。 | +| [IFaceAuthInterface](interface_i_face_auth_interface.md) | interface
定义获取人脸认证驱动的执行器列表接口。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [AuthType](#authtype): int { PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | -| [ExecutorRole](#executorrole): int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | -| [ExecutorSecureLevel](#executorsecurelevel): int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | -| [CommandId](#commandid): int { LOCK_TEMPLATE = 1, UNLOCK_TEMPLATE = 2, VENDOR_COMMAND_BEGIN = 10000 } | 枚举人脸认证功能相关操作命令。 | -| [FaceTipsCode](#facetipscode): int { FACE_AUTH_TIP_TOO_BRIGHT = 1, FACE_AUTH_TIP_TOO_DARK = 2, FACE_AUTH_TIP_TOO_CLOSE = 3, FACE_AUTH_TIP_TOO_FAR = 4,   FACE_AUTH_TIP_TOO_HIGH = 5, FACE_AUTH_TIP_TOO_LOW = 6, FACE_AUTH_TIP_TOO_RIGHT = 7, FACE_AUTH_TIP_TOO_LEFT = 8,   FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, FACE_AUTH_TIP_POOR_GAZE = 10, FACE_AUTH_TIP_NOT_DETECTED = 11, VENDOR_FACE_AUTH_TIP_BEGIN = 10000 } | 枚举提示信息编码。 | +| [AuthType](#authtype) : int { PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | +| [ExecutorRole](#executorrole) : int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | +| [ExecutorSecureLevel](#executorsecurelevel) : int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | +| [CommandId](#commandid) : int { LOCK_TEMPLATE = 1, UNLOCK_TEMPLATE = 2, VENDOR_COMMAND_BEGIN = 10000 } | 枚举人脸认证功能相关操作命令。 | +| [FaceTipsCode](#facetipscode) : int { FACE_AUTH_TIP_TOO_BRIGHT = 1, FACE_AUTH_TIP_TOO_DARK = 2, FACE_AUTH_TIP_TOO_CLOSE = 3, FACE_AUTH_TIP_TOO_FAR = 4,   FACE_AUTH_TIP_TOO_HIGH = 5, FACE_AUTH_TIP_TOO_LOW = 6, FACE_AUTH_TIP_TOO_RIGHT = 7, FACE_AUTH_TIP_TOO_LEFT = 8,   FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, FACE_AUTH_TIP_POOR_GAZE = 10, FACE_AUTH_TIP_NOT_DETECTED = 11, VENDOR_FACE_AUTH_TIP_BEGIN = 10000 } | 枚举提示信息编码。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径 | +| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### AuthType @@ -64,7 +64,7 @@ enum AuthType : int ``` -**描述:** +**描述:** 枚举用户认证凭据类型。 @@ -82,7 +82,7 @@ enum AuthType : int enum CommandId : int ``` -**描述:** +**描述:** 枚举人脸认证功能相关操作命令。 @@ -100,7 +100,7 @@ enum CommandId : int enum ExecutorRole : int ``` -**描述:** +**描述:** 枚举执行器角色。 @@ -118,7 +118,7 @@ enum ExecutorRole : int enum ExecutorSecureLevel : int ``` -**描述:** +**描述:** 枚举执行器安全等级。 @@ -137,7 +137,7 @@ enum ExecutorSecureLevel : int enum FaceTipsCode : int ``` -**描述:** +**描述:** 枚举提示信息编码。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_feature_info.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_feature_info.md index a70f0222d87c4633abcb243913540b3fd9b6fb97..264819bf5e2f833983c0f71affb111f7abbc0847 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_feature_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_feature_info.md @@ -1,27 +1,31 @@ # HdfFeatureInfo -## **概述** +## 概述 feature对象信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [ifName](#ifname) | feature对象的网卡名称。 | -| [type](#type) | feature对象的类型。 | +| [ifName](#ifname) | String
feature对象的网卡名称。  | +| [type](#type) | int
feature对象的类型。  | -## **类成员变量说明** +## 类成员变量说明 ### ifName @@ -30,9 +34,7 @@ feature对象信息。 ``` String HdfFeatureInfo::ifName ``` - -**描述:** - +**描述:** feature对象的网卡名称。 @@ -42,7 +44,5 @@ feature对象的网卡名称。 ``` int HdfFeatureInfo::type ``` - -**描述:** - +**描述:** feature对象的类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_color.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_color.md index 6dc7205e01de6bb66bf73bb9eebbf8c8737a0efc..e247187ce7a0a33b81b56e968f7e5863501c1bc1 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_color.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_color.md @@ -1,28 +1,32 @@ # HdfLightColor -## **概述** +## 概述 定义亮灯参数。 参数包括灯的模式设置。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [colorValue](#colorvalue) | 设置灯的模式 | +| [colorValue](#colorvalue) | union [ColorValue](union_color_value.md)
设置灯的模式, 详见[ColorValue](union_color_value.md)。  | -## **类成员变量说明** +## 类成员变量说明 ### colorValue @@ -31,7 +35,5 @@ ``` union ColorValue HdfLightColor::colorValue ``` - -**描述:** - +**描述:** 设置灯的模式, 详见[ColorValue](union_color_value.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_effect.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_effect.md index 341b2fb7f29860c5bd48a843f233b9b22516cf16..eb4b887f74f54fc1c01c7a29b76102469f6f0c80 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_effect.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_effect.md @@ -1,29 +1,37 @@ # HdfLightEffect -## **概述** +## 概述 定义灯的效果参数。 参数包括设置灯的亮度、闪烁模式。 +**Since:** + +3.1 + +**Version:** + +1.0 + **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [lightBrightness](#lightbrightness) | 亮度值。 | -| [flashEffect](#flasheffect) | 闪烁模式。 | +| [lightBrightness](#lightbrightness) | int
亮度值:Bits 24–31为扩展位,Bits 16–23为红色,Bits 8–15为绿色,Bits 0–7为蓝色。 如果字节段等于0时,灯的亮度根据HCS配置的默认亮度进行设置。 | +| [flashEffect](#flasheffect) | struct [HdfLightFlashEffect](_hdf_light_flash_effect.md)
闪烁模式。 | -## **类成员变量说明** +## 类成员变量说明 ### flashEffect @@ -33,9 +41,9 @@ struct HdfLightFlashEffect HdfLightEffect::flashEffect ``` -**描述:** +**描述:** -闪烁模式。详见**[HdfLightFlashEffect](_hdf_light_flash_effect.md)**。 +闪烁模式。详见[HdfLightFlashEffect](_hdf_light_flash_effect.md)。 ### lightBrightness @@ -45,6 +53,6 @@ struct HdfLightFlashEffect HdfLightEffect::flashEffect int HdfLightEffect::lightBrightness ``` -**描述:** +**描述:** 亮度值:Bits 24–31为扩展位,Bits 16–23为红色,Bits 8–15为绿色,Bits 0–7为蓝色。 如果字节段等于0时,灯的亮度根据HCS配置的默认亮度进行设置。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_flash_effect.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_flash_effect.md index 2d853ebaab83a9eed7c4fe87c32e706da4c0b38a..0af880b9749bb00d4479d5980acbe166f93b7789 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_flash_effect.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_flash_effect.md @@ -1,30 +1,38 @@ # HdfLightFlashEffect -## **概述** +## 概述 定义灯的闪烁参数。 这些参数包括闪烁模式以及闪烁期间指示灯的打开和关闭时间。 +**Since:** + +3.1 + +**Version:** + +1.0 + **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [flashMode](#flashmode) | 闪烁模式。 | -| [onTime](#ontime) | 表示在一个闪烁周期内灯持续点亮的时间,单位毫秒。 | -| [offTime](#offtime) | 表示在一个闪烁周期内灯持续熄灭的时间,单位毫秒。 | +| [flashMode](#flashmode) | int
闪烁模式。 | +| [onTime](#ontime) | int
表示在一个闪烁周期内灯持续点亮的时间,单位毫秒。 | +| [offTime](#offtime) | int
表示在一个闪烁周期内灯持续熄灭的时间,单位毫秒。 | -## **类成员变量说明** +## 类成员变量说明 ### flashMode @@ -34,9 +42,9 @@ int HdfLightFlashEffect::flashMode ``` -**描述:** +**描述:** -闪烁模式。详见[HdfLightFlashMode](light.md#hdflightflashmode)。 +闪烁模式。详见[HdfLightFlashMode](_light.md#hdflightflashmode)。 ### offTime @@ -46,7 +54,7 @@ int HdfLightFlashEffect::flashMode int HdfLightFlashEffect::offTime ``` -**描述:** +**描述:** 表示在一个闪烁周期内灯持续熄灭的时间,单位毫秒。 @@ -58,6 +66,6 @@ int HdfLightFlashEffect::offTime int HdfLightFlashEffect::onTime ``` -**描述:** +**描述:** 表示在一个闪烁周期内灯持续点亮的时间,单位毫秒。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_info.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_info.md index 8674b13b2368719c859becac7cc845613fbfc560..bbd9d9fa4c3d4ab68efaa5af6e7c86e2d6bccd9f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_light_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_light_info.md @@ -1,31 +1,35 @@ # HdfLightInfo -## **概述** +## 概述 定义灯的基本信息。 参数包括灯类型ID、逻辑灯的名称、逻辑控制器中物理灯的数量和自定义扩展信息。 +**Since:** +3.1 +**Version:** +1.0 **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [lightName](#lightname) | 逻辑灯的名称。 | -| [lightId](#lightid) | 灯类型ID。 | -| [lightNumber](#lightnumber) | 逻辑控制器中物理灯的数量。 | -| [reserved](#reserved) | 自定义扩展信息。 | +| [lightName](#lightname) | String
逻辑灯的名称。  | +| [lightId](#lightid) | int
灯类型ID。详见[HdfLightId](_light.md#hdflightid)。  | +| [lightNumber](#lightnumber) | int
逻辑控制器中物理灯的数量。  | +| [reserved](#reserved) | int
自定义扩展信息。  | -## **类成员变量说明** +## 类成员变量说明 ### lightId @@ -34,10 +38,8 @@ ``` int HdfLightInfo::lightId ``` - -**描述:** - -灯类型ID。详见[HdfLightId](light.md#hdflightid)。 +**描述:** +灯类型ID。详见[HdfLightId](_light.md#hdflightid)。 ### lightName @@ -46,9 +48,7 @@ int HdfLightInfo::lightId ``` String HdfLightInfo::lightName ``` - -**描述:** - +**描述:** 逻辑灯的名称。 @@ -58,9 +58,7 @@ String HdfLightInfo::lightName ``` int HdfLightInfo::lightNumber ``` - -**描述:** - +**描述:** 逻辑控制器中物理灯的数量。 @@ -70,7 +68,5 @@ int HdfLightInfo::lightNumber ``` int HdfLightInfo::reserved ``` - -**描述:** - +**描述:** 自定义扩展信息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_motion_event.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_motion_event.md index cdf6b6de73a224d141a63e61054f03cb318f0c1c..e81d7271b4d6de8a880156ebf7aeeb6f11a54f27 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_motion_event.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_motion_event.md @@ -1,32 +1,36 @@ # HdfMotionEvent -## **概述** +## 概述 上报手势识别数据结构。 上报手势识别数据事件信息包括手势识别类型、手势识别结果、手势识别状态、手势识别数据长度、手势识别数据。 +**Since:** + +3.2 + **相关模块:** -[Motion](motion.md) +[Motion](_motion.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [motion](#motion) | 手势识别类型。 | -| [result](#result) | 手势识别结果。 | -| [status](#status) | 手势识别状态。 | -| [datalen](#datalen) | 手势识别数据长度。 | -| [data](#data) | 手势识别数据。 | +| [motion](#motion) | int
手势识别类型。 | +| [result](#result) | int
手势识别结果。 | +| [status](#status) | int
手势识别状态。 | +| [datalen](#datalen) | int
手势识别数据长度。 | +| [data](#data) | int[]
手势识别数据。 | -## **类成员变量说明** +## 类成员变量说明 ### data @@ -36,7 +40,7 @@ int [] HdfMotionEvent::data ``` -**描述:** +**描述:** 手势识别数据。 @@ -48,7 +52,7 @@ int [] HdfMotionEvent::data int HdfMotionEvent::datalen ``` -**描述:** +**描述:** 手势识别数据长度。 @@ -60,7 +64,7 @@ int HdfMotionEvent::datalen int HdfMotionEvent::motion ``` -**描述:** +**描述:** 手势识别类型。 @@ -72,7 +76,7 @@ int HdfMotionEvent::motion int HdfMotionEvent::result ``` -**描述:** +**描述:** 手势识别结果。 @@ -84,6 +88,6 @@ int HdfMotionEvent::result int HdfMotionEvent::status ``` -**描述:** +**描述:** 手势识别状态。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info.md index c865bc30d915523c671a2979d1f10d2b1417c9b5..ace41fab355aa5036a3c711448fac66fdc79f006 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info.md @@ -1,30 +1,34 @@ # HdfNetDeviceInfo -## **概述** +## 概述 网络设备信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [index](#index) | 网络设备索引。 | -| [ifName](#ifname) | 网卡名称。 | -| [ifNameLen](#ifnamelen) | 网卡名称长度。 | -| [iftype](#iftype) | 网卡类型。 | -| [mac](#mac) | 网络设备MAC地址。 | +| [index](#index) | unsigned int
网络设备索引。  | +| [ifName](#ifname) | String
网卡名称。  | +| [ifNameLen](#ifnamelen) | unsigned int
网卡名称长度。  | +| [iftype](#iftype) | unsigned char
网卡类型。  | +| [mac](#mac) | unsigned char[]
网络设备MAC地址。  | -## **类成员变量说明** +## 类成员变量说明 ### ifName @@ -33,9 +37,7 @@ ``` String HdfNetDeviceInfo::ifName ``` - -**描述:** - +**描述:** 网卡名称。 @@ -45,9 +47,7 @@ String HdfNetDeviceInfo::ifName ``` unsigned int HdfNetDeviceInfo::ifNameLen ``` - -**描述:** - +**描述:** 网卡名称长度。 @@ -57,9 +57,7 @@ unsigned int HdfNetDeviceInfo::ifNameLen ``` unsigned char HdfNetDeviceInfo::iftype ``` - -**描述:** - +**描述:** 网卡类型。 @@ -69,9 +67,7 @@ unsigned char HdfNetDeviceInfo::iftype ``` unsigned int HdfNetDeviceInfo::index ``` - -**描述:** - +**描述:** 网络设备索引。 @@ -81,7 +77,5 @@ unsigned int HdfNetDeviceInfo::index ``` unsigned char [] HdfNetDeviceInfo::mac ``` - -**描述:** - +**描述:** 网络设备MAC地址。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info_result.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info_result.md index d48f209f60a14cc68c2e966173192a5018b49d5a..2abb49fec2211de047a697aa3272825689a9e425 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info_result.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_net_device_info_result.md @@ -1,26 +1,30 @@ # HdfNetDeviceInfoResult -## **概述** +## 概述 网络设备信息集合。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [deviceInfos](#deviceinfos) | 网络设备信息集合。 | +| [deviceInfos](#deviceinfos) | struct [HdfNetDeviceInfo](_hdf_net_device_info.md)[]
网络设备信息集合。  | -## **类成员变量说明** +## 类成员变量说明 ### deviceInfos @@ -29,7 +33,5 @@ ``` struct HdfNetDeviceInfo [] HdfNetDeviceInfoResult::deviceInfos ``` - -**描述:** - +**描述:** 网络设备信息集合。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_pin_auth.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_pin_auth.md index b5a0a2ce3457fe5f5a1208b51d0cf9d3933efa5f..1e2d58b8206830b3c31a4528fc5c7cc72e105f89 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_pin_auth.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_pin_auth.md @@ -1,59 +1,58 @@ # HdfPinAuth -## **概述** +## 概述 提供口令认证驱动的标准API接口。 口令认证驱动为口令认证服务提供统一的访问接口。获取口令认证驱动代理后,口令认证服务可以调用相关接口获取执行器,获取口令认证执行器后, 口令认证服务可以调用相关接口获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 -**Since:** +**Since:** 3.2 -## **汇总** +## 汇总 ### 文件 | 名称 | 描述 | | -------- | -------- | -| [IExecutor.idl](pin__auth_2_i_executor_8idl.md) | 定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 | -| [IExecutorCallback.idl](pin__auth_2_i_executor_callback_8idl.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。 | +| [IExecutor.idl](_i_executor_8idl_pinauth.md) | 定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 | +| [IExecutorCallback.idl](_i_executor_callback_8idl_pinauth.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。 | | [IPinAuthInterface.idl](_i_pin_auth_interface_8idl.md) | 定义获取口令认证驱动的执行器列表接口,用于从口令认证驱动获取执行器对象列表。 | -| [PinAuthTypes.idl](_pin_auth_types_8idl.md) | 定义口令认证驱动的枚举类和数据结构。 | ### 类 | 名称 | 描述 | | -------- | -------- | -| [IExecutor](interface_pin_i_executor.md) | 定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 | -| [IExecutorCallback](interface_pin_i_executor_callback.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。使用细节见[IExecutor](interface_pin_i_executor.md)。 | -| [IPinAuthInterface](interface_i_pin_auth_interface.md) | 定义获取口令认证驱动的执行器列表接口。 | -| [ExecutorInfo](_executor_info.md) | 执行器信息。 | -| [TemplateInfo](_template_info.md) | 凭据模版信息。 | +| [IExecutor](interface_i_executor_pinauth.md) | interface
定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 | +| [IExecutorCallback](interface_i_executor_callback_pinauth.md) | interface
定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。使用细节见[IExecutor](interface_i_executor_pinauth.md)。 | +| [IPinAuthInterface](interface_i_pin_auth_interface.md) | interface
定义获取口令认证驱动的执行器列表接口。 | +| [ExecutorInfo](_executor_info_pinauth.md) | struct
执行器信息。 | +| [TemplateInfo](_template_info_pinauth.md) | struct
凭据模版信息,口令模版在用户注册口令认证凭据时生成并存储,用于支持通过口令认证方式验证用户身份。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [AuthType](#authtype): int {   PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | -| [ExecutorRole](#executorrole): int {   COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | -| [ExecutorSecureLevel](#executorsecurelevel): int {   ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | -| [CommandId](#commandid): int { DEFAULT = 0 } | 枚举口令认证相关功能操作命令。 | +| [AuthType](#authtype) : int {   PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | +| [ExecutorRole](#executorrole) : int {   COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | +| [ExecutorSecureLevel](#executorsecurelevel) : int {   ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | +| [CommandId](#commandid) : int { DEFAULT = 0 } | 枚举口令认证相关功能操作命令。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径 | +| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### AuthType @@ -63,7 +62,7 @@ enum AuthType : int ``` -**描述:** +**描述:** 枚举用户认证凭据类型。 @@ -81,7 +80,7 @@ enum AuthType : int enum CommandId : int ``` -**描述:** +**描述:** 枚举口令认证相关功能操作命令。 @@ -97,7 +96,7 @@ enum CommandId : int enum ExecutorRole : int ``` -**描述:** +**描述:** 枚举执行器角色。 @@ -115,7 +114,7 @@ enum ExecutorRole : int enum ExecutorSecureLevel : int ``` -**描述:** +**描述:** 枚举执行器安全等级。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_events.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_events.md index e736441a261b43df836741365219889894a43d75..bee809490b418c65e62431aebeee3e13e89c1e6e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_events.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_events.md @@ -1,34 +1,38 @@ # HdfSensorEvents -## **概述** +## 概述 定义传感器上报的数据。 上报的传感器数据包括传感器ID、传感器算法版本号、数据生成时间、传感器类型ID、 数据选项(如测量范围和精度)、数据上报模式、数据地址、数据长度。 +**Since:** +2.2 +**Version:** +1.0 **相关模块:** -[Sensor](sensor.md) +[Sensor](_sensor.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [sensorId](#sensorid) | 传感器ID。 | -| [version](#version) | 传感器算法版本号。 | -| [timestamp](#timestamp) | 传感器数据生成时间。 | -| [option](#option) | 传感器数据选项,包括测量范围和精度。 | -| [mode](#mode) | 传感器数据上报模式。 | -| [data](#data) | 传感器数据地址。 | -| [dataLen](#datalen) | 传感器数据长度。 | +| [sensorId](#sensorid) | int
传感器ID。  | +| [version](#version) | int
传感器算法版本号。  | +| [timestamp](#timestamp) | long
传感器数据生成时间。  | +| [option](#option) | unsigned int
传感器数据选项,包括测量范围和精度。  | +| [mode](#mode) | int
传感器数据上报模式。  | +| [data](#data) | unsigned char[]
传感器数据地址。  | +| [dataLen](#datalen) | unsigned int
传感器数据长度。  | -## **类成员变量说明** +## 类成员变量说明 ### data @@ -37,9 +41,7 @@ ``` unsigned char [] HdfSensorEvents::data ``` - -**描述:** - +**描述:** 传感器数据地址。 @@ -49,9 +51,7 @@ unsigned char [] HdfSensorEvents::data ``` unsigned int HdfSensorEvents::dataLen ``` - -**描述:** - +**描述:** 传感器数据长度。 @@ -61,9 +61,7 @@ unsigned int HdfSensorEvents::dataLen ``` int HdfSensorEvents::mode ``` - -**描述:** - +**描述:** 传感器数据上报模式。 @@ -73,9 +71,7 @@ int HdfSensorEvents::mode ``` unsigned int HdfSensorEvents::option ``` - -**描述:** - +**描述:** 传感器数据选项,包括测量范围和精度。 @@ -85,9 +81,7 @@ unsigned int HdfSensorEvents::option ``` int HdfSensorEvents::sensorId ``` - -**描述:** - +**描述:** 传感器ID。 @@ -97,9 +91,7 @@ int HdfSensorEvents::sensorId ``` long HdfSensorEvents::timestamp ``` - -**描述:** - +**描述:** 传感器数据生成时间。 @@ -109,7 +101,5 @@ long HdfSensorEvents::timestamp ``` int HdfSensorEvents::version ``` - -**描述:** - +**描述:** 传感器算法版本号。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_information.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_information.md index ae9c37c451081576d74ad35cd807c07f9f82c80a..13fb20e624b3d731d8b27b05979bcba3b895670b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_information.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_sensor_information.md @@ -1,36 +1,44 @@ # HdfSensorInformation -## **概述** +## 概述 定义传感器的基本信息。 传感器的信息包括传感器名称、供应商、固件版本、硬件版本、传感器类型ID、传感器ID、最大测量范围、精度和功率。 +**Since:** + +2.2 + +**Version:** + +1.0 + **相关模块:** -[Sensor](sensor.md) +[Sensor](_sensor.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [sensorName](#sensorname) | 传感器名称。 | -| [vendorName](#vendorname) | 传感器供应商。 | -| [firmwareVersion](#firmwareversion) | 传感器固件版本。 | -| [hardwareVersion](#hardwareversion) | 传感器硬件版本。 | -| [sensorTypeId](#sensortypeid) | 传感器类型ID。 | -| [sensorId](#sensorid) | 传感器ID,由传感器驱动程序开发人员定义。 | -| [maxRange](#maxrange) | 传感器的最大测量范围。 | -| [accuracy](#accuracy) | 传感器精度。 | -| [power](#power) | 传感器功率。 | +| [sensorName](#sensorname) | String
传感器名称。 | +| [vendorName](#vendorname) | String
传感器供应商。 | +| [firmwareVersion](#firmwareversion) | String
传感器固件版本。 | +| [hardwareVersion](#hardwareversion) | String
传感器硬件版本。 | +| [sensorTypeId](#sensortypeid) | int
传感器类型ID(在[HdfSensorTypeTag](_sensor.md#hdfsensortypetag)中描述)**。** | +| [sensorId](#sensorid) | int
传感器ID,由传感器驱动程序开发人员定义。 | +| [maxRange](#maxrange) | float
传感器的最大测量范围。 | +| [accuracy](#accuracy) | float
传感器精度。 | +| [power](#power) | float
传感器功率。 | -## **类成员变量说明** +## 类成员变量说明 ### accuracy @@ -40,7 +48,7 @@ float HdfSensorInformation::accuracy ``` -**描述:** +**描述:** 传感器精度。 @@ -52,7 +60,7 @@ float HdfSensorInformation::accuracy String HdfSensorInformation::firmwareVersion ``` -**描述:** +**描述:** 传感器固件版本。 @@ -64,7 +72,7 @@ String HdfSensorInformation::firmwareVersion String HdfSensorInformation::hardwareVersion ``` -**描述:** +**描述:** 传感器硬件版本。 @@ -76,7 +84,7 @@ String HdfSensorInformation::hardwareVersion float HdfSensorInformation::maxRange ``` -**描述:** +**描述:** 传感器的最大测量范围。 @@ -88,7 +96,7 @@ float HdfSensorInformation::maxRange float HdfSensorInformation::power ``` -**描述:** +**描述:** 传感器功率。 @@ -100,7 +108,7 @@ float HdfSensorInformation::power int HdfSensorInformation::sensorId ``` -**描述:** +**描述:** 传感器ID,由传感器驱动程序开发人员定义。 @@ -112,7 +120,7 @@ int HdfSensorInformation::sensorId String HdfSensorInformation::sensorName ``` -**描述:** +**描述:** 传感器名称。 @@ -124,9 +132,9 @@ String HdfSensorInformation::sensorName int HdfSensorInformation::sensorTypeId ``` -**描述:** +**描述:** -传感器类型ID(在[HdfSensorTypeTag](sensor.md#hdfsensortypetag)中描述)**。** +传感器类型ID(在[HdfSensorTypeTag](_sensor.md#hdfsensortypetag)中描述)。 ### vendorName @@ -136,6 +144,6 @@ int HdfSensorInformation::sensorTypeId String HdfSensorInformation::vendorName ``` -**描述:** +**描述:** 传感器供应商。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_sta_info.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_sta_info.md index 05d24dd843d57a33be7655c3d921bd681b4a36e9..d8cefd9cf2ba7987aadc15b83a71c0bf761471cf 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_sta_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_sta_info.md @@ -1,26 +1,30 @@ # HdfStaInfo -## **概述** +## 概述 STA的信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [mac](#mac) | STA的MAC地址。 | +| [mac](#mac) | unsigned char[]
STA的MAC地址。  | -## **类成员变量说明** +## 类成员变量说明 ### mac @@ -29,7 +33,5 @@ STA的信息。 ``` unsigned char [] HdfStaInfo::mac ``` - -**描述:** - +**描述:** STA的MAC地址。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_thermal_callback_info.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_thermal_callback_info.md index ba1f6fd2b244795392c49f9bd994bc27fb3298c2..e21b1699f641e59d77f8a84ea5f687b87d49fcd9 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_thermal_callback_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_thermal_callback_info.md @@ -1,26 +1,28 @@ # HdfThermalCallbackInfo -## **概述** +## 概述 设备发热的信息列表。 +**Since:** +3.1 **相关模块:** [Thermal](thermal.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [info](#info) | 设备发热的信息列表。 | +| [info](#info) | List< struct [ThermalZoneInfo](_thermal_zone_info.md) >
设备发热的信息列表。  | -## **类成员变量说明** +## 类成员变量说明 ### info @@ -29,7 +31,5 @@ ``` List HdfThermalCallbackInfo::info ``` - -**描述:** - +**描述:** 设备发热的信息列表。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_user_auth.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_user_auth.md index 2fbbca3bfa3acb1cfe8f629664d9347ab8386d2e..57ea3ed3a194502428047fa52c1fdbb0373f2466 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_user_auth.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_user_auth.md @@ -1,18 +1,18 @@ # HdfUserAuth -## **概述** +## 概述 提供用户认证驱动的标准API接口。 -用户认证驱动为用户认证服务提供统一的访问接口。获取用户认证驱动代理后,用户认证服务可以调用相关接口注册执行器,管理用户认证凭据, 完成PIN码和生物特征。 +用户认证驱动为用户认证服务提供统一的访问接口。获取用户认证驱动代理后,用户认证服务可以调用相关接口注册执行器,管理用户认证凭据, 完成PIN码和生物特征认证。 -**Since:** +**Since:** 3.2 -## **汇总** +## 汇总 ### 文件 @@ -27,27 +27,27 @@ | 名称 | 描述 | | -------- | -------- | -| [IUserAuthInterface](interface_i_user_auth_interface.md) | 声明用户认证驱动的API接口。 | -| [ExecutorRegisterInfo](_executor_register_info.md) | 执行器注册信息。 | -| [ExecutorInfo](_user_executor_info.md) | 执行器信息。 | -| [ScheduleInfo](_schedule_info.md) | 调度信息。 | -| [AuthSolution](_auth_solution.md) | 认证方案。 | -| [ExecutorSendMsg](_executor_send_msg.md) | 执行器发送的消息。 | -| [AuthResultInfo](_auth_result_info.md) | 用户身份认证结果信息。 | -| [IdentifyResultInfo](_identify_result_info.md) | 用户身份识别结果信息。 | -| [EnrollParam](_enroll_param.md) | 注册认证凭据参数。 | -| [CredentialInfo](_credential_info.md) | 认证凭据信息。 | -| [EnrolledInfo](_enrolled_info.md) | 注册信息。 | -| [EnrollResultInfo](_enroll_resultinfo.md) | 录入结果信息。 | +| [IUserAuthInterface](interface_i_user_auth_interface.md) | interface
声明用户认证驱动的API接口。 | +| [ExecutorRegisterInfo](_executor_register_info.md) | struct
执行器注册信息。 | +| [ExecutorInfo](_executor_info_userauth.md) | struct
执行器信息。 | +| [ScheduleInfo](_schedule_info.md) | struct
调度信息。 | +| [AuthSolution](_auth_solution.md) | struct
认证方案。 | +| [ExecutorSendMsg](_executor_send_msg.md) | struct
执行器发送的消息。 | +| [AuthResultInfo](_auth_result_info.md) | struct
用户身份认证结果信息。 | +| [IdentifyResultInfo](_identify_result_info.md) | struct
用户身份识别结果信息。 | +| [EnrollParam](_enroll_param.md) | struct
注册认证凭据参数。 | +| [CredentialInfo](_credential_info.md) | struct
认证凭据信息。 | +| [EnrolledInfo](_enrolled_info.md) | struct
注册信息。 | +| [EnrollResultInfo](_enroll_result_info.md) | struct
录入结果信息。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [AuthType](#authtype): int { PIN = 1, FACE = 2, FINGERPRINT = 4, ALL = 0 } | 枚举用户认证凭据类型。 | -| [ExecutorRole](#executorrole): int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | -| [ExecutorSecureLevel](#executorsecurelevel): int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | +| [AuthType](#authtype) : int {  ALL = 0, PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | +| [ExecutorRole](#executorrole) : int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | +| [ExecutorSecureLevel](#executorsecurelevel) : int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | | [PinSubType](#pinsubtype) : int { PIN_SIX = 10000, PIN_NUMBER = 10001, PIN_MIX = 10002 } | 口令认证子类型。 | @@ -58,7 +58,7 @@ | package ohos.hdi.user_auth.v1_0 | 用户认证接口的包路径 | -## **枚举类型说明** +## 枚举类型说明 ### AuthType @@ -68,16 +68,16 @@ enum AuthType : int ``` -**描述:** +**描述:** 枚举用户认证凭据类型。 | 枚举值 | 描述 | | -------- | -------- | +| ALL | 表示包含所有认证凭据类型。 | | PIN | 认证凭据类型为口令。 | | FACE | 认证凭据类型为人脸。 | | FINGERPRINT | 认证凭据类型为指纹。 | -| ALL | 表示包含所有认证凭据类型。 | ### ExecutorRole @@ -87,7 +87,7 @@ enum AuthType : int enum ExecutorRole : int ``` -**描述:** +**描述:** 枚举执行器角色。 @@ -105,7 +105,7 @@ enum ExecutorRole : int enum ExecutorSecureLevel : int ``` -**描述:** +**描述:** 枚举执行器安全等级。 @@ -124,7 +124,7 @@ enum ExecutorSecureLevel : int enum PinSubType : int ``` -**描述:** +**描述:** 口令认证子类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_vibrator_info.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_vibrator_info.md index f176936bc9025a917b58ec1c130041f4ad96026a..2adcdc1816795b347fd5f38fe848f1a145238ded 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_vibrator_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_vibrator_info.md @@ -1,33 +1,37 @@ # HdfVibratorInfo -## **概述** +## 概述 定义马达参数。 参数包括设置马达振幅和频率以及振幅和频率的范围。 +**Since:** +3.2 +**Version:** +1.1 **相关模块:** -[Vibrator](vibrator.md) +[Vibrator](_vibrator.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [isSupportIntensity](#issupportintensity) | 设置马达振幅。1表示支持,0表示不支持。 | -| [isSupportFrequency](#issupportfrequency) | 设置马达频率。1表示支持,0表示不支持。 | -| [intensityMaxValue](#intensitymaxvalue) | 最大振幅。 | -| [intensityMinValue](#intensityminvalue) | 最小振幅。 | -| [frequencyMaxValue](#frequencymaxvalue) | 最大频率。 | -| [frequencyMinValue](#frequencyminvalue) | 最小频率。 | +| [isSupportIntensity](#issupportintensity) | int
设置马达振幅。1表示支持,0表示不支持。  | +| [isSupportFrequency](#issupportfrequency) | int
设置马达频率。1表示支持,0表示不支持。  | +| [intensityMaxValue](#intensitymaxvalue) | int
最大振幅。  | +| [intensityMinValue](#intensityminvalue) | int
最小振幅。  | +| [frequencyMaxValue](#frequencymaxvalue) | int
最大频率。  | +| [frequencyMinValue](#frequencyminvalue) | int
最小频率。  | -## **类成员变量说明** +## 类成员变量说明 ### frequencyMaxValue @@ -36,9 +40,7 @@ ``` int HdfVibratorInfo::frequencyMaxValue ``` - -**描述:** - +**描述:** 最大频率。 @@ -48,9 +50,7 @@ int HdfVibratorInfo::frequencyMaxValue ``` int HdfVibratorInfo::frequencyMinValue ``` - -**描述:** - +**描述:** 最小频率。 @@ -60,9 +60,7 @@ int HdfVibratorInfo::frequencyMinValue ``` int HdfVibratorInfo::intensityMaxValue ``` - -**描述:** - +**描述:** 最大振幅。 @@ -72,9 +70,7 @@ int HdfVibratorInfo::intensityMaxValue ``` int HdfVibratorInfo::intensityMinValue ``` - -**描述:** - +**描述:** 最小振幅。 @@ -84,9 +80,7 @@ int HdfVibratorInfo::intensityMinValue ``` int HdfVibratorInfo::isSupportFrequency ``` - -**描述:** - +**描述:** 设置马达频率。1表示支持,0表示不支持。 @@ -96,7 +90,5 @@ int HdfVibratorInfo::isSupportFrequency ``` int HdfVibratorInfo::isSupportIntensity ``` - -**描述:** - +**描述:** 设置马达振幅。1表示支持,0表示不支持。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_driver_scan_ssid.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_driver_scan_ssid.md index 7fb2e4b79eb9895f1dcba5b2ee8be56b94294721..9d8d540aba64956f73580531f907631b53d74f12 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_driver_scan_ssid.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_driver_scan_ssid.md @@ -1,27 +1,31 @@ # HdfWifiDriverScanSsid -## **概述** +## 概述 WiFi扫描参数SSID信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [ssid](#ssid) | WiFi扫描的SSID。 | -| [ssidLen](#ssidlen) | WiFi扫描的SSID长度。 | +| [ssid](#ssid) | String
WiFi扫描的SSID。  | +| [ssidLen](#ssidlen) | int
WiFi扫描的SSID长度。  | -## **类成员变量说明** +## 类成员变量说明 ### ssid @@ -30,9 +34,7 @@ WiFi扫描参数SSID信息。 ``` String HdfWifiDriverScanSsid::ssid ``` - -**描述:** - +**描述:** WiFi扫描的SSID。 @@ -42,7 +44,5 @@ WiFi扫描的SSID。 ``` int HdfWifiDriverScanSsid::ssidLen ``` - -**描述:** - +**描述:** WiFi扫描的SSID长度。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_info.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_info.md index 9adcd49e7bfdfaded903d9535971b586d944b3ca..69cc166158c67265ce3d4795a815961688c71b3d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_info.md @@ -1,27 +1,31 @@ # HdfWifiInfo -## **概述** +## 概述 WiFi频段信息。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [band](#band) | WiFi频段。 | -| [size](#size) | WiFi频段下支持的频率个数。 | +| [band](#band) | int
WiFi频段。  | +| [size](#size) | unsigned int
WiFi频段下支持的频率个数。  | -## **类成员变量说明** +## 类成员变量说明 ### band @@ -30,9 +34,7 @@ WiFi频段信息。 ``` int HdfWifiInfo::band ``` - -**描述:** - +**描述:** WiFi频段。 @@ -42,7 +44,5 @@ WiFi频段。 ``` unsigned int HdfWifiInfo::size ``` - -**描述:** - +**描述:** WiFi频段下支持的频率个数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan.md index 8f86e02e5da124f5a357b345a7705d5ba83222d1..3d3a7f97e34f86239493a97a7da80f96e92fe9c0 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan.md @@ -1,31 +1,35 @@ # HdfWifiScan -## **概述** +## 概述 WiFi扫描参数。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [ssids](#ssids) | WiFi扫描的SSID集合。 | -| [freqs](#freqs) | WiFi扫描的频率集合。 | -| [extraIes](#extraies) | WiFi扫描请求中携带的扩展IE。 | -| [bssid](#bssid) | WiFi扫描的BSSID。 | -| [prefixSsidScanFlag](#prefixssidscanflag) | SSID扫描的前缀标志。 | -| [fastConnectFlag](#fastconnectflag) | 快速连接标志。 | +| [ssids](#ssids) | struct [HdfWifiDriverScanSsid](_hdf_wifi_driver_scan_ssid.md)[]
WiFi扫描的SSID集合。  | +| [freqs](#freqs) | int[]
WiFi扫描的频率集合。  | +| [extraIes](#extraies) | unsigned char[]
WiFi扫描请求中携带的扩展IE。  | +| [bssid](#bssid) | unsigned char[]
WiFi扫描的BSSID。  | +| [prefixSsidScanFlag](#prefixssidscanflag) | unsigned char
SSID扫描的前缀标志。  | +| [fastConnectFlag](#fastconnectflag) | unsigned char
快速连接标志。  | -## **类成员变量说明** +## 类成员变量说明 ### bssid @@ -34,9 +38,7 @@ WiFi扫描参数。 ``` unsigned char [] HdfWifiScan::bssid ``` - -**描述:** - +**描述:** WiFi扫描的BSSID。 @@ -46,9 +48,7 @@ WiFi扫描的BSSID。 ``` unsigned char [] HdfWifiScan::extraIes ``` - -**描述:** - +**描述:** WiFi扫描请求中携带的扩展IE。 @@ -58,9 +58,7 @@ WiFi扫描请求中携带的扩展IE。 ``` unsigned char HdfWifiScan::fastConnectFlag ``` - -**描述:** - +**描述:** 快速连接标志。 @@ -70,9 +68,7 @@ unsigned char HdfWifiScan::fastConnectFlag ``` int [] HdfWifiScan::freqs ``` - -**描述:** - +**描述:** WiFi扫描的频率集合。 @@ -82,9 +78,7 @@ WiFi扫描的频率集合。 ``` unsigned char HdfWifiScan::prefixSsidScanFlag ``` - -**描述:** - +**描述:** SSID扫描的前缀标志。 @@ -94,7 +88,5 @@ SSID扫描的前缀标志。 ``` struct HdfWifiDriverScanSsid [] HdfWifiScan::ssids ``` - -**描述:** - +**描述:** WiFi扫描的SSID集合。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan_result.md b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan_result.md index 3c752f70abebab38485fe2885322b0644b05fad3..36ba9a8d9fad0df1358015e1a59bd7d029ca7536 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan_result.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdf_wifi_scan_result.md @@ -1,36 +1,40 @@ # HdfWifiScanResult -## **概述** +## 概述 WiFi扫描结果。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [flags](#flags) | BSS/IBSS的标志位。 | -| [bssid](#bssid) | BSSID信息。 | -| [caps](#caps) | Capability信息字段(主机字节序排列)。 | -| [freq](#freq) | 信道频率。 | -| [beaconInt](#beaconint) | Beacon帧间隔。 | -| [qual](#qual) | 信号质量。 | -| [level](#level) | 信号强度。 | -| [age](#age) | 收到最新的Beacon或者探测响应帧数据的时间长度,单位为毫秒。 | -| [variable](#variable) | 扫描结果中的变量值。 | -| [ie](#ie) | 紧跟的Probe Response中IE字段。 | -| [beaconIe](#beaconie) | 紧跟的Beacon中IE字段。 | +| [flags](#flags) | int
BSS/IBSS的标志位。  | +| [bssid](#bssid) | unsigned char[]
BSSID信息。  | +| [caps](#caps) | short
Capability信息字段(主机字节序排列)。  | +| [freq](#freq) | int
信道频率。  | +| [beaconInt](#beaconint) | short
Beacon帧间隔。  | +| [qual](#qual) | int
信号质量。  | +| [level](#level) | int
信号强度。  | +| [age](#age) | unsigned int
收到最新的Beacon或者探测响应帧数据的时间长度,单位为毫秒。  | +| [variable](#variable) | unsigned char[]
扫描结果中的变量值。  | +| [ie](#ie) | unsigned char[]
紧跟的Probe Response中IE字段。  | +| [beaconIe](#beaconie) | unsigned char[]
紧跟的Beacon中IE字段。  | -## **类成员变量说明** +## 类成员变量说明 ### age @@ -39,9 +43,7 @@ WiFi扫描结果。 ``` unsigned int HdfWifiScanResult::age ``` - -**描述:** - +**描述:** 收到最新的Beacon或者探测响应帧数据的时间长度,单位为毫秒。 @@ -51,9 +53,7 @@ unsigned int HdfWifiScanResult::age ``` unsigned char [] HdfWifiScanResult::beaconIe ``` - -**描述:** - +**描述:** 紧跟的Beacon中IE字段。 @@ -63,9 +63,7 @@ unsigned char [] HdfWifiScanResult::beaconIe ``` short HdfWifiScanResult::beaconInt ``` - -**描述:** - +**描述:** Beacon帧间隔。 @@ -75,9 +73,7 @@ Beacon帧间隔。 ``` unsigned char [] HdfWifiScanResult::bssid ``` - -**描述:** - +**描述:** BSSID信息。 @@ -87,9 +83,7 @@ BSSID信息。 ``` short HdfWifiScanResult::caps ``` - -**描述:** - +**描述:** Capability信息字段(主机字节序排列)。 @@ -99,9 +93,7 @@ Capability信息字段(主机字节序排列)。 ``` int HdfWifiScanResult::flags ``` - -**描述:** - +**描述:** BSS/IBSS的标志位。 @@ -111,9 +103,7 @@ BSS/IBSS的标志位。 ``` int HdfWifiScanResult::freq ``` - -**描述:** - +**描述:** 信道频率。 @@ -123,9 +113,7 @@ int HdfWifiScanResult::freq ``` unsigned char [] HdfWifiScanResult::ie ``` - -**描述:** - +**描述:** 紧跟的Probe Response中IE字段。 @@ -135,9 +123,7 @@ unsigned char [] HdfWifiScanResult::ie ``` int HdfWifiScanResult::level ``` - -**描述:** - +**描述:** 信号强度。 @@ -147,9 +133,7 @@ int HdfWifiScanResult::level ``` int HdfWifiScanResult::qual ``` - -**描述:** - +**描述:** 信号质量。 @@ -159,7 +143,5 @@ int HdfWifiScanResult::qual ``` unsigned char [] HdfWifiScanResult::variable ``` - -**描述:** - +**描述:** 扫描结果中的变量值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/activity_recognition.md b/zh-cn/device-dev/reference/hdi-apis/_hdi_activity_recognition.md similarity index 72% rename from zh-cn/device-dev/reference/hdi-apis/activity_recognition.md rename to zh-cn/device-dev/reference/hdi-apis/_hdi_activity_recognition.md index d7eb2ef08f3d82c16c9b20a8859c8080d90dfbca..453ebd7a70a5cdad8f540d0130d3b2ea8a5525f2 100644 --- a/zh-cn/device-dev/reference/hdi-apis/activity_recognition.md +++ b/zh-cn/device-dev/reference/hdi-apis/_hdi_activity_recognition.md @@ -1,29 +1,28 @@ # HdiActivityRecognition - -## **概述** +## 概述 提供订阅和获取用户行为的API。 MSDP(Multimodal Sensor Data Platform)可以获取行为识别驱动程序的对象或代理,然后调用该对象或代理提供的API, 获取设备支持的行为类型,订阅或取消订阅不同的行为事件,获取当前的行为事件,以及获取设备缓存的行为事件。 -**Since**: +**Since:** 3.2 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 | 名称 | 描述 | | -------- | -------- | -| [ActivityRecognitionTypes.idl](activity_recognition_types_idl.md) | 定义行为识别模块使用的数据类型。 | +| [ActivityRecognitionTypes.idl](_activity_recognition_types_8idl.md) | 定义行为识别模块使用的数据类型。 | | [IActivityChangedCallback.idl](_i_activity_changed_callback_8idl.md) | 定义行为识别数据上报回调函数接口。 | | [IActivityInterface.idl](_i_activity_interface_8idl.md) | 声明行为识别模块提供的API,用于获取设备支持的行为类型,订阅或取消订阅不同的行为事件,获取当前的行为事件,以及获取设备缓存的行为事件。 | @@ -32,17 +31,17 @@ MSDP(Multimodal Sensor Data Platform)可以获取行为识别驱动程序的 | 名称 | 描述 | | -------- | -------- | -| [ActRecognitionEvent](_act_recognition_event.md) | 定义行为事件上报的数据结构。 | -| [IActivityChangedCallback](interface_i_activity_changed_callback.md) | 定义上报行为事件的回调函数。 | -| [IActivityInterface](interface_i_activity_interface.md) | 定义对行为识别进行基本操作的接口。 | +| [ActRecognitionEvent](_act_recognition_event.md) | struct
定义行为事件上报的数据结构。 | +| [IActivityChangedCallback](interface_i_activity_changed_callback.md) | interface
定义上报行为事件的回调函数 | +| [IActivityInterface](interface_i_activity_interface.md) | interface
定义对行为识别进行基本操作的接口。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [ActRecognitionEventType](#actrecognitioneventtype) { ACT_RECOGNITION_EVENT_ENTER = 0x01, ACT_RECOGNITION_EVENT_EXIT = 0x02 } | 枚举行为事件的类型。 | -| [ActRecognitionPowerMode](#actrecognitionpowermode) { ACT_RECOGNITION_NORMAL_MODE = 0, ACT_RECOGNITION_LOW_POWER_MODE = 1 } | 枚举功耗模式的类型。 | +| [ActRecognitionEventType](#actrecognitioneventtype) { ACT_RECOGNITION_EVENT_ENTER = 0x01 , ACT_RECOGNITION_EVENT_EXIT = 0x02 } | 枚举行为事件的类型。 | +| [ActRecognitionPowerMode](#actrecognitionpowermode) { ACT_RECOGNITION_NORMAL_MODE = 0 , ACT_RECOGNITION_LOW_POWER_MODE = 1 } | 枚举功耗模式的类型。 | ### 关键字 @@ -52,7 +51,7 @@ MSDP(Multimodal Sensor Data Platform)可以获取行为识别驱动程序的 | package ohos.hdi.activity_recognition.v1_0 | 行为识别模块接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### ActRecognitionEventType @@ -62,7 +61,7 @@ MSDP(Multimodal Sensor Data Platform)可以获取行为识别驱动程序的 enum ActRecognitionEventType ``` -**描述:** +**描述:** 枚举行为事件的类型。 @@ -81,7 +80,7 @@ enum ActRecognitionEventType enum ActRecognitionPowerMode ``` -**描述:** +**描述:** 枚举功耗模式的类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_cellbatching.md b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_cellbatching.md new file mode 100644 index 0000000000000000000000000000000000000000..2c7b76741c1306d0741d6f7bd36ecdc6017cc6a5 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_cellbatching.md @@ -0,0 +1,74 @@ +# HdiLpfenceCellbatching + + +## 概述 + +为低功耗围栏服务提供基站轨迹数据记录的API。 + +本模块能够控制设备对接收的基站数据进行缓存和上报。 + +应用场景:根据设备接收的基站轨迹数据,判断用户的大致活动区域,进而进行一些服务提醒。 + +**Since:** + +4.0 + +**Version:** + +1.0 + + +## 汇总 + + +### 文件 + + | 名称 | 描述 | +| -------- | -------- | +| [CellbatchingTypes.idl](_cellbatching_types_8idl.md) | 定义基站轨迹数据记录模块使用的数据类型。 | +| [ICellbatchingCallback.idl](_i_cellbatching_callback_8idl.md) | 定义基站轨迹数据记录模块回调接口。 | +| [ICellbatchingInterface.idl](_i_cellbatching_interface_8idl.md) | 声明基站轨迹数据记录模块提供的API,用于使能和去使能基站轨迹数据记录功能,主动获取基站轨迹数据。 | + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [CellbatchingRequest](_cellbatching_request.md) | struct
定义设置基站轨迹数据上报功能的数据结构。 | +| [CellTrajectoryData](_cell_trajectory_data.md) | struct
定义上报的基站轨迹数据的数据结构。 | +| [ICellbatchingCallback](interface_i_cellbatching_callback.md) | interface
导入基站轨迹数据记录模块的数据类型。 | +| [ICellbatchingInterface](interface_i_cellbatching_interface.md) | interface
导入基站轨迹数据记录模块的数据类型。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [CellbatchingSwitch](#cellbatchingswitch) { SWITCH_OFF = 0 , SWITCH_ON = 1 } | 枚举对基站轨迹数据记录的开关操作。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellbatching.v1_0 | 基站轨迹数据记录模块接口的包路径。 | + + +## 枚举类型说明 + + +### CellbatchingSwitch + + +``` +enum CellbatchingSwitch +``` + +**描述:** + +枚举对基站轨迹数据记录的开关操作。 + + | 枚举值 | 描述 | +| -------- | -------- | +| SWITCH_OFF | 关闭基站轨迹数据记录功能。 | +| SWITCH_ON | 打开基站轨迹数据记录功能。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_cellfence.md b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_cellfence.md new file mode 100644 index 0000000000000000000000000000000000000000..fbfb4a16929e73aaae6b816606c2b675adce4895 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_cellfence.md @@ -0,0 +1,76 @@ +# HdiLpfenceCellfence + + +## 概述 + +为低功耗围栏服务提供基站围栏的API。 + +本模块接口提供添加基站围栏、删除基站围栏和获取基站围栏使用信息的功能。 + +应用场景:判断用户设备是否达到某个较大范围的位置区域,从而进行一些后续服务,如景区服务介绍等。 + +**Since:** + +4.0 + +**Version:** + +1.0 + + +## 汇总 + + +### 文件 + + | 名称 | 描述 | +| -------- | -------- | +| [CellfenceTypes.idl](_cellfence_types_8idl.md) | 定义基站围栏使用的数据类型。 | +| [ICellfenceCallback.idl](_i_cellfence_callback_8idl.md) | 定义基站围栏模块回调接口。 | +| [ICellfenceInterface.idl](_i_cellfence_interface_8idl.md) | 声明基站围栏模块提供的API,用于添加基站围栏,删除基站围栏和获取基站围栏使用信息。 | + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [CellfenceInfo](_cellfence_info.md) | struct
定义基站基本信息的数据结构。 | +| [CellfenceRequest](_cellfence_request.md) | struct
定义添加基站围栏的数据结构。 | +| [CellfenceStatus](_cellfence_status.md) | struct
定义设备与基站围栏状态关系的数据结构。 | +| [CellfenceSize](_cellfence_size.md) | struct
定义基站围栏使用信息的数据结构。 | +| [ICellfenceCallback](interface_i_cellfence_callback.md) | interface
导入基站围栏模块的数据类型。 | +| [ICellfenceInterface](interface_i_cellfence_interface.md) | interface
导入基站围栏模块的数据类型。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [CellfenceTransition](#cellfencetransition) { FENCE_ENTER = 0 , FENCE_EXIT = 3 } | 枚举设备与基站围栏的位置关系。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellfence.v1_0 | 基站围栏模块接口的包路径。 | + + +## 枚举类型说明 + + +### CellfenceTransition + + +``` +enum CellfenceTransition +``` + +**描述:** + +枚举设备与基站围栏的位置关系。 + + | 枚举值 | 描述 | +| -------- | -------- | +| FENCE_ENTER | 设备在基站围栏范围内。 | +| FENCE_EXIT | 设备不在基站围栏范围内。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_geofence.md b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_geofence.md new file mode 100644 index 0000000000000000000000000000000000000000..a2ba16cc20f886fd651b2c779f224a737e67f2df --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_geofence.md @@ -0,0 +1,162 @@ +# HdiLpfenceGeofence + + +## 概述 + +为低功耗围栏服务提供地理围栏的API。 + +本模块接口提供添加圆形和多边形地理围栏,删除地理围栏,获取地理围栏状态信息,获取设备地理位置等功能。本模块可在AP休眠状态下持续工作。 + +应用场景:判断用户设备是否达到某个精确地理位置区域,从而进行一些后续服务,如门禁卡的切换、定制消息的提醒等。 + +**Since:** + +4.0 + +**Version:** + +1.0 + + +## 汇总 + + +### 文件 + + | 名称 | 描述 | +| -------- | -------- | +| [GeofenceTypes.idl](_geofence_types_8idl.md) | 定义地理围栏使用的数据类型。 | +| [IGeofenceCallback.idl](_i_geofence_callback_8idl.md) | 定义地理围栏模块回调接口。 | +| [IGeofenceIntf.idl](_i_geofence_intf_8idl.md) | 声明基站围栏模块提供的API,用于添加多种地理围栏,删除地理围栏,获取地理围栏状态信息,获取设备地理位置,下发基站离线数据库。 | + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [Point](_point.md) | struct
定义位置坐标的数据结构。 | +| [GeofenceCircleRequest](_geofence_circle_request.md) | struct
定义添加圆形地理围栏的数据结构。 | +| [GeofencePolygonRequest](_geofence_polygon_request.md) | struct
定义添加多边形地理围栏的数据结构。 | +| [GeofenceResult](_geofence_result.md) | struct
定义添加或删除地理围栏执行结果的数据结构。 | +| [OfflineDb](_offline_db.md) | struct
定义下发基站离线数据库的数据结构。 | +| [GeoLocationInfo](_geo_location_info.md) | struct
定义设备具体位置信息的数据结构。 | +| [GeofenceSize](_geofence_size.md) | struct
定义地理围栏使用信息的数据结构。 | +| [CurrentCell](_current_cell.md) | struct
定义设备驻留的基站主区信息的数据结构。 | +| [NeighborCell](_neighbor_cell.md) | struct
定义设备驻留的基站邻区信息的数据结构。 | +| [GeofenceCellInfo](_geofence_cell_info.md) | struct
定义设备驻留的基站小区信息的数据结构。 | +| [RequestCellDb](_request_cell_db.md) | struct
定义请求基站离线数据库数据的数据结构。 | +| [IGeofenceCallback](interface_i_geofence_callback.md) | interface
导入地理围栏模块的数据类型。 | +| [IGeofenceInterface](interface_i_geofence_interface.md) | interface
导入地理围栏模块的数据类型。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [GeofenceTransition](#geofencetransition) {
GEOFENCE_TRANSITION_ENTERED = (1 << 0) , GEOFENCE_TRANSITION_EXITED = (1 << 1) , GEOFENCE_TRANSITION_UNCERTAIN = (1 << 2) , GEOFENCE_TRANSITION_DWELL = (1 << 3) ,
GEOFENCE_TRANSITION_INDOOR = (1 << 4) , GEOFENCE_TRANSITION_OUTDOOR = (1 << 5)
} | 枚举可关注的地理围栏状态事件。 | +| [GeofenceAttribute](#geofenceattribute) { GEOFENCE_ATTRI_COORDINATE_WGS84 = 16 } | 枚举地理围栏支持的设置项。 | +| [GeofenceAccuracy](#geofenceaccuracy) { ACCURACY_FINE = 1 , ACCURACY_BALANCE = 2 , ACCURACY_COARSE = 3 } | 枚举地理围栏支持的精度模式。 | +| [GeofenceCellType](#geofencecelltype) { GEOFENCE_CELL_G4 = 0 , GEOFENCE_CELL_NR = 1 } | 枚举移动通信技术代。 | +| [GeofenceLocSource](#geofencelocsource) {
GEOFENCE_GNSS = 1 , GEOFENCE_WIFI = 2 , GEOFENCE_SENSOR = 4 , GEOFENCE_CELL = 8 ,
GEOFENCE_BT = 16
} | 枚举位置信息来源。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.geofence.v1_0 | 地理围栏模块接口的包路径。 | + + +## 枚举类型说明 + + +### GeofenceAccuracy + + +``` +enum GeofenceAccuracy +``` + +**描述:** + +枚举地理围栏支持的精度模式。 + + | 枚举值 | 描述 | +| -------- | -------- | +| ACCURACY_FINE | 高精度模式,GNSS模块接收GPS定位信号频率为1秒1次,功耗较高。 | +| ACCURACY_BALANCE | 中精度模式,GNSS模块接收GPS定位信号频率为60秒1次,功耗较低。 | +| ACCURACY_COARSE | 低精度模式,只使用基站定位,不依赖GNSS模块。 | + + +### GeofenceAttribute + + +``` +enum GeofenceAttribute +``` + +**描述:** + +枚举地理围栏支持的设置项。 + + | 枚举值 | 描述 | +| -------- | -------- | +| GEOFENCE_ATTRI_COORDINATE_WGS84 | 地理位置使用WGS-84地心坐标系。 | + + +### GeofenceCellType + + +``` +enum GeofenceCellType +``` + +**描述:** + +枚举移动通信技术代。 + + | 枚举值 | 描述 | +| -------- | -------- | +| GEOFENCE_CELL_G4 | 第2、3、4代移动通信技术 | +| GEOFENCE_CELL_NR | 第5代移动通信技术 | + + +### GeofenceLocSource + + +``` +enum GeofenceLocSource +``` + +**描述:** + +枚举位置信息来源。 + + | 枚举值 | 描述 | +| -------- | -------- | +| GEOFENCE_GNSS | 位置信息来源于GNSS模块 | +| GEOFENCE_WIFI | 位置信息来源于Wi-Fi模块 | +| GEOFENCE_SENSOR | 位置信息来源于Sensor模块 | +| GEOFENCE_CELL | 位置信息来源于基站模块 | +| GEOFENCE_BT | 位置信息来源于蓝牙模块 | + + +### GeofenceTransition + + +``` +enum GeofenceTransition +``` + +**描述:** + +枚举可关注的地理围栏状态事件。 + + | 枚举值 | 描述 | +| -------- | -------- | +| GEOFENCE_TRANSITION_ENTERED | 设备在地理围栏范围内。 | +| GEOFENCE_TRANSITION_EXITED | 设备在地理围栏范围外。 | +| GEOFENCE_TRANSITION_UNCERTAIN | 无法确定设备与地理围栏位置关系。 | +| GEOFENCE_TRANSITION_DWELL | 设备在地理围栏内,且持续徘徊一段时间。 | +| GEOFENCE_TRANSITION_INDOOR | 设备在地理围栏内,且在室内。 | +| GEOFENCE_TRANSITION_OUTDOOR | 设备在地理围栏内,且在室外。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_wififence.md b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_wififence.md new file mode 100644 index 0000000000000000000000000000000000000000..8f724ea99e9bb200b859a2cb4afd73732b525018 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_hdi_lpfence_wififence.md @@ -0,0 +1,92 @@ +# HdiLpfenceWififence + + +## 概述 + +为低功耗围栏服务提供Wi-Fi围栏的API。 + +本模块接口提供添加Wi-Fi围栏,删除Wi-Fi围栏,获取Wi-Fi围栏状态,获取Wi-Fi围栏使用信息的功能。 + +应用场景:一般用于判断设备是否在室内特定位置,如居所内或商场的某个店铺内。 + +**Since:** + +4.0 + +**Version:** + +1.0 + + +## 汇总 + + +### 文件 + + | 名称 | 描述 | +| -------- | -------- | +| [IWififenceCallback.idl](_i_wififence_callback_8idl.md) | 定义Wi-Fi围栏模块回调接口。 | +| [IWififenceInterface.idl](_i_wififence_interface_8idl.md) | 定义Wi-Fi围栏模块回调接口。 | +| [WififenceTypes.idl](_wififence_types_8idl.md) | 定义Wi-Fi围栏使用的数据类型。 | + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IWififenceCallback](interface_i_wififence_callback.md) | interface
导入Wi-Fi围栏模块的数据类型。 | +| [IWififenceInterface](interface_i_wififence_interface.md) | interface
导入Wi-Fi围栏模块的数据类型。 | +| [WififenceRequest](_wififence_request.md) | struct
定义添加Wi-Fi围栏的数据结构。 | +| [WififenceSize](_wififence_size.md) | struct
定义Wi-Fi围栏使用信息的数据结构。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [WififenceTransition](#wififencetransition) { WIFIFENCE_TRANSITION_ENTERED = (1 << 0) , WIFIFENCE_TRANSITION_EXITED = (1 << 1) } | 枚举Wi-Fi围栏状态事件。 | +| [WififenceAlgoType](#wififencealgotype) { TYPE_ONE_BSSID = 1 , TYPE_FP_MATCH = 2 } | 枚举Wi-Fi围栏的匹配算法。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.wififence.v1_0 | Wi-Fi围栏模块接口的包路径。 | + + +## 枚举类型说明 + + +### WififenceAlgoType + + +``` +enum WififenceAlgoType +``` + +**描述:** + +枚举Wi-Fi围栏的匹配算法。 + + | 枚举值 | 描述 | +| -------- | -------- | +| TYPE_ONE_BSSID | Wi-Fi围栏中MAC地址与设备扫描的MAC地址有交集时,即认为设备在围栏内。 | +| TYPE_FP_MATCH | Wi-Fi围栏中MAC地址和RSSI值与设备扫描的MAC地址和RSSI值相似度达到一定阈值时,即认为设备在围栏内。 | + + +### WififenceTransition + + +``` +enum WififenceTransition +``` + +**描述:** + +枚举Wi-Fi围栏状态事件。 + + | 枚举值 | 描述 | +| -------- | -------- | +| WIFIFENCE_TRANSITION_ENTERED | 设备在Wi-Fi围栏范围内。 | +| WIFIFENCE_TRANSITION_EXITED | 设备在Wi-Fi围栏范围外。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_activity_changed_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_activity_changed_callback_8idl.md index 512c1de4667f228022002ae3532680b03b471cb2..025b7b8c25f938d741c891ef70e6149a6ea7aabf 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_activity_changed_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_activity_changed_callback_8idl.md @@ -1,33 +1,33 @@ # IActivityChangedCallback.idl -## **概述** +## 概述 定义行为识别数据上报回调函数接口。 在行为识别用户订阅行为识别数据时需要注册这个回调函数接口的实例。 -**Since**: +**Since:** 3.2 -**Version**: +**Version:** 1.0 **相关模块:** -[HdiActivityRecognition](activity_recognition.md) +[HdiActivityRecognition](_hdi_activity_recognition.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IActivityChangedCallback](interface_i_activity_changed_callback.md) | 定义上报行为事件的回调函数 | +| [IActivityChangedCallback](interface_i_activity_changed_callback.md) | interface
定义上报行为事件的回调函数 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_activity_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_activity_interface_8idl.md index 1115b0560274f44133152ce9dacc3ca6910f019b..18b2c898409c74c8d6050832254e5e574f523cce 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_activity_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_activity_interface_8idl.md @@ -1,31 +1,31 @@ # IActivityInterface.idl -## **概述** +## 概述 声明行为识别模块提供的API,用于获取设备支持的行为类型,订阅或取消订阅不同的行为事件,获取当前的行为事件,以及获取设备缓存的行为事件。 -**Since**: +**Since:** 3.2 -**Version**: +**Version:** 1.0 **相关模块:** -[HdiActivityRecognition](activity_recognition.md) +[HdiActivityRecognition](_hdi_activity_recognition.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IActivityInterface](interface_i_activity_interface.md) | 定义对行为识别进行基本操作的接口。 | +| [IActivityInterface](interface_i_activity_interface.md) | interface
定义对行为识别进行基本操作的接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_audio_adapter_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_audio_adapter_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..16ca81638f55e3f2cf48592cf8eae9d4843d0796 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_audio_adapter_8idl.md @@ -0,0 +1,35 @@ +# IAudioAdapter.idl + + +## 概述 + +Audio适配器的接口定义文件。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IAudioAdapter](interface_i_audio_adapter.md) | interface
AudioAdapter音频适配器接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.audio.v1_0 | 音频接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_audio_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_audio_callback_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..0ac04c908dbe961cc254219e478c11a94cd86897 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_audio_callback_8idl.md @@ -0,0 +1,35 @@ +# IAudioCallback.idl + + +## 概述 + +Audio播放的回调函数定义文件。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IAudioCallback](interface_i_audio_callback.md) | interface
Audio回调接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.audio.v1_0 | 音频接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_audio_capture_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_audio_capture_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..4d2fd76313e6cb70b466679024cbc28956c19347 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_audio_capture_8idl.md @@ -0,0 +1,35 @@ +# IAudioCapture.idl + + +## 概述 + +Audio录音的接口定义文件。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IAudioCapture](interface_i_audio_capture.md) | interface
AudioCapture音频录音接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.audio.v1_0 | 音频接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_audio_manager_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_audio_manager_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..cd81444cd42e5f6149497a5525a39ae76fc535b2 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_audio_manager_8idl.md @@ -0,0 +1,35 @@ +# IAudioManager.idl + + +## 概述 + +Audio适配器管理及加载的接口定义文件。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IAudioManager](interface_i_audio_manager.md) | interface
AudioManager音频适配器管理接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.audio.v1_0 | 音频接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_audio_render_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_audio_render_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..eb39b43a25ee7c90b64ddaf5795e99b40b7668d2 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_audio_render_8idl.md @@ -0,0 +1,35 @@ +# IAudioRender.idl + + +## 概述 + +Audio播放的接口定义文件。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IAudioRender](interface_i_audio_render.md) | interface
AudioRender音频播放接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.audio.v1_0 | 音频接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_battery_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_battery_callback_8idl.md index 7b87b968efd6452fef859f9392e44af4e1ff2797..4699652adbe5046ecac40ceb421550e475963f5e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_battery_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_battery_callback_8idl.md @@ -1,7 +1,7 @@ # IBatteryCallback.idl -## **概述** +## 概述 电池信息的回调。 @@ -20,18 +20,18 @@ [Battery](battery.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IBatteryCallback](interface_i_battery_callback.md) | 电池信息的回调。 | +| [IBatteryCallback](interface_i_battery_callback.md) | interface
电池信息的回调。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.battery.v1_0 | 电池模块接口的包路径 | +| package ohos.hdi.battery.v1_0 | 电池模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_battery_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_battery_interface_8idl.md index 662cabfcd0b933eb19f6919c278e149ffd712b34..72e25925d2de4477c587dd88d1371d418605a455 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_battery_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_battery_interface_8idl.md @@ -1,7 +1,7 @@ # IBatteryInterface.idl -## **概述** +## 概述 获取、订阅电池信息的接口。 @@ -20,18 +20,18 @@ [Battery](battery.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IBatteryInterface](interface_i_battery_interface.md) | 获取、订阅电池信息的接口。 | +| [IBatteryInterface](interface_i_battery_interface.md) | interface
获取、订阅电池信息的接口。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.battery.v1_0 | 电池模块接口的包路径 | +| package ohos.hdi.battery.v1_0 | 电池模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_8idl.md index 0c641e4aeb1d2785a18aeaa78ab38c30e4c49b54..85852e5b35a67818cc441758176f52ba1b7af569 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_8idl.md @@ -1,7 +1,7 @@ # ICameraDevice.idl -## **概述** +## 概述 Camera设备操作接口。 @@ -15,17 +15,17 @@ Camera设备操作接口。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ICameraDevice](interface_i_camera_device.md) | 定义Camera设备基本的操作。 | +| [ICameraDevice](interface_i_camera_device.md) | interface
定义Camera设备基本的操作。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_callback_8idl.md index 944d0a957e8a806e67b2eb1a7c3bd7dc10d40a91..8c80f84d456ac84bf9ba0746442f1d301e9eed53 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_camera_device_callback_8idl.md @@ -1,7 +1,7 @@ # ICameraDeviceCallback.idl -## **概述** +## 概述 Camera设备的回调接口,主要包含Camera设备发生错误时和上报metadata的回调函数。 @@ -15,20 +15,20 @@ Camera设备的回调接口,主要包含Camera设备发生错误时和上报me **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ICameraDeviceCallback](interface_i_camera_device_callback.md) | 定义Camera设备回调操作。 | +| [ICameraDeviceCallback](interface_i_camera_device_callback.md) | interface
定义Camera设备回调操作。 | -### 关键字 +### 变量 | 名称 | 描述 | | -------- | -------- | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_8idl.md index 8a2434a865bed0af4cd3ab98ca7cbc91ee15b333..a6c07f3716f2a6f19577cd8a00d97dbd2c4c17af 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_8idl.md @@ -1,7 +1,7 @@ # ICameraHost.idl -## **概述** +## 概述 Camera服务的管理类,对上层提供HDI接口。 @@ -15,20 +15,20 @@ Camera服务的管理类,对上层提供HDI接口。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ICameraHost](interface_i_camera_host.md) | 定义Camera设备功能操作。 | +| [ICameraHost](interface_i_camera_host.md) | interface
定义Camera设备功能操作。 | -### 关键字 +### 变量 | 名称 | 描述 | | -------- | -------- | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_callback_8idl.md index c77ad0f79b94cd58cf9c658b89bbb1b8a9343616..c20eb7521b58ada33369b361b026f756e416cf0f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_camera_host_callback_8idl.md @@ -1,7 +1,7 @@ # ICameraHostCallback.idl -## **概述** +## 概述 ICameraHost的回调接口,提供Camera设备和闪关灯状态变化的回调函数,回调函数由调用者实现。 @@ -15,20 +15,20 @@ ICameraHost的回调接口,提供Camera设备和闪关灯状态变化的回调 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ICameraHostCallback](interface_i_camera_host_callback.md) | 定义Camera设备功能回调操作。 | +| [ICameraHostCallback](interface_i_camera_host_callback.md) | interface
定义Camera设备功能回调操作。 | -### 关键字 +### 变量 | 名称 | 描述 | | -------- | -------- | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_cellbatching_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_cellbatching_callback_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..d0d6b3a608bfa1e275296a3a9389b101a3023da8 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_cellbatching_callback_8idl.md @@ -0,0 +1,37 @@ +# ICellbatchingCallback.idl + + +## 概述 + +定义基站轨迹数据记录模块回调接口。 + +在用户订阅基站轨迹数据记录功能时需要注册这个回调函数接口的实例。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [ICellbatchingCallback](interface_i_cellbatching_callback.md) | interface
导入基站轨迹数据记录模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellbatching.v1_0 | 基站轨迹数据记录模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_cellbatching_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_cellbatching_interface_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..20183e21fecebf0587fa608e2448e40904339dab --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_cellbatching_interface_8idl.md @@ -0,0 +1,35 @@ +# ICellbatchingInterface.idl + + +## 概述 + +声明基站轨迹数据记录模块提供的API,用于使能和去使能基站轨迹数据记录功能,主动获取基站轨迹数据。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [ICellbatchingInterface](interface_i_cellbatching_interface.md) | interface
导入基站轨迹数据记录模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellbatching.v1_0 | 基站轨迹数据记录模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_cellfence_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_cellfence_callback_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..281bd0396df93235ddcf7fdf9261bd8d713449ec --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_cellfence_callback_8idl.md @@ -0,0 +1,35 @@ +# ICellfenceCallback.idl + + +## 概述 + +定义基站围栏模块回调接口。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [ICellfenceCallback](interface_i_cellfence_callback.md) | interface
导入基站围栏模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellfence.v1_0 | 基站围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_cellfence_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_cellfence_interface_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..0182142e3f157b5613383e7353f3df1803f4bc36 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_cellfence_interface_8idl.md @@ -0,0 +1,35 @@ +# ICellfenceInterface.idl + + +## 概述 + +声明基站围栏模块提供的API,用于添加基站围栏,删除基站围栏和获取基站围栏使用信息。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [ICellfenceInterface](interface_i_cellfence_interface.md) | interface
导入基站围栏模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.cellfence.v1_0 | 基站围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_circle.md b/zh-cn/device-dev/reference/hdi-apis/_i_circle.md index 2293ef4912ae0d72e8cf9aa7ecea55cf098cde01..d8532c54d8f208b37f028cb5a612bb258113706d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_circle.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_circle.md @@ -1,7 +1,7 @@ # ICircle -## **概述** +## 概述 圆形描述结构体定义,用于硬件加速绘制圆形。 @@ -10,14 +10,14 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [x](_display.md#x-24) | 矩形框起始X坐标。 | -| [y](_display.md#y-24) | 矩形框起始Y坐标。 | -| [r](_display.md#r) | 圆的半径。 | -| [color](_display.md#color-25) | 圆的颜色。 | +| [x](_display.md#x-24) | int32_t
圆心x坐标 | +| [y](_display.md#y-24) | int32_t
圆心y坐标r | +| [r](_display.md#r) | int32_t
圆的半径 | +| [color](_display.md#color-25) | uint32_t
圆的颜色 | diff --git a/zh-cn/device-dev/reference/hdi-apis/face__auth_2_i_executor_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_executor_8idl_faceauth.md similarity index 60% rename from zh-cn/device-dev/reference/hdi-apis/face__auth_2_i_executor_8idl.md rename to zh-cn/device-dev/reference/hdi-apis/_i_executor_8idl_faceauth.md index f10ada48070e6ba28b3e710c710f13cf97c6608f..bce94c0700755cfbb8627d77fe39683b4d7cc549 100644 --- a/zh-cn/device-dev/reference/hdi-apis/face__auth_2_i_executor_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_executor_8idl_faceauth.md @@ -1,27 +1,27 @@ # IExecutor.idl -## **概述** +## 概述 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfFaceAuth](_hdf_face_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IExecutor](interface_i_executor.md) | 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 | +| [IExecutor](interface_i_executor_faceauth.md) | interface
定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/pin__auth_2_i_executor_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_executor_8idl_pinauth.md similarity index 58% rename from zh-cn/device-dev/reference/hdi-apis/pin__auth_2_i_executor_8idl.md rename to zh-cn/device-dev/reference/hdi-apis/_i_executor_8idl_pinauth.md index c521e57491dce8ea817583370c6219278cfe6051..1ad18256a76a0cd08d75b4bd145fb8188acc47eb 100644 --- a/zh-cn/device-dev/reference/hdi-apis/pin__auth_2_i_executor_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_executor_8idl_pinauth.md @@ -1,31 +1,31 @@ # IExecutor.idl -## **概述** +## 概述 定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfPinAuth](_hdf_pin_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IExecutor](interface_pin_i_executor.md) | 定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 | +| [IExecutor](interface_i_executor_pinauth.md) | interface
定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径 | +| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/face__auth_2_i_executor_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_executor_callback_8idl_faceauth.md similarity index 53% rename from zh-cn/device-dev/reference/hdi-apis/face__auth_2_i_executor_callback_8idl.md rename to zh-cn/device-dev/reference/hdi-apis/_i_executor_callback_8idl_faceauth.md index 89c668dc7fcf495eb6d5710d3fcb68b36b87686e..993c87d5fa2b5dd1413021d17790288e26097d6e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/face__auth_2_i_executor_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_executor_callback_8idl_faceauth.md @@ -1,31 +1,31 @@ # IExecutorCallback.idl -## **概述** +## 概述 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfFaceAuth](_hdf_face_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IExecutorCallback](interface_i_executor_callback.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。使用细节见[IExecutor](interface_i_executor.md)。 | +| [IExecutorCallback](interface_i_executor_callback_faceauth.md) | interface
定义异步API接口回调,用于返回异步接口的请求处理结果和信息。使用细节见[IExecutor](interface_i_executor_faceauth.md)。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径 | +| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_executor_callback_8idl_pinauth.md b/zh-cn/device-dev/reference/hdi-apis/_i_executor_callback_8idl_pinauth.md new file mode 100644 index 0000000000000000000000000000000000000000..8f910b040b69a32dac4bc6bfac237bf86436dd3e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_executor_callback_8idl_pinauth.md @@ -0,0 +1,31 @@ +# IExecutorCallback.idl + + +## 概述 + +定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。 + +**Since:** + +3.2 + +**相关模块:** + +[HdfPinAuth](_hdf_pin_auth.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IExecutorCallback](interface_i_executor_callback_pinauth.md) | interface
定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。使用细节见[IExecutor](interface_i_executor_pinauth.md)。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_face_auth_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_face_auth_interface_8idl.md index 9a2f845c20dafdb59bbdc5f7bba0550e9691c864..bb93f5cc907066b51323be4c2db29d89e3907f69 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_face_auth_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_face_auth_interface_8idl.md @@ -1,31 +1,31 @@ # IFaceAuthInterface.idl -## **概述** +## 概述 定义获取人脸认证驱动的执行器列表接口,用于从人脸认证驱动获取执行器对象列表。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfFaceAuth](_hdf_face_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IFaceAuthInterface](interface_i_face_auth_interface.md) | 定义获取人脸认证驱动的执行器列表接口。 | +| [IFaceAuthInterface](interface_i_face_auth_interface.md) | interface
定义获取人脸认证驱动的执行器列表接口。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径 | +| package ohos.hdi.face_auth.v1_0 | 人脸认证接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_geofence_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_geofence_callback_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..2953a14bc933acc7d038b233497eb7b916f2ae15 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_geofence_callback_8idl.md @@ -0,0 +1,35 @@ +# IGeofenceCallback.idl + + +## 概述 + +定义地理围栏模块回调接口。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IGeofenceCallback](interface_i_geofence_callback.md) | interface
导入地理围栏模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.geofence.v1_0 | 地理围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_geofence_intf_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_geofence_intf_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..cd146d6aa6bd88777e5731cfeb05fcf78a285bf7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_geofence_intf_8idl.md @@ -0,0 +1,35 @@ +# IGeofenceIntf.idl + + +## 概述 + +声明基站围栏模块提供的API,用于添加多种地理围栏,删除地理围栏,获取地理围栏状态信息,获取设备地理位置,下发基站离线数据库。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IGeofenceInterface](interface_i_geofence_interface.md) | interface
导入地理围栏模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.geofence.v1_0 | 地理围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_input_interface.md b/zh-cn/device-dev/reference/hdi-apis/_i_input_interface.md index 8c20b1df852f9663f11f9810664778f527c65541..30a8e54edf3a730ae66522324a1a05177d91d250 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_input_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_input_interface.md @@ -1,28 +1,28 @@ # IInputInterface -## **概述** +## 概述 定义用于提供Input设备驱动程序功能的接口。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [iInputManager](#iinputmanager) | Input设备的设备管理接口 | -| [iInputController](#iinputcontroller) | Input设备的业务控制接口 | -| [iInputReporter](#iinputreporter) | Input设备的数据上报接口 | +| [iInputManager](#iinputmanager) | [InputManager](_input_manager.md) \*
Input设备的设备管理接口  | +| [iInputController](#iinputcontroller) | [InputController](_input_controller.md) \*
Input设备的业务控制接口  | +| [iInputReporter](#iinputreporter) | [InputReporter](_input_reporter.md) \*
Input设备的数据上报接口  | -## **类成员变量说明** +## 类成员变量说明 ### iInputController @@ -31,9 +31,7 @@ ``` InputController* IInputInterface::iInputController ``` - -**描述:** - +**描述:** Input设备的业务控制接口 @@ -43,9 +41,7 @@ Input设备的业务控制接口 ``` InputManager* IInputInterface::iInputManager ``` - -**描述:** - +**描述:** Input设备的设备管理接口 @@ -55,7 +51,5 @@ Input设备的设备管理接口 ``` InputReporter* IInputInterface::iInputReporter ``` - -**描述:** - +**描述:** Input设备的数据上报接口 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_light_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_light_interface_8idl.md index aca373cfa7d9f8ce752380cdec2ec7e0466188ee..848b3b0d2816a0d8338a54e84aa9ef759d82fa48 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_light_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_light_interface_8idl.md @@ -1,7 +1,7 @@ # ILightInterface.idl -## **概述** +## 概述 定义灯模块的通用接口能力,包括获取灯类型ID、打开或关闭灯光、设置灯的亮度和闪烁模式。 @@ -15,17 +15,17 @@ **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ILightInterface](interface_i_light_interface.md) | 提供灯模块基本操作接口。 | +| [ILightInterface](interface_i_light_interface.md) | interface
提供灯模块基本操作接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_line.md b/zh-cn/device-dev/reference/hdi-apis/_i_line.md index 5862171b3cf32ca39b0a60adf34cf1f13729464d..ecf51d93fe590a3ae0b11e3f1d0cb0b18b0bff4c 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_line.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_line.md @@ -1,7 +1,7 @@ # ILine -## **概述** +## 概述 线条描述结构体定义,用于硬件加速绘制直线。 @@ -10,15 +10,15 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [x0](_display.md#x0-12) | 线条起点的X坐标。 | -| [y0](_display.md#y0-12) | 线条起点的Y坐标。 | -| [x1](_display.md#x1-13) | 线条终点的X坐标。 | -| [y1](_display.md#y1-13) | 线条终点的Y坐标。 | -| [color](_display.md#color-15) | 线条颜色。 | +| [x0](_display.md#x0-12) | int32_t
线条起点的x坐标 | +| [y0](_display.md#y0-12) | int32_t
线条起点的y坐标 | +| [x1](_display.md#x1-13) | int32_t
线条终点的x坐标 | +| [y1](_display.md#y1-13) | int32_t
线条终点的y坐标 | +| [color](_display.md#color-15) | uint32_t
线条颜色 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_motion_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_motion_callback_8idl.md index 08483942ca8df59eb0513ecef2444a4cab4337d0..26b3b974ed2f62d5a8a9c27e1754db0a856f9d72 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_motion_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_motion_callback_8idl.md @@ -1,7 +1,7 @@ # IMotionCallback.idl -## **概述** +## 概述 定义上报手势识别数据回调函数接口。 @@ -17,17 +17,17 @@ **相关模块:** -[Motion](motion.md) +[Motion](_motion.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IMotionCallback](interface_i_motion_callback.md) | 定义上报手势识别数据回调函数。 | +| [IMotionCallback](interface_i_motion_callback.md) | interface
定义上报手势识别数据回调函数。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_motion_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_motion_interface_8idl.md index 92fd912be4c749fd3e0af1668131c13ccc2c8729..863b811feb7cc71f0772d9ac43210cece804e9fa 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_motion_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_motion_interface_8idl.md @@ -1,7 +1,7 @@ # IMotionInterface.idl -## **概述** +## 概述 定义使能/去使能手势识别、订阅/取消订阅手势识别数据的接口。 @@ -17,17 +17,17 @@ **相关模块:** -[Motion](motion.md) +[Motion](_motion.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IMotionInterface](interface_i_motion_interface.md) | 提供Motion设备基本控制操作接口。 | +| [IMotionInterface](interface_i_motion_interface.md) | interface
提供Motion设备基本控制操作接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_nnrt_device_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_nnrt_device_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..995cd340295fd1507f04d22de6ca099228b90ff3 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_nnrt_device_8idl.md @@ -0,0 +1,37 @@ +# INnrtDevice.idl + + +## 概述 + +该文件定义芯片设备相关的接口。 + +该文件包含对芯片设备的信息查询、AI模型编译接口。 + +**Since:** + +3.2 + +**Version:** + +2.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [INnrtDevice](interface_i_nnrt_device.md) | interface
定义了与设备相关的接口,实现设备管理和模型编译等操作。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.nnrt.v2_0 | NNRt模块的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_o_tensor.md b/zh-cn/device-dev/reference/hdi-apis/_i_o_tensor.md new file mode 100644 index 0000000000000000000000000000000000000000..7fdb326dd0d86512de1235df0fa744c3afa9225e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_o_tensor.md @@ -0,0 +1,81 @@ +# IOTensor + + +## 概述 + +AI模型的输入输出张量。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [name](#name) | String
张量的名称  | +| [dataType](#datatype) | enum [DataType](_n_n_rt.md#datatype)
张量的数据类型, 数据类型定义请查看[DataType](_n_n_rt.md#datatype) | +| [dimensions](#dimensions) | int[]
张量的形状  | +| [format](#format) | enum [Format](_n_n_rt.md#format)
张量的数据排列格式,排列格式的定义请查看[Format](_n_n_rt.md#format) | +| [data](#data) | struct [SharedBuffer](_shared_buffer.md)
张量的数据,数据保存在共享内存中,共享内存的定义请查看[SharedBuffer](_shared_buffer.md) | + + +## 类成员变量说明 + + +### data + + +``` +struct SharedBuffer IOTensor::data +``` +**描述:** +张量的数据,数据保存在共享内存中,共享内存的定义请查看[SharedBuffer](_shared_buffer.md) + + +### dataType + + +``` +enum DataType IOTensor::dataType +``` +**描述:** +张量的数据类型, 数据类型定义请查看[DataType](_n_n_rt.md#datatype) + + +### dimensions + + +``` +int [] IOTensor::dimensions +``` +**描述:** +张量的形状 + + +### format + + +``` +enum Format IOTensor::format +``` +**描述:** +张量的数据排列格式,排列格式的定义请查看[Format](_n_n_rt.md#format) + + +### name + + +``` +String IOTensor::name +``` +**描述:** +张量的名称 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_offline_stream_operator_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_offline_stream_operator_8idl.md index 4328c264226967bd3e8853dd2b5f9e084dea7b55..169a4a97fac101efe6264566aa46e8f959017c54 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_offline_stream_operator_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_offline_stream_operator_8idl.md @@ -1,7 +1,7 @@ # IOfflineStreamOperator.idl -## **概述** +## 概述 离线流的操作接口。 @@ -15,20 +15,20 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IOfflineStreamOperator](interface_i_offline_stream_operator.md) | 定义Camera设备离线流操作。 | +| [IOfflineStreamOperator](interface_i_offline_stream_operator.md) | interface
定义Camera设备离线流操作。 | -### 关键字 +### 变量 | 名称 | 描述 | | -------- | -------- | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_pin_auth_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_pin_auth_interface_8idl.md index 4a1362ac9401a1f682c0f0ef0e61fb6cac9ecfe2..95466b91b8146d74f17156625fccd0fefcae0d8d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_pin_auth_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_pin_auth_interface_8idl.md @@ -1,31 +1,31 @@ # IPinAuthInterface.idl -## **概述** +## 概述 定义获取口令认证驱动的执行器列表接口,用于从口令认证驱动获取执行器对象列表。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfPinAuth](_hdf_pin_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IPinAuthInterface](interface_i_pin_auth_interface.md) | 定义获取口令认证驱动的执行器列表接口。 | +| [IPinAuthInterface](interface_i_pin_auth_interface.md) | interface
定义获取口令认证驱动的执行器列表接口。 | ### 关键字 | 名称 | 描述 | | -------- | -------- | -| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径 | +| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_power_hdi_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_power_hdi_callback_8idl.md index 3336fcba06cf6ec28189e14c35300c7d6b3eedd2..3fd942d407b6a546b30eba26f5221ff0936b0798 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_power_hdi_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_power_hdi_callback_8idl.md @@ -1,13 +1,13 @@ # IPowerHdiCallback.idl -## **概述** +## 概述 休眠/唤醒状态的回调。 电源模块为电源服务提供的订阅休眠/唤醒状态的回调。 -**Since:** +**Since:** 3.1 @@ -20,14 +20,14 @@ [Power](power.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IPowerHdiCallback](interface_i_power_hdi_callback.md) | 休眠/唤醒状态的回调。 | +| [IPowerHdiCallback](interface_i_power_hdi_callback.md) | interface
休眠/唤醒状态的回调。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_power_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_power_interface_8idl.md index dc9da2e90b44e572eece17d102853495bb91e7a2..d0648c50c4eaec940a1a93c35460571b7e650fdc 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_power_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_power_interface_8idl.md @@ -1,13 +1,13 @@ # IPowerInterface.idl -## **概述** +## 概述 休眠/唤醒操作、订阅休眠/唤醒状态、运行锁管理的接口。 电源模块为电源服务提供休眠/唤醒操作、订阅休眠/唤醒状态和运行锁管理的接口。 -**Since:** +**Since:** 3.1 @@ -20,14 +20,14 @@ [Power](power.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IPowerInterface](interface_i_power_interface.md) | 休眠/唤醒操作、订阅休眠/唤醒状态、运行锁管理的接口。 | +| [IPowerInterface](interface_i_power_interface.md) | interface
休眠/唤醒操作、订阅休眠/唤醒状态、运行锁管理的接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_prepared_model_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_prepared_model_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..1e7fd7783d9712411ee42e8d1d48cb0df5f2a9c6 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_prepared_model_8idl.md @@ -0,0 +1,35 @@ +# IPreparedModel.idl + + +## 概述 + +该文件定义了AI模型推理、获取模型输入tensor维度范围、导出编译后模型等接口。 + +**Since:** + +3.2 + +**Version:** + +2.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IPreparedModel](interface_i_prepared_model.md) | interface
定义模型编译后的对象,包含编译后模型导出、模型推理接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.nnrt.v2_0 | NNRt模块的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_rect.md b/zh-cn/device-dev/reference/hdi-apis/_i_rect.md index f9085f24e11c14e4ef55d9b4c02f27e8bd7e4b97..ec72624f51e3a6b9dfe5d3e2151ad70653e12d85 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_rect.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_rect.md @@ -1,23 +1,23 @@ # IRect -## **概述** +## 概述 -定义矩形信息。 +定义矩形信息 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [x](_display.md#x-14) | 矩形框起始X坐标。 | -| [y](_display.md#y-14) | 矩形框起始Y坐标。 | -| [w](_display.md#w-12) | 矩形框宽度。 | -| [h](_display.md#h-12) | 矩形框高度。 | +| [x](_display.md#x-14) | int32_t
矩形框起始x坐标 | +| [y](_display.md#y-14) | int32_t
矩形框起始y坐标 | +| [w](_display.md#w-12) | int32_t
矩形框宽度 | +| [h](_display.md#h-12) | int32_t
矩形框高度 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_ril_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_ril_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..c78949f41c6481d6ee1731805b59fd5d2adddc01 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_ril_8idl.md @@ -0,0 +1,35 @@ +# IRil.idl + + +## 概述 + +Ril模块的请求接口。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IRil](interface_i_ril.md) | interface
Ril模块的请求接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.ril.v1_0 | Ril模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_ril_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_ril_callback_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..909e4026fabe04e2f00cc22409fafb10486da64f --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_ril_callback_8idl.md @@ -0,0 +1,35 @@ +# IRilCallback.idl + + +## 概述 + +Ril模块的回调接口 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IRilCallback](interface_i_ril_callback.md) | interface
Ril模块的回调接口。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.ril.v1_0 | Ril模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_sensor_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_sensor_callback_8idl.md index 90176ba6c0d139069118cc31184af63e7d5c8158..de8e511dff94ca2011d9919e97c7dca27d0dd9ac 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_sensor_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_sensor_callback_8idl.md @@ -1,11 +1,11 @@ # ISensorCallback.idl -## **概述** +## 概述 Sensor模块为Sensor服务提供数据上报的回调函数。 -**Since:** +**Since:** 2.2 @@ -15,17 +15,17 @@ Sensor模块为Sensor服务提供数据上报的回调函数。 **相关模块:** -[Sensor](sensor.md) +[Sensor](_sensor.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ISensorCallback](interface_i_sensor_callback.md) | 定义用于上报传感器数据的回调函数。 | +| [ISensorCallback](interface_i_sensor_callback.md) | interface
定义用于上报传感器数据的回调函数。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_sensor_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_sensor_interface_8idl.md index 9b93aadd9a598ef7f112ba15e6d775a9b074ced5..37d319717c07a16b5857c5939425f89692572e4f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_sensor_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_sensor_interface_8idl.md @@ -1,11 +1,11 @@ # ISensorInterface.idl -## **概述** +## 概述 Sensor模块对外通用的接口声明文件,提供获取传感器设备信息、订阅/取消订阅传感器数据、 使能/去使能传感器、设置传感器模式、设置传感器精度,量程等可选配置接口定义。 -**Since:** +**Since:** 2.2 @@ -15,17 +15,17 @@ Sensor模块对外通用的接口声明文件,提供获取传感器设备信 **相关模块:** -[Sensor](sensor.md) +[Sensor](_sensor.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ISensorInterface](interface_i_sensor_interface.md) | 提供Sensor设备基本控制操作接口。 | +| [ISensorInterface](interface_i_sensor_interface.md) | interface
提供Sensor设备基本控制操作接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_8idl.md index 1ee2bebbcae25ee741c7f52362cfc1cd8a3e3a57..70cfefd536f0b3cfe1e05dfd2232d18bfc04b559 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_8idl.md @@ -1,11 +1,11 @@ # IStreamOperator.idl -## **概述** +## 概述 流的操作接口。 -**Since:** +**Since:** 3.2 @@ -15,22 +15,22 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IStreamOperator](interface_i_stream_operator.md) | 定义Camera设备流操作。 | +| [IStreamOperator](interface_i_stream_operator.md) | interface
定义Camera设备流操作。 | -### 关键字 +### 变量 | 名称 | 描述 | | -------- | -------- | | package ohos.hdi.camera.v1_0 | Camera设备接口的包路径。 | -| sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable | ohos.hdi.camera.v1_0序列,可用缓冲区生成器。 | +| sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable | ohos.hdi.camera.v1_0序列,可用缓冲区生成器。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_callback_8idl.md index f349924e485b58083362b1641a013ba2252ede13..68b19a851b9d4818ccd86a6cf9e33ecea76f9a6b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_stream_operator_callback_8idl.md @@ -1,11 +1,11 @@ # IStreamOperatorCallback.idl -## **概述** +## 概述 [IStreamOperator](interface_i_stream_operator.md)相关的回调,这些回调均由调用者实现。 -**Since:** +**Since:** 3.2 @@ -15,20 +15,20 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IStreamOperatorCallback](interface_i_stream_operator_callback.md) | 定义Camera设备流回调操作。 | +| [IStreamOperatorCallback](interface_i_stream_operator_callback.md) | interface
定义Camera设备流回调操作。 | -### 关键字 +### 变量 | 名称 | 描述 | | -------- | -------- | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_surface.md b/zh-cn/device-dev/reference/hdi-apis/_i_surface.md index 8006305430c09c9e3f97b5731cf0b882e3ee9f4c..a5ca123687c102bd5a8ae26b46cfadf361779ecb 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_surface.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_surface.md @@ -1,7 +1,7 @@ # ISurface -## **概述** +## 概述 用于存放窗口相关信息的结构体定义,提供给硬件加速使用,例如图像合成,位图搬移等操作。 @@ -10,23 +10,23 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [phyAddr](_display.md#phyaddr-23) | 图像首地址 | -| [height](_display.md#height-48) | 图像高度 | -| [width](_display.md#width-49) | 图像宽度 | -| [stride](_display.md#stride-12) | 图像跨度 | -| [enColorFmt](_display.md#encolorfmt) | 图像格式 | -| [bYCbCrClut](_display.md#bycbcrclut) | CLUT表是否位于 YCbCr 空间 | -| [bAlphaMax255](_display.md#balphamax255) | 图像Alpha最大值为255还是128 | -| [bAlphaExt1555](_display.md#balphaext1555) | 是否使能1555的Alpha扩展 | -| [alpha0](_display.md#alpha0-22) | Alpha0值,取值范围:[0,255] | -| [alpha1](_display.md#alpha1-22) | Alpha1值,取值范围:[0,255] | -| [clutPhyAddr](_display.md#clutphyaddr) | CbCr分量地址 | -| [cbcrStride](_display.md#cbcrstride) | CbCr分量跨度 | -| [clutPhyAddr](_display.md#clutphyaddr) | CLUT表首地址,用作颜色扩展或颜色校正 | +| [phyAddr](_display.md#phyaddr-23) | uint64_t
图像首地址 | +| [height](_display.md#height-48) | int32_t
图像高度 | +| [width](_display.md#width-49) | int32_t
图像宽度 | +| [stride](_display.md#stride-12) | int32_t
图像跨度 | +| [enColorFmt](_display.md#encolorfmt) | [PixelFormat](_display.md#pixelformat)
图像格式 | +| [bYCbCrClut](_display.md#bycbcrclut) | bool
CLUT表是否位于 YCbCr 空间 | +| [bAlphaMax255](_display.md#balphamax255) | bool
图像alpha最大值为255还是128 | +| [bAlphaExt1555](_display.md#balphaext1555) | bool
是否使能1555的Alpha扩展 | +| [alpha0](_display.md#alpha0-22) | uint8_t
Alpha0值,取值范围:[0,255] | +| [alpha1](_display.md#alpha1-22) | uint8_t
Alpha1值,取值范围:[0,255] | +| [cbcrPhyAddr](_display.md#cbcrphyaddr) | uint64_t
CbCr分量地址 | +| [cbcrStride](_display.md#cbcrstride) | int32_t
CbCr分量跨度 | +| [clutPhyAddr](_display.md#clutphyaddr) | uint64_t
Clut表首地址,用作颜色扩展或颜色校正 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_thermal_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_thermal_callback_8idl.md index 67ec77493039b8de2a3a97be1063c2945c4c968a..51b3c103cad2e0595fefd2dbfdfae9ee1e4a4ac2 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_thermal_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_thermal_callback_8idl.md @@ -1,7 +1,7 @@ # IThermalCallback.idl -## **概述** +## 概述 设备发热状态的回调。 @@ -20,14 +20,14 @@ [Thermal](thermal.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IThermalCallback](interface_i_thermal_callback.md) | 订阅设备发热状态的回调。 | +| [IThermalCallback](interface_i_thermal_callback.md) | interface
订阅设备发热状态的回调。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_thermal_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_thermal_interface_8idl.md index 94f01ad5540cbeb24513fed7cab2573ee21ac077..b6bc811df10cfeea34d2de775f0d52fdb4c60287 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_thermal_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_thermal_interface_8idl.md @@ -1,7 +1,7 @@ # IThermalInterface.idl -## **概述** +## 概述 设备温度管理、控制及订阅接口。 @@ -20,14 +20,14 @@ [Thermal](thermal.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IThermalInterface](interface_i_thermal_interface.md) | 设备温度管理、控制及订阅接口。 | +| [IThermalInterface](interface_i_thermal_interface.md) | interface
设备温度管理、控制及订阅接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_usb_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_usb_interface_8idl.md index b7dad51734962b8a92cdac7544341552bb0c51c6..78619bd4bd24d50ebb6815f107f0f2383862f099 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_usb_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_usb_interface_8idl.md @@ -1,7 +1,7 @@ # IUsbInterface.idl -## **概述** +## 概述 声明标准的USB驱动接口函数。 @@ -15,17 +15,17 @@ **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IUsbInterface](interface_i_usb_interface.md) | 定义USB驱动基本的操作功能。 | +| [IUsbInterface](interface_i_usb_interface.md) | interface
定义USB驱动基本的操作功能。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_usbd_bulk_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_usbd_bulk_callback_8idl.md index 0c86dd008f370412921b5187ee2498c4c62b529a..fc629fcae1335a4bf76e62e9c30c01ee30df06c3 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_usbd_bulk_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_usbd_bulk_callback_8idl.md @@ -1,7 +1,7 @@ # IUsbdBulkCallback.idl -## **概述** +## 概述 USB驱动批量传输读/写数据的回调。 @@ -15,17 +15,17 @@ USB驱动批量传输读/写数据的回调。 **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) | USB驱动的回调函数。 | +| [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) | interface
USB驱动的回调函数。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_usbd_subscriber_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_usbd_subscriber_8idl.md index 6a7bdfc81009ef635e3bf85ea770726963a073fc..d9ea98b74cc03613fab84a6d3e5ba8bb4e13d367 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_usbd_subscriber_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_usbd_subscriber_8idl.md @@ -1,7 +1,7 @@ # IUsbdSubscriber.idl -## **概述** +## 概述 USB驱动的订阅函数。 @@ -15,17 +15,17 @@ USB驱动的订阅函数。 **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IUsbdSubscriber](interface_i_usbd_subscriber.md) | 定义USB驱动的订阅类相关函数。 | +| [IUsbdSubscriber](interface_i_usbd_subscriber.md) | interface
定义USB驱动的订阅类相关函数。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_user_auth_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_user_auth_interface_8idl.md index 65a42d5ab47817d5f689becba8a863a3595d9667..6f4f9cc391a8260c35bf8d1ea570d7e5b9cbf448 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_user_auth_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_user_auth_interface_8idl.md @@ -1,27 +1,27 @@ # IUserAuthInterface.idl -## **概述** +## 概述 声明用户认证驱动的API接口。接口可用于注册执行器,管理用户认证凭据,完成PIN码和生物特征认证。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IUserAuthInterface](interface_i_user_auth_interface.md) | 声明用户认证驱动的API接口。 | +| [IUserAuthInterface](interface_i_user_auth_interface.md) | interface
声明用户认证驱动的API接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_vibrator_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_vibrator_interface_8idl.md index bd1f6b90c2b08b8e9b58193eafea768589d6836e..6a44f066c33a79a8f265aef01a5fb8c33bb15e02 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_vibrator_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_vibrator_interface_8idl.md @@ -1,7 +1,7 @@ # IVibratorInterface.idl -## **概述** +## 概述 定义马达的通用API,可用于控制马达执行单次或周期性振动、设置马达振幅与频率。 @@ -15,17 +15,17 @@ **相关模块:** -[Vibrator](vibrator.md) +[Vibrator](_vibrator.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IVibratorInterface](interface_i_vibrator_interface.md) | Vibrator模块向上层服务提供统一的接口。 | +| [IVibratorInterface](interface_i_vibrator_interface.md) | interface
Vibrator模块向上层服务提供统一的接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_wififence_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_wififence_callback_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..6ccb9d6c281192aa7b8702cd004523919c601e90 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_wififence_callback_8idl.md @@ -0,0 +1,35 @@ +# IWififenceCallback.idl + + +## 概述 + +定义Wi-Fi围栏模块回调接口。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceWififence](_hdi_lpfence_wififence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IWififenceCallback](interface_i_wififence_callback.md) | interface
导入Wi-Fi围栏模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.wififence.v1_0 | Wi-Fi围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_wififence_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_wififence_interface_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..f473171a739fcc146835b6a4dfd2f770a5ece651 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_i_wififence_interface_8idl.md @@ -0,0 +1,35 @@ +# IWififenceInterface.idl + + +## 概述 + +定义Wi-Fi围栏模块回调接口。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceWififence](_hdi_lpfence_wififence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IWififenceInterface](interface_i_wififence_interface.md) | interface
导入Wi-Fi围栏模块的数据类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.wififence.v1_0 | Wi-Fi围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_wlan_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_wlan_callback_8idl.md index beb6dbd85a0accf901c36f1212d4e1a5747c95f6..10a8f12dc97ba18c212ee001cfb9e83e16ac79ed 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_wlan_callback_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_wlan_callback_8idl.md @@ -1,7 +1,7 @@ # IWlanCallback.idl -## **概述** +## 概述 WLAN模块为WLAN服务提供的重启驱动、扫描结果、Netlink消息处理的回调。 @@ -15,17 +15,17 @@ WLAN模块为WLAN服务提供的重启驱动、扫描结果、Netlink消息处 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IWlanCallback](interface_i_wlan_callback.md) | 定义WLAN模块的回调函数。 | +| [IWlanCallback](interface_i_wlan_callback.md) | interface
定义WLAN模块的回调函数。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_i_wlan_interface_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_i_wlan_interface_8idl.md index adaa08cb01c1d4e01d58f984623fd0d762a7a56e..92e29bad5036400f6b07b81508bd38aeddb79eda 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_i_wlan_interface_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_i_wlan_interface_8idl.md @@ -1,9 +1,11 @@ # IWlanInterface.idl -## **概述** +## 概述 -WLAN模块操作接口,上层服务调用相关的接口可实现:建立/关闭WLAN热点,扫描/关联/去关联WLAN热点,设置国家码,管理网络设备等功能。 +建立/关闭WLAN热点,扫描/关联/去关联WLAN热点,设置国家码,管理网络设备等操作的接口。 + +上层服务调用相关的接口实现:建立/关闭WLAN热点,扫描/关联/去关联WLAN热点,设置国家码,管理网络设备等功能。 **Since:** @@ -15,17 +17,17 @@ WLAN模块操作接口,上层服务调用相关的接口可实现:建立/关 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [IWlanInterface](interface_i_wlan_interface.md) | WLAN模块向上层WLAN服务提供了统一接口。 | +| [IWlanInterface](interface_i_wlan_interface.md) | interface
WLAN模块向上层WLAN服务提供了统一接口。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_icc_io_result_info.md b/zh-cn/device-dev/reference/hdi-apis/_icc_io_result_info.md new file mode 100644 index 0000000000000000000000000000000000000000..35f7f0a28942a6c04d5c85077e9148a6aed65899 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_icc_io_result_info.md @@ -0,0 +1,55 @@ +# IccIoResultInfo + + +## 概述 + +SIM数据的响应结果信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [sw1](#sw1) | int
SIM卡状态字1,命令执行后SIM卡返回的响应  | +| [sw2](#sw2) | int
SIM卡状态字2,命令执行后SIM卡返回的响应  | +| [response](#response) | String
响应信息  | + + +## 类成员变量说明 + + +### response + + +``` +String IccIoResultInfo::response +``` +**描述:** +响应信息 + + +### sw1 + + +``` +int IccIoResultInfo::sw1 +``` +**描述:** +SIM卡状态字1,命令执行后SIM卡返回的响应 + + +### sw2 + + +``` +int IccIoResultInfo::sw2 +``` +**描述:** +SIM卡状态字2,命令执行后SIM卡返回的响应 diff --git a/zh-cn/device-dev/reference/hdi-apis/_identify_result_info.md b/zh-cn/device-dev/reference/hdi-apis/_identify_result_info.md index 7de20781d4853dcc55f0a24b127939d5abc0c241..0033407fb4d7f270bbf961d4b432e8be7d1fc663 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_identify_result_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_identify_result_info.md @@ -1,36 +1,32 @@ # IdentifyResultInfo -## **概述** +## 概述 用户身份识别结果信息。 -**Since:** - +**Since:** 3.2 - **Version:** - 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [result](#result) | 用户身份识别结果。 | -| [userId](#userid) | 用户ID。 | -| [token](#token) | 用户身份识别令牌。 | +| [result](#result) | int
用户身份识别结果。  | +| [userId](#userid) | int
用户ID。  | +| [token](#token) | unsigned char[]
用户身份识别令牌。  | -## **类成员变量说明** +## 类成员变量说明 ### result @@ -39,9 +35,7 @@ ``` int IdentifyResultInfo::result ``` - -**描述:** - +**描述:** 用户身份识别结果。 @@ -51,9 +45,7 @@ int IdentifyResultInfo::result ``` unsigned char [] IdentifyResultInfo::token ``` - -**描述:** - +**描述:** 用户身份识别令牌。 @@ -63,7 +55,5 @@ unsigned char [] IdentifyResultInfo::token ``` int IdentifyResultInfo::userId ``` - -**描述:** - +**描述:** 用户ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/input.md b/zh-cn/device-dev/reference/hdi-apis/_input.md similarity index 66% rename from zh-cn/device-dev/reference/hdi-apis/input.md rename to zh-cn/device-dev/reference/hdi-apis/_input.md index 4e58d0dde9250ce07d777c7e2192f2f08f27753a..774ec22b1a87e88c6c57bea7b5ed4789dca6529f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/input.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input.md @@ -1,22 +1,22 @@ # Input -## **概述** +## 概述 Input模块驱动接口声明。 本模块为Input服务提供相关驱动接口,包括Input设备的打开和关闭、Input事件获取、设备信息查询、回调函数注册、特性状态控制等接口。 -**Since**: +**Since:** 1.0 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 @@ -33,21 +33,21 @@ Input模块驱动接口声明。 | 名称 | 描述 | | -------- | -------- | -| [InputController](_input_controller.md) | 提供Input设备业务控制相关的接口。 | -| [InputManager](_input_manager.md) | 提供Input设备管理相关的接口。 | -| [IInputInterface](_i_input_interface.md) | 定义用于提供Input设备驱动程序功能的接口。 | -| [InputReporter](_input_reporter.md) | 提供Input设备数据上报相关的接口。 | -| [InputEventPackage](_input_event_package.md) | Input事件数据包结构。 | -| [InputHotPlugEvent](_input_hot_plug_event.md) | 热插拔事件数据包结构。 | -| [InputDevDesc](_input_dev_desc.md) | Input设备描述信息。 | -| [InputEventCb](_input_event_cb.md) | 此结构体定义了输入事件回调函数并提供给Input服务使用。 | -| [InputHostCb](_input_host_cb.md) | 此结构体定义了热插拔事件上报回调函数并提供给Input服务使用。 | -| [InputDevAbility](_input_dev_ability.md) | Input设备的能力属性,存储支持事件的位图。 | -| [InputDimensionInfo](_input_dimension_info.md) | Input设备的维度信息。 | -| [InputDevIdentify](_input_dev_identify.md) | Input设备的识别信息。 | -| [InputDevAttr](_input_dev_attr.md) | Input设备属性。 | -| [InputDeviceInfo](_input_device_info.md) | Input设备基础设备信息。 | -| [InputExtraCmd](_input_extra_cmd.md) | 扩展指令的数据结构。 | +| [InputController](_input_controller.md) | struct
提供Input设备业务控制相关的接口。 | +| [InputManager](_input_manager.md) | struct
提供Input设备管理相关的接口。 | +| [IInputInterface](_i_input_interface.md) | struct
定义用于提供Input设备驱动程序功能的接口。 | +| [InputReporter](_input_reporter.md) | struct
提供Input设备数据上报相关的接口。 | +| [InputEventPackage](_input_event_package.md) | struct
Input事件数据包结构。 | +| [InputHotPlugEvent](_input_hot_plug_event.md) | struct
热插拔事件数据包结构。 | +| [InputDevDesc](_input_dev_desc.md) | struct
Input设备描述信息。 | +| [InputEventCb](_input_event_cb.md) | struct
此结构体定义了输入事件回调函数并提供给Input服务使用。 | +| [InputHostCb](_input_host_cb.md) | struct
此结构体定义了热插拔事件上报回调函数并提供给Input服务使用。 | +| [InputDevAbility](_input_dev_ability.md) | struct
Input设备的能力属性,存储支持事件的位图。 | +| [InputDimensionInfo](_input_dimension_info.md) | struct
Input设备的维度信息。 | +| [InputDevIdentify](_input_dev_identify.md) | struct
Input设备的识别信息。 | +| [InputDevAttr](_input_dev_attr.md) | struct
Input设备属性。 | +| [InputDeviceInfo](_input_device_info.md) | struct
Input设备基础设备信息。 | +| [InputExtraCmd](_input_extra_cmd.md) | struct
扩展指令的数据结构。 | ### 宏定义 @@ -71,20 +71,20 @@ Input模块驱动接口声明。 | 名称 | 描述 | | -------- | -------- | -| [RetStatus](#retstatus) {   INPUT_SUCCESS = 0, INPUT_FAILURE = -1, INPUT_INVALID_PARAM = -2, INPUT_NOMEM = -3,   INPUT_NULL_PTR = -4, INPUT_TIMEOUT = -5, INPUT_UNSUPPORTED = -6 } | 定义返回值类型。 | -| [InputDevType](#inputdevtype) {   INDEV_TYPE_TOUCH, INDEV_TYPE_KEY, INDEV_TYPE_KEYBOARD, INDEV_TYPE_MOUSE,   INDEV_TYPE_BUTTON, INDEV_TYPE_CROWN, INDEV_TYPE_ENCODER, INDEV_TYPE_UNKNOWN } | 定义Input设备类型。 | +| [RetStatus](#retstatus) { INPUT_SUCCESS = 0, INPUT_FAILURE = -1, INPUT_INVALID_PARAM = -2, INPUT_NOMEM = -3,   INPUT_NULL_PTR = -4, INPUT_TIMEOUT = -5, INPUT_UNSUPPORTED = -6 } | 定义返回值类型。 | +| [InputDevType](#inputdevtype) { INDEV_TYPE_TOUCH, INDEV_TYPE_KEY, INDEV_TYPE_KEYBOARD, INDEV_TYPE_MOUSE,   INDEV_TYPE_BUTTON, INDEV_TYPE_CROWN, INDEV_TYPE_ENCODER, INDEV_TYPE_UNKNOWN } | 定义Input设备类型。 | | [PowerStatus](#powerstatus) { INPUT_RESUME, INPUT_SUSPEND, INPUT_LOW_POWER, INPUT_POWER_STATUS_UNKNOWN } | 定义电源状态。 | -| [CapacitanceTest](#capacitancetest) {   BASE_TEST, FULL_TEST, MMI_TEST, RUNNING_TEST,   TEST_TYPE_UNKNOWN } | 定义容值测试类型。 | +| [CapacitanceTest](#capacitancetest) { BASE_TEST, FULL_TEST, MMI_TEST, RUNNING_TEST,   TEST_TYPE_UNKNOWN } | 定义容值测试类型。 | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [GetInputInterface](#getinputinterface) ([IInputInterface](_i_input_interface.md) \*\*interface) | Input服务通过调用此接口获取操作Input设备的所有接口。 | +| [GetInputInterface](#getinputinterface) ([IInputInterface](_i_input_interface.md) \*\*interface) | int32_t
Input服务通过调用此接口获取操作Input设备的所有接口。 | -## **宏定义说明** +## 宏定义说明 ### BITS_TO_UINT64 @@ -94,7 +94,7 @@ Input模块驱动接口声明。 #define BITS_TO_UINT64( count) DIV_ROUND_UP(count, BYTE_HAS_BITS * sizeof(uint64_t)) ``` -**描述:** +**描述:** 比特与64位无符号整数的转换公式 @@ -106,7 +106,7 @@ Input模块驱动接口声明。 #define BYTE_HAS_BITS 8 ``` -**描述:** +**描述:** 一个字节所包含的比特数 @@ -118,7 +118,7 @@ Input模块驱动接口声明。 #define CHIP_INFO_LEN 10 ``` -**描述:** +**描述:** 芯片信息长度 @@ -130,7 +130,7 @@ Input模块驱动接口声明。 #define CHIP_NAME_LEN 10 ``` -**描述:** +**描述:** 芯片名称长度 @@ -142,7 +142,7 @@ Input模块驱动接口声明。 #define DEV_MANAGER_SERVICE_NAME "hdf_input_host" ``` -**描述:** +**描述:** Input设备节点服务名称 @@ -154,7 +154,7 @@ Input设备节点服务名称 #define DEV_NAME_LEN 64 ``` -**描述:** +**描述:** Input设备名称长度 @@ -166,7 +166,7 @@ Input设备名称长度 #define DIV_ROUND_UP( nr, d ) (((nr) + (d) - 1) / (d)) ``` -**描述:** +**描述:** 向上取整计算公式 @@ -178,7 +178,7 @@ Input设备名称长度 #define HDF_FF_CNT (0x7f + 1) ``` -**描述:** +**描述:** Input设备发送力反馈命令的数量最大值 @@ -190,7 +190,7 @@ Input设备发送力反馈命令的数量最大值 #define MAX_INPUT_DEV_NUM 32 ``` -**描述:** +**描述:** Input设备数量的最大值 @@ -202,7 +202,7 @@ Input设备数量的最大值 #define SELF_TEST_RESULT_LEN 20 ``` -**描述:** +**描述:** 自测试结果长度 @@ -214,12 +214,12 @@ Input设备数量的最大值 #define VENDOR_NAME_LEN 10 ``` -**描述:** +**描述:** 厂商名称长度 -## **枚举类型说明** +## 枚举类型说明 ### CapacitanceTest @@ -229,7 +229,7 @@ Input设备数量的最大值 enum CapacitanceTest ``` -**描述:** +**描述:** 定义容值测试类型。 @@ -249,7 +249,7 @@ enum CapacitanceTest enum InputDevType ``` -**描述:** +**描述:** 定义Input设备类型。 @@ -272,7 +272,7 @@ enum InputDevType enum PowerStatus ``` -**描述:** +**描述:** 定义电源状态。 @@ -291,7 +291,7 @@ enum PowerStatus enum RetStatus ``` -**描述:** +**描述:** 定义返回值类型。 @@ -306,7 +306,7 @@ enum RetStatus | INPUT_UNSUPPORTED | 特性不支持 | -## **函数说明** +## 函数说明 ### GetInputInterface() @@ -316,7 +316,7 @@ enum RetStatus int32_t GetInputInterface (IInputInterface ** interface) ``` -**描述:** +**描述:** Input服务通过调用此接口获取操作Input设备的所有接口。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_controller.md b/zh-cn/device-dev/reference/hdi-apis/_input_controller.md index 34ed01cf05b1a3ccbf1c59fe78ea25dd1a2d19bb..8c1d658571dc35d3c335d068c4f70e3f32639fc5 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_controller.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_controller.md @@ -1,7 +1,7 @@ # InputController -## **概述** +## 概述 提供Input设备业务控制相关的接口。 @@ -9,28 +9,28 @@ **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([SetPowerStatus](#setpowerstatus) )(uint32_t devIndex, uint32_t status) | 设置电源状态。 | -| ([GetPowerStatus](#getpowerstatus) )(uint32_t devIndex, uint32_t \*status) | 获取电源状态。 | -| ([GetDeviceType](#getdevicetype) )(uint32_t devIndex, uint32_t \*deviceType) | 获取devIndex对应的Input设备的类型。 | -| ([GetChipInfo](#getchipinfo) )(uint32_t devIndex, char \*chipInfo, uint32_t length) | 获取器件对应的编码信息。 | -| ([GetVendorName](#getvendorname) )(uint32_t devIndex, char \*vendorName, uint32_t length) | 获取devIndex对应的模组厂商名。 | -| ([GetChipName](#getchipname) )(uint32_t devIndex, char \*chipName, uint32_t length) | 获取devIndex对应的驱动芯片名。 | -| ([SetGestureMode](#setgesturemode) )(uint32_t devIndex, uint32_t gestureMode) | 设置手势模式。 | -| ([RunCapacitanceTest](#runcapacitancetest) )(uint32_t devIndex, uint32_t testType, char \*result, uint32_t length) | 执行容值自检测试。 | -| ([RunExtraCommand](#runextracommand) )(uint32_t devIndex, [InputExtraCmd](_input_extra_cmd.md) \*cmd) | 执行拓展指令。 | +| (\* [SetPowerStatus](#setpowerstatus) )(uint32_t devIndex, uint32_t status) | int32_t
设置电源状态。 | +| (\* [GetPowerStatus](#getpowerstatus) )(uint32_t devIndex, uint32_t \*status) | int32_t
获取电源状态。 | +| (\* [GetDeviceType](#getdevicetype) )(uint32_t devIndex, uint32_t \*deviceType) | int32_t
获取devIndex对应的Input设备的类型。 | +| (\* [GetChipInfo](#getchipinfo) )(uint32_t devIndex, char \*chipInfo, uint32_t length) | int32_t
获取器件对应的编码信息。 | +| (\* [GetVendorName](#getvendorname) )(uint32_t devIndex, char \*vendorName, uint32_t length) | int32_t
获取devIndex对应的模组厂商名。 | +| (\* [GetChipName](#getchipname) )(uint32_t devIndex, char \*chipName, uint32_t length) | int32_t
获取devIndex对应的驱动芯片名。 | +| (\* [SetGestureMode](#setgesturemode) )(uint32_t devIndex, uint32_t gestureMode) | int32_t
设置手势模式。 | +| (\* [RunCapacitanceTest](#runcapacitancetest) )(uint32_t devIndex, uint32_t testType, char \*result, uint32_t length) | int32_t
执行容值自检测试。 | +| (\* [RunExtraCommand](#runextracommand) )(uint32_t devIndex, [InputExtraCmd](_input_extra_cmd.md) \*cmd) | int32_t
执行拓展指令。 | -## **类成员变量说明** +## 类成员变量说明 ### GetChipInfo @@ -40,7 +40,7 @@ int32_t(* InputController::GetChipInfo) (uint32_t devIndex, char *chipInfo, uint32_t length) ``` -**描述:** +**描述:** 获取器件对应的编码信息。 @@ -58,7 +58,7 @@ int32_t(* InputController::GetChipInfo) (uint32_t devIndex, char *chipInfo, uint INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### GetChipName @@ -68,7 +68,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::GetChipName) (uint32_t devIndex, char *chipName, uint32_t length) ``` -**描述:** +**描述:** 获取devIndex对应的驱动芯片名。 @@ -84,7 +84,7 @@ int32_t(* InputController::GetChipName) (uint32_t devIndex, char *chipName, uint INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### GetDeviceType @@ -94,7 +94,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::GetDeviceType) (uint32_t devIndex, uint32_t *deviceType) ``` -**描述:** +**描述:** 获取devIndex对应的Input设备的类型。 @@ -103,13 +103,13 @@ int32_t(* InputController::GetDeviceType) (uint32_t devIndex, uint32_t *deviceTy | 名称 | 描述 | | -------- | -------- | | devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | -| deviceType | 输出参数,获取的对应设备索引的设备类型,具体参考[InputDevType](input.md#inputdevtype)。 | +| deviceType | 输出参数,获取的对应设备索引的设备类型,具体参考[InputDevType](_input.md#inputdevtype)。 | **返回:** INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### GetPowerStatus @@ -119,7 +119,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::GetPowerStatus) (uint32_t devIndex, uint32_t *status) ``` -**描述:** +**描述:** 获取电源状态。 @@ -130,13 +130,13 @@ int32_t(* InputController::GetPowerStatus) (uint32_t devIndex, uint32_t *status) | 名称 | 描述 | | -------- | -------- | | devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | -| status | 输出参数,获取的对应设备索引的电源状态,具体参考[PowerStatus](input.md#powerstatus)。 | +| status | 输出参数,获取的对应设备索引的电源状态,具体参考[PowerStatus](_input.md#powerstatus)。 | **返回:** INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### GetVendorName @@ -146,7 +146,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::GetVendorName) (uint32_t devIndex, char *vendorName, uint32_t length) ``` -**描述:** +**描述:** 获取devIndex对应的模组厂商名。 @@ -162,7 +162,7 @@ int32_t(* InputController::GetVendorName) (uint32_t devIndex, char *vendorName, INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### RunCapacitanceTest @@ -172,7 +172,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::RunCapacitanceTest) (uint32_t devIndex, uint32_t testType, char *result, uint32_t length) ``` -**描述:** +**描述:** 执行容值自检测试。 @@ -183,7 +183,7 @@ int32_t(* InputController::RunCapacitanceTest) (uint32_t devIndex, uint32_t test | 名称 | 描述 | | -------- | -------- | | devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | -| testType | 输入参数,容值测试的测试类型,具体参考[CapacitanceTest](input.md#capacitancetest)。 | +| testType | 输入参数,容值测试的测试类型,具体参考[CapacitanceTest](_input.md#capacitancetest)。 | | result | 输出参数,容值测试的结果,成功则输出“SUCC”,失败则返回对应的错误提示。 | | length | 输入参数,保存容值测试结果的内存长度。 | @@ -191,7 +191,7 @@ int32_t(* InputController::RunCapacitanceTest) (uint32_t devIndex, uint32_t test INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### RunExtraCommand @@ -201,7 +201,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::RunExtraCommand) (uint32_t devIndex, InputExtraCmd *cmd) ``` -**描述:** +**描述:** 执行拓展指令。 @@ -216,7 +216,7 @@ int32_t(* InputController::RunExtraCommand) (uint32_t devIndex, InputExtraCmd *c INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### SetGestureMode @@ -226,7 +226,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::SetGestureMode) (uint32_t devIndex, uint32_t gestureMode) ``` -**描述:** +**描述:** 设置手势模式。 @@ -243,7 +243,7 @@ int32_t(* InputController::SetGestureMode) (uint32_t devIndex, uint32_t gestureM INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### SetPowerStatus @@ -253,7 +253,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputController::SetPowerStatus) (uint32_t devIndex, uint32_t status) ``` -**描述:** +**描述:** 设置电源状态。 @@ -264,10 +264,10 @@ int32_t(* InputController::SetPowerStatus) (uint32_t devIndex, uint32_t status) | 名称 | 描述 | | -------- | -------- | | devIndex | 输入参数,Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | -| status | 输入参数,设置的电源状态,Input服务控制Input设备进入resume或者suspend等状态[PowerStatus](input.md#powerstatus)。 | +| status | 输入参数,设置的电源状态,Input服务控制Input设备进入resume或者suspend等状态[PowerStatus](_input.md#powerstatus)。 | **返回:** INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_dev_ability.md b/zh-cn/device-dev/reference/hdi-apis/_input_dev_ability.md index fc6af49701af96bf471528f33c670fabffa8f03e..acf49d3cae019a26c82223e703b2b7b43199ae05 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_dev_ability.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_dev_ability.md @@ -1,39 +1,41 @@ # InputDevAbility -## **概述** +## 概述 -Input设备的能力属性,存储支持事件的位图。用位的方式来表示该Input设备能够上报的事件类型。 +Input设备的能力属性,存储支持事件的位图。 + +用位的方式来表示该Input设备能够上报的事件类型。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [devProp](#devprop) [[BITS_TO_UINT64](input.md#bitstouint64)(INPUT_PROP_CNT)] | 设备属性 | -| [eventType](#eventtype) [[BITS_TO_UINT64](input.md#bitstouint64)(EV_CNT)] | 记录支持的事件类型的位图 | -| [absCode](#abscode) [[BITS_TO_UINT64](input.md#bitstouint64)(ABS_CNT)] | 记录支持的绝对坐标的位图 | -| [relCode](#relcode) [[BITS_TO_UINT64](input.md#bitstouint64)(REL_CNT)] | 记录支持的相对坐标的位图 | -| [keyCode](#keycode) [[BITS_TO_UINT64](input.md#bitstouint64)(KEY_CNT)] | 记录支持的按键值的位图 | -| [ledCode](#ledcode) [[BITS_TO_UINT64](input.md#bitstouint64)(LED_CNT)] | 记录设备支持的指示灯的位图 | -| [miscCode](#misccode) [[BITS_TO_UINT64](input.md#bitstouint64)(MSC_CNT)] | 记录设备支持的其他功能的位图 | -| [soundCode](#soundcode) [[BITS_TO_UINT64](input.md#bitstouint64)(SND_CNT)] | 记录设备支持的声音或警报的位图 | -| [forceCode](#forcecode) [[BITS_TO_UINT64](input.md#bitstouint64)([HDF_FF_CNT](input.md#hdf_ff_cnt))] | 记录设备支持的作用力功能的位图 | -| [switchCode](#switchcode) [[BITS_TO_UINT64](input.md#bitstouint64)(SW_CNT)] | 记录设备支持的开关功能的位图 | -| [keyType](#keytype) [[BITS_TO_UINT64](input.md#bitstouint64)(KEY_CNT)] | 按键状态的位图 | -| [ledType](#ledtype) [[BITS_TO_UINT64](input.md#bitstouint64)(LED_CNT)] | LED状态的位图 | -| [soundType](#soundtype) [[BITS_TO_UINT64](input.md#bitstouint64)(SND_CNT)] | 声音状态的位图 | -| [switchType](#switchtype) [[BITS_TO_UINT64](input.md#bitstouint64)(SW_CNT)] | 开关状态的位图 | +| [devProp](#devprop) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(INPUT_PROP_CNT)] | uint64_t
设备属性  | +| [eventType](#eventtype) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(EV_CNT)] | uint64_t
用于记录支持的事件类型的位图  | +| [absCode](#abscode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(ABS_CNT)] | uint64_t
记录支持的绝对坐标的位图  | +| [relCode](#relcode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(REL_CNT)] | uint64_t
记录支持的相对坐标的位图  | +| [keyCode](#keycode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(KEY_CNT)] | uint64_t
记录支持的按键值的位图  | +| [ledCode](#ledcode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(LED_CNT)] | uint64_t
记录设备支持的指示灯的位图  | +| [miscCode](#misccode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(MSC_CNT)] | uint64_t
记录设备支持的其他功能的位图  | +| [soundCode](#soundcode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(SND_CNT)] | uint64_t
记录设备支持的声音或警报的位图  | +| [forceCode](#forcecode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)([HDF_FF_CNT](_input.md#hdf_ff_cnt))] | uint64_t
记录设备支持的作用力功能的位图  | +| [switchCode](#switchcode) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(SW_CNT)] | uint64_t
记录设备支持的开关功能的位图  | +| [keyType](#keytype) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(KEY_CNT)] | uint64_t
按键状态的位图  | +| [ledType](#ledtype) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(LED_CNT)] | uint64_t
led状态的位图  | +| [soundType](#soundtype) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(SND_CNT)] | uint64_t
声音状态的位图  | +| [switchType](#switchtype) [[BITS_TO_UINT64](_input.md#bits_to_uint64)(SW_CNT)] | uint64_t
开关状态的位图  | -## **类成员变量说明** +## 类成员变量说明 ### absCode @@ -42,9 +44,7 @@ Input设备的能力属性,存储支持事件的位图。用位的方式来表 ``` uint64_t InputDevAbility::absCode[BITS_TO_UINT64(ABS_CNT)] ``` - -**描述:** - +**描述:** 记录支持的绝对坐标的位图 @@ -54,9 +54,7 @@ uint64_t InputDevAbility::absCode[BITS_TO_UINT64(ABS_CNT)] ``` uint64_t InputDevAbility::devProp[BITS_TO_UINT64(INPUT_PROP_CNT)] ``` - -**描述:** - +**描述:** 设备属性 @@ -66,9 +64,7 @@ uint64_t InputDevAbility::devProp[BITS_TO_UINT64(INPUT_PROP_CNT)] ``` uint64_t InputDevAbility::eventType[BITS_TO_UINT64(EV_CNT)] ``` - -**描述:** - +**描述:** 用于记录支持的事件类型的位图 @@ -78,9 +74,7 @@ uint64_t InputDevAbility::eventType[BITS_TO_UINT64(EV_CNT)] ``` uint64_t InputDevAbility::forceCode[BITS_TO_UINT64(HDF_FF_CNT)] ``` - -**描述:** - +**描述:** 记录设备支持的作用力功能的位图 @@ -90,9 +84,7 @@ uint64_t InputDevAbility::forceCode[BITS_TO_UINT64(HDF_FF_CNT)] ``` uint64_t InputDevAbility::keyCode[BITS_TO_UINT64(KEY_CNT)] ``` - -**描述:** - +**描述:** 记录支持的按键值的位图 @@ -102,9 +94,7 @@ uint64_t InputDevAbility::keyCode[BITS_TO_UINT64(KEY_CNT)] ``` uint64_t InputDevAbility::keyType[BITS_TO_UINT64(KEY_CNT)] ``` - -**描述:** - +**描述:** 按键状态的位图 @@ -114,9 +104,7 @@ uint64_t InputDevAbility::keyType[BITS_TO_UINT64(KEY_CNT)] ``` uint64_t InputDevAbility::ledCode[BITS_TO_UINT64(LED_CNT)] ``` - -**描述:** - +**描述:** 记录设备支持的指示灯的位图 @@ -126,9 +114,7 @@ uint64_t InputDevAbility::ledCode[BITS_TO_UINT64(LED_CNT)] ``` uint64_t InputDevAbility::ledType[BITS_TO_UINT64(LED_CNT)] ``` - -**描述:** - +**描述:** led状态的位图 @@ -138,9 +124,7 @@ led状态的位图 ``` uint64_t InputDevAbility::miscCode[BITS_TO_UINT64(MSC_CNT)] ``` - -**描述:** - +**描述:** 记录设备支持的其他功能的位图 @@ -150,9 +134,7 @@ uint64_t InputDevAbility::miscCode[BITS_TO_UINT64(MSC_CNT)] ``` uint64_t InputDevAbility::relCode[BITS_TO_UINT64(REL_CNT)] ``` - -**描述:** - +**描述:** 记录支持的相对坐标的位图 @@ -162,9 +144,7 @@ uint64_t InputDevAbility::relCode[BITS_TO_UINT64(REL_CNT)] ``` uint64_t InputDevAbility::soundCode[BITS_TO_UINT64(SND_CNT)] ``` - -**描述:** - +**描述:** 记录设备支持的声音或警报的位图 @@ -174,9 +154,7 @@ uint64_t InputDevAbility::soundCode[BITS_TO_UINT64(SND_CNT)] ``` uint64_t InputDevAbility::soundType[BITS_TO_UINT64(SND_CNT)] ``` - -**描述:** - +**描述:** 声音状态的位图 @@ -186,9 +164,7 @@ uint64_t InputDevAbility::soundType[BITS_TO_UINT64(SND_CNT)] ``` uint64_t InputDevAbility::switchCode[BITS_TO_UINT64(SW_CNT)] ``` - -**描述:** - +**描述:** 记录设备支持的开关功能的位图 @@ -198,7 +174,5 @@ uint64_t InputDevAbility::switchCode[BITS_TO_UINT64(SW_CNT)] ``` uint64_t InputDevAbility::switchType[BITS_TO_UINT64(SW_CNT)] ``` - -**描述:** - +**描述:** 开关状态的位图 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_dev_attr.md b/zh-cn/device-dev/reference/hdi-apis/_input_dev_attr.md index 27ffb8c84c6882fdecde230d24023d0ead5bade6..599cb39761e51b14ac6b2de6a6c1822e9019d0e2 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_dev_attr.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_dev_attr.md @@ -1,28 +1,28 @@ # InputDevAttr -## **概述** +## 概述 Input设备属性。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [devName](#devname) [DEV_NAME_LEN] | 设备名 | -| [id](#id) | 设备识别信息 | -| [axisInfo](#axisinfo) [ABS_CNT] | 设备维度信息 | +| [devName](#devname) [[DEV_NAME_LEN](_input.md#dev_name_len)] | char
设备名  | +| [id](#id) | [InputDevIdentify](_input_dev_identify.md)
设备识别信息  | +| [axisInfo](#axisinfo) [ABS_CNT] | [InputDimensionInfo](_input_dimension_info.md)
设备维度信息  | -## **类成员变量说明** +## 类成员变量说明 ### axisInfo @@ -31,9 +31,7 @@ Input设备属性。 ``` InputDimensionInfo InputDevAttr::axisInfo[ABS_CNT] ``` - -**描述:** - +**描述:** 设备维度信息 @@ -43,9 +41,7 @@ InputDimensionInfo InputDevAttr::axisInfo[ABS_CNT] ``` char InputDevAttr::devName[DEV_NAME_LEN] ``` - -**描述:** - +**描述:** 设备名 @@ -55,7 +51,5 @@ char InputDevAttr::devName[DEV_NAME_LEN] ``` InputDevIdentify InputDevAttr::id ``` - -**描述:** - +**描述:** 设备识别信息 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_dev_desc.md b/zh-cn/device-dev/reference/hdi-apis/_input_dev_desc.md index 89b51c3c3dde76f178fcee194062fde0dea4d740..9d9fbf85a8435f9164f2728e2431b13c0cdb81bc 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_dev_desc.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_dev_desc.md @@ -1,27 +1,27 @@ # InputDevDesc -## **概述** +## 概述 Input设备描述信息。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [devIndex](#devindex) | 设备索引。 | -| [devType](#devtype) | 设备类型。 | +| [devIndex](#devindex) | uint32_t
设备索引  | +| [devType](#devtype) | uint32_t
设备类型  | -## **类成员变量说明** +## 类成员变量说明 ### devIndex @@ -30,9 +30,7 @@ Input设备描述信息。 ``` uint32_t InputDevDesc::devIndex ``` - -**描述:** - +**描述:** 设备索引 @@ -42,7 +40,5 @@ uint32_t InputDevDesc::devIndex ``` uint32_t InputDevDesc::devType ``` - -**描述:** - +**描述:** 设备类型 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_dev_identify.md b/zh-cn/device-dev/reference/hdi-apis/_input_dev_identify.md index 1470ec653c305b4fc2d1fe79aba276a557ea4c30..af6198fbe8b4ce1a1ace98a04d20df5c5870e847 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_dev_identify.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_dev_identify.md @@ -1,29 +1,29 @@ # InputDevIdentify -## **概述** +## 概述 Input设备的识别信息。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [busType](#bustype) | 总线类型 | -| [vendor](#vendor) | 生产商编号 | -| [product](#product) | 产品编号 | -| [version](#version) | 版本号 | +| [busType](#bustype) | uint16_t
总线类型  | +| [vendor](#vendor) | uint16_t
生产商编号  | +| [product](#product) | uint16_t
产品编号  | +| [version](#version) | uint16_t
版本号  | -## **类成员变量说明** +## 类成员变量说明 ### busType @@ -32,9 +32,7 @@ Input设备的识别信息。 ``` uint16_t InputDevIdentify::busType ``` - -**描述:** - +**描述:** 总线类型 @@ -44,9 +42,7 @@ uint16_t InputDevIdentify::busType ``` uint16_t InputDevIdentify::product ``` - -**描述:** - +**描述:** 产品编号 @@ -56,9 +52,7 @@ uint16_t InputDevIdentify::product ``` uint16_t InputDevIdentify::vendor ``` - -**描述:** - +**描述:** 生产商编号 @@ -68,7 +62,5 @@ uint16_t InputDevIdentify::vendor ``` uint16_t InputDevIdentify::version ``` - -**描述:** - +**描述:** 版本号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_device_info.md b/zh-cn/device-dev/reference/hdi-apis/_input_device_info.md index 46d0ccbb683ebbeff26b184da4525c295562f601..9151c102fb96af61a311c3c20dc296bbee938d32 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_device_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_device_info.md @@ -1,32 +1,32 @@ # InputDeviceInfo -## **概述** +## 概述 Input设备基础设备信息。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [devIndex](#devindex) | 设备索引 | -| [devType](#devtype) | 设备类型 | -| [chipInfo](#chipinfo) [CHIP_INFO_LEN] | 驱动芯片编码信息 | -| [vendorName](#vendorname) [VENDOR_NAME_LEN] | 模组厂商名 | -| [chipName](#chipname) [CHIP_NAME_LEN] | 驱动芯片型号 | -| [attrSet](#attrset) | 设备属性 | -| [abilitySet](#abilityset) | 设备能力属性 | +| [devIndex](#devindex) | uint32_t
设备索引  | +| [devType](#devtype) | uint32_t
设备类型  | +| [chipInfo](#chipinfo) [[CHIP_INFO_LEN](_input.md#chip_info_len)] | char
驱动芯片编码信息  | +| [vendorName](#vendorname) [[VENDOR_NAME_LEN](_input.md#vendor_name_len)] | char
模组厂商名  | +| [chipName](#chipname) [[CHIP_NAME_LEN](_input.md#chip_name_len)] | char
驱动芯片型号  | +| [attrSet](#attrset) | [InputDevAttr](_input_dev_attr.md)
设备属性  | +| [abilitySet](#abilityset) | [InputDevAbility](_input_dev_ability.md)
设备能力属性  | -## **类成员变量说明** +## 类成员变量说明 ### abilitySet @@ -35,9 +35,7 @@ Input设备基础设备信息。 ``` InputDevAbility InputDeviceInfo::abilitySet ``` - -**描述:** - +**描述:** 设备能力属性 @@ -47,9 +45,7 @@ InputDevAbility InputDeviceInfo::abilitySet ``` InputDevAttr InputDeviceInfo::attrSet ``` - -**描述:** - +**描述:** 设备属性 @@ -59,9 +55,7 @@ InputDevAttr InputDeviceInfo::attrSet ``` char InputDeviceInfo::chipInfo[CHIP_INFO_LEN] ``` - -**描述:** - +**描述:** 驱动芯片编码信息 @@ -71,9 +65,7 @@ char InputDeviceInfo::chipInfo[CHIP_INFO_LEN] ``` char InputDeviceInfo::chipName[CHIP_NAME_LEN] ``` - -**描述:** - +**描述:** 驱动芯片型号 @@ -83,9 +75,7 @@ char InputDeviceInfo::chipName[CHIP_NAME_LEN] ``` uint32_t InputDeviceInfo::devIndex ``` - -**描述:** - +**描述:** 设备索引 @@ -95,9 +85,7 @@ uint32_t InputDeviceInfo::devIndex ``` uint32_t InputDeviceInfo::devType ``` - -**描述:** - +**描述:** 设备类型 @@ -107,7 +95,5 @@ uint32_t InputDeviceInfo::devType ``` char InputDeviceInfo::vendorName[VENDOR_NAME_LEN] ``` - -**描述:** - +**描述:** 模组厂商名 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_dimension_info.md b/zh-cn/device-dev/reference/hdi-apis/_input_dimension_info.md index 16919c614433d3d3781a4618a1aafb2d04a49272..36f628a827c710cdae4aa320a7e3f9a2d0087903 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_dimension_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_dimension_info.md @@ -1,31 +1,31 @@ # InputDimensionInfo -## **概述** +## 概述 Input设备的维度信息。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [axis](#axis) | 坐标轴 | -| [min](#min) | 记录各个坐标的最小值 | -| [max](#max) | 记录各个坐标的最大值 | -| [fuzz](#fuzz) | 记录各个坐标的分辨率 | -| [flat](#flat) | 记录各个坐标的基准值 | -| [range](#range) | 范围 | +| [axis](#axis) | int32_t
坐标轴  | +| [min](#min) | int32_t
记录各个坐标的最小值  | +| [max](#max) | int32_t
记录各个坐标的最大值  | +| [fuzz](#fuzz) | int32_t
记录各个坐标的分辨率  | +| [flat](#flat) | int32_t
记录各个坐标的基准值  | +| [range](#range) | int32_t
范围  | -## **类成员变量说明** +## 类成员变量说明 ### axis @@ -34,9 +34,7 @@ Input设备的维度信息。 ``` int32_t InputDimensionInfo::axis ``` - -**描述:** - +**描述:** 坐标轴 @@ -46,9 +44,7 @@ int32_t InputDimensionInfo::axis ``` int32_t InputDimensionInfo::flat ``` - -**描述:** - +**描述:** 记录各个坐标的基准值 @@ -58,9 +54,7 @@ int32_t InputDimensionInfo::flat ``` int32_t InputDimensionInfo::fuzz ``` - -**描述:** - +**描述:** 记录各个坐标的分辨率 @@ -70,9 +64,7 @@ int32_t InputDimensionInfo::fuzz ``` int32_t InputDimensionInfo::max ``` - -**描述:** - +**描述:** 记录各个坐标的最大值 @@ -82,9 +74,7 @@ int32_t InputDimensionInfo::max ``` int32_t InputDimensionInfo::min ``` - -**描述:** - +**描述:** 记录各个坐标的最小值 @@ -94,7 +84,5 @@ int32_t InputDimensionInfo::min ``` int32_t InputDimensionInfo::range ``` - -**描述:** - +**描述:** 范围 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_event_cb.md b/zh-cn/device-dev/reference/hdi-apis/_input_event_cb.md index b91f20bfafd8c53c43ce9a481a9d368572730044..3fa9b50838d74e2084ae1f2d6e03ba71178c1e54 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_event_cb.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_event_cb.md @@ -1,26 +1,26 @@ # InputEventCb -## **概述** +## 概述 此结构体定义了输入事件回调函数并提供给Input服务使用。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([EventPkgCallback](#eventpkgcallback) )(const [InputEventPackage](_input_event_package.md) \*\*pkgs, uint32_t count, uint32_t devIndex) | 输入事件数据上报的回调函数。 | +| (\* [EventPkgCallback](#eventpkgcallback) )(const [InputEventPackage](_input_event_package.md) \*\*pkgs, uint32_t count, uint32_t devIndex) | void
输入事件数据上报的回调函数。 | -## **类成员变量说明** +## 类成员变量说明 ### EventPkgCallback @@ -30,7 +30,7 @@ void(* InputEventCb::EventPkgCallback) (const InputEventPackage **pkgs, uint32_t count, uint32_t devIndex) ``` -**描述:** +**描述:** 输入事件数据上报的回调函数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_event_package.md b/zh-cn/device-dev/reference/hdi-apis/_input_event_package.md index 402db456d3bfe64396d9441dc458292e260e9a18..600b0fb8e5f9c2a8ff8494ebd7487d11d7538b4b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_event_package.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_event_package.md @@ -1,29 +1,29 @@ # InputEventPackage -## **概述** +## 概述 Input事件数据包结构。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [type](#type) | 输入事件的属性 | -| [code](#code) | 输入事件的特定编码项 | -| [value](#value) | 输入事件编码项对应的值 | -| [timestamp](#timestamp) | 输入事件对应的时间戳 | +| [type](#type) | uint32_t
输入事件的属性  | +| [code](#code) | uint32_t
输入事件的特定编码项  | +| [value](#value) | int32_t
输入事件编码项对应的值  | +| [timestamp](#timestamp) | uint64_t
输入事件对应的时间戳  | -## **类成员变量说明** +## 类成员变量说明 ### code @@ -32,9 +32,7 @@ Input事件数据包结构。 ``` uint32_t InputEventPackage::code ``` - -**描述:** - +**描述:** 输入事件的特定编码项 @@ -44,9 +42,7 @@ uint32_t InputEventPackage::code ``` uint64_t InputEventPackage::timestamp ``` - -**描述:** - +**描述:** 输入事件对应的时间戳 @@ -56,9 +52,7 @@ uint64_t InputEventPackage::timestamp ``` uint32_t InputEventPackage::type ``` - -**描述:** - +**描述:** 输入事件的属性 @@ -68,7 +62,5 @@ uint32_t InputEventPackage::type ``` int32_t InputEventPackage::value ``` - -**描述:** - +**描述:** 输入事件编码项对应的值 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_extra_cmd.md b/zh-cn/device-dev/reference/hdi-apis/_input_extra_cmd.md index 15f6265f62ba0cbecfe9168947ea9d38d228de6d..c9f5a5f50ba1cac71303c31cb300fccbc886ea35 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_extra_cmd.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_extra_cmd.md @@ -1,27 +1,27 @@ # InputExtraCmd -## **概述** +## 概述 扩展指令的数据结构。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [cmdCode](#cmdcode) | 指令对应的编码。 | -| [cmdValue](#cmdvalue) | 指令传输的数据。 | +| [cmdCode](#cmdcode) | const char \*
指令对应的编码  | +| [cmdValue](#cmdvalue) | const char \*
指令传输的数据  | -## **类成员变量说明** +## 类成员变量说明 ### cmdCode @@ -30,9 +30,7 @@ ``` const char* InputExtraCmd::cmdCode ``` - -**描述:** - +**描述:** 指令对应的编码 @@ -42,7 +40,5 @@ const char* InputExtraCmd::cmdCode ``` const char* InputExtraCmd::cmdValue ``` - -**描述:** - +**描述:** 指令传输的数据 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_host_cb.md b/zh-cn/device-dev/reference/hdi-apis/_input_host_cb.md index 9fa62eb2d7cb0ddf78799b6be36ac01ec01ec69d..3ff4a39a0d3c63b164212e64864802d66f72dcb6 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_host_cb.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_host_cb.md @@ -1,23 +1,26 @@ # InputHostCb -## **概述** +## 概述 此结构体定义了热插拔事件上报回调函数并提供给Input服务使用。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([HotPlugCallback](#hotplugcallback) )(const [InputHotPlugEvent](_input_hot_plug_event.md) \*event) | 热插拔事件上报的回调函数。 | +| (\* [HotPlugCallback](#hotplugcallback) )(const [InputHotPlugEvent](_input_hot_plug_event.md) \*event) | void
热插拔事件上报的回调函数。 | + + +## 类成员变量说明 ### HotPlugCallback @@ -27,7 +30,7 @@ void(* InputHostCb::HotPlugCallback) (const InputHotPlugEvent *event) ``` -**描述:** +**描述:** 热插拔事件上报的回调函数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_hot_plug_event.md b/zh-cn/device-dev/reference/hdi-apis/_input_hot_plug_event.md index 120da873657221d2f2301b1f9caa4d8e7ec76543..9c8ad3e3528da62c8b2393af190188d0380b1980 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_hot_plug_event.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_hot_plug_event.md @@ -1,28 +1,28 @@ # InputHotPlugEvent -## **概述** +## 概述 热插拔事件数据包结构。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [devIndex](#devindex) | 设备索引。 | -| [devType](#devtype) | 设备类型。 | -| [status](#status) | 设备状态。 | +| [devIndex](#devindex) | uint32_t
设备索引 | +| [devType](#devtype) | uint32_t
设备类型 | +| [status](#status) | uint32_t
设备状态。 | -## **类成员变量说明** +## 类成员变量说明 ### devIndex @@ -32,7 +32,7 @@ uint32_t InputHotPlugEvent::devIndex ``` -**描述:** +**描述:** 设备索引 @@ -44,7 +44,7 @@ uint32_t InputHotPlugEvent::devIndex uint32_t InputHotPlugEvent::devType ``` -**描述:** +**描述:** 设备类型 @@ -56,8 +56,10 @@ uint32_t InputHotPlugEvent::devType uint32_t InputHotPlugEvent::status ``` -**描述:** +**描述:** 设备状态。 -1: 离线。 0: 在线。 +- 1:离线。 + +- 0:在线。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_manager.md b/zh-cn/device-dev/reference/hdi-apis/_input_manager.md index f3ba8b6b97959e9cc7cde4292f23be594c589155..f3796ec7683a659ca52f346c2957d2945093e0cc 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_manager.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_manager.md @@ -1,7 +1,7 @@ # InputManager -## **概述** +## 概述 提供Input设备管理相关的接口。 @@ -9,24 +9,24 @@ **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([ScanInputDevice](#scaninputdevice) )([InputDevDesc](_input_dev_desc.md) \*staArr, uint32_t arrLen) | Input服务用于扫描所有在线设备。 | -| ([OpenInputDevice](#openinputdevice) )(uint32_t devIndex) | Input服务打开对应设备的设备文件。 | -| ([CloseInputDevice](#closeinputdevice) )(uint32_t devIndex) | Input服务关闭对应设备的设备文件。 | -| ([GetInputDevice](#getinputdevice) )(uint32_t devIndex, [InputDeviceInfo](_input_device_info.md) \*\*devInfo) | Input服务获取对应ID的设备信息。 | -| ([GetInputDeviceList](#getinputdevicelist) )(uint32_t \*devNum, [InputDeviceInfo](_input_device_info.md) \*\*devList, uint32_t size) | Input服务获取所有Input设备列表的设备信息。 | +| (\* [ScanInputDevice](#scaninputdevice) )([InputDevDesc](_input_dev_desc.md) \*staArr, uint32_t arrLen) | int32_t
Input服务用于扫描所有在线设备。 | +| (\* [OpenInputDevice](#openinputdevice) )(uint32_t devIndex) | int32_t
Input服务打开对应设备的设备文件。 | +| (\* [CloseInputDevice](#closeinputdevice) )(uint32_t devIndex) | int32_t
Input服务关闭对应设备的设备文件。 | +| (\* [GetInputDevice](#getinputdevice) )(uint32_t devIndex, [InputDeviceInfo](_input_device_info.md) \*\*devInfo) | int32_t
Input服务获取对应ID的设备信息。 | +| (\* [GetInputDeviceList](#getinputdevicelist) )(uint32_t \*devNum, [InputDeviceInfo](_input_device_info.md) \*\*devList, uint32_t size) | int32_t
Input服务获取所有Input设备列表的设备信息。 | -## **类成员变量说明** +## 类成员变量说明 ### CloseInputDevice @@ -36,7 +36,7 @@ int32_t(* InputManager::CloseInputDevice) (uint32_t devIndex) ``` -**描述:** +**描述:** Input服务关闭对应设备的设备文件。 @@ -50,7 +50,7 @@ Input服务关闭对应设备的设备文件。 INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### GetInputDevice @@ -60,7 +60,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputManager::GetInputDevice) (uint32_t devIndex, InputDeviceInfo **devInfo) ``` -**描述:** +**描述:** Input服务获取对应ID的设备信息。 @@ -75,7 +75,7 @@ Input服务获取对应ID的设备信息。 INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### GetInputDeviceList @@ -85,7 +85,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputManager::GetInputDeviceList) (uint32_t *devNum, InputDeviceInfo **devList, uint32_t size) ``` -**描述:** +**描述:** Input服务获取所有Input设备列表的设备信息。 @@ -101,7 +101,7 @@ Input服务获取所有Input设备列表的设备信息。 INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### OpenInputDevice @@ -111,7 +111,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputManager::OpenInputDevice) (uint32_t devIndex) ``` -**描述:** +**描述:** Input服务打开对应设备的设备文件。 @@ -125,7 +125,7 @@ Input服务打开对应设备的设备文件。 INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### ScanInputDevice @@ -135,7 +135,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputManager::ScanInputDevice) (InputDevDesc *staArr, uint32_t arrLen) ``` -**描述:** +**描述:** Input服务用于扫描所有在线设备。 @@ -150,4 +150,4 @@ Input服务用于扫描所有在线设备。 INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_input_reporter.md b/zh-cn/device-dev/reference/hdi-apis/_input_reporter.md index 05a265bcd9663ff490143df88032c8cc19bf972a..c4c5333e9b36851a03a7cb93bbc154d888c7c4f9 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_input_reporter.md +++ b/zh-cn/device-dev/reference/hdi-apis/_input_reporter.md @@ -1,31 +1,31 @@ # InputReporter -## **概述** +## 概述 提供Input设备数据上报相关的接口。 -此类接口包含input设备的数据上报回调函数的注册和注销。 +此类接口包含Input设备的数据上报回调函数的注册和注销。 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([RegisterReportCallback](#registerreportcallback) )(uint32_t devIndex, [InputEventCb](_input_event_cb.md) \*callback) | 注册对应设备的回调函数。 | -| ([UnregisterReportCallback](#unregisterreportcallback) )(uint32_t devIndex) | 注销对应设备的回调函数。 | -| ([RegisterHotPlugCallback](#registerhotplugcallback) )([InputHostCb](_input_host_cb.md) \*callback) | 注册Input设备的热插拔回调函数。 | -| ([UnregisterHotPlugCallback](#unregisterhotplugcallback) )(void) | 注销Input设备的热插拔回调函数。 | +| (\* [RegisterReportCallback](#registerreportcallback) )(uint32_t devIndex, [InputEventCb](_input_event_cb.md) \*callback) | int32_t
注册对应设备的回调函数。 | +| (\* [UnregisterReportCallback](#unregisterreportcallback) )(uint32_t devIndex) | int32_t
注销对应设备的回调函数。 | +| (\* [RegisterHotPlugCallback](#registerhotplugcallback) )([InputHostCb](_input_host_cb.md) \*callback) | int32_t
注册Input设备的热插拔回调函数。 | +| (\* [UnregisterHotPlugCallback](#unregisterhotplugcallback) )(void) | int32_t
注销Input设备的热插拔回调函数。 | -## **类成员变量说明** +## 类成员变量说明 ### RegisterHotPlugCallback @@ -35,7 +35,7 @@ int32_t(* InputReporter::RegisterHotPlugCallback) (InputHostCb *callback) ``` -**描述:** +**描述:** 注册Input设备的热插拔回调函数。 @@ -51,7 +51,7 @@ Input服务通过此接口注册回调函数到hdi中,所有Input设备由此 INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### RegisterReportCallback @@ -61,7 +61,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputReporter::RegisterReportCallback) (uint32_t devIndex, InputEventCb *callback) ``` -**描述:** +**描述:** 注册对应设备的回调函数。 @@ -78,7 +78,7 @@ Input服务通过此接口注册数据回调函数到hdi中,hdi通过此回调 INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### UnregisterHotPlugCallback @@ -88,7 +88,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputReporter::UnregisterHotPlugCallback) (void) ``` -**描述:** +**描述:** 注销Input设备的热插拔回调函数。 @@ -96,7 +96,7 @@ int32_t(* InputReporter::UnregisterHotPlugCallback) (void) INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 ### UnregisterReportCallback @@ -106,7 +106,7 @@ INPUT_SUCCESS 表示执行成功。 int32_t(* InputReporter::UnregisterReportCallback) (uint32_t devIndex) ``` -**描述:** +**描述:** 注销对应设备的回调函数。 @@ -120,4 +120,4 @@ int32_t(* InputReporter::UnregisterReportCallback) (uint32_t devIndex) INPUT_SUCCESS 表示执行成功。 -其他值表示执行失败,具体错误码查看[RetStatus](input.md#retstatus)。 +其他值表示执行失败,具体错误码查看[RetStatus](_input.md#retstatus)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_layer_alpha.md b/zh-cn/device-dev/reference/hdi-apis/_layer_alpha.md index 2e941168a2d4917bc64becf9fea5d23769db931e..1957c3b31d8058bca6e154eee6ed38a04ddcab05 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_layer_alpha.md +++ b/zh-cn/device-dev/reference/hdi-apis/_layer_alpha.md @@ -1,24 +1,24 @@ # LayerAlpha -## **概述** +## 概述 -定义图层Alpha信息的结构体。 +定义图层Alpha信息的结构体 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [enGlobalAlpha](_display.md#englobalalpha-12) | 全局Alpha使能标志 | -| [enPixelAlpha](_display.md#enpixelalpha-12) | 像素Alpha使能标志 | -| [alpha0](_display.md#alpha0-12) | Alpha0值,取值范围:[0, 255] | -| [alpha1](_display.md#alpha1-12) | Alpha1值,取值范围:[0, 255] | -| [gAlpha](_display.md#galpha) | 全局Alpha值,取值范围:[0, 255] | +| [enGlobalAlpha](_display.md#englobalalpha-12) | bool
全局alpha使能标志 | +| [enPixelAlpha](_display.md#enpixelalpha-12) | bool
像素alpha使能标志 | +| [alpha0](_display.md#alpha0-12) | uint8_t
alpha0值,取值范围:[0, 255] | +| [alpha1](_display.md#alpha1-12) | uint8_t
alpha1值,取值范围:[0, 255] | +| [gAlpha](_display.md#galpha) | uint8_t
全局alpha值,取值范围:[0, 255] | diff --git a/zh-cn/device-dev/reference/hdi-apis/_layer_buffer.md b/zh-cn/device-dev/reference/hdi-apis/_layer_buffer.md index 6f19f9bbb6d40719f9c9725735b455b0577bb6fe..f47d4eb0af9f2161b77a1a4b94961895e917baf2 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_layer_buffer.md +++ b/zh-cn/device-dev/reference/hdi-apis/_layer_buffer.md @@ -1,7 +1,7 @@ # LayerBuffer -## **概述** +## 概述 图层Buffer,用于存放图层数据。 @@ -10,17 +10,17 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [fenceId](_display.md#fenceid) | buffer的fence号 | -| [width](_display.md#width-39) | buffer宽度 | -| [height](_display.md#height-38) | buffer高度 | -| [pitch](_display.md#pitch) | 一行数据所占字节数 | -| [pixFormat](_display.md#pixformat-22) | 图层像素格式 | -| [data](_display.md#data-12) | 图层buffer数据 | -| [hdl](_display.md#hdl) | 图层buffer句柄 | +| [fenceId](_display.md#fenceid) | int32_t
buffer 的fence号 | +| [width](_display.md#width-39) | int32_t
buffer宽度 | +| [height](_display.md#height-38) | int32_t
buffer高度 | +| [pitch](_display.md#pitch) | int32_t
一行数据所占字节数 | +| [pixFormat](_display.md#pixformat-22) | [PixelFormat](_display.md#pixelformat)
buffer像素格式r | +| [data](_display.md#data-12) | [BufferData](_buffer_data.md)
图层buffer数据 | +| [hdl](_display.md#hdl) | BufferHandle \*
图层buffer句柄 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_layer_funcs.md b/zh-cn/device-dev/reference/hdi-apis/_layer_funcs.md index 95fb4bf8040f3a5fac4b3ba9eab25ce0b900d31d..8ad42c4f940c80f88bd2c54b95491234b84c9e33 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_layer_funcs.md +++ b/zh-cn/device-dev/reference/hdi-apis/_layer_funcs.md @@ -1,7 +1,7 @@ # LayerFuncs -## **概述** +## 概述 显示图层驱动接口结构体,定义显示图层驱动接口函数指针。 @@ -10,58 +10,58 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([InitDisplay](#initdisplay))(uint32_t devId) | 初始化显示设备。 | -| ([DeinitDisplay](#deinitdisplay))(uint32_t devId) | 取消初始化显示设备。 | -| ([GetDisplayInfo](#getdisplayinfo))(uint32_t devId, DisplayInfo \*dispInfo) | 获取显示设备相关信息。 | -| ([CreateLayer](#createlayer))(uint32_t devId, const LayerInfo \*layerInfo, uint32_t \*layerId) | 打开图层。 | -| ([CloseLayer](#closelayer))(uint32_t devId, uint32_t layerId) | 关闭图层。 | -| ([SetLayerVisible](#setlayervisible))(uint32_t devId, uint32_t layerId, bool visible) | 设置图层是否可见。 | -| ([GetLayerVisibleState](#getlayervisiblestate))(uint32_t devId, uint32_t layerId, bool \*visible) | 获取图层是否可见状态。 | -| ([SetLayerSize](#setlayersize))(uint32_t devId, uint32_t layerId, IRect \*rect) | 设置图层大小。 | -| ([GetLayerSize](#getlayersize))(uint32_t devId, uint32_t layerId, IRect \*rect) | 获取图层大小。 | -| ([SetLayerCrop](#setlayercrop))(uint32_t devId, uint32_t layerId, IRect \*rect) | 设置图层裁剪区域。 | -| ([SetLayerZorder](#setlayerzorder))(uint32_t devId, uint32_t layerId, uint32_t zorder) | 设置图层Z轴次序。 | -| ([GetLayerZorder](#getlayerzorder))(uint32_t devId, uint32_t layerId, uint32_t \*zorder) | 获取图层Z轴次序。 | -| ([SetLayerPreMulti](#setlayerpremulti))(uint32_t devId, uint32_t layerId, bool preMul) | 设置图层预乘。 | -| ([GetLayerPreMulti](#getlayerpremulti))(uint32_t devId, uint32_t layerId, bool \*preMul) | 获取图层预乘标识。 | -| ([SetLayerAlpha](#setlayeralpha))(uint32_t devId, uint32_t layerId, LayerAlpha \*alpha) | 设置图层Alpha值。 | -| ([GetLayerAlpha](#getlayeralpha))(uint32_t devId, uint32_t layerId, LayerAlpha \*alpha) | 获取图层Alpha值。 | -| ([SetLayerColorKey](#setlayercolorkey))(uint32_t devId, uint32_t layerId, bool enable, uint32_t key) | 设置图层colorkey属性,在图层叠加时使用。 | -| ([GetLayerColorKey](#getlayercolorkey))(uint32_t devId, uint32_t layerId, bool \*enable, uint32_t \*key) | 获取图层colorkey。 | -| ([SetLayerPalette](#setlayerpalette))(uint32_t devId, uint32_t layerId, uint32_t \*palette, uint32_t len) | 设置图层调色板。 | -| ([GetLayerPalette](#getlayerpalette))(uint32_t devId, uint32_t layerId, uint32_t \*palette, uint32_t len) | 获取图层调色板。 | -| ([SetTransformMode](#settransformmode))(uint32_t devId, uint32_t layerId, TransformType type) | 设置图层变换模式,根据不同的场景设置图层的旋转、缩放、移位等。 | -| ([SetLayerCompression](#setlayercompression))(uint32_t devId, uint32_t layerId, int32_t compType) | 设置图层压缩功能。 | -| ([GetLayerCompression](#getlayercompression))(uint32_t devId, uint32_t layerId, int32_t \*compType) | 获取图层压缩功能是否打开。 | -| ([SetLayerDirtyRegion](#setlayerdirtyregion))(uint32_t devId, uint32_t layerId, IRect \*region) | 设置图层刷新区域。 | -| ([GetLayerBuffer](#getlayerbuffer))(uint32_t devId, uint32_t layerId, LayerBuffer \*buffer) | 获取图层的buffer。 | -| ([Flush](#flush))(uint32_t devId, uint32_t layerId, LayerBuffer \*buffer) | 刷新图层。 | -| ([WaitForVBlank](#waitforvblank))(uint32_t devId, uint32_t layerId, int32_t timeOut) | 实现等待帧消隐期到来功能。 | -| ([SnapShot](#snapshot))(uint32_t devId, LayerBuffer \*buffer) | 实现抓图功能。 | -| ([SetLayerVisibleRegion](#setlayervisibleregion))(uint32_t devId, uint32_t layerId, uint32_t num, IRect \*rect) | 设置一个图层的可见区域。 | -| ([SetLayerBuffer](#setlayerbuffer))(uint32_t devId, uint32_t layerId, const BufferHandle \*buffer, int32_t fence) | 设置一个层的缓冲区。 | -| ([InvokeLayerCmd](#invokelayercmd))(uint32_t devId, uint32_t layerId, uint32_t cmd,...) | 扩展接口。 | -| ([SetLayerCompositionType](#setlayercompositiontype))(uint32_t devId, uint32_t layerId, CompositionType type) | 设置客户端期望的组合类型。 | -| ([SetLayerBlendType](#setlayerblendtype))(uint32_t devId, uint32_t layerId, BlendType type) | 设置混合类型。 | -| ([SetLayerColorTransform](#setlayercolortransform))(uint32_t devId, uint32_t layerId, const float \*matrix) | 设置图层当前的颜色转换矩阵。 | -| ([SetLayerColorDataSpace](#setlayercolordataspace))(uint32_t devId, uint32_t layerId, ColorDataSpace colorSpace) | 设置图层的颜色数据空间。 | -| ([GetLayerColorDataSpace](#getlayercolordataspace))(uint32_t devId, uint32_t layerId, ColorDataSpace \*colorSpace) | 获取图层当前的颜色数据空间。 | -| ([SetLayerMetaData](#setlayermetadata))(uint32_t devId, uint32_t layerId, uint32_t num, const HDRMetaData \*metaData) | 设置图层的HDRmetaData。 | -| ([SetLayerMetaDataSet](#setlayermetadataset))(uint32_t devId, uint32_t layerId, HDRMetadataKey key, uint32_t num, const uint8_t \*metaData) | 设置图层的metaData set。 | -| ([GetSupportedPresentTimestamp](#getsupportedpresenttimestamp))(uint32_t devId, uint32_t layerId, PresentTimestampType \*type) | 获取图层支持的上屏时间戳类型。 | -| ([GetHwPresentTimestamp](#gethwpresenttimestamp))(uint32_t devId, uint32_t layerId, PresentTimestamp \*pts) | 获取图层的上屏时间戳信息。 | -| ([SetLayerTunnelHandle](#setlayertunnelhandle))(uint32_t devId, uint32_t layerId, ExtDataHandle \*handle) | 设置图层的tunnel句柄。 | -| ([GetLayerReleaseFence](#getlayerreleasefence))(uint32_t devId, uint32_t layerId, int32_t \*fence) | 获取图层的同步栅栏。 | - - -## **类成员变量说明** +| (\* [InitDisplay](#initdisplay) )(uint32_t devId) | int32_t
初始化显示设备。 | +| (\* [DeinitDisplay](#deinitdisplay) )(uint32_t devId) | int32_t
取消初始化显示设备。 | +| (\* [GetDisplayInfo](#getdisplayinfo) )(uint32_t devId, [DisplayInfo](_display_info.md) \*dispInfo) | int32_t
获取显示设备相关信息。 | +| (\* [CreateLayer](#createlayer) )(uint32_t devId, const [LayerInfo](_layer_info.md) \*layerInfo, uint32_t \*layerId) | int32_t
打开图层。 | +| (\* [CloseLayer](#closelayer) )(uint32_t devId, uint32_t layerId) | int32_t
关闭图层。 | +| (\* [SetLayerVisible](#setlayervisible) )(uint32_t devId, uint32_t layerId, bool visible) | int32_t
设置图层是否可见。 | +| (\* [GetLayerVisibleState](#getlayervisiblestate) )(uint32_t devId, uint32_t layerId, bool \*visible) | int32_t
获取图层是否可见状态。 | +| (\* [SetLayerSize](#setlayersize) )(uint32_t devId, uint32_t layerId, [IRect](_i_rect.md) \*rect) | int32_t
设置图层大小。 | +| (\* [GetLayerSize](#getlayersize) )(uint32_t devId, uint32_t layerId, [IRect](_i_rect.md) \*rect) | int32_t
获取图层大小。 | +| (\* [SetLayerCrop](#setlayercrop) )(uint32_t devId, uint32_t layerId, [IRect](_i_rect.md) \*rect) | int32_t
设置图层裁剪区域。 | +| (\* [SetLayerZorder](#setlayerzorder) )(uint32_t devId, uint32_t layerId, uint32_t zorder) | int32_t
设置图层Z轴次序。 | +| (\* [GetLayerZorder](#getlayerzorder) )(uint32_t devId, uint32_t layerId, uint32_t \*zorder) | int32_t
获取图层Z轴次序。 | +| (\* [SetLayerPreMulti](#setlayerpremulti) )(uint32_t devId, uint32_t layerId, bool preMul) | int32_t
设置图层预乘。 | +| (\* [GetLayerPreMulti](#getlayerpremulti) )(uint32_t devId, uint32_t layerId, bool \*preMul) | int32_t
获取图层预乘标识。 | +| (\* [SetLayerAlpha](#setlayeralpha) )(uint32_t devId, uint32_t layerId, [LayerAlpha](_layer_alpha.md) \*alpha) | int32_t
设置图层alpha值。 | +| (\* [GetLayerAlpha](#getlayeralpha) )(uint32_t devId, uint32_t layerId, [LayerAlpha](_layer_alpha.md) \*alpha) | int32_t
获取图层alpha值。 | +| (\* [SetLayerColorKey](#setlayercolorkey) )(uint32_t devId, uint32_t layerId, bool enable, uint32_t key) | int32_t
设置图层colorkey属性,在图层叠加时使用。 | +| (\* [GetLayerColorKey](#getlayercolorkey) )(uint32_t devId, uint32_t layerId, bool \*enable, uint32_t \*key) | int32_t
获取图层colorkey。 | +| (\* [SetLayerPalette](#setlayerpalette) )(uint32_t devId, uint32_t layerId, uint32_t \*palette, uint32_t len) | int32_t
设置图层调色板。 | +| (\* [GetLayerPalette](#getlayerpalette) )(uint32_t devId, uint32_t layerId, uint32_t \*palette, uint32_t len) | int32_t
获取图层调色板。 | +| (\* [SetTransformMode](#settransformmode) )(uint32_t devId, uint32_t layerId, [TransformType](_display.md#transformtype) type) | int32_t
设置图层变换模式,根据不同的场景设置图层的旋转、缩放、移位等。 | +| (\* [SetLayerCompression](#setlayercompression) )(uint32_t devId, uint32_t layerId, int32_t compType) | int32_t
设置图层压缩功能 | +| (\* [GetLayerCompression](#getlayercompression) )(uint32_t devId, uint32_t layerId, int32_t \*compType) | int32_t
获取图层压缩功能是否打开。 | +| (\* [SetLayerDirtyRegion](#setlayerdirtyregion) )(uint32_t devId, uint32_t layerId, [IRect](_i_rect.md) \*region) | int32_t
设置图层刷新区域。 | +| (\* [GetLayerBuffer](#getlayerbuffer) )(uint32_t devId, uint32_t layerId, [LayerBuffer](_layer_buffer.md) \*buffer) | int32_t
获取图层的buffer。 | +| (\* [Flush](#flush) )(uint32_t devId, uint32_t layerId, [LayerBuffer](_layer_buffer.md) \*buffer) | int32_t
刷新图层。 | +| (\* [WaitForVBlank](#waitforvblank) )(uint32_t devId, uint32_t layerId, int32_t timeOut) | int32_t
实现等待帧消隐期到来功能。 | +| (\* [SnapShot](#snapshot) )(uint32_t devId, [LayerBuffer](_layer_buffer.md) \*buffer) | int32_t
实现抓图功能。 | +| (\* [SetLayerVisibleRegion](#setlayervisibleregion) )(uint32_t devId, uint32_t layerId, uint32_t num, [IRect](_i_rect.md) \*rect) | int32_t
设置一个图层的可见区域 | +| (\* [SetLayerBuffer](#setlayerbuffer) )(uint32_t devId, uint32_t layerId, const BufferHandle \*buffer, int32_t fence) | int32_t
设置一个层的缓冲区。 | +| (\* [InvokeLayerCmd](#invokelayercmd) )(uint32_t devId, uint32_t layerId, uint32_t cmd,...) | int32_t
扩展接口 | +| (\* [SetLayerCompositionType](#setlayercompositiontype) )(uint32_t devId, uint32_t layerId, [CompositionType](_display.md#compositiontype) type) | int32_t
设置客户端期望的组合类型 | +| (\* [SetLayerBlendType](#setlayerblendtype) )(uint32_t devId, uint32_t layerId, [BlendType](_display.md#blendtype) type) | int32_t
设置混合类型 | +| (\* [SetLayerColorTransform](#setlayercolortransform) )(uint32_t devId, uint32_t layerId, const float \*matrix) | int32_t
设置图层当前的颜色转换矩阵。 | +| (\* [SetLayerColorDataSpace](#setlayercolordataspace) )(uint32_t devId, uint32_t layerId, [ColorDataSpace](_display.md#colordataspace) colorSpace) | int32_t
设置图层的颜色数据空间。 | +| (\* [GetLayerColorDataSpace](#getlayercolordataspace) )(uint32_t devId, uint32_t layerId, [ColorDataSpace](_display.md#colordataspace) \*colorSpace) | int32_t
获取图层当前的颜色数据空间。 | +| (\* [SetLayerMetaData](#setlayermetadata) )(uint32_t devId, uint32_t layerId, uint32_t num, const [HDRMetaData](_h_d_r_meta_data.md) \*metaData) | int32_t
设置图层的HDRmetaData。 | +| (\* [SetLayerMetaDataSet](#setlayermetadataset) )(uint32_t devId, uint32_t layerId, [HDRMetadataKey](_display.md#hdrmetadatakey) key, uint32_t num, const uint8_t \*metaData) | int32_t
设置图层的metaData set。 | +| (\* [GetSupportedPresentTimestamp](#getsupportedpresenttimestamp) )(uint32_t devId, uint32_t layerId, [PresentTimestampType](_display.md#presenttimestamptype) \*type) | int32_t
获取图层支持的上屏时间戳类型。 | +| (\* [GetHwPresentTimestamp](#gethwpresenttimestamp) )(uint32_t devId, uint32_t layerId, [PresentTimestamp](_present_timestamp.md) \*pts) | int32_t
获取图层的上屏时间戳信息。 | +| (\* [SetLayerTunnelHandle](#setlayertunnelhandle) )(uint32_t devId, uint32_t layerId, ExtDataHandle \*handle) | int32_t
设置图层的tunnel句柄。 | +| (\* [GetLayerReleaseFence](#getlayerreleasefence) )(uint32_t devId, uint32_t layerId, int32_t \*fence) | int32_t
获取图层的同步栅栏。 | + + +## 类成员变量说明 ### CloseLayer @@ -71,7 +71,7 @@ int32_t(* LayerFuncs::CloseLayer) (uint32_t devId, uint32_t layerId) ``` -**描述:** +**描述:** 关闭图层。 @@ -102,7 +102,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::CreateLayer) (uint32_t devId, const LayerInfo *layerInfo, uint32_t *layerId) ``` -**描述:** +**描述:** 打开图层。 @@ -134,7 +134,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::DeinitDisplay) (uint32_t devId) ``` -**描述:** +**描述:** 取消初始化显示设备。 @@ -162,7 +162,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::Flush) (uint32_t devId, uint32_t layerId, LayerBuffer *buffer) ``` -**描述:** +**描述:** 刷新图层。 @@ -190,7 +190,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetDisplayInfo) (uint32_t devId, DisplayInfo *dispInfo) ``` -**描述:** +**描述:** 获取显示设备相关信息。 @@ -215,7 +215,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetHwPresentTimestamp) (uint32_t devId, uint32_t layerId, PresentTimestamp *pts) ``` -**描述:** +**描述:** 获取图层的上屏时间戳信息。 @@ -225,7 +225,7 @@ int32_t(* LayerFuncs::GetHwPresentTimestamp) (uint32_t devId, uint32_t layerId, | -------- | -------- | | devId | 输入参数,指示需要操作的设备ID。 | | layerId | 输入参数,指示需要操作的图层ID。 | -| pts | 输出参数,保存图层的上屏时间戳信息, 由接口实现层进行写入。 | +| pts | 输出参数,保存图层的上屏时间戳信息,由接口实现层进行写入。 | **返回:** @@ -241,7 +241,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerAlpha) (uint32_t devId, uint32_t layerId, LayerAlpha *alpha) ``` -**描述:** +**描述:** 获取图层alpha值。 @@ -271,7 +271,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerBuffer) (uint32_t devId, uint32_t layerId, LayerBuffer *buffer) ``` -**描述:** +**描述:** 获取图层的buffer。 @@ -303,7 +303,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerColorDataSpace) (uint32_t devId, uint32_t layerId, ColorDataSpace *colorSpace) ``` -**描述:** +**描述:** 获取图层当前的颜色数据空间。 @@ -329,7 +329,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerColorKey) (uint32_t devId, uint32_t layerId, bool *enable, uint32_t *key) ``` -**描述:** +**描述:** 获取图层colorkey。 @@ -360,7 +360,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerCompression) (uint32_t devId, uint32_t layerId, int32_t *compType) ``` -**描述:** +**描述:** 获取图层压缩功能是否打开。 @@ -390,7 +390,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerPalette) (uint32_t devId, uint32_t layerId, uint32_t *palette, uint32_t len) ``` -**描述:** +**描述:** 获取图层调色板。 @@ -421,7 +421,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerPreMulti) (uint32_t devId, uint32_t layerId, bool *preMul) ``` -**描述:** +**描述:** 获取图层预乘标识。 @@ -451,7 +451,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerReleaseFence) (uint32_t devId, uint32_t layerId, int32_t *fence) ``` -**描述:** +**描述:** 获取图层的同步栅栏。 @@ -461,7 +461,7 @@ int32_t(* LayerFuncs::GetLayerReleaseFence) (uint32_t devId, uint32_t layerId, i | -------- | -------- | | devId | 输入参数,指示需要操作的设备ID。 | | layerId | 输入参数,指示需要操作的图层ID。 | -| fence | 输出参数,保存图层的 release fence, 由接口实现层进行写入。 | +| fence | 输出参数,保存图层的 release fence,由接口实现层进行写入。 | **返回:** @@ -477,7 +477,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerSize) (uint32_t devId, uint32_t layerId, IRect *rect) ``` -**描述:** +**描述:** 获取图层大小。 @@ -507,7 +507,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerVisibleState) (uint32_t devId, uint32_t layerId, bool *visible) ``` -**描述:** +**描述:** 获取图层是否可见状态。 @@ -537,7 +537,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetLayerZorder) (uint32_t devId, uint32_t layerId, uint32_t *zorder) ``` -**描述:** +**描述:** 获取图层Z轴次序。 @@ -567,7 +567,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::GetSupportedPresentTimestamp) (uint32_t devId, uint32_t layerId, PresentTimestampType *type) ``` -**描述:** +**描述:** 获取图层支持的上屏时间戳类型。 @@ -577,7 +577,7 @@ int32_t(* LayerFuncs::GetSupportedPresentTimestamp) (uint32_t devId, uint32_t la | -------- | -------- | | devId | 输入参数,指示需要操作的设备ID。 | | layerId | 输入参数,指示需要操作的图层ID。 | -| type | 输出参数,保存图层支持的上屏时间戳类型, 由接口实现层进行写入。 | +| type | 输出参数,保存图层支持的上屏时间戳类型,由接口实现层进行写入。 | **返回:** @@ -593,7 +593,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::InitDisplay) (uint32_t devId) ``` -**描述:** +**描述:** 初始化显示设备。 @@ -621,7 +621,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::InvokeLayerCmd) (uint32_t devId, uint32_t layerId, uint32_t cmd,...) ``` -**描述:** +**描述:** 扩展接口 @@ -647,7 +647,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerAlpha) (uint32_t devId, uint32_t layerId, LayerAlpha *alpha) ``` -**描述:** +**描述:** 设置图层alpha值。 @@ -677,7 +677,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerBlendType) (uint32_t devId, uint32_t layerId, BlendType type) ``` -**描述:** +**描述:** 设置混合类型 @@ -703,7 +703,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerBuffer) (uint32_t devId, uint32_t layerId, const BufferHandle *buffer, int32_t fence) ``` -**描述:** +**描述:** 设置一个层的缓冲区。 @@ -730,7 +730,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerColorDataSpace) (uint32_t devId, uint32_t layerId, ColorDataSpace colorSpace) ``` -**描述:** +**描述:** 设置图层的颜色数据空间。 @@ -756,9 +756,9 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerColorKey) (uint32_t devId, uint32_t layerId, bool enable, uint32_t key) ``` -**描述:** +**描述:** -设置图层colorkey属性,在图层叠加时使用。 +设置图层colorkey属性,在图层叠加时使用。 **参数:** @@ -787,7 +787,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerColorTransform) (uint32_t devId, uint32_t layerId, const float *matrix) ``` -**描述:** +**描述:** 设置图层当前的颜色转换矩阵。 @@ -813,9 +813,9 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerCompositionType) (uint32_t devId, uint32_t layerId, CompositionType type) ``` -**描述:** +**描述:** -设置客户端期望的组合类型。 +设置客户端期望的组合类型 **参数:** @@ -839,9 +839,9 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerCompression) (uint32_t devId, uint32_t layerId, int32_t compType) ``` -**描述:** +**描述:** -设置图层压缩功能。 +设置图层压缩功能 在特定场景下,需要对图像数据进行压缩,可设置启动或关闭图层压缩功能。 @@ -871,7 +871,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerCrop) (uint32_t devId, uint32_t layerId, IRect *rect) ``` -**描述:** +**描述:** 设置图层裁剪区域。 @@ -897,7 +897,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerDirtyRegion) (uint32_t devId, uint32_t layerId, IRect *region) ``` -**描述:** +**描述:** 设置图层刷新区域。 @@ -925,7 +925,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerMetaData) (uint32_t devId, uint32_t layerId, uint32_t num, const HDRMetaData *metaData) ``` -**描述:** +**描述:** 设置图层的HDRmetaData。 @@ -952,7 +952,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerMetaDataSet) (uint32_t devId, uint32_t layerId, HDRMetadataKey key, uint32_t num, const uint8_t *metaData) ``` -**描述:** +**描述:** 设置图层的metaData set。 @@ -962,9 +962,9 @@ int32_t(* LayerFuncs::SetLayerMetaDataSet) (uint32_t devId, uint32_t layerId, HD | -------- | -------- | | devId | 输入参数,指示需要操作的设备ID。 | | layerId | 输入参数,指示需要操作的图层ID。 | -| key | 输入参数,表示需要设置的[HDRMetadataKey](_display.md#hdrmetadatakey)。 | +| key | 输入参数,表示需要设置的 HDRMetadataKey。 | | num | 输入参数,metadata 数组个数。 | -| metaData | 输入参数,表示需要设置的 metadata 数组首地址, 数据类型为uint8_t。 | +| metaData | 输入参数,表示需要设置的 metadata 数组首地址,数据类型为uint8_t。 | **返回:** @@ -980,7 +980,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerPalette) (uint32_t devId, uint32_t layerId, uint32_t *palette, uint32_t len) ``` -**描述:** +**描述:** 设置图层调色板。 @@ -1011,7 +1011,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerPreMulti) (uint32_t devId, uint32_t layerId, bool preMul) ``` -**描述:** +**描述:** 设置图层预乘。 @@ -1041,7 +1041,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerSize) (uint32_t devId, uint32_t layerId, IRect *rect) ``` -**描述:** +**描述:** 设置图层大小。 @@ -1071,7 +1071,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerTunnelHandle) (uint32_t devId, uint32_t layerId, ExtDataHandle *handle) ``` -**描述:** +**描述:** 设置图层的tunnel句柄。 @@ -1097,7 +1097,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerVisible) (uint32_t devId, uint32_t layerId, bool visible) ``` -**描述:** +**描述:** 设置图层是否可见。 @@ -1129,7 +1129,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerVisibleRegion) (uint32_t devId, uint32_t layerId, uint32_t num, IRect *rect) ``` -**描述:** +**描述:** 设置一个图层的可见区域 @@ -1156,7 +1156,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetLayerZorder) (uint32_t devId, uint32_t layerId, uint32_t zorder) ``` -**描述:** +**描述:** 设置图层Z轴次序。 @@ -1188,7 +1188,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SetTransformMode) (uint32_t devId, uint32_t layerId, TransformType type) ``` -**描述:** +**描述:** 设置图层变换模式,根据不同的场景设置图层的旋转、缩放、移位等。 @@ -1214,14 +1214,12 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::SnapShot) (uint32_t devId, LayerBuffer *buffer) ``` -**描述:** +**描述:** 实现抓图功能。 本函数将显示设备上的图像数据截图保存到buffer中,用于调试、应用截图等场景。 -otherwise. - **参数:** | 名称 | 描述 | @@ -1243,7 +1241,7 @@ DISPLAY_SUCCESS 表示执行成功。 int32_t(* LayerFuncs::WaitForVBlank) (uint32_t devId, uint32_t layerId, int32_t timeOut) ``` -**描述:** +**描述:** 实现等待帧消隐期到来功能。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_layer_info.md b/zh-cn/device-dev/reference/hdi-apis/_layer_info.md index 2a37f273707a9af958cdac308f26f6cabf525855..ce540ba23b1f0b395ae546c3ede0c7703c7b0ed4 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_layer_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_layer_info.md @@ -1,9 +1,9 @@ # LayerInfo -## **概述** +## 概述 -定义图层信息结构体。 +定义图层信息结构体 在创建图层时,需要将LayerInfo传递给创建图层接口,创建图层接口根据图层信息创建相应图层。 @@ -12,15 +12,15 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [width](_display.md#width-29) | 图层宽度 | -| [height](_display.md#height-28) | 图层高度 | -| [type](_display.md#type-17) | 图层类型,包括图形层、视频层和媒体播放模式。 | -| [bpp](_display.md#bpp) | 每像素所占bit数 | -| [pixFormat](_display.md#pixformat-12) | 图层像素格式 | +| [width](_display.md#width-29) | int32_t
图层宽度 | +| [height](_display.md#height-28) | int32_t
图层高度 | +| [type](_display.md#type-17) | [LayerType](_display.md#layertype)
图层类型,包括图形层、视频层和媒体播放模式 | +| [bpp](_display.md#bpp) | int32_t
每像素所占bit数 | +| [pixFormat](_display.md#pixformat-12) | [PixelFormat](_display.md#pixelformat)
图层像素格式 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_layer_norm_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_layer_norm_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..ae1d00b44499b6fb6f4e15136384d615cd0c57cc --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_layer_norm_fusion.md @@ -0,0 +1,84 @@ +# LayerNormFusion + + +## 概述 + +对一个tensor从某一axis开始做层归一化。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_LAYER_NORM_FUSION。 + +输入: + +- x,n维tensor。 + +- gamma,一个m维tensor,gamma维度应该与input做归一化部分的shape一致。 + +- beta,一个m维tensor,shape与gamma一样。 + +输出: + +- output,n维输出tensor,数据类型和shape和input一致。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [beginNormAxis](#beginnormaxis) | long
指定x需进行层归一化的起始维度。  | +| [epsilon](#epsilon) | float
为数值稳定性定义一个加到分母上的值。  | +| [elementwiseAffine](#elementwiseaffine) | boolean
是否为元素级别的操作。  | +| [beginParamsAxis](#beginparamsaxis) | long
指定输入参数gamma,beta需进行层归一化的开始维度,其值必须在[-n, n)范围内。  | + + +## 类成员变量说明 + + +### beginNormAxis + + +``` +long LayerNormFusion::beginNormAxis +``` +**描述:** +指定x需进行层归一化的起始维度。 + + +### beginParamsAxis + + +``` +long LayerNormFusion::beginParamsAxis +``` +**描述:** +指定输入参数gamma,beta需进行层归一化的开始维度,其值必须在[-n, n)范围内。 + + +### elementwiseAffine + + +``` +boolean LayerNormFusion::elementwiseAffine +``` +**描述:** +是否为元素级别的操作。 + + +### epsilon + + +``` +float LayerNormFusion::epsilon +``` +**描述:** +为数值稳定性定义一个加到分母上的值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_less_equal.md b/zh-cn/device-dev/reference/hdi-apis/_less_equal.md new file mode 100644 index 0000000000000000000000000000000000000000..a9b47416e56c6c4468466c1be7461a3919e44568 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_less_equal.md @@ -0,0 +1,26 @@ +# LessEqual + + +## 概述 + +对输入x1和x2,计算每对元素的x1<=x2的结果。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_LESS_EQUAL。 + +输入: + +- x1,可以是实数、布尔值或数据类型是实数或者布尔类型的tensor。 + +- x2,如果x1是tensor,x2可以是实数、布尔值,否则只能是tensor,其数据类型是实数或DATA_TYPE_BOOL。 + +输出: + +- output,数据类型为DATA_TYPE_BOOL的tensor;使用量化模型时,output的量化参数不可省略,但量化参数的数值不会对输入结果产生影响。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/light.md b/zh-cn/device-dev/reference/hdi-apis/_light.md similarity index 71% rename from zh-cn/device-dev/reference/hdi-apis/light.md rename to zh-cn/device-dev/reference/hdi-apis/_light.md index adab9f4230644c23ae3c35d389ea821bd7b537bf..09477d091c072c8221579861685da785874b0bc8 100644 --- a/zh-cn/device-dev/reference/hdi-apis/light.md +++ b/zh-cn/device-dev/reference/hdi-apis/_light.md @@ -1,22 +1,22 @@ # Light -## **概述** +## 概述 灯驱动对灯服务提供通用的接口能力。 灯模块为灯服务提供通用的接口去访问灯驱动,服务获取灯驱动对象或代理后,可以通过调用的APIs接口获取相关的灯信息。 例如打开或关闭灯、根据灯类型ID设置灯闪烁模式。 -**Since**: +**Since:** 3.1 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 @@ -31,14 +31,14 @@ | 名称 | 描述 | | -------- | -------- | -| [ILightInterface](interface_i_light_interface.md) | 提供灯模块基本操作接口。 | -| [HdfLightInfo](_hdf_light_info.md) | 定义灯的基本信息。 | -| [HdfLightFlashEffect](_hdf_light_flash_effect.md) | 定义灯的闪烁参数。 | -| [RGBColor](_r_g_b_color.md) | 定义灯的RGB模式。 | -| [WRGBColor](_w_r_g_b_color.md) | 定义灯的WRGB模式。 | -| [ColorValue](union_color_value.md) | 定义灯的颜色模式。 | -| [HdfLightColor](_hdf_light_color.md) | 定义亮灯参数。 | -| [HdfLightEffect](_hdf_light_effect.md) | 定义灯的效果参数。 | +| [ILightInterface](interface_i_light_interface.md) | interface
提供灯模块基本操作接口。 | +| [HdfLightInfo](_hdf_light_info.md) | struct
定义灯的基本信息。 | +| [HdfLightFlashEffect](_hdf_light_flash_effect.md) | struct
定义灯的闪烁参数。 | +| [RGBColor](_r_g_b_color.md) | struct
定义灯的RGB模式。 | +| [WRGBColor](_w_r_g_b_color.md) | struct
定义灯的WRGB模式。 | +| [ColorValue](union_color_value.md) | union
定义灯的颜色模式。 | +| [HdfLightColor](_hdf_light_color.md) | struct
定义亮灯参数。 | +| [HdfLightEffect](_hdf_light_effect.md) | struct
定义灯的效果参数。 | ### 枚举 @@ -46,7 +46,7 @@ | 名称 | 描述 | | -------- | -------- | | [HdfLightId](#hdflightid) { HDF_LIGHT_ID_BATTERY = 1, HDF_LIGHT_ID_NOTIFICATIONS = 2, HDF_LIGHT_ID_ATTENTION = 3, HDF_LIGHT_ID_BUTT = 4 } | 枚举灯类型。 | -| [HdfLightFlashMode](#hdflightflashmode) { HDF_LIGHT_FLASH_NONE = 0, HDF_LIGHT_FLASH_BLINK = 1, HDF_LIGHT_FLASH_GRADIENT = 2, HDF_LIGHT_FLASH_BUTT = 3 } | 枚举灯的模式。 | +| [HdfLightFlashMode](#hdflightflashmode) { HDF_LIGHT_FLASH_NONE = 0, HDF_LIGHT_FLASH_TIMED = 1, HDF_LIGHT_FLASH_GRADIENT = 2, HDF_LIGHT_FLASH_BUTT = 3 } | 枚举灯的模式。 | ### 关键字 @@ -56,7 +56,7 @@ | package ohos.hdi.light.v1_0 | 灯模块接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### HdfLightFlashMode @@ -66,7 +66,7 @@ enum HdfLightFlashMode ``` -**描述:** +**描述:** 枚举灯的模式。 @@ -85,7 +85,7 @@ enum HdfLightFlashMode enum HdfLightId ``` -**描述:** +**描述:** 枚举灯类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_light_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_light_types_8idl.md index 7ba20d9db066445089a3964a8a8e83175583dd9a..9ac672f6b45f481864809105144eac6f80af7e90 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_light_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_light_types_8idl.md @@ -1,7 +1,7 @@ # LightTypes.idl -## **概述** +## 概述 定义灯的数据结构,包括灯类型ID、灯的基本信息、灯的模式、灯的闪烁参数、灯的颜色模式和灯的效果参数。 @@ -15,31 +15,31 @@ **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [HdfLightInfo](_hdf_light_info.md) | 定义灯的基本信息。 | -| [HdfLightFlashEffect](_hdf_light_flash_effect.md) | 定义灯的闪烁参数。 | -| [RGBColor](_r_g_b_color.md) | 定义灯的RGB模式。 | -| [WRGBColor](_w_r_g_b_color.md) | 定义灯的WRGB模式。 | -| [ColorValue](union_color_value.md) | 定义灯的颜色模式。 | -| [HdfLightColor](_hdf_light_color.md) | 定义亮灯参数。 | -| [HdfLightEffect](_hdf_light_effect.md) | 定义灯的效果参数。 | +| [HdfLightInfo](_hdf_light_info.md) | struct
定义灯的基本信息。 | +| [HdfLightFlashEffect](_hdf_light_flash_effect.md) | struct
定义灯的闪烁参数。 | +| [RGBColor](_r_g_b_color.md) | struct
定义灯的RGB模式。 | +| [WRGBColor](_w_r_g_b_color.md) | struct
定义灯的WRGB模式。 | +| [ColorValue](union_color_value.md) | union
定义灯的颜色模式。 | +| [HdfLightColor](_hdf_light_color.md) | struct
定义亮灯参数。 | +| [HdfLightEffect](_hdf_light_effect.md) | struct
定义灯的效果参数。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [HdfLightId](light.md#hdflightid) { HDF_LIGHT_ID_BATTERY = 1, HDF_LIGHT_ID_NOTIFICATIONS = 2, HDF_LIGHT_ID_ATTENTION = 3, HDF_LIGHT_ID_BUTT = 4 } | 枚举灯类型。 | -| [HdfLightFlashMode](light.md#hdflightflashmode) { HDF_LIGHT_FLASH_NONE = 0, HDF_LIGHT_FLASH_BLINK = 1, HDF_LIGHT_FLASH_GRADIENT = 2, HDF_LIGHT_FLASH_BUTT = 3 } | 枚举灯的模式。 | +| [HdfLightId](_light.md#hdflightid) { HDF_LIGHT_ID_BATTERY = 1, HDF_LIGHT_ID_NOTIFICATIONS = 2, HDF_LIGHT_ID_ATTENTION = 3, HDF_LIGHT_ID_BUTT = 4 } | 枚举灯类型。 | +| [HdfLightFlashMode](_light.md#hdflightflashmode) { HDF_LIGHT_FLASH_NONE = 0, HDF_LIGHT_FLASH_TIMED = 1, HDF_LIGHT_FLASH_GRADIENT = 2, HDF_LIGHT_FLASH_BUTT = 3 } | 枚举灯的模式。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_lock_status_resp.md b/zh-cn/device-dev/reference/hdi-apis/_lock_status_resp.md new file mode 100644 index 0000000000000000000000000000000000000000..2bff688b410808160d4c130d4142690ef075c355 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_lock_status_resp.md @@ -0,0 +1,44 @@ +# LockStatusResp + + +## 概述 + +SIM卡解锁响应 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [result](#result) | int
查询结果,具体查看[RilErrType](_ril.md#rilerrtype) | +| [remain](#remain) | int
剩余次数  | + + +## 类成员变量说明 + + +### remain + + +``` +int LockStatusResp::remain +``` +**描述:** +剩余次数 + + +### result + + +``` +int LockStatusResp::result +``` +**描述:** +查询结果,具体查看[RilErrType](_ril.md#rilerrtype) diff --git a/zh-cn/device-dev/reference/hdi-apis/_lte_rssi.md b/zh-cn/device-dev/reference/hdi-apis/_lte_rssi.md new file mode 100644 index 0000000000000000000000000000000000000000..1ad28ed81e96066fa16daf36601af7d673ac6ef3 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_lte_rssi.md @@ -0,0 +1,66 @@ +# LteRssi + + +## 概述 + +LTE信号强度。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [rxlev](#rxlev) | int
信号接收强度,取值范围0~99  | +| [rsrq](#rsrq) | int
表示信号接收质量,取值范围0~33  | +| [rsrp](#rsrp) | int
表示接收信号码功率,取值范围0~97  | +| [snr](#snr) | int
表示信号干扰噪声比,适用于LTE模式,取值范围0~251  | + + +## 类成员变量说明 + + +### rsrp + + +``` +int LteRssi::rsrp +``` +**描述:** +表示接收信号码功率,取值范围0~97 + + +### rsrq + + +``` +int LteRssi::rsrq +``` +**描述:** +表示信号接收质量,取值范围0~33 + + +### rxlev + + +``` +int LteRssi::rxlev +``` +**描述:** +信号接收强度,取值范围0~99 + + +### snr + + +``` +int LteRssi::snr +``` +**描述:** +表示信号干扰噪声比,适用于LTE模式,取值范围0~251 diff --git a/zh-cn/device-dev/reference/hdi-apis/_mat_mul_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_mat_mul_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..a18999c319ca6da84f9e84f7a98f5b3a2f177f71 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_mat_mul_fusion.md @@ -0,0 +1,71 @@ +# MatMulFusion + + +## 概述 + +对输入x1和x2,计算x1和x2的内积。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_MATMUL_FUSION。 + +输入: + +- x1,n维输入tensor,实数或DATA_TYPE_BOOL类型的tensor。 + +- x2,n维输入tensor,实数或DATA_TYPE_BOOL类型的tensor。 + +输出: + +- output,计算得到内积,当type!=DATA_TYPE_UNKNOWN时,output数据类型由type决定;当type==DATA_TYPE_UNKNOWN时, output的数据类型取决于x1和x2进行计算时转化的数据类型。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [transposeA](#transposea) | boolean
是否对x1矩阵进行转置。  | +| [transposeB](#transposeb) | boolean
是否对x2矩阵进行转置。  | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType MatMulFusion::activationType +``` +**描述:** +激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 + + +### transposeA + + +``` +boolean MatMulFusion::transposeA +``` +**描述:** +是否对x1矩阵进行转置。 + + +### transposeB + + +``` +boolean MatMulFusion::transposeB +``` +**描述:** +是否对x2矩阵进行转置。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_max_pool_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_max_pool_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..cd4c7d80d937f56ac84b1c780cb9a549524685dc --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_max_pool_fusion.md @@ -0,0 +1,115 @@ +# MaxPoolFusion + + +## 概述 + +对输入x,计算 2D 最大值池化。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_MAX_POOL_FUSION。 + +参数限制:当padMode==PAD_MODE_PAD时,padList的数值必须大于等于0。其他情况下padding的数值必须为0。 + +输入: + +- x,n维tensor + +输出: + +- output,x1和x2两个tensor对应元素的最大值。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [kernelSize](#kernelsize) | long[]
取最大值的kernel大小,是一个长度为2的int数组[kernel_height,kernel_weight]。  | +| [strides](#strides) | long[]
池化核步长,kernel移动的距离,是一个长度为2的int数组。  | +| [pad](#pad) | long[]
填充数组。  | +| [padMode](#padmode) | enum [PadMode](_n_n_rt.md#padmode)
填充类型,详情请参考:[PadMode](_n_n_rt.md#padmode)。  | +| [format](#format) | enum [Format](_n_n_rt.md#format)
运算时数据的排列,详情请参考:[Format](_n_n_rt.md#format)。  | +| [global](#global) | boolean
是否是全局池化。  | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType MaxPoolFusion::activationType +``` +**描述:** +激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 + + +### format + + +``` +enum Format MaxPoolFusion::format +``` +**描述:** +运算时数据的排列,详情请参考:[Format](_n_n_rt.md#format)。 + + +### global + + +``` +boolean MaxPoolFusion::global +``` +**描述:** +是否是全局池化。 + + +### kernelSize + + +``` +long [] MaxPoolFusion::kernelSize +``` +**描述:** +取最大值的kernel大小,是一个长度为2的int数组[kernel_height,kernel_weight]。 + + +### pad + + +``` +long [] MaxPoolFusion::pad +``` +**描述:** +填充数组。 + + +### padMode + + +``` +enum PadMode MaxPoolFusion::padMode +``` +**描述:** +填充类型,详情请参考:[PadMode](_n_n_rt.md#padmode)。 + + +### strides + + +``` +long [] MaxPoolFusion::strides +``` +**描述:** +池化核步长,kernel移动的距离,是一个长度为2的int数组。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_maximum.md b/zh-cn/device-dev/reference/hdi-apis/_maximum.md new file mode 100644 index 0000000000000000000000000000000000000000..bac47e4576aeadfa455270525b8be38bc29d8a1b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_maximum.md @@ -0,0 +1,28 @@ +# Maximum + + +## 概述 + +对输入x1和x2,计算x1和x2对应元素最大值,x1和x2的输入遵守隐式类型转换规则,使数据类型一致。 + +输入必须是两个张量或一个张量和一个标量。当输入是两个张量时,它们的数据类型不能同时为DATA_TYPE_BOOL。它们的形状支持 broadcast成相同的大小。当输入是一个张量和一个标量时,标量只能是一个常数。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_MAXIMUM。 + +输入: + +- x1,n维输入tensor,实数或DATA_TYPE_BOOL类型。 + +- x2,n维输入tensor,实数或DATA_TYPE_BOOL类型。 + +输出: + +- output,x1和x2两个tensor对应元素的最大值。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_meas_channel_param.md b/zh-cn/device-dev/reference/hdi-apis/_meas_channel_param.md index f79fa1a599c8747f62b908285f98f36075bb59b8..802e5522167896fd73b16906e153e5cdda08942f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_meas_channel_param.md +++ b/zh-cn/device-dev/reference/hdi-apis/_meas_channel_param.md @@ -1,35 +1,31 @@ # MeasChannelParam -## **概述** +## 概述 信道测量参数。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [channelId](#channelid) | 信道号。 | -| [measTime](#meastime) | 测量时间。 | +| [channelId](#channelid) | int
信道号。  | +| [measTime](#meastime) | int
测量时间。  | -## **类成员变量说明** +## 类成员变量说明 ### channelId @@ -38,9 +34,7 @@ ``` int MeasChannelParam::channelId ``` - -**描述:** - +**描述:** 信道号。 @@ -50,7 +44,5 @@ int MeasChannelParam::channelId ``` int MeasChannelParam::measTime ``` - -**描述:** - +**描述:** 测量时间。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_meas_channel_result.md b/zh-cn/device-dev/reference/hdi-apis/_meas_channel_result.md index 58c05d98f1424fcd8821a7ac425df7ee2acdbb5d..95f44286f60b671cf12e380255d8bac009545c8e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_meas_channel_result.md +++ b/zh-cn/device-dev/reference/hdi-apis/_meas_channel_result.md @@ -1,36 +1,32 @@ # MeasChannelResult -## **概述** +## 概述 信道测量结果。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [channelId](#channelid) | 信道号。 | -| [chload](#chload) | 信道负载。 | -| [noise](#noise) | 信道噪声。 | +| [channelId](#channelid) | int
信道号。  | +| [chload](#chload) | int
信道负载。  | +| [noise](#noise) | int
信道噪声。  | -## **类成员变量说明** +## 类成员变量说明 ### channelId @@ -39,9 +35,7 @@ ``` int MeasChannelResult::channelId ``` - -**描述:** - +**描述:** 信道号。 @@ -51,9 +45,7 @@ int MeasChannelResult::channelId ``` int MeasChannelResult::chload ``` - -**描述:** - +**描述:** 信道负载。 @@ -63,7 +55,5 @@ int MeasChannelResult::chload ``` int MeasChannelResult::noise ``` - -**描述:** - +**描述:** 信道噪声。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_mode_data.md b/zh-cn/device-dev/reference/hdi-apis/_mode_data.md new file mode 100644 index 0000000000000000000000000000000000000000..154fd589fb60a86e3a4797c1dbe8164cf98500d7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_mode_data.md @@ -0,0 +1,74 @@ +# ModeData + + +## 概述 + +接收短信处理模式。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号 | +| [result](#result) | boolean
是否接收短信 | +| [mode](#mode) | int
接收短信处理模式 | +| [pdu](#pdu) | String
协议数据单元 | + + +## 类成员变量说明 + + +### mode + + +``` +int ModeData::mode +``` + +**描述:** + +接收短信处理模式 + + +### pdu + + +``` +String ModeData::pdu +``` + +**描述:** + +协议数据单元 + + +### result + + +``` +boolean ModeData::result +``` + +**描述:** + +是否接收短信 + + +### serial + + +``` +int ModeData::serial +``` + +**描述:** + +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_model.md b/zh-cn/device-dev/reference/hdi-apis/_model.md new file mode 100644 index 0000000000000000000000000000000000000000..e74d871f5d737f9058efd0aa0859d516bdd05e53 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_model.md @@ -0,0 +1,94 @@ +# Model + + +## 概述 + +模型结构体。 + +该结构体中存储了模型推理时所有的信息,每一个Model的第0个子图都是主子图,一般情况下一个Model仅有一个subGraph(其他情况目前暂不支持)。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [name](#name) | String
模型名称。  | +| [inputIndex](#inputindex) | unsigned int[]
模型的输入张量在allTensors数组中的下标。  | +| [outputIndex](#outputindex) | unsigned int[]
模型的输出张量在allTensors数组中的下标。  | +| [nodes](#nodes) | struct [Node](_node.md)[]
模型中所有的算子节点组成的数组,详情请参考:[Node](_node.md)。  | +| [allTensors](#alltensors) | struct [Tensor](_tensor.md)[]
模型中所有的张量组成的数组,该数组中包括输入张量,输出张量和常量张量,详情请参考:[Tensor](_tensor.md)。  | +| [subGraph](#subgraph) | struct [SubGraph](_sub_graph.md)[]
模型中所有的子图组成的数组,详情请参考:[SubGraph](_sub_graph.md)。  | + + +## 类成员变量说明 + + +### allTensors + + +``` +struct Tensor [] Model::allTensors +``` +**描述:** +模型中所有的张量组成的数组,该数组中包括输入张量,输出张量和常量张量,详情请参考:[Tensor](_tensor.md)。 + + +### inputIndex + + +``` +unsigned int [] Model::inputIndex +``` +**描述:** +模型的输入张量在allTensors数组中的下标。 + + +### name + + +``` +String Model::name +``` +**描述:** +模型名称。 + + +### nodes + + +``` +struct Node [] Model::nodes +``` +**描述:** +模型中所有的算子节点组成的数组,详情请参考:[Node](_node.md)。 + + +### outputIndex + + +``` +unsigned int [] Model::outputIndex +``` +**描述:** +模型的输出张量在allTensors数组中的下标。 + + +### subGraph + + +``` +struct SubGraph [] Model::subGraph +``` +**描述:** +模型中所有的子图组成的数组,详情请参考:[SubGraph](_sub_graph.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_model_config.md b/zh-cn/device-dev/reference/hdi-apis/_model_config.md new file mode 100644 index 0000000000000000000000000000000000000000..f37070026d608365688734ca007f9db38afb0987 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_model_config.md @@ -0,0 +1,70 @@ +# ModelConfig + + +## 概述 + +定义编译模型需要的参数配置。 + +**Since:** +3.2 +**Version:** +2.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [enableFloat16](#enablefloat16) | boolean
float32浮点模型是否以float16浮点运行  | +| [mode](#mode) | enum [PerformanceMode](_n_n_rt.md#performancemode)
计算任务的性能模式,性能模式定义请查看[PerformanceMode](_n_n_rt.md#performancemode) | +| [priority](#priority) | enum [Priority](_n_n_rt.md#priority)
计算任务的优先级,优先级详情请看[Priority](_n_n_rt.md#priority) | +| [extensions](#extensions) | Map< String, byte[]>
底层硬件自定义属性,按照“名称:二进制值”来存储,由HDI服务自行解析  | + + +## 类成员变量说明 + + +### enableFloat16 + + +``` +boolean ModelConfig::enableFloat16 +``` +**描述:** +float32浮点模型是否以float16浮点运行 + + +### extensions + + +``` +Map ModelConfig::extensions +``` +**描述:** +底层硬件自定义属性,按照“名称:二进制值”来存储,由HDI服务自行解析 + + +### mode + + +``` +enum PerformanceMode ModelConfig::mode +``` +**描述:** +计算任务的性能模式,性能模式定义请查看[PerformanceMode](_n_n_rt.md#performancemode) + + +### priority + + +``` +enum Priority ModelConfig::priority +``` +**描述:** +计算任务的优先级,优先级详情请看[Priority](_n_n_rt.md#priority) diff --git a/zh-cn/device-dev/reference/hdi-apis/_model_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_model_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..58170ce499b6db1f3ce837faf966e6eee981cc79 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_model_types_8idl.md @@ -0,0 +1,48 @@ +# ModelTypes.idl + + +## 概述 + +该文件定义AI模型相关的结构体。 + +在**PrepareModel**阶段,需要解析Model并将其转换为用于推理的模型结构,在**Run**阶段则会执行模型推理。大致流程如下: + +1. 编写[NodeAttrTypes.idl](_node_attr_types_8idl.md)文件中每一个算子的函数,并将函数与[NodeType](_n_n_rt.md#nodetype)进行关联。 + +2. 遍历[Model](_model.md)的subGraph参数,然后从子图的nodeIndecies中获得该子图包含的算子节点以及算子的输入输出张量和整个[Model](_model.md)的输入输出张量。 + +3. 通过[Node](_node.md)的nodeType参数找到算子函数,并构建用于运行时的模型结构。 + +4. 执行模型推理时,通过用户输入张量传递给模型并执行模型推理,最终输出模型推理的结果。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [Tensor](_tensor.md) | struct
张量结构体。 | +| [Node](_node.md) | struct
算子节点结构体。 | +| [SubGraph](_sub_graph.md) | struct
子图结构体。 | +| [Model](_model.md) | struct
模型结构体。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.nnrt.v2_0 | NNRt模块的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/motion.md b/zh-cn/device-dev/reference/hdi-apis/_motion.md similarity index 63% rename from zh-cn/device-dev/reference/hdi-apis/motion.md rename to zh-cn/device-dev/reference/hdi-apis/_motion.md index 4662cf421979b9d24c5be1ca2143d2c649104b93..199086927343a45815689bac3a445aee54874e02 100644 --- a/zh-cn/device-dev/reference/hdi-apis/motion.md +++ b/zh-cn/device-dev/reference/hdi-apis/_motion.md @@ -1,18 +1,18 @@ # Motion -## **概述** +## 概述 手势识别设备驱动对硬件服务提供通用的接口能力。 -模块提供硬件服务对手势识别驱动模块访问统一接口,服务获取驱动对象或者代理后,通过其提供的各类方法,实现使能手势识别/ 去使能手势识别、订阅/取消订阅手势识别数据。 +模块提供硬件服务对手势识别驱动模块访问统一接口,服务获取驱动对象或者代理后,通过其提供的各类方法,实现使能手势识别/去使能手势识别、订阅/取消订阅手势识别数据。 -**Since**: +**Since:** 3.2 -## **汇总** +## 汇总 ### 文件 @@ -28,16 +28,16 @@ | 名称 | 描述 | | -------- | -------- | -| [IMotionCallback](interface_i_motion_callback.md) | 定义上报手势识别数据回调函数。 | -| [IMotionInterface](interface_i_motion_interface.md) | 提供Motion设备基本控制操作接口。 | -| [HdfMotionEvent](_hdf_motion_event.md) | 上报手势识别数据结构。 | +| [IMotionCallback](interface_i_motion_callback.md) | interface
定义上报手势识别数据回调函数。 | +| [IMotionInterface](interface_i_motion_interface.md) | interface
提供Motion设备基本控制操作接口。 | +| [HdfMotionEvent](_hdf_motion_event.md) | struct
上报手势识别数据结构。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [HdfMotionTypeTag](#hdfmotiontypetag) {   HDF_MOTION_TYPE_PICKUP = 0, HDF_MOTION_TYPE_FLIP, HDF_MOTION_CLOSE_TO_EAR, HDF_MOTION_TYPE_SHAKE,   HDF_MOTION_TYPE_ROTATION, HDF_MOTION_TYPE_POCKET_MODE, HDF_MOTION_TYPE_LEAVE_EAR, HDF_MOTION_TYPE_WRIST_UP,   HDF_MOTION_TYPE_WRIST_DOWN, HDF_MOTION_TYPE_MAX } | 枚举手势识别类型。 | +| [HdfMotionTypeTag](#hdfmotiontypetag) { HDF_MOTION_TYPE_PICKUP = 0, HDF_MOTION_TYPE_FLIP, HDF_MOTION_CLOSE_TO_EAR, HDF_MOTION_TYPE_SHAKE,   HDF_MOTION_TYPE_ROTATION, HDF_MOTION_TYPE_POCKET_MODE, HDF_MOTION_TYPE_LEAVE_EAR, HDF_MOTION_TYPE_WRIST_UP,   HDF_MOTION_TYPE_WRIST_DOWN, HDF_MOTION_TYPE_MAX } | 枚举手势识别类型。 | ### 关键字 @@ -47,7 +47,7 @@ | package ohos.hdi.motion.v1_0 | 手势识别模块接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### HdfMotionTypeTag @@ -57,7 +57,7 @@ enum HdfMotionTypeTag ``` -**描述:** +**描述:** 枚举手势识别类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_motion_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_motion_types_8idl.md index 2f1c31dce3a06a64e8cba139bb0ec3235c4b5b06..1d4093706c44d4fcb9229ad89eaa559c9aa06512 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_motion_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_motion_types_8idl.md @@ -1,7 +1,7 @@ # MotionTypes.idl -## **概述** +## 概述 定义手势识别模块用到的数据结构,包括手势识别类型、上报的手势识别数据结构。 @@ -15,21 +15,28 @@ **相关模块:** -[Motion](motion.md) +[Motion](_motion.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [HdfMotionEvent](_hdf_motion_event.md) | 上报手势识别数据结构。 | +| [HdfMotionEvent](_hdf_motion_event.md) | struct
上报手势识别数据结构。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [HdfMotionTypeTag](motion.md#hdfmotiontypetag) {   HDF_MOTION_TYPE_PICKUP = 0, HDF_MOTION_TYPE_FLIP, HDF_MOTION_CLOSE_TO_EAR, HDF_MOTION_TYPE_SHAKE,   HDF_MOTION_TYPE_ROTATION, HDF_MOTION_TYPE_POCKET_MODE, HDF_MOTION_TYPE_LEAVE_EAR, HDF_MOTION_TYPE_WRIST_UP,   HDF_MOTION_TYPE_WRIST_DOWN, HDF_MOTION_TYPE_MAX } | 枚举手势识别类型。 | +| [HdfMotionTypeTag](_motion.md#hdfmotiontypetag) { HDF_MOTION_TYPE_PICKUP = 0, HDF_MOTION_TYPE_FLIP, HDF_MOTION_CLOSE_TO_EAR, HDF_MOTION_TYPE_SHAKE,   HDF_MOTION_TYPE_ROTATION, HDF_MOTION_TYPE_POCKET_MODE, HDF_MOTION_TYPE_LEAVE_EAR, HDF_MOTION_TYPE_WRIST_UP,   HDF_MOTION_TYPE_WRIST_DOWN, HDF_MOTION_TYPE_MAX } | 枚举手势识别类型。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.motion.v1_0 | 手势识别模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_mul_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_mul_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..d04f950a1db50c276084dfff72bbfe6091053cb1 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_mul_fusion.md @@ -0,0 +1,49 @@ +# MulFusion + + +## 概述 + +对输入x1和x2,将x1和x2相同的位置的元素相乘得到output。 + +如果x1和x2类型shape不同,要求x1和x2可以通过broadcast扩充成相同的shape进行相乘。 该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_MUL_FUSION。 + +输入: + +- x1,int或float类型的张量。 + +- x2,int或float类型的张量。 + +输出: + +- x1和x2每个元素的乘积。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType MulFusion::activationType +``` +**描述:** +激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_n_n_rt.md b/zh-cn/device-dev/reference/hdi-apis/_n_n_rt.md new file mode 100644 index 0000000000000000000000000000000000000000..92e23f3790e74806f96e4106cd9c71b736f88198 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_n_n_rt.md @@ -0,0 +1,592 @@ +# NNRt + + +## 概述 + +NNRt(Neural Network Runtime,神经网络运行时)是面向AI领域的跨芯片推理计算运行时,作为中间桥梁连通上层AI推理框架和底层加速芯片,实现AI模型的跨芯片推理计算。提供统一AI芯片驱动接口,实现AI芯片驱动接入OpenHarmony。 + +**Since:** + +3.2 + +**Version:** + +2.0 + + +## 汇总 + + +### 文件 + + | 名称 | 描述 | +| -------- | -------- | +| [INnrtDevice.idl](_i_nnrt_device_8idl.md) | 该文件定义芯片设备相关的接口。 | +| [IPreparedModel.idl](_i_prepared_model_8idl.md) | 该文件定义了AI模型推理、获取模型输入tensor维度范围、导出编译后模型等接口。 | +| [ModelTypes.idl](_model_types_8idl.md) | 该文件定义AI模型相关的结构体。 | +| [NnrtTypes.idl](_nnrt_types_8idl.md) | 该文件定义了HDI接口中用到的类型。 | +| [NodeAttrTypes.idl](_node_attr_types_8idl.md) | 该文件定义AI模型算子的参数和功能。 | + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [INnrtDevice](interface_i_nnrt_device.md) | interface
定义了与设备相关的接口,实现设备管理和模型编译等操作。 | +| [IPreparedModel](interface_i_prepared_model.md) | interface
定义模型编译后的对象,包含编译后模型导出、模型推理接口。 | +| [Tensor](_tensor.md) | struct
张量结构体。 | +| [Node](_node.md) | struct
算子节点结构体。 | +| [SubGraph](_sub_graph.md) | struct
子图结构体。 | +| [Model](_model.md) | struct
模型结构体。 | +| [SharedBuffer](_shared_buffer.md) | struct
共享内存数据的结构体。 | +| [ModelConfig](_model_config.md) | struct
定义编译模型需要的参数配置。 | +| [QuantParam](_quant_param.md) | struct
量化参数结构体。 | +| [IOTensor](_i_o_tensor.md) | struct
AI模型的输入输出张量。 | +| [Activation](_activation.md) | struct
激活类型的算子,所有的激活函数都属于该算子,具体的激活函数类型一句参数来确定。 | +| [AddFusion](_add_fusion.md) | struct
输入Tensor逐元素相加, 输出x和y的和,数据形状与输入broadcast之后一样,数据类型与较高精度的输入精度一致。 | +| [ArgMaxFusion](_arg_max_fusion.md) | struct
返回跨轴的tensor前K个索引或者是数值。 | +| [AvgPoolFusion](_avg_pool_fusion.md) | struct
在输入tensor上应用 2D 平均池化。支持int8量化输入。 | +| [BatchToSpaceND](_batch_to_space_n_d.md) | struct
将一个4维tensor的batch维度按block_shape切分成小块,并将这些小块拼接到空间维度。 | +| [BiasAdd](_bias_add.md) | struct
对给出的输入张量上的各个维度方向上的数据进行偏置。 | +| [Cast](_cast.md) | struct
根据输出张量的类型对张量数据类型进行转换。 | +| [Concat](_concat.md) | struct
在指定轴上连接张量,将输入张量按给定的轴连接起来。 | +| [Conv2DFusion](_conv2_d_fusion.md) | struct
对将4维的tensor执行带有偏置的二维卷积运算。 | +| [Conv2dTransposeFusion](_conv2d_transpose_fusion.md) | struct
对一个4维的tensor执行带有偏置的二维反卷积。 | +| [DivFusion](_div_fusion.md) | struct
将两个tensor执行除法运算。 | +| [Eltwise](_eltwise.md) | struct
元素级别操作的算子。 | +| [ExpandDims](_expand_dims.md) | struct
在给定轴上为tensor添加一个额外的维度。 | +| [Fill](_fill.md) | struct
根据指定的维度,创建由一个标量填充的tensor。 | +| [FullConnection](_full_connection.md) | struct
对输入数据做全连接。 | +| [FusedBatchNorm](_fused_batch_norm.md) | struct
对一个tensor进行批标准化的运算。 | +| [Gather](_gather.md) | struct
根据指定的索引和轴返回输入tensor的切片。 | +| [LayerNormFusion](_layer_norm_fusion.md) | struct
对一个tensor从某一axis开始做层归一化。 | +| [LessEqual](_less_equal.md) | struct
对输入x1和x2,计算每对元素的x1<=x2的结果。 | +| [MatMulFusion](_mat_mul_fusion.md) | struct
对输入x1和x2,计算x1和x2的内积。 | +| [Maximum](_maximum.md) | struct
对输入x1和x2,计算x1和x2对应元素最大值,x1和x2的输入遵守隐式类型转换规则,使数据类型一致。 | +| [MaxPoolFusion](_max_pool_fusion.md) | struct
对输入x,计算 2D 最大值池化。 | +| [MulFusion](_mul_fusion.md) | struct
对输入x1和x2,将x1和x2相同的位置的元素相乘得到output。 | +| [OneHot](_one_hot.md) | struct
根据indices指定的位置,生成一个由one-hot向量构成的tensor。 | +| [PadFusion](_pad_fusion.md) | struct
在x指定维度的数据前后,添加指定数值进行增广。 | +| [PowFusion](_pow_fusion.md) | struct
求x的y次幂,输入必须是两个tensor或一个tensor和一个标量。 | +| [PReLUFusion](_p_re_l_u_fusion.md) | struct
计算x和weight的PReLU激活值。 | +| [QuantDTypeCast](_quant_d_type_cast.md) | struct
数据类型转换。 | +| [ReduceFusion](_reduce_fusion.md) | struct
减小x张量的维度。 | +| [Reshape](_reshape.md) | struct
根据inputShape调整input的形状。 | +| [Resize](_resize.md) | struct
按给定的参数对输入的张量进行变形。 | +| [Rsqrt](_rsqrt.md) | struct
求x的平方根的倒数。 | +| [ScaleFusion](_scale_fusion.md) | struct
给定一个tensor,计算其缩放后的值。 | +| [Shape](_shape.md) | struct
输出输入tensor的形状。 | +| [SliceFusion](_slice_fusion.md) | struct
在x各维度,在axes维度中,以begin为起点,截取size长度的切片。 | +| [Softmax](_softmax.md) | struct
给定一个tensor,计算其softmax结果。 | +| [SpaceToBatchND](_space_to_batch_n_d.md) | struct
将4维张量在空间维度上进行切分成多个小块,然后在batch维度上拼接这些小块。 | +| [Split](_split.md) | struct
算子沿 axis 维度将x拆分成多个张量,张量数量由outputNum指定。 | +| [Sqrt](_sqrt.md) | struct
给定一个tensor,计算其平方根。 | +| [SquaredDifference](_squared_difference.md) | struct
计算两个输入的差值并返回差值的平方。SquaredDifference算子支持tensor和tensor相减。 | +| [Squeeze](_squeeze.md) | struct
去除axis中,长度为1的维度。支持int8量化输入。 | +| [Stack](_stack.md) | struct
将一组tensor沿axis维度进行堆叠,堆叠前每个tensor的维数为n,则堆叠后output维数为n+1。 | +| [StridedSlice](_strided_slice.md) | struct
根据步长和索引对输入张量进行切片提取。 | +| [SubFusion](_sub_fusion.md) | struct
计算两个输入的差值。 | +| [TileFusion](_tile_fusion.md) | struct
以multiples指定的次数拷贝输入张量。 | +| [TopKFusion](_top_k_fusion.md) | struct
查找沿axis轴的前K个最大值和对应索引。 | +| [Transpose](_transpose.md) | struct
根据perm对x进行数据重排。 | +| [Unsqueeze](_unsqueeze.md) | struct
根据输入axis的值。增加一个维度。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [DeviceType](#devicetype) : int { OTHER , CPU , GPU , ACCELERATOR } | AI计算芯片的类型。 | +| [DeviceStatus](#devicestatus) : int { AVAILABLE , BUSY , OFFLINE , UNKNOWN } | 用于AI计算芯片的状态。 | +| [PerformanceMode](#performancemode) : int {PERFORMANCE_NONE , PERFORMANCE_LOW , PERFORMANCE_MEDIUM , PERFORMANCE_HIGH ,PERFORMANCE_EXTREME
} | 芯片执行AI计算的性能模式。 | +| [Priority](#priority) : int { PRIORITY_NONE , PRIORITY_LOW , PRIORITY_MEDIUM , PRIORITY_HIGH } | AI计算任务的优先级。 | +| [Format](#format) : byte { FORMAT_NONE = -1 , FORMAT_NCHW = 0 , FORMAT_NHWC = 1 } | 算子数据排布。需要配合[Tensor](_tensor.md)使用。 | +| [DataType](#datatype) : byte {
DATA_TYPE_UNKNOWN = 0 , DATA_TYPE_BOOL = 30 , DATA_TYPE_INT8 = 32 , DATA_TYPE_INT16 = 33 , DATA_TYPE_INT32 = 34 , DATA_TYPE_INT64 = 35 , DATA_TYPE_UINT8 = 37 , DATA_TYPE_UINT16 = 38 , DATA_TYPE_UINT32 = 39 , DATA_TYPE_UINT64 = 40 , DATA_TYPE_FLOAT16 = 42 , DATA_TYPE_FLOAT32 = 43 ,DATA_TYPE_FLOAT64 = 44} | 张量的数据类型。需要配合[Tensor](_tensor.md)使用。 | +| [QuantType](#quanttype) : byte { QUANT_TYPE_NONE , QUANT_TYPE_ALL } | 量化类型。需要配合[Node](_node.md)使用。 | +| [NodeType](#nodetype) : unsigned int {
NODE_TYPE_NONE = 0 , NODE_TYPE_ACTIVATION = 2 , NODE_TYPE_ADD_FUSION = 5 , NODE_TYPE_ARGMAX_FUSION = 11 ,
NODE_TYPE_AVGPOOL_FUSION = 17 , NODE_TYPE_BATCH_TO_SPACE_ND = 22 , NODE_TYPE_BIAS_ADD = 23 , NODE_TYPE_CAST = 28 ,
NODE_TYPE_CONCAT = 31 , NODE_TYPE_CONV2D_FUSION = 35 , NODE_TYPE_CONV2D_TRANSPOSE_FUSION = 36 , NODE_TYPE_DIV_FUSION = 47 , NODE_TYPE_ELTWISE = 52 , NODE_TYPE_EXPAND_DIMS = 56 , NODE_TYPE_FILL = 66 , NODE_TYPE_FULL_CONNECTION = 67 ,
NODE_TYPE_FUSED_BATCH_NORM = 68 , NODE_TYPE_GATHER = 69 , NODE_TYPE_LAYER_NORM_FUSION = 75 , NODE_TYPE_LESS_EQUAL = 78 ,
NODE_TYPE_MATMUL_FUSION = 89 , NODE_TYPE_MAXIMUM = 90 , NODE_TYPE_MAX_POOL_FUSION = 92 , NODE_TYPE_MUL_FUSION = 99 ,
NODE_TYPE_ONE_HOT = 105 , NODE_TYPE_PAD_FUSION = 107 , NODE_TYPE_POW_FUSION = 110 , NODE_TYPE_PRELU_FUSION = 112 ,
NODE_TYPE_QUANT_DTYPE_CAST = 113 , NODE_TYPE_REDUCE_FUSION = 118 , NODE_TYPE_RESHAPE = 119 , NODE_TYPE_RESIZE = 120 ,
NODE_TYPE_RSQRT = 126 , NODE_TYPE_SCALE_FUSION = 127 , NODE_TYPE_SHAPE = 130 , NODE_TYPE_SLICE_FUSION = 135 ,
NODE_TYPE_SOFTMAX = 138 , NODE_TYPE_SPACE_TO_BATCH_ND = 141 , NODE_TYPE_SPLIT = 145 , NODE_TYPE_SQRT = 146 ,
NODE_TYPE_SQUEEZE = 147 , NODE_TYPE_SQUARED_DIFFERENCE = 149 , NODE_TYPE_STACK = 150 , NODE_TYPE_STRIDED_SLICE = 151 ,
NODE_TYPE_SUB_FUSION = 152 , NODE_TYPE_TILE_FUSION = 160 , NODE_TYPE_TOPK_FUSION = 161 , NODE_TYPE_TRANSPOSE = 162 ,
NODE_TYPE_UNSQUEEZE = 165
} | 算子类型。 | +| [ResizeMethod](#resizemethod) : byte { RESIZE_METHOD_UNKNOWN = -1 , RESIZE_METHOD_LINEAR = 0 , RESIZE_METHOD_NEAREST = 1 , RESIZE_METHOD_CUBIC = 2 } | 调整尺寸的方法。需要配合[Resize](_resize.md)算子使用。 | +| [CoordinateTransformMode](#coordinatetransformmode) : byte { COORDINATE_TRANSFORM_MODE_ASYMMETRIC = 0 , COORDINATE_TRANSFORM_MODE_ALIGN_CORNERS = 1 , COORDINATE_TRANSFORM_MODE_HALF_PIXEL = 2 } | 坐标变换模式,仅[Resize](_resize.md)算子使用这些枚举。 | +| [NearestMode](#nearestmode) : byte {
NEAREST_MODE_NORMAL = 0 , NEAREST_MODE_ROUND_HALF_DOWN = 1 , NEAREST_MODE_ROUND_HALF_UP = 2 , NEAREST_MODE_FLOOR = 3 ,
NEAREST_MODE_CEIL = 4
} | 临近算法类型。需要配合[Resize](_resize.md)算子使用。 | +| [ActivationType](#activationtype) : byte {
ACTIVATION_TYPE_NO_ACTIVATION = 0 , ACTIVATION_TYPE_RELU = 1 , ACTIVATION_TYPE_SIGMOID = 2 , ACTIVATION_TYPE_RELU6 = 3 ,
ACTIVATION_TYPE_ELU = 4 , ACTIVATION_TYPE_LEAKY_RELU = 5 , ACTIVATION_TYPE_ABS = 6 , ACTIVATION_TYPE_RELU1 = 7 ,
ACTIVATION_TYPE_SOFTSIGN = 8 , ACTIVATION_TYPE_SOFTPLUS = 9 , ACTIVATION_TYPE_TANH = 10 , ACTIVATION_TYPE_SELU = 11 ,
ACTIVATION_TYPE_HSWISH = 12 , ACTIVATION_TYPE_HSIGMOID = 13 , ACTIVATION_TYPE_THRESHOLDRELU = 14 , ACTIVATION_TYPE_LINEAR = 15 , ACTIVATION_TYPE_HARD_TANH = 16 , ACTIVATION_TYPE_SIGN = 17 , ACTIVATION_TYPE_SWISH = 18 , ACTIVATION_TYPE_GELU = 19 ,
ACTIVATION_TYPE_UNKNOWN = 20} | 激活函数类型。 | +| [ReduceMode](#reducemode) : byte {
REDUCE_MODE_MEAN = 0 , REDUCE_MODE_MAX = 1 , REDUCE_MODE_MIN = 2 , REDUCE_MODE_PROD = 3 , REDUCE_MODE_SUM = 4 , REDUCE_MODE_SUM_SQUARE = 5 , REDUCE_MODE_ASUM = 6 , REDUCE_MODE_ALL = 7} | 用于维度移除的方法,需要配合[ReduceFusion](_reduce_fusion.md)算子使用。 | +| [EltwiseMode](#eltwisemode) : byte { ELTWISE_MODE_PROD = 0 , ELTWISE_MODE_SUM = 1 , ELTWISE_MODE_MAXIMUM = 2 , ELTWISE_MODE_UNKNOWN = 3 } | 元素级别运算支持的计算类型,需要配合[Eltwise](_eltwise.md)算子使用。 | +| [PadMode](#padmode) : byte { PAD_MODE_PAD = 0 , PAD_MODE_SAME = 1 , PAD_MODE_VALID = 2 } | 填充类型,需要配合[AvgPoolFusion](_avg_pool_fusion.md),[AvgPoolFusion](_avg_pool_fusion.md),[Conv2DFusion](_conv2_d_fusion.md),[MaxPoolFusion](_max_pool_fusion.md)使用。 | +| [RoundMode](#roundmode) : byte { ROUND_MODE_FLOOR = 0 , ROUND_MODE_CEIL = 1 } | 小数取整算法,需要配合[AvgPoolFusion](_avg_pool_fusion.md)算子使用。 | +| [PaddingMode](#paddingmode) : byte { PADDING_MODE_CONSTANT = 0 , PADDING_MODE_REFLECT = 1 , PADDING_MODE_SYMMETRIC = 2 , PADDING_MODE_RESERVED = 3 } | 填充类型,需要配合[PadFusion](_pad_fusion.md)算子使用。 | +| [NNRT_ReturnCode](#nnrt_returncode) : int {
NNRT_SUCCESS = 0 , NNRT_FAILED = 1 , NNRT_NULL_PTR = 2 , NNRT_INVALID_PARAMETER = 3 ,
NNRT_MEMORY_ERROR = 4 , NNRT_OUT_OF_MEMORY = 5 , NNRT_OPERATION_FORBIDDEN = 6 , NNRT_INVALID_FILE = 7 ,
NNRT_INVALID_PATH = 8 , NNRT_INSUFFICIENT_BUFFER = 9 , NNRT_NO_CHANGE = 10 , NNRT_NOT_SUPPORT = 11 ,
NNRT_SERVICE_ERROR = 12 , NNRT_DEVICE_ERROR = 13 , NNRT_DEVICE_BUSY = 14 , NNRT_CANCELLED = 15 ,
NNRT_PERMISSION_DENIED = 16 , NNRT_TIME_OUT = 17 , NNRT_INVALID_TENSOR = 18 , NNRT_INVALID_NODE = 19 ,
NNRT_INVALID_INPUT = 20 , NNRT_INVALID_OUTPUT = 21 , NNRT_INVALID_DATATYPE = 22 , NNRT_INVALID_FORMAT = 23 ,
NNRT_INVALID_TENSOR_NAME = 24 , NNRT_INVALID_SHAPE = 25 , NNRT_OUT_OF_DIMENTION_RANGES = 26 , NNRT_INVALID_BUFFER = 27 ,
NNRT_INVALID_BUFFER_SIZE = 28 , NNRT_INVALID_PERFORMANCE_MODE = 29 , NNRT_INVALID_PRIORITY = 30 , NNRT_INVALID_MODEL = 31 ,
NNRT_INVALID_MODEL_CACHE = 32 , NNRT_UNSUPPORTED_OP = 33
} | NNRt定义的专用错误码,为HDI接口的返回值。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.nnrt.v2_0 | NNRt模块的包路径。 | + + +## 枚举类型说明 + + +### ActivationType + + +``` +enum ActivationType : byte +``` + +**描述:** + +激活函数类型。 + +激活函数使得神经网络模型具有区分非线性函数的能力,这也让神经网络模型可以被应用于众多非线性模型中。[NodeAttrTypes.idl](_node_attr_types_8idl.md)文件中拥有ActivationType类型的参数的算子会在运行完成算子的运算之后执行相对应的激活函数。 + + | 枚举值 | 描述 | +| -------- | -------- | +| ACTIVATION_TYPE_NO_ACTIVATION | 无激活函数。 | +| ACTIVATION_TYPE_RELU | ReLU激活函数。逐元素求$ max(x_i, 0) $,负数输出值会被修改为0,正数输出不受影响。
$ \text{ReLU}(x_i) = (x_i)^+ = \max(x_i, 0),$
其中$ x_i $是输入元素。 | +| ACTIVATION_TYPE_SIGMOID | Sigmoid激活函数。按元素计算Sigmoid激活函数。Sigmoid函数定义为:
$ \text{Sigmoid}(x_i) = \frac{1}{1 + \exp(-x_i)} $
其中$ x_i $是输入的元素。 | +| ACTIVATION_TYPE_RELU6 | ReLU6激活函数。ReLU6类似于ReLU,不同之处在于设置了上限,其上限为6,如果输入大于6,输出会被限制为6。ReLU6函数定义为:
$ \text{ReLU6}(x_i) = \min(\max(0, x_i), 6) $
其中$ x_i $是输入的元素。 | +| ACTIVATION_TYPE_ELU | 指数线性单元激活函数(Exponential Linear Unit activation function,ELU)激活函数。对输入的每个元素计算ELU。ELU函数定义为:
$ ELU(x_{i}) = \begin{cases} x_i, &\text{if } x_i \geq 0; \cr \alpha \* (\exp(x_i) - 1), &\text{otherwise.} \end{cases} $
其中,$ x_i $表示输入的元素,$ \alpha $表示alpha参数,该参数通过[Activation](_activation.md)进行设置。 | +| ACTIVATION_TYPE_LEAKY_RELU | LeakyReLU激活函数。 LeakyReLU函数定义为:
$ \text{LeakyReLU}(x_i) = \begin{cases} x_i, &\text{if } x_i \geq 0; \cr {\alpha} \* x_i, &\text{otherwise.} \end{cases}$
其中,$ x_i $表示输入的元素,$ \alpha $表示alpha参数,该参数通过[Activation](_activation.md)进行设置。 | +| ACTIVATION_TYPE_ABS | 计算绝对值的激活函数。函数定义为:
$ \text{abs}(x_i) = \|x_i\| $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_RELU1 | ReLU1激活函数。ReLU1函数定义为:
$ \text{ReLU1}(x_i)= \min(\max(0, x_i), 1) $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_SOFTSIGN | SoftSign激活函数。SoftSign函数定义如下:
$ \text{SoftSign}(x_i) = \frac{x_i}{1 + \|x_i\|} $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_SOFTPLUS | Softplus激活函数。Softplus为ReLU函数的平滑近似。可对一组数值使用来确保转换后输出结果均为正值。Softplus函数定义如下:
$ \text{Softplus}(x_i) = \log(1 + \exp(x_i)) $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_TANH | Tanh激活函数。Tanh函数定义如下:
$ tanh(x) = \frac{\exp(x_i) - \exp(-x_i)}{\exp(x_i) + \exp(-x_i)} = \frac{\exp(2x_i) - 1}{\exp(2x_i) + 1} $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_SELU | SELU(Scaled exponential Linear Unit)激活函数。SELU函数定义如下:
$ SELU(x_{i}) = scale \* \begin{cases} x_{i}, &\text{if } x_{i} \geq 0; \cr \text{alpha} \* (\exp(x_i) - 1), &\text{otherwise.} \end{cases} $
其中,$ x_i $是输入元素,$ \alpha $和$ scale $是预定义的常量( $\alpha=1.67326324$,$scale=1.05070098$)。 | +| ACTIVATION_TYPE_HSWISH | Hard Swish激活函数。
$ \text{Hardswish}(x_{i}) = x_{i} \* \frac{ReLU6(x_{i} + 3)}{6} $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_HSIGMOID | Hard Sigmoid激活函数。 Hard Sigmoid函数定义如下:
$ \text{Hardsigmoid}(x_{i}) = max(0, min(1, \frac{x_{i} + 3}{6})) $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_THRESHOLDRELU | ThresholdedReLU激活函数。类似ReLU激活函数,min数定义如下:
$ \text{ThresholdedReLU}(x_i) = \min(\max(0, x_i), t) $
其中,$ x_i $是输入元素,$ t $是最大值。 | +| ACTIVATION_TYPE_LINEAR | Linear激活函数。Linear函数定义如下:
$ \text{Linear}(x_i) = x_i $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_HARD_TANH | HardTanh激活函数。HardTanh函数定义如下:
$ \text{HardTanh}(x_i) = \begin{cases} \text{max_val} & \text{ if } x_i > \text{ max_val } \\ \text{min_val} & \text{ if } x_i < \text{ min_val } \\ x_i & \text{ otherwise } \\ \end{cases} $
其中,$ x_i $是输入,$ max\_val $是最大值,$ min\_val $是最小值,这两个参数通过[Activation](_activation.md)进行设置。 | +| ACTIVATION_TYPE_SIGN | Sign激活函数。Sign函数定义如下:
$ Sign(x_i) = \begin{cases} -1, &if\ x_i < 0 \cr 0, &if\ x_i = 0 \cr 1, &if\ x_i > 0\end{cases} $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_SWISH | Swish激活函数。Swish激活函数定义如下:
$ \text{Swish}(x_i) = x_i \* Sigmoid(x_i) $
其中,$ x_i $表示输入的元素。 | +| ACTIVATION_TYPE_GELU | GELU(Gaussian error linear unit activation function)高斯误差线性单元激活函数。GELU函数定义如下:
$ GELU(x_i) = x_i\*P(X < x_i) $
其中,$ x_i $是输入元素,$ P $是标准高斯分布的累积分布函数。需要通过[Activation](_activation.md)的approximate参数指定是否使用近似。 | +| ACTIVATION_TYPE_UNKNOWN | 未知 | + + +### CoordinateTransformMode + + +``` +enum CoordinateTransformMode : byte +``` + +**描述:** + +坐标变换模式,仅[Resize](_resize.md)算子使用这些枚举。 + +以变换 Width 为例, 记 new_i 为resize之后的Tenosr沿X轴的第i个坐标;记 old_i 为输入Tensor沿X的轴的对应坐标;记 newWidth 是resize之后的Tensor沿着X的轴的长度;记 oldWidth 是输入Tenosr沿X的轴的长度。 可以通过下面的公式计算出 old_i : + +- COORDINATE_TRANSFORM_MODE_ASYMMETRIC: + $ old_i = newWidth != 0 ? new_i \* oldWidth / newWidth : 0 $ + +- COORDINATE_TRANSFORM_MODE_ALIGN_CORNERS: + $ old_i = newWidth != 1 ? new_i \* (oldWidth - 1) / (newWidth - 1) $ + +- COORDINATE_TRANSFORM_MODE_HALF_PIXEL: + $ old_i = newWidth > 1 ? (new_x + 0.5) \* oldWidth / newWidth - 0.5 : 0 $ + + | 枚举值 | 描述 | +| -------- | -------- | +| COORDINATE_TRANSFORM_MODE_ASYMMETRIC | 不进行对齐,直接按照比例缩放 | +| COORDINATE_TRANSFORM_MODE_ALIGN_CORNERS | 对齐图像的4个角 | +| COORDINATE_TRANSFORM_MODE_HALF_PIXEL | 对齐像素点中心 | + + +### DataType + + +``` +enum DataType : byte +``` + +**描述:** + +张量的数据类型。需要配合[Tensor](_tensor.md)使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| DATA_TYPE_UNKNOWN | 数据类型未知 | +| DATA_TYPE_BOOL | 数据类型是BOOL | +| DATA_TYPE_INT8 | 数据类型是INT8 | +| DATA_TYPE_INT16 | 数据类型是INT16 | +| DATA_TYPE_INT32 | 数据类型是INT32 | +| DATA_TYPE_INT64 | 数据类型是INT64 | +| DATA_TYPE_UINT8 | 数据类型是UINT8 | +| DATA_TYPE_UINT16 | 数据类型是UINT16 | +| DATA_TYPE_UINT32 | 数据类型是UINT32 | +| DATA_TYPE_UINT64 | 数据类型是UINT64 | +| DATA_TYPE_FLOAT16 | 数据类型是FLOAT16 | +| DATA_TYPE_FLOAT32 | 数据类型是FLOAT32 | +| DATA_TYPE_FLOAT64 | 数据类型是FLOAT64 | + + +### DeviceStatus + + +``` +enum DeviceStatus : int +``` + +**描述:** + +用于AI计算芯片的状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| AVAILABLE | 芯片当前处于可用状态 | +| BUSY | 芯片当前处于忙碌状态,可能无法及时响应计算任务 | +| OFFLINE | 芯片当前处于下线状态,无法响应计算任务 | +| UNKNOWN | 芯片当前处于未知状态 | + + +### DeviceType + + +``` +enum DeviceType : int +``` + +**描述:** + +AI计算芯片的类型。 + + | 枚举值 | 描述 | +| -------- | -------- | +| OTHER | 不属于以下类型的芯片 | +| CPU | CPU芯片 | +| GPU | GPU芯片 | +| ACCELERATOR | AI专用加速芯片,比如NPU、DSP | + + +### EltwiseMode + + +``` +enum EltwiseMode : byte +``` + +**描述:** + +元素级别运算支持的计算类型,需要配合[Eltwise](_eltwise.md)算子使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| ELTWISE_MODE_PROD | 两个tensor对应元素乘积。 | +| ELTWISE_MODE_SUM | 两个tensor对应元素之差。 | +| ELTWISE_MODE_MAXIMUM | 两个tensor对应元素的最大值。 | +| ELTWISE_MODE_UNKNOWN | 未知。 | + + +### Format + + +``` +enum Format : byte +``` + +**描述:** + +算子数据排布。需要配合[Tensor](_tensor.md)使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| FORMAT_NONE | 用于数据排列,作为Format初始的值。 | +| FORMAT_NCHW | 数据排列为NCHW。 | +| FORMAT_NHWC | 数据排列为NHWC。 | + + +### NearestMode + + +``` +enum NearestMode : byte +``` + +**描述:** + +临近算法类型。需要配合[Resize](_resize.md)算子使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| NEAREST_MODE_NORMAL | 四舍五入取整 | +| NEAREST_MODE_ROUND_HALF_DOWN | 向负无穷取整,例如23.5取整为23,−23.5取整为−24 | +| NEAREST_MODE_ROUND_HALF_UP | 向正无穷取整,例如23.5取整为24,−23.5取整为−23 | +| NEAREST_MODE_FLOOR | 向下取临近的整数,例如23.5取整为23,−23.5取整为−24 | +| NEAREST_MODE_CEIL | 向上取临近的整数整,例如23.5取整为24,−23.5取整为−23 | + + +### NNRT_ReturnCode + + +``` +enum NNRT_ReturnCode : int +``` + +**描述:** + +NNRt定义的专用错误码,为HDI接口的返回值。 + + | 枚举值 | 描述 | +| -------- | -------- | +| NNRT_SUCCESS | 成功 | +| NNRT_FAILED | 失败 | +| NNRT_NULL_PTR | 空指针 | +| NNRT_INVALID_PARAMETER | 非法参数 | +| NNRT_MEMORY_ERROR | 内存错误 | +| NNRT_OUT_OF_MEMORY | 内存不足 | +| NNRT_OPERATION_FORBIDDEN | 禁止的操作 | +| NNRT_INVALID_FILE | 非法文件 | +| NNRT_INVALID_PATH | 非法路径 | +| NNRT_INSUFFICIENT_BUFFER | 缓存不足 | +| NNRT_NO_CHANGE | 无变化 | +| NNRT_NOT_SUPPORT | 不支持 | +| NNRT_SERVICE_ERROR | 服务错误 | +| NNRT_DEVICE_ERROR | 设备错误 | +| NNRT_DEVICE_BUSY | 设备忙碌 | +| NNRT_CANCELLED | 操作取消 | +| NNRT_PERMISSION_DENIED | 拒绝访问 | +| NNRT_TIME_OUT | 超时 | +| NNRT_INVALID_TENSOR | 非法tensor | +| NNRT_INVALID_NODE | 非法节点 | +| NNRT_INVALID_INPUT | 非法输入 | +| NNRT_INVALID_OUTPUT | 非法输出 | +| NNRT_INVALID_DATATYPE | 非法数据类型 | +| NNRT_INVALID_FORMAT | 非法数据布局 | +| NNRT_INVALID_TENSOR_NAME | 非法tensor名称 | +| NNRT_INVALID_SHAPE | 非法shape | +| NNRT_OUT_OF_DIMENTION_RANGES | 超出维度范围 | +| NNRT_INVALID_BUFFER | 非法缓存 | +| NNRT_INVALID_BUFFER_SIZE | 非法缓存大小 | +| NNRT_INVALID_PERFORMANCE_MODE | 非法性能模式 | +| NNRT_INVALID_PRIORITY | 非法优先级 | +| NNRT_INVALID_MODEL | 非法模型 | +| NNRT_INVALID_MODEL_CACHE | 非法模型缓存 | +| NNRT_UNSUPPORTED_OP | 算子不支持 | + + +### NodeType + + +``` +enum NodeType : unsigned int +``` + +**描述:** + +算子类型。 + + | 枚举值 | 描述 | +| -------- | -------- | +| NODE_TYPE_NONE | 算子类型为NONE | +| NODE_TYPE_ACTIVATION | 激活函数类型 | +| NODE_TYPE_ADD_FUSION | ADD算子 | +| NODE_TYPE_ARGMAX_FUSION | ArgMax算子 | +| NODE_TYPE_AVGPOOL_FUSION | AVGPOOL算子 | +| NODE_TYPE_BATCH_TO_SPACE_ND | BatchToSpaceND算子 | +| NODE_TYPE_BIAS_ADD | BiasAdd算子 | +| NODE_TYPE_CAST | Cast算子 | +| NODE_TYPE_CONCAT | Concat算子 | +| NODE_TYPE_CONV2D_FUSION | Conv2D算子,包含了普通卷积、可分离卷积和分组卷积 | +| NODE_TYPE_CONV2D_TRANSPOSE_FUSION | 二维反卷积算子 | +| NODE_TYPE_DIV_FUSION | Div算子 | +| NODE_TYPE_ELTWISE | 元素级别算子 | +| NODE_TYPE_EXPAND_DIMS | ExpandDims张算子 | +| NODE_TYPE_FILL | Fill算子 | +| NODE_TYPE_FULL_CONNECTION | FullConnection算子 | +| NODE_TYPE_FUSED_BATCH_NORM | BatchNorm算子 | +| NODE_TYPE_GATHER | Gather算子 | +| NODE_TYPE_LAYER_NORM_FUSION | LayerNorm算子 | +| NODE_TYPE_LESS_EQUAL | LessEqual算子 | +| NODE_TYPE_MATMUL_FUSION | MatMul算子 | +| NODE_TYPE_MAXIMUM | Maximum算子 | +| NODE_TYPE_MAX_POOL_FUSION | MaxPool算子 | +| NODE_TYPE_MUL_FUSION | Mul算子 | +| NODE_TYPE_ONE_HOT | OneHot算子 | +| NODE_TYPE_PAD_FUSION | Pad算子 | +| NODE_TYPE_POW_FUSION | Pow算子 | +| NODE_TYPE_PRELU_FUSION | PReLU算子 | +| NODE_TYPE_QUANT_DTYPE_CAST | QuantDTypeCast算子 | +| NODE_TYPE_REDUCE_FUSION | Reduce算子 | +| NODE_TYPE_RESHAPE | Reshape算子 | +| NODE_TYPE_RESIZE | Resize算子 | +| NODE_TYPE_RSQRT | Rsqrt算子 | +| NODE_TYPE_SCALE_FUSION | Scale算子 | +| NODE_TYPE_SHAPE | Shape算子 | +| NODE_TYPE_SLICE_FUSION | Slice算子 | +| NODE_TYPE_SOFTMAX | Softmax算子 | +| NODE_TYPE_SPACE_TO_BATCH_ND | SpaceToBatchND算子 | +| NODE_TYPE_SPLIT | Split算子 | +| NODE_TYPE_SQRT | Sqrt算子 | +| NODE_TYPE_SQUEEZE | SquaredDifference算子 | +| NODE_TYPE_SQUARED_DIFFERENCE | Squeeze算子 | +| NODE_TYPE_STACK | Stack算子 | +| NODE_TYPE_STRIDED_SLICE | StridedSlice算子 | +| NODE_TYPE_SUB_FUSION | Sub算子 | +| NODE_TYPE_TILE_FUSION | Tile算子 | +| NODE_TYPE_TOPK_FUSION | TopK算子 | +| NODE_TYPE_TRANSPOSE | Transpose算子 | +| NODE_TYPE_UNSQUEEZE | Unsqueeze算子 | + + +### PaddingMode + + +``` +enum PaddingMode : byte +``` + +**描述:** + +填充类型,需要配合[PadFusion](_pad_fusion.md)算子使用。 + +当输入的张量x= $[[1,2,3],[4,5,6],[7,8,9]]$、paddings= $[[2,2],[2,2]]$时效果如下: + +- paddingMode==PADDING_MODE_CONSTANT并且constantValue = 0时输出为: + $[[0. 0. 0. 0. 0. 0. 0.],\\ [0. 0. 0. 0. 0. 0. 0.],\\ [0. 0. 1. 2. 3. 0. 0.],\\ [0. 0. 4. 5. 6. 0. 0.],\\ [0. 0. 7. 8. 9. 0. 0.],\\ [0. 0. 0. 0. 0. 0. 0.],\\ [0. 0. 0. 0. 0. 0. 0.]]\\ $ + +- paddingMode==PADDING_MODE_REFLECT输出为: + $[[9. 8. 7. 8. 9. 8. 7.],\\ [6. 5. 4. 5. 6. 5. 4.],\\ [3. 2. 1. 2. 3. 2. 1.],\\ [6. 5. 4. 5. 6. 5. 4.],\\ [9. 8. 7. 8. 9. 8. 7.],\\ [6. 5. 4. 5. 6. 5. 4.],\\ [3. 2. 1. 2. 3. 2. 1.]]\\ $ + +- paddingMode==PADDING_MODE_SYMMETRIC输出为: + $[[5. 4. 4. 5. 6. 6. 5.],\\ [2. 1. 1. 2. 3. 3. 2.],\\ [2. 1. 1. 2. 3. 3. 2.],\\ [5. 4. 4. 5. 6. 6. 5.],\\ [8. 7. 7. 8. 9. 9. 8.],\\ [8. 7. 7. 8. 9. 9. 8.],\\ [5. 4. 4. 5. 6. 6. 5.]]\\ $ + + | 枚举值 | 描述 | +| -------- | -------- | +| PADDING_MODE_CONSTANT | 使用常量填充,默认值为0。 | +| PADDING_MODE_REFLECT | 以数据区的便捷为轴,使填充区和数据区的数据以该轴保持对称。 | +| PADDING_MODE_SYMMETRIC | 此填充方法类似于 PADDING_MODE_REFLECT,它以待填充区和数据区的交界为轴,使待填充区和数据区的数据以该轴保持对称。 | +| PADDING_MODE_RESERVED | 预留,暂未使用。 | + + +### PadMode + + +``` +enum PadMode : byte +``` + +**描述:** + +填充类型,需要配合[AvgPoolFusion](_avg_pool_fusion.md),[AvgPoolFusion](_avg_pool_fusion.md),[Conv2DFusion](_conv2_d_fusion.md),[MaxPoolFusion](_max_pool_fusion.md)使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| PAD_MODE_PAD | 在输入的高度和宽度方向上填充0。 若设置该模式,算子的padding参数必须大于等于0。 | +| PAD_MODE_SAME | 输出的高度和宽度分别与输入整除 stride 后的值相同。 若设置该模式,算子的padding参数必须为0。 | +| PAD_MODE_VALID | 在不填充的前提下返回有效计算所得的输出。不满足计算的多余像素会被丢弃。 若设置此模式,则算子的padding参数必须为0。 | + + +### PerformanceMode + + +``` +enum PerformanceMode : int +``` + +**描述:** + +芯片执行AI计算的性能模式。 + + | 枚举值 | 描述 | +| -------- | -------- | +| PERFORMANCE_NONE | 不指定任何性能模式,具体运行模式由芯片定义 | +| PERFORMANCE_LOW | 低性能模式,执行AI计算速度慢,功耗低 | +| PERFORMANCE_MEDIUM | 中性能模式,执行AI计算速度较慢,功耗较低 | +| PERFORMANCE_HIGH | 高性能模式,执行AI计算速度较快,功耗较高 | +| PERFORMANCE_EXTREME | 最高性能模式,执行AI计算速度快,功耗高 | + + +### Priority + + +``` +enum Priority : int +``` + +**描述:** + +AI计算任务的优先级。 + + | 枚举值 | 描述 | +| -------- | -------- | +| PRIORITY_NONE | 不指定任何任务优先级,具体执行策略由芯片定义 | +| PRIORITY_LOW | 低优先级,若有更高优先级的任务,芯片会执行更高优先级的任务 | +| PRIORITY_MEDIUM | 中等优先级,若有更高优先级的任务,芯片会执行更高优先级的任务 | +| PRIORITY_HIGH | 高优先级,高优先级任务最先执行 | + + +### QuantType + + +``` +enum QuantType : byte +``` + +**描述:** + +量化类型。需要配合[Node](_node.md)使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| QUANT_TYPE_NONE | 不使用量化 | +| QUANT_TYPE_ALL | int8全量化 | + + +### ReduceMode + + +``` +enum ReduceMode : byte +``` + +**描述:** + +用于维度移除的方法,需要配合[ReduceFusion](_reduce_fusion.md)算子使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| REDUCE_MODE_MEAN | 使用指定维度所有元素的平均值代替该维度的其他元素,以移除该维度。 | +| REDUCE_MODE_MAX | 使用指定维度所有元素的最大值代替该维度的其他元素,以移除该维度。 | +| REDUCE_MODE_MIN | 使用指定维度所有元素的最小值代替该维度的其他元素,以移除该维度。 | +| REDUCE_MODE_PROD | 使用指定维度所有元素的乘积代替该维度的其他元素,以移除该维度。 | +| REDUCE_MODE_SUM | 使用指定维度所有元素的加和代替该维度的其他元素,以移除该维度。 | +| REDUCE_MODE_SUM_SQUARE | 使用指定维度所有元素的平方和替该维度的其他元素,以移除该维度。 | +| REDUCE_MODE_ASUM | 使用指定维度所有元素的绝对值和代替该维度的其他元素,以移除该维度。 | +| REDUCE_MODE_ALL | 使用指定维度所有元素的逻辑与代替该维度的其他元素,以移除该维度。 | + + +### ResizeMethod + + +``` +enum ResizeMethod : byte +``` + +**描述:** + +调整尺寸的方法。需要配合[Resize](_resize.md)算子使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RESIZE_METHOD_UNKNOWN | 未知,默认值。 | +| RESIZE_METHOD_LINEAR | 双线性插值。 假设需要计算未知函数f在点$ (x,y) $的值其中$ x_1 < x < x_2, y_1 < y < y_2$,并且已知四个坐标点的值$ Q_{11} = (x_1, y_1), Q_{12} = (x1, y2), Q_{21} = (x_2, y_1),Q_{22} = (x_2, y_2) $,并且$ f(Q_{11}),f(Q_{12}),f(Q_{21}),f(Q_{22}) $表示四个点的数值,则通过如下公式可计算$ f(x,y) $的值:
$ f(x,y_1) = \frac{x_2-x}{x_2-x_1}f(Q_{11})+\frac{x-x_1}{x_2-x_1}f(Q_{21}) $
$ f(x,y_2) = \frac{x_2-x}{x_2-x_1}f(Q_{12})+\frac{x-x_1}{x_2-x_1}f(Q_{22}) $
$ f(x,y) = \frac{y_2-y}{y_2-y_1}f(x,y_1)+\frac{y-y_1}{y_2-y_1}f(x,y_2) $ | +| RESIZE_METHOD_NEAREST | 最近临近插值。假设需要计算未知函数f在点$ (x,y) $的值其中$ x_1 < x <x_2, y_1 < y < y_2 $,并且已知四个坐标点的值$ Q_{11} = (x_1, y_1), Q_{12} = (x1, y2), Q_{21} = (x_2, y_1),Q_{22} = (x_2, y_2) $,则从4个点中选择距离点$ (x,y) $最近的点的数值作为$ f(x,y) $的值。 | +| RESIZE_METHOD_CUBIC | 双三次插值。 双三次插值是取采样点周围16个点的值的加权平均来计算采样点的数值。该参数需要配合[Resize](_resize.md)的cubicCoeff和coordinateTransformMode参数使用。 当coordinateTransformMode==COORDINATE_TRANSFORM_MODE_HALF_PIXEL时,cubicCoeff=-0.5,其他情况cubicCoeff=-0.75。插值函数的权重函数如下:
$ W(x) = \begin{cases} (cubicCoeff+2)\|x\|^3 - (cubicCoeff+3)\|x\|^2 +1 , &\text{if } \|x\| \leq 1; \cr cubicCoeff\|x\|^3 - 5cubicCoeff\|x\|^2 + 8cubicCoeff\|x\| - 4a, &\text{if } 1 \lt \|x\| \leq 2; \cr 0, &\text{otherwise.} \end{cases} $ | + + +### RoundMode + + +``` +enum RoundMode : byte +``` + +**描述:** + +小数取整算法,需要配合[AvgPoolFusion](_avg_pool_fusion.md)算子使用。 + + | 枚举值 | 描述 | +| -------- | -------- | +| ROUND_MODE_FLOOR | 向下取临近的整数,例如23.5取整为23,−23.5取整为−24 | +| ROUND_MODE_CEIL | 向上取临近的整数整,例如23.5取整为24,−23.5取整为−23 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_neighbor_cell.md b/zh-cn/device-dev/reference/hdi-apis/_neighbor_cell.md new file mode 100644 index 0000000000000000000000000000000000000000..a9bb31ba03684b4cf49c787b9f8282d1df0e8dab --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_neighbor_cell.md @@ -0,0 +1,90 @@ +# NeighborCell + + +## 概述 + +定义设备驻留的基站邻区信息的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [physicalId](#physicalid) | int
邻区ID号  | +| [mcc](#mcc) | unsigned short
移动国家码  | +| [mnc](#mnc) | unsigned short
移动网络码  | +| [rssi](#rssi) | short
信号接收强度  | +| [rat](#rat) | unsigned short
网络制式  | +| [pci](#pci) | unsigned int
物理小区识别码  | + + +## 类成员变量说明 + + +### mcc + + +``` +unsigned short NeighborCell::mcc +``` +**描述:** +移动国家码 + + +### mnc + + +``` +unsigned short NeighborCell::mnc +``` +**描述:** +移动网络码 + + +### pci + + +``` +unsigned int NeighborCell::pci +``` +**描述:** +物理小区识别码 + + +### physicalId + + +``` +int NeighborCell::physicalId +``` +**描述:** +邻区ID号 + + +### rat + + +``` +unsigned short NeighborCell::rat +``` +**描述:** +网络制式 + + +### rssi + + +``` +short NeighborCell::rssi +``` +**描述:** +信号接收强度 diff --git a/zh-cn/device-dev/reference/hdi-apis/_nnrt_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_nnrt_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..f272dab8b1fb3e98ddc432d58e884e45dfb97e99 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_nnrt_types_8idl.md @@ -0,0 +1,62 @@ +# NnrtTypes.idl + + +## 概述 + +该文件定义了HDI接口中用到的类型。 + +**Since:** + +3.2 + +**Version:** + +2.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [SharedBuffer](_shared_buffer.md) | struct
共享内存数据的结构体。 | +| [ModelConfig](_model_config.md) | struct
定义编译模型需要的参数配置。 | +| [QuantParam](_quant_param.md) | struct
量化参数结构体。 | +| [IOTensor](_i_o_tensor.md) | struct
AI模型的输入输出张量。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [DeviceType](_n_n_rt.md#devicetype) : int { OTHER , CPU , GPU , ACCELERATOR } | AI计算芯片的类型。 | +| [DeviceStatus](_n_n_rt.md#devicestatus) : int { AVAILABLE , BUSY , OFFLINE , UNKNOWN } | 用于AI计算芯片的状态。 | +| [PerformanceMode](_n_n_rt.md#performancemode) : int {PERFORMANCE_NONE , PERFORMANCE_LOW , PERFORMANCE_MEDIUM , PERFORMANCE_HIGH ,PERFORMANCE_EXTREME
} | 芯片执行AI计算的性能模式。 | +| [Priority](_n_n_rt.md#priority) : int { PRIORITY_NONE , PRIORITY_LOW , PRIORITY_MEDIUM , PRIORITY_HIGH } | AI计算任务的优先级。 | +| [Format](_n_n_rt.md#format) : byte { FORMAT_NONE = -1 , FORMAT_NCHW = 0 , FORMAT_NHWC = 1 } | 算子数据排布。需要配合[Tensor](_tensor.md)使用。 | +| [DataType](_n_n_rt.md#datatype) : byte {
DATA_TYPE_UNKNOWN = 0 , DATA_TYPE_BOOL = 30 , DATA_TYPE_INT8 = 32 , DATA_TYPE_INT16 = 33 , DATA_TYPE_INT32 = 34 , DATA_TYPE_INT64 = 35 , DATA_TYPE_UINT8 = 37 , DATA_TYPE_UINT16 = 38 , DATA_TYPE_UINT32 = 39 , DATA_TYPE_UINT64 = 40 , DATA_TYPE_FLOAT16 = 42 , DATA_TYPE_FLOAT32 = 43 ,DATA_TYPE_FLOAT64 = 44} | 张量的数据类型。需要配合[Tensor](_tensor.md)使用。 | +| [QuantType](_n_n_rt.md#quanttype) : byte { QUANT_TYPE_NONE , QUANT_TYPE_ALL } | 量化类型。需要配合[Node](_node.md)使用。 | +| [NodeType](_n_n_rt.md#nodetype) : unsigned int {
NODE_TYPE_NONE = 0 , NODE_TYPE_ACTIVATION = 2 , NODE_TYPE_ADD_FUSION = 5 , NODE_TYPE_ARGMAX_FUSION = 11 , NODE_TYPE_AVGPOOL_FUSION = 17 , NODE_TYPE_BATCH_TO_SPACE_ND = 22 , NODE_TYPE_BIAS_ADD = 23 , NODE_TYPE_CAST = 28 ,
NODE_TYPE_CONCAT = 31 , NODE_TYPE_CONV2D_FUSION = 35 , NODE_TYPE_CONV2D_TRANSPOSE_FUSION = 36 , NODE_TYPE_DIV_FUSION = 47 , NODE_TYPE_ELTWISE = 52 , NODE_TYPE_EXPAND_DIMS = 56 , NODE_TYPE_FILL = 66 , NODE_TYPE_FULL_CONNECTION = 67 ,
NODE_TYPE_FUSED_BATCH_NORM = 68 , NODE_TYPE_GATHER = 69 , NODE_TYPE_LAYER_NORM_FUSION = 75 , NODE_TYPE_LESS_EQUAL = 78 ,
NODE_TYPE_MATMUL_FUSION = 89 , NODE_TYPE_MAXIMUM = 90 , NODE_TYPE_MAX_POOL_FUSION = 92 , NODE_TYPE_MUL_FUSION = 99 ,
NODE_TYPE_ONE_HOT = 105 , NODE_TYPE_PAD_FUSION = 107 , NODE_TYPE_POW_FUSION = 110 , NODE_TYPE_PRELU_FUSION = 112 ,
NODE_TYPE_QUANT_DTYPE_CAST = 113 , NODE_TYPE_REDUCE_FUSION = 118 , NODE_TYPE_RESHAPE = 119 , NODE_TYPE_RESIZE = 120 ,
NODE_TYPE_RSQRT = 126 , NODE_TYPE_SCALE_FUSION = 127 , NODE_TYPE_SHAPE = 130 , NODE_TYPE_SLICE_FUSION = 135 ,
NODE_TYPE_SOFTMAX = 138 , NODE_TYPE_SPACE_TO_BATCH_ND = 141 , NODE_TYPE_SPLIT = 145 , NODE_TYPE_SQRT = 146 ,
NODE_TYPE_SQUEEZE = 147 , NODE_TYPE_SQUARED_DIFFERENCE = 149 , NODE_TYPE_STACK = 150 , NODE_TYPE_STRIDED_SLICE = 151 ,
NODE_TYPE_SUB_FUSION = 152 , NODE_TYPE_TILE_FUSION = 160 , NODE_TYPE_TOPK_FUSION = 161 , NODE_TYPE_TRANSPOSE = 162 , NODE_TYPE_UNSQUEEZE = 165
} | 算子类型。 | +| [ResizeMethod](_n_n_rt.md#resizemethod) : byte { RESIZE_METHOD_UNKNOWN = -1 , RESIZE_METHOD_LINEAR = 0 , RESIZE_METHOD_NEAREST = 1 , RESIZE_METHOD_CUBIC = 2 } | 调整尺寸的方法。需要配合[Resize](_resize.md)算子使用。 | +| [CoordinateTransformMode](_n_n_rt.md#coordinatetransformmode) : byte { COORDINATE_TRANSFORM_MODE_ASYMMETRIC = 0 , COORDINATE_TRANSFORM_MODE_ALIGN_CORNERS = 1 , COORDINATE_TRANSFORM_MODE_HALF_PIXEL = 2 } | 坐标变换模式,仅[Resize](_resize.md)算子使用这些枚举。 | +| [NearestMode](_n_n_rt.md#nearestmode) : byte {
NEAREST_MODE_NORMAL = 0 , NEAREST_MODE_ROUND_HALF_DOWN = 1 , NEAREST_MODE_ROUND_HALF_UP = 2 , NEAREST_MODE_FLOOR = 3 , NEAREST_MODE_CEIL = 4
} | 临近算法类型。需要配合[Resize](_resize.md)算子使用。 | +| [ActivationType](_n_n_rt.md#activationtype) : byte {
ACTIVATION_TYPE_NO_ACTIVATION = 0 , ACTIVATION_TYPE_RELU = 1 , ACTIVATION_TYPE_SIGMOID = 2 , ACTIVATION_TYPE_RELU6 = 3 ,
ACTIVATION_TYPE_ELU = 4 , ACTIVATION_TYPE_LEAKY_RELU = 5 , ACTIVATION_TYPE_ABS = 6 , ACTIVATION_TYPE_RELU1 = 7 ,
ACTIVATION_TYPE_SOFTSIGN = 8 , ACTIVATION_TYPE_SOFTPLUS = 9 , ACTIVATION_TYPE_TANH = 10 , ACTIVATION_TYPE_SELU = 11 ,
ACTIVATION_TYPE_HSWISH = 12 , ACTIVATION_TYPE_HSIGMOID = 13 , ACTIVATION_TYPE_THRESHOLDRELU = 14 , ACTIVATION_TYPE_LINEAR = 15 , ACTIVATION_TYPE_HARD_TANH = 16 , ACTIVATION_TYPE_SIGN = 17 , ACTIVATION_TYPE_SWISH = 18 , ACTIVATION_TYPE_GELU = 19 ,
ACTIVATION_TYPE_UNKNOWN = 20} | 激活函数类型。 | +| [ReduceMode](_n_n_rt.md#reducemode) : byte {
REDUCE_MODE_MEAN = 0 , REDUCE_MODE_MAX = 1 , REDUCE_MODE_MIN = 2 , REDUCE_MODE_PROD = 3 , REDUCE_MODE_SUM = 4 , REDUCE_MODE_SUM_SQUARE = 5 , REDUCE_MODE_ASUM = 6 , REDUCE_MODE_ALL = 7} | 用于维度移除的方法,需要配合[ReduceFusion](_reduce_fusion.md)算子使用。 | +| [EltwiseMode](_n_n_rt.md#eltwisemode) : byte { ELTWISE_MODE_PROD = 0 , ELTWISE_MODE_SUM = 1 , ELTWISE_MODE_MAXIMUM = 2 , ELTWISE_MODE_UNKNOWN = 3 } | 元素级别运算支持的计算类型,需要配合[Eltwise](_eltwise.md)算子使用。 | +| [PadMode](_n_n_rt.md#padmode) : byte { PAD_MODE_PAD = 0 , PAD_MODE_SAME = 1 , PAD_MODE_VALID = 2 } | 填充类型,需要配合[AvgPoolFusion](_avg_pool_fusion.md),[AvgPoolFusion](_avg_pool_fusion.md),[Conv2DFusion](_conv2_d_fusion.md),[MaxPoolFusion](_max_pool_fusion.md)使用。 | +| [RoundMode](_n_n_rt.md#roundmode) : byte { ROUND_MODE_FLOOR = 0 , ROUND_MODE_CEIL = 1 } | 小数取整算法,需要配合[AvgPoolFusion](_avg_pool_fusion.md)算子使用。 | +| [PaddingMode](_n_n_rt.md#paddingmode) : byte { PADDING_MODE_CONSTANT = 0 , PADDING_MODE_REFLECT = 1 , PADDING_MODE_SYMMETRIC = 2 , PADDING_MODE_RESERVED = 3 } | 填充类型,需要配合[PadFusion](_pad_fusion.md)算子使用。 | +| [NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode) : int {
NNRT_SUCCESS = 0 , NNRT_FAILED = 1 , NNRT_NULL_PTR = 2 , NNRT_INVALID_PARAMETER = 3 ,
NNRT_MEMORY_ERROR = 4 , NNRT_OUT_OF_MEMORY = 5 , NNRT_OPERATION_FORBIDDEN = 6 , NNRT_INVALID_FILE = 7 ,
NNRT_INVALID_PATH = 8 , NNRT_INSUFFICIENT_BUFFER = 9 , NNRT_NO_CHANGE = 10 , NNRT_NOT_SUPPORT = 11 ,
NNRT_SERVICE_ERROR = 12 , NNRT_DEVICE_ERROR = 13 , NNRT_DEVICE_BUSY = 14 , NNRT_CANCELLED = 15 ,
NNRT_PERMISSION_DENIED = 16 , NNRT_TIME_OUT = 17 , NNRT_INVALID_TENSOR = 18 , NNRT_INVALID_NODE = 19 ,
NNRT_INVALID_INPUT = 20 , NNRT_INVALID_OUTPUT = 21 , NNRT_INVALID_DATATYPE = 22 , NNRT_INVALID_FORMAT = 23 ,
NNRT_INVALID_TENSOR_NAME = 24 , NNRT_INVALID_SHAPE = 25 , NNRT_OUT_OF_DIMENTION_RANGES = 26 , NNRT_INVALID_BUFFER = 27 , NNRT_INVALID_BUFFER_SIZE = 28 , NNRT_INVALID_PERFORMANCE_MODE = 29 , NNRT_INVALID_PRIORITY = 30 , NNRT_INVALID_MODEL = 31 ,
NNRT_INVALID_MODEL_CACHE = 32 , NNRT_UNSUPPORTED_OP = 33
} | NNRt定义的专用错误码,为HDI接口的返回值。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.nnrt.v2_0 | NNRt模块的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_node.md b/zh-cn/device-dev/reference/hdi-apis/_node.md new file mode 100644 index 0000000000000000000000000000000000000000..de2e90687a60cd93cd372b7fb860aedd614266ab --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_node.md @@ -0,0 +1,134 @@ +# Node + + +## 概述 + +算子节点结构体。 + +nodeAttr参数是一段被序列化的数据,并调用OHOS的hdi的反序列化接口才能得到具体参数。大致流程如下: + +1. 定义算子参数的结构体,OP op{},其中OP可以被替换为[NodeAttrTypes.idl](_node_attr_types_8idl.md)的算子参数结构体,op是变量名。 + +2. 申明MessageParcle对象,用存储反序列化的数据,OHOS::MessageParcel data。 + +3. 将nodeAttr写入data中,data.WriteBuffer(nodeAttr.data(),nodeAttr.size())。 + +4. 将data中的数据反序列化到op结构体中,(void)OPBlockUnmarshalling(data, op)。 + +然后就可以在op中查看具体的算子的参数值。 + +例如: 某一个算子的 nodeType为NODE_TYPE_FULL_CONNECTION,那么它所对应的算子参数结构体应该为[FullConnection](_full_connection.md), 则该算子具有四个参数:hasBias,useAxis,axis和activationType。 + +则按照如下流程调用: + +1. [FullConnection](_full_connection.md) full_connection{}; + +2. OHOS::MessageParcel data; + +3. data.WriteBuffer(nodeAttr.data(),nodeAttr.size()); + +4. (void)FullConnectionBlockUnmarshalling(data, full_connection); + +至此FullConnection的四个参数就写入了full_connection中。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [name](#name) | String
算子节点的名称 。 | +| [nodeType](#nodetype) | enum [NodeType](_n_n_rt.md#nodetype)
算子节点的类型,详情请参考:[NodeType](_n_n_rt.md#nodetype)。 | +| [nodeAttr](#nodeattr) | byte[]
算子节点的参数对应的序列化数组。 | +| [inputIndex](#inputindex) | unsigned int[]
算子节点的输入节点下标。 | +| [outputIndex](#outputindex) | unsigned int[]
算子节点的输出节点下标。 | +| [quantType](#quanttype) | enum [QuantType](_n_n_rt.md#quanttype)
算子节点的量化参数,详情请参考:[QuantType](_n_n_rt.md#quanttype)。 | + + +## 类成员变量说明 + + +### inputIndex + + +``` +unsigned int [] Node::inputIndex +``` + +**描述:** + +算子节点的输入节点下标。 + + +### name + + +``` +String Node::name +``` + +**描述:** + +算子节点的名称 。 + + +### nodeAttr + + +``` +byte [] Node::nodeAttr +``` + +**描述:** + +算子节点的参数对应的序列化数组。 + + +### nodeType + + +``` +enum NodeType Node::nodeType +``` + +**描述:** + +算子节点的类型,详情请参考:[NodeType](_n_n_rt.md#nodetype)。 + + +### outputIndex + + +``` +unsigned int [] Node::outputIndex +``` + +**描述:** + +算子节点的输出节点下标。 + + +### quantType + + +``` +enum QuantType Node::quantType +``` + +**描述:** + +算子节点的量化参数,详情请参考:[QuantType](_n_n_rt.md#quanttype)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_node_attr_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_node_attr_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..1efa18bbfdfcf752baf21395759cc1e5fa399c6c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_node_attr_types_8idl.md @@ -0,0 +1,88 @@ +# NodeAttrTypes.idl + + +## 概述 + +该文件定义AI模型算子的参数和功能。 + +该文文件中所有的结构体仅声明了算子的属性,并不包含执行算子函数的接口,具体介绍如下: + +- 该文件中每一个算子都与[NodeType](_n_n_rt.md#nodetype)的枚举值一一对应,执行模型推理时,[NodeType](_n_n_rt.md#nodetype)会在[Node](_node.md)的nodeType中存储。 + +- 每一个算子都至少有一个“输入”与“输出”,“输入”即为该算子接收的张量,“输出”为经过算子运算之后得到的“张量”;“输入”、“算子”和“输出”之间的关系需要通过[Node](_node.md)结构体的inputIndex和outIndex来确认。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [Activation](_activation.md) | struct
激活类型的算子,所有的激活函数都属于该算子,具体的激活函数类型一句参数来确定。 | +| [AddFusion](_add_fusion.md) | struct
输入Tensor逐元素相加, 输出x和y的和,数据形状与输入broadcast之后一样,数据类型与较高精度的输入精度一致。 | +| [ArgMaxFusion](_arg_max_fusion.md) | struct
返回跨轴的tensor前K个索引或者是数值。 | +| [AvgPoolFusion](_avg_pool_fusion.md) | struct
在输入tensor上应用 2D 平均池化。支持int8量化输入。 | +| [BatchToSpaceND](_batch_to_space_n_d.md) | struct
将一个4维tensor的batch维度按block_shape切分成小块,并将这些小块拼接到空间维度。 | +| [BiasAdd](_bias_add.md) | struct
对给出的输入张量上的各个维度方向上的数据进行偏置。 | +| [Cast](_cast.md) | struct
根据输出张量的类型对张量数据类型进行转换。 | +| [Concat](_concat.md) | struct
在指定轴上连接张量,将输入张量按给定的轴连接起来。 | +| [Conv2DFusion](_conv2_d_fusion.md) | struct
对将4维的tensor执行带有偏置的二维卷积运算。 | +| [Conv2dTransposeFusion](_conv2d_transpose_fusion.md) | struct
对一个4维的tensor执行带有偏置的二维反卷积。 | +| [DivFusion](_div_fusion.md) | struct
将两个tensor执行除法运算。 | +| [Eltwise](_eltwise.md) | struct
元素级别操作的算子。 | +| [ExpandDims](_expand_dims.md) | struct
在给定轴上为tensor添加一个额外的维度。 | +| [Fill](_fill.md) | struct
根据指定的维度,创建由一个标量填充的tensor。 | +| [FullConnection](_full_connection.md) | struct
对输入数据做全连接。 | +| [FusedBatchNorm](_fused_batch_norm.md) | struct
对一个tensor进行批标准化的运算。 | +| [Gather](_gather.md) | struct
根据指定的索引和轴返回输入tensor的切片。 | +| [LayerNormFusion](_layer_norm_fusion.md) | struct
对一个tensor从某一axis开始做层归一化。 | +| [LessEqual](_less_equal.md) | struct
对输入x1和x2,计算每对元素的x1<=x2的结果。 | +| [MatMulFusion](_mat_mul_fusion.md) | struct
对输入x1和x2,计算x1和x2的内积。 | +| [Maximum](_maximum.md) | struct
对输入x1和x2,计算x1和x2对应元素最大值,x1和x2的输入遵守隐式类型转换规则,使数据类型一致。 | +| [MaxPoolFusion](_max_pool_fusion.md) | struct
对输入x,计算 2D 最大值池化。 | +| [MulFusion](_mul_fusion.md) | struct
对输入x1和x2,将x1和x2相同的位置的元素相乘得到output。 | +| [OneHot](_one_hot.md) | struct
根据indices指定的位置,生成一个由one-hot向量构成的tensor。 | +| [PadFusion](_pad_fusion.md) | struct
在x指定维度的数据前后,添加指定数值进行增广。 | +| [PowFusion](_pow_fusion.md) | struct
求x的y次幂,输入必须是两个tensor或一个tensor和一个标量。 | +| [PReLUFusion](_p_re_l_u_fusion.md) | struct
计算x和weight的PReLU激活值。 | +| [QuantDTypeCast](_quant_d_type_cast.md) | struct
数据类型转换。 | +| [ReduceFusion](_reduce_fusion.md) | struct
减小x张量的维度。 | +| [Reshape](_reshape.md) | struct
根据inputShape调整input的形状。 | +| [Resize](_resize.md) | struct
按给定的参数对输入的张量进行变形。 | +| [Rsqrt](_rsqrt.md) | struct
求x的平方根的倒数。 | +| [ScaleFusion](_scale_fusion.md) | struct
给定一个tensor,计算其缩放后的值。 | +| [Shape](_shape.md) | struct
输出输入tensor的形状。 | +| [SliceFusion](_slice_fusion.md) | struct
在x各维度,在axes维度中,以begin为起点,截取size长度的切片。 | +| [Softmax](_softmax.md) | struct
给定一个tensor,计算其softmax结果。 | +| [SpaceToBatchND](_space_to_batch_n_d.md) | struct
将4维张量在空间维度上进行切分成多个小块,然后在batch维度上拼接这些小块。 | +| [Split](_split.md) | struct
算子沿 axis 维度将x拆分成多个张量,张量数量由outputNum指定。 | +| [Sqrt](_sqrt.md) | struct
给定一个tensor,计算其平方根。 | +| [SquaredDifference](_squared_difference.md) | struct
计算两个输入的差值并返回差值的平方。SquaredDifference算子支持tensor和tensor相减。 | +| [Squeeze](_squeeze.md) | struct
去除axis中,长度为1的维度。支持int8量化输入。 | +| [Stack](_stack.md) | struct
将一组tensor沿axis维度进行堆叠,堆叠前每个tensor的维数为n,则堆叠后output维数为n+1。 | +| [StridedSlice](_strided_slice.md) | struct
根据步长和索引对输入张量进行切片提取。 | +| [SubFusion](_sub_fusion.md) | struct
计算两个输入的差值。 | +| [TileFusion](_tile_fusion.md) | struct
以multiples指定的次数拷贝输入张量。 | +| [TopKFusion](_top_k_fusion.md) | struct
查找沿axis轴的前K个最大值和对应索引。 | +| [Transpose](_transpose.md) | struct
根据perm对x进行数据重排。 | +| [Unsqueeze](_unsqueeze.md) | struct
根据输入axis的值。增加一个维度。 | + + +### 变量 + + | 名称 | 描述 | +| -------- | -------- | +| [v2_0](_n_n_rt.md) | package ohos hdi nnrt
NNRt模块的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_nr_rssi.md b/zh-cn/device-dev/reference/hdi-apis/_nr_rssi.md new file mode 100644 index 0000000000000000000000000000000000000000..e3d9448822d8f9934dc9ab15189d6513cbb4e2a7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_nr_rssi.md @@ -0,0 +1,55 @@ +# NrRssi + + +## 概述 + +NR信号强度。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [rsrp](#rsrp) | int
表示接收信号码功率  | +| [rsrq](#rsrq) | int
表示信号接收质量  | +| [sinr](#sinr) | int
表示信号干扰噪声比  | + + +## 类成员变量说明 + + +### rsrp + + +``` +int NrRssi::rsrp +``` +**描述:** +表示接收信号码功率 + + +### rsrq + + +``` +int NrRssi::rsrq +``` +**描述:** +表示信号接收质量 + + +### sinr + + +``` +int NrRssi::sinr +``` +**描述:** +表示信号干扰噪声比 diff --git a/zh-cn/device-dev/reference/hdi-apis/_offline_db.md b/zh-cn/device-dev/reference/hdi-apis/_offline_db.md new file mode 100644 index 0000000000000000000000000000000000000000..33939be8c44e0d596f317757f336dbd2ae417e7b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_offline_db.md @@ -0,0 +1,57 @@ +# OfflineDb + + +## 概述 + +定义下发基站离线数据库的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [times](#times) | unsigned int
当前数据包的序号,从1开始。  | +| [totalTimes](#totaltimes) | unsigned int
此次下发基站离线数据库的总包数。  | +| [dbs](#dbs) | unsigned char[]
基站离线数据库数据。  | + + +## 类成员变量说明 + + +### dbs + + +``` +unsigned char [] OfflineDb::dbs +``` +**描述:** +基站离线数据库数据。 + + +### times + + +``` +unsigned int OfflineDb::times +``` +**描述:** +当前数据包的序号,从1开始。 + + +### totalTimes + + +``` +unsigned int OfflineDb::totalTimes +``` +**描述:** +此次下发基站离线数据库的总包数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_omx_codec_buffer.md b/zh-cn/device-dev/reference/hdi-apis/_omx_codec_buffer.md index 34b9713074eade2f98e39c2e9aa645cb7cd67e3f..e48db7ba54596d3abcfbe576438bf16c035dc0ea 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_omx_codec_buffer.md +++ b/zh-cn/device-dev/reference/hdi-apis/_omx_codec_buffer.md @@ -1,38 +1,38 @@ # OmxCodecBuffer -## **概述** +## 概述 Codec buffer信息的定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [bufferId](#bufferid) | buffer的ID。 | -| [size](#size) | 结构体大小。 | -| [version](#version) | 组件版本信息。 | -| [bufferType](#buffertype) | buffer类型。 | -| [buffer](#buffer) | 编码或者解码使用的buffer。 | -| [bufferLen](#bufferlen) | buffer大小。 | -| [allocLen](#alloclen) | 申请的buffer大小。 | -| [filledLen](#filledlen) | 填充的buffer大小。 | -| [offset](#offset) | 有效数据从缓冲区开始的起始偏移量。 | -| [fenceFd](#fencefd) | 该描述符来自buffer消费者,Codec等待成功后才可以使用输入或者输出buffer。 | -| [type](#type) | 共享内存类型。 | -| [pts](#pts) | 时间戳。 | -| [flag](#flag) | 标志。 | +| [bufferId](#bufferid) | uint32_t
buffer ID。  | +| [size](#size) | uint32_t
结构体大小。  | +| [version](#version) | union OMX_VERSIONTYPE
组件版本信息。  | +| [bufferType](#buffertype) | enum [CodecBufferType](_codec.md#codecbuffertype)
buffer类型。  | +| [buffer](#buffer) | uint8_t \*
编码或者解码使用的buffer。  | +| [bufferLen](#bufferlen) | uint32_t
buffer大小。  | +| [allocLen](#alloclen) | uint32_t
申请的buffer大小。  | +| [filledLen](#filledlen) | uint32_t
填充的buffer大小。  | +| [offset](#offset) | uint32_t
有效数据从缓冲区开始的起始偏移量。  | +| [fenceFd](#fencefd) | int32_t
该描述符来自buffer消费者,Codec等待成功后才可以使用输入或者输出buffer。  | +| [type](#type) | enum [ShareMemTypes](_codec.md#sharememtypes)
共享内存类型。  | +| [pts](#pts) | int64_t
时间戳。  | +| [flag](#flag) | uint32_t
标志。  | -## **类成员变量说明** +## 类成员变量说明 ### allocLen @@ -41,9 +41,7 @@ Codec buffer信息的定义。 ``` uint32_t OmxCodecBuffer::allocLen ``` - -**描述:** - +**描述:** 申请的buffer大小。 @@ -53,9 +51,7 @@ uint32_t OmxCodecBuffer::allocLen ``` uint8_t* OmxCodecBuffer::buffer ``` - -**描述:** - +**描述:** 编码或者解码使用的buffer。 @@ -65,9 +61,7 @@ uint8_t* OmxCodecBuffer::buffer ``` uint32_t OmxCodecBuffer::bufferId ``` - -**描述:** - +**描述:** buffer ID。 @@ -77,9 +71,7 @@ buffer ID。 ``` uint32_t OmxCodecBuffer::bufferLen ``` - -**描述:** - +**描述:** buffer大小。 @@ -89,9 +81,7 @@ buffer大小。 ``` enum CodecBufferType OmxCodecBuffer::bufferType ``` - -**描述:** - +**描述:** buffer类型。 @@ -101,9 +91,7 @@ buffer类型。 ``` int32_t OmxCodecBuffer::fenceFd ``` - -**描述:** - +**描述:** 该描述符来自buffer消费者,Codec等待成功后才可以使用输入或者输出buffer。 @@ -113,9 +101,7 @@ int32_t OmxCodecBuffer::fenceFd ``` uint32_t OmxCodecBuffer::filledLen ``` - -**描述:** - +**描述:** 填充的buffer大小。 @@ -125,9 +111,7 @@ uint32_t OmxCodecBuffer::filledLen ``` uint32_t OmxCodecBuffer::flag ``` - -**描述:** - +**描述:** 标志。 @@ -137,9 +121,7 @@ uint32_t OmxCodecBuffer::flag ``` uint32_t OmxCodecBuffer::offset ``` - -**描述:** - +**描述:** 有效数据从缓冲区开始的起始偏移量。 @@ -149,9 +131,7 @@ uint32_t OmxCodecBuffer::offset ``` int64_t OmxCodecBuffer::pts ``` - -**描述:** - +**描述:** 时间戳。 @@ -161,9 +141,7 @@ int64_t OmxCodecBuffer::pts ``` uint32_t OmxCodecBuffer::size ``` - -**描述:** - +**描述:** 结构体大小。 @@ -173,9 +151,7 @@ uint32_t OmxCodecBuffer::size ``` enum ShareMemTypes OmxCodecBuffer::type ``` - -**描述:** - +**描述:** 共享内存类型。 @@ -185,7 +161,5 @@ enum ShareMemTypes OmxCodecBuffer::type ``` union OMX_VERSIONTYPE OmxCodecBuffer::version ``` - -**描述:** - +**描述:** 组件版本信息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_one_hot.md b/zh-cn/device-dev/reference/hdi-apis/_one_hot.md new file mode 100644 index 0000000000000000000000000000000000000000..ecc860b5b292d47b1227cea8d0ac2f0cfbd0edd0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_one_hot.md @@ -0,0 +1,63 @@ +# OneHot + + +## 概述 + +根据indices指定的位置,生成一个由one-hot向量构成的tensor。 + +每个onehot向量中的有效值由on_value决定,其他位置由off_value决定。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_ONE_HOT。 + +输入: + +- indices,n维tensor。indices中每个元素决定每个one-hot向量,on_value的位置。 + +- depth,一个整型标量,决定one-hot向量的深度。要求depth>0。 + +- on_value,一个标量,指定one-hot向量中的有效值。 + +- off_value,一个标量,指定one-hot向量中除有效位以外,其他位置的值。 + +输出: + +- output,如果indices时n维tensor,则output是(n+1)维tensor。output的形状由indices和axis共同决定。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long
一个整型标量,指定插入one-hot的维度。 | + + +## 类成员变量说明 + + +### axis + + +``` +long OneHot::axis +``` + +**描述:** + +一个整型标量,指定插入one-hot的维度。 + +indices的形状是[N,C],depth的值是D,当axis=0时,output形状为[D,N,C], indices的形状是[N,C],depth的值是D,当axis=-1时,output形状为[N,C,D], indices的形状是[N,C],depth的值是D,当axis=1时,output形状为[N,D,C]。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_open_logical_channel_response.md b/zh-cn/device-dev/reference/hdi-apis/_open_logical_channel_response.md new file mode 100644 index 0000000000000000000000000000000000000000..30b80b94705d8b721f87a9ec6ae6a6be43d1f12d --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_open_logical_channel_response.md @@ -0,0 +1,66 @@ +# OpenLogicalChannelResponse + + +## 概述 + +APDU打开逻辑通道响应信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [sw1](#sw1) | int
SIM卡状态字1,命令执行后SIM卡返回的响应  | +| [sw2](#sw2) | int
SIM卡状态字2,命令执行后SIM卡返回的响应  | +| [channelId](#channelid) | int
打开的逻辑通道ID  | +| [response](#response) | String
响应信息  | + + +## 类成员变量说明 + + +### channelId + + +``` +int OpenLogicalChannelResponse::channelId +``` +**描述:** +打开的逻辑通道ID + + +### response + + +``` +String OpenLogicalChannelResponse::response +``` +**描述:** +响应信息 + + +### sw1 + + +``` +int OpenLogicalChannelResponse::sw1 +``` +**描述:** +SIM卡状态字1,命令执行后SIM卡返回的响应 + + +### sw2 + + +``` +int OpenLogicalChannelResponse::sw2 +``` +**描述:** +SIM卡状态字2,命令执行后SIM卡返回的响应 diff --git a/zh-cn/device-dev/reference/hdi-apis/_operator_info.md b/zh-cn/device-dev/reference/hdi-apis/_operator_info.md new file mode 100644 index 0000000000000000000000000000000000000000..e07dc24c61864718e4a06fb91a5e907044c9c11d --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_operator_info.md @@ -0,0 +1,55 @@ +# OperatorInfo + + +## 概述 + +运营商信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [longName](#longname) | String
获取注册网络的长格式的运营商名称  | +| [shortName](#shortname) | String
获取注册网络的短格式的运营商名称  | +| [numeric](#numeric) | String
运营商编号  | + + +## 类成员变量说明 + + +### longName + + +``` +String OperatorInfo::longName +``` +**描述:** +获取注册网络的长格式的运营商名称 + + +### numeric + + +``` +String OperatorInfo::numeric +``` +**描述:** +运营商编号 + + +### shortName + + +``` +String OperatorInfo::shortName +``` +**描述:** +获取注册网络的短格式的运营商名称 diff --git a/zh-cn/device-dev/reference/hdi-apis/_p_re_l_u_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_p_re_l_u_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..dd85de180c98c1ca01b17c115dab551c1a04de03 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_p_re_l_u_fusion.md @@ -0,0 +1,49 @@ +# PReLUFusion + + +## 概述 + +计算x和weight的PReLU激活值。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_PRELU_FUSION。 + +输入: + +- x,一个n维tensor,如果n>=2,则要求x1的排布为[BatchSize,…,Channels],第二个维度为通道数。 + +- weight,一个1维tensor。weight的长度只能是1或者等于通道数。当weight长度为1,则x所有通道共享一个权重值。 若weight长度等于通道数,每个通道独享一个权重,若x维数n<2,weight长度只能为1。 + +输出: + +- output,x的PReLU激活值。形状和数据类型和x保持一致。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [channelShared](#channelshared) | boolean
是否开启权重共享,可以用于校验参数合法性。 若weight的是1则channelShared一定为true,否则为false。  | + + +## 类成员变量说明 + + +### channelShared + + +``` +boolean PReLUFusion::channelShared +``` +**描述:** +是否开启权重共享,可以用于校验参数合法性。 若weight的是1则channelShared一定为true,否则为false。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_pad_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_pad_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..3a28fbe5e98d32c6ed3a89d4375e39329d28037a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_pad_fusion.md @@ -0,0 +1,73 @@ +# PadFusion + + +## 概述 + +在x指定维度的数据前后,添加指定数值进行增广。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_PAD_FUSION。 + +参数限制:当paddingMode==PADDING_MODE_CONSTANT时,需要设置constantValue,默认constantValue为0。 + +输入: + +- x,n维tensor + +- paddings,一个2维tensor,指定每一维度增补的长度,shape为[n,2]。paddings[i][0]表示第i维上,需要在输入张量前增补的数量; paddings[i][1]表示第i维上,需要在输入张量x后增补的数量。 + +输出: + +- output,一个n维tensor,维数和数据类型和x保持一致。shape由x和paddings共同决定 output.shape[i] = input.shape[i] + paddings[i][0]+paddings[i][1]。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [paddings](#paddings) | long[][]
一个2维tensor,指定每一维度增补的长度,shape为[n,2]。paddings[i][0]表示第i维上,需要在x1前增补的数量; paddings[i][1]表示第i维上,需要在x1后增补的数量。 该参数和输入的paddings意义相同。  | +| [paddingMode](#paddingmode) | enum [PaddingMode](_n_n_rt.md#paddingmode)
填充类型。 详情请参考:[PaddingMode](_n_n_rt.md#paddingmode)。  | +| [constantValue](#constantvalue) | float
一个常数,数据类型和x一致,指定Pad操作增广的数值。 仅paddingMode==PADDING_MODE_CONSTANT时生效,默认值为0。  | + + +## 类成员变量说明 + + +### constantValue + + +``` +float PadFusion::constantValue +``` +**描述:** +一个常数,数据类型和x一致,指定Pad操作增广的数值。 仅paddingMode==PADDING_MODE_CONSTANT时生效,默认值为0。 + + +### paddingMode + + +``` +enum PaddingMode PadFusion::paddingMode +``` +**描述:** +填充类型。 详情请参考:[PaddingMode](_n_n_rt.md#paddingmode)。 + + +### paddings + + +``` +long [][] PadFusion::paddings +``` +**描述:** +一个2维tensor,指定每一维度增补的长度,shape为[n,2]。paddings[i][0]表示第i维上,需要在x1前增补的数量; paddings[i][1]表示第i维上,需要在x1后增补的数量。 该参数和输入的paddings意义相同。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_physical_channel_config.md b/zh-cn/device-dev/reference/hdi-apis/_physical_channel_config.md new file mode 100644 index 0000000000000000000000000000000000000000..da0c46433a0fc280ec6c3dbdc95910339423fcd2 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_physical_channel_config.md @@ -0,0 +1,132 @@ +# PhysicalChannelConfig + + +## 概述 + +物理通道配置。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [cellConnStatus](#cellconnstatus) | enum [RilCellConnectionStatus](_ril.md#rilcellconnectionstatus)
连接状态  | +| [ratType](#rattype) | enum [RilRadioTech](_ril.md#rilradiotech)
语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) | +| [cellBandwidthDownlinkKhz](#cellbandwidthdownlinkkhz) | int
下行带宽,单位为kHz  | +| [cellBandwidthUplinkKhz](#cellbandwidthuplinkkhz) | int
上行带宽,单位为kHz  | +| [freqRange](#freqrange) | int
频率范围  | +| [downlinkChannelNum](#downlinkchannelnum) | int
下行信道号  | +| [uplinkChannelNum](#uplinkchannelnum) | int
上行信道号  | +| [physicalCellId](#physicalcellid) | int
物理小区标识  | +| [contextIdNum](#contextidnum) | int
逻辑设备编号  | +| [contextIds](#contextids) | List< int >
上行信道号  | + + +## 类成员变量说明 + + +### cellBandwidthDownlinkKhz + + +``` +int PhysicalChannelConfig::cellBandwidthDownlinkKhz +``` +**描述:** +下行带宽,单位为kHz + + +### cellBandwidthUplinkKhz + + +``` +int PhysicalChannelConfig::cellBandwidthUplinkKhz +``` +**描述:** +上行带宽,单位为kHz + + +### cellConnStatus + + +``` +enum RilCellConnectionStatus PhysicalChannelConfig::cellConnStatus +``` +**描述:** +连接状态 + + +### contextIdNum + + +``` +int PhysicalChannelConfig::contextIdNum +``` +**描述:** +逻辑设备编号 + + +### contextIds + + +``` +List PhysicalChannelConfig::contextIds +``` +**描述:** +上行信道号 + + +### downlinkChannelNum + + +``` +int PhysicalChannelConfig::downlinkChannelNum +``` +**描述:** +下行信道号 + + +### freqRange + + +``` +int PhysicalChannelConfig::freqRange +``` +**描述:** +频率范围 + + +### physicalCellId + + +``` +int PhysicalChannelConfig::physicalCellId +``` +**描述:** +物理小区标识 + + +### ratType + + +``` +enum RilRadioTech PhysicalChannelConfig::ratType +``` +**描述:** +语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### uplinkChannelNum + + +``` +int PhysicalChannelConfig::uplinkChannelNum +``` +**描述:** +上行信道号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_pin_auth_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_pin_auth_types_8idl.md deleted file mode 100644 index 8a10abb5afe0b23f994349952633fca6574d9387..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_pin_auth_types_8idl.md +++ /dev/null @@ -1,42 +0,0 @@ -# PinAuthTypes.idl - - -## **概述** - -定义口令认证驱动的枚举类和数据结构。 - -**Since:** - -3.2 - -**所属模块:** - -[HdfPinAuth](_hdf_pin_auth.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [ExecutorInfo](_executor_info.md) | 执行器信息。 | -| [TemplateInfo](_template_info.md) | 凭据模版信息。 | - - -### 枚举 - - | 名称 | 描述 | -| -------- | -------- | -| [AuthType](_hdf_pin_auth.md#authtype): int {   PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | -| [ExecutorRole](_hdf_pin_auth.md#executorrole): int {   COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | -| [ExecutorSecureLevel](_hdf_pin_auth.md#executorsecurelevel): int {   ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | -| [CommandId](_hdf_pin_auth.md#commandid): int { DEFAULT = 0 } | 枚举口令认证功能相关操作命令。 | - - -### 关键字 - - | 名称 | 描述 | -| -------- | -------- | -| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_point.md b/zh-cn/device-dev/reference/hdi-apis/_point.md new file mode 100644 index 0000000000000000000000000000000000000000..3cc42b72968b73029d8f47ee0e937bb34909e8ce --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_point.md @@ -0,0 +1,46 @@ +# Point + + +## 概述 + +定义位置坐标的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [latitude](#latitude) | double
纬度  | +| [longitude](#longitude) | double
经度  | + + +## 类成员变量说明 + + +### latitude + + +``` +double Point::latitude +``` +**描述:** +纬度 + + +### longitude + + +``` +double Point::longitude +``` +**描述:** +经度 diff --git a/zh-cn/device-dev/reference/hdi-apis/_port_info.md b/zh-cn/device-dev/reference/hdi-apis/_port_info.md index 80422dc158b7ddc3353f149bcababf3303f10b93..0c94c7746a0a7d5972b1251a9b5b997a9dd10c9f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_port_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_port_info.md @@ -1,37 +1,33 @@ # PortInfo -## **概述** +## 概述 USB设备端口信息。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [portId](#portid) | USB设备端口ID。 | -| [powerRole](#powerrole) | USB设备电源角色。 | -| [dataRole](#datarole) | USB设备数据角色。 | -| [mode](#mode) | USB设备模式。 | +| [portId](#portid) | int
USB设备端口ID。  | +| [powerRole](#powerrole) | int
USB设备电源角色。  | +| [dataRole](#datarole) | int
USB设备数据角色。  | +| [mode](#mode) | int
USB设备模式。  | -## **类成员变量说明** +## 类成员变量说明 ### dataRole @@ -40,9 +36,7 @@ USB设备端口信息。 ``` int PortInfo::dataRole ``` - -**描述:** - +**描述:** USB设备数据角色。 @@ -52,9 +46,7 @@ USB设备数据角色。 ``` int PortInfo::mode ``` - -**描述:** - +**描述:** USB设备模式。 @@ -64,9 +56,7 @@ USB设备模式。 ``` int PortInfo::portId ``` - -**描述:** - +**描述:** USB设备端口ID。 @@ -76,7 +66,5 @@ USB设备端口ID。 ``` int PortInfo::powerRole ``` - -**描述:** - +**描述:** USB设备电源角色。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_pow_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_pow_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..ac1fb6c618d240ebe64636adb53f71d09897eb5f --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_pow_fusion.md @@ -0,0 +1,64 @@ +# PowFusion + + +## 概述 + +求x的y次幂,输入必须是两个tensor或一个tensor和一个标量。 + +当输入是两个tensor时,它们的数据类型不能同时为DATA_TYPE_BOOL,且要求两个tensor的shape相同。当输入是一个tensor和一个标量时,标量只能是一个常数。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_POW_FUSION。 + +参数说明:x的每个元素会做如下运算:x' = scale\*x+shift,然后对于x'再求y次幂。 + +输入: + +- x,实数、bool值或tensor,tensor的数据类型为实数或DATA_TYPE_BOOL。 + +- y,实数、bool值或tensor,tensor的数据类型为实数或DATA_TYPE_BOOL。 + +输出: + +- output,形状由x和y broadcast后的形状决定。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [scale](#scale) | float
对x的数值进行缩放。  | +| [shift](#shift) | float
对x的数值缩放后的值进行增减。  | + + +## 类成员变量说明 + + +### scale + + +``` +float PowFusion::scale +``` +**描述:** +对x的数值进行缩放。 + + +### shift + + +``` +float PowFusion::shift +``` +**描述:** +对x的数值缩放后的值进行增减。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_power_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_power_types_8idl.md index 30be1eeab46b01def03497a8d4ae50c4517e2e92..ac6081213e111e2112f1fabec0c89e45c1bca52d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_power_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_power_types_8idl.md @@ -1,7 +1,7 @@ # PowerTypes.idl -## **概述** +## 概述 电源相关的数据类型。 @@ -20,14 +20,14 @@ [Power](power.md) -## **汇总** +## 汇总 ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [PowerHdfCmd](power.md#powerhdfcmd) {   CMD_REGISTER_CALLBCK = 0, CMD_START_SUSPEND, CMD_STOP_SUSPEND, CMD_FORCE_SUSPEND,   CMD_SUSPEND_BLOCK, CMD_SUSPEND_UNBLOCK, CMD_DUMP } | 枚举电源命令的参数。 | +| [PowerHdfCmd](power.md#powerhdfcmd) { CMD_REGISTER_CALLBCK = 0, CMD_START_SUSPEND, CMD_STOP_SUSPEND, CMD_FORCE_SUSPEND,   CMD_SUSPEND_BLOCK, CMD_SUSPEND_UNBLOCK, CMD_DUMP } | 枚举电源命令的参数。 | | [PowerHdfCallbackCmd](power.md#powerhdfcallbackcmd) { CMD_ON_SUSPEND = 0, CMD_ON_WAKEUP } | 枚举电源状态回调的参数。 | | [PowerHdfState](power.md#powerhdfstate) { AWAKE = 0, INACTIVE, SLEEP } | 枚举电源的状态。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_preferred_network_type_info.md b/zh-cn/device-dev/reference/hdi-apis/_preferred_network_type_info.md new file mode 100644 index 0000000000000000000000000000000000000000..9b234505eec2fc6eb6aa1a83600d81a51daa38b4 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_preferred_network_type_info.md @@ -0,0 +1,112 @@ +# PreferredNetworkTypeInfo + + +## 概述 + +首选网络类型信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [preferredNetworkType](#preferrednetworktype) | int
网络类型 | +| [flag](#flag) | int
网络标识  | + + +## 类成员变量说明 + + +### flag + + +``` +int PreferredNetworkTypeInfo::flag +``` +**描述:** +网络标识 + + +### preferredNetworkType + + +``` +int PreferredNetworkTypeInfo::preferredNetworkType +``` +**描述:** +网络类型 + +- 0:自动。 + +- 1:GSM。 + +- 2:WCDMA。 + +- 3:LTE。 + +- 4:LTE、WCDMA。 + +- 5:LTE、WCDMA、GSM。 + +- 6:WCDMA、GSM。 + +- 7:CDMA。 + +- 8:EVDO。 + +- 9:EVDO、CDMA。 + +- 10:WCDMA、GSM、EVDO、CDMA。 + +- 11:LTE、EVDO、CDMA。 + +- 12:LTE、WCDMA、GSM、EVDO、CDMA。 + +- 13:TDSCDMA。 + +- 14:TDSCDMA、GSM。 + +- 15:TDSCDMA、WCDMA。 + +- 16:TDSCDMA、WCDMA、GSM。 + +- 17:LTE、TDSCDMA。 + +- 18:LTE、TDSCDMA、GSM。 + +- 19:LTE、TDSCDMA、WCDMA。 + +- 20:LTE、TDSCDMA、WCDMA、GSM。 + +- 21:TDSCDMA、WCDMA、GSM、EVDO、CDMA。 + +- 22:LTE、TDSCDMA、WCDMA、GSM、EVDO、CDMA。 + +- 31:NR。 + +- 32:NR、LTE。 + +- 33:NR、LTE、WCDMA。 + +- 34:NR、LTE、WCDMA、GSM。 + +- 35:NR、LTE、EVDO、CDMA。 + +- 36:NR、LTE、WCDMA、GSM、EVDO、CDMA。 + +- 37:NR、LTE、TDSCDMA。 + +- 38:NR、LTE、TDSCDMA、GSM。 + +- 39:NR、LTE、TDSCDMA、WCDMA。 + +- 40:NR、LTE、TDSCDMA、WCDMA、GSM。 + +- 41:NR、LTE、TDSCDMA、WCDMA、GSM、EVDO、CDMA diff --git a/zh-cn/device-dev/reference/hdi-apis/_present_timestamp.md b/zh-cn/device-dev/reference/hdi-apis/_present_timestamp.md index b10f8ce64080ce7d2becd8ca098d5f5836573efc..99d63c93bd130f5ed410a301868eb43072f94dc7 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_present_timestamp.md +++ b/zh-cn/device-dev/reference/hdi-apis/_present_timestamp.md @@ -1,21 +1,21 @@ # PresentTimestamp -## **概述** +## 概述 -上屏时间戳结构体定义。 +上屏时间戳结构体定义 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [type](_display.md#type-37) | 上屏时间戳类型 | -| [time](_display.md#time) | 类型对应的值 | +| [type](_display.md#type-37) | [PresentTimestampType](_display.md#presenttimestamptype)
上屏时间戳类型 | +| [time](_display.md#time) | int64_t
类型对应的值 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_projection_screen_cmd_param.md b/zh-cn/device-dev/reference/hdi-apis/_projection_screen_cmd_param.md index baac9ef747bea6a6dd2036e24677077acffefeba..b12227cf9e2c5f1e2f2e7799ab1c31685fd39124 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_projection_screen_cmd_param.md +++ b/zh-cn/device-dev/reference/hdi-apis/_projection_screen_cmd_param.md @@ -1,35 +1,31 @@ # ProjectionScreenCmdParam -## **概述** +## 概述 投屏参数。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [cmdId](#cmdid) | 投屏命令ID。 | -| [buf](#buf) | 投屏命令内容。 | +| [cmdId](#cmdid) | int
投屏命令ID。  | +| [buf](#buf) | byte[]
投屏命令内容。  | -## **类成员变量说明** +## 类成员变量说明 ### buf @@ -38,9 +34,7 @@ ``` byte [] ProjectionScreenCmdParam::buf ``` - -**描述:** - +**描述:** 投屏命令内容。 @@ -50,7 +44,5 @@ byte [] ProjectionScreenCmdParam::buf ``` int ProjectionScreenCmdParam::cmdId ``` - -**描述:** - +**描述:** 投屏命令ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_property_object.md b/zh-cn/device-dev/reference/hdi-apis/_property_object.md index 2bc7c1197be43e77c135cfc654ea93bf5487f1e9..f46a67e69b5af53b68cd33a1f4b9a01ec24df54f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_property_object.md +++ b/zh-cn/device-dev/reference/hdi-apis/_property_object.md @@ -1,7 +1,7 @@ # PropertyObject -## **概述** +## 概述 定义包含名称、属性ID和值的属性对象。 @@ -10,13 +10,13 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [name](_display.md#name-12) | 属性名称 | -| [propId](_display.md#propid) | 属性ID | -| [value](_display.md#value-12) | 属性值 | +| [name](_display.md#name-12) [[PROPERTY_NAME_LEN](_display.md#property_name_len)] | char
属性名称 | +| [propId](_display.md#propid) | uint32_t
属性ID | +| [value](_display.md#value-12) | uint64_t
属性值 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_ps_reg_status_info.md b/zh-cn/device-dev/reference/hdi-apis/_ps_reg_status_info.md new file mode 100644 index 0000000000000000000000000000000000000000..3a28dc74adc1f1b05f99333186398e8580263d80 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ps_reg_status_info.md @@ -0,0 +1,116 @@ +# PsRegStatusInfo + + +## 概述 + +PS注册状态信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [notifyType](#notifytype) | int
通知类型 | +| [regStatus](#regstatus) | enum [RilRegStatus](_ril.md#rilregstatus)
注册状态,具体查看[RilRegStatus](_ril.md#rilregstatus) | +| [lacCode](#laccode) | int
地区区域码  | +| [cellId](#cellid) | int
小区标识  | +| [radioTechnology](#radiotechnology) | enum [RilRadioTech](_ril.md#rilradiotech)
语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) | +| [isNrAvailable](#isnravailable) | boolean
表示NR模式是否可用  | +| [isEnDcAvailable](#isendcavailable) | boolean
表示ENDC是否可用  | +| [isDcNrRestricted](#isdcnrrestricted) | boolean
表示DCNR是否受限  | + + +## 类成员变量说明 + + +### cellId + + +``` +int PsRegStatusInfo::cellId +``` +**描述:** +小区标识 + + +### isDcNrRestricted + + +``` +boolean PsRegStatusInfo::isDcNrRestricted +``` +**描述:** +表示DCNR是否受限 + + +### isEnDcAvailable + + +``` +boolean PsRegStatusInfo::isEnDcAvailable +``` +**描述:** +表示ENDC是否可用 + + +### isNrAvailable + + +``` +boolean PsRegStatusInfo::isNrAvailable +``` +**描述:** +表示NR模式是否可用 + + +### lacCode + + +``` +int PsRegStatusInfo::lacCode +``` +**描述:** +地区区域码 + + +### notifyType + + +``` +int PsRegStatusInfo::notifyType +``` +**描述:** +通知类型 + +- 0:禁止主动上报 + +- 1:使用格式1上报,具体由芯片自定义 + +- 2:使用格式2上报,具体由芯片自定义 + + +### radioTechnology + + +``` +enum RilRadioTech PsRegStatusInfo::radioTechnology +``` +**描述:** +语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### regStatus + + +``` +enum RilRegStatus PsRegStatusInfo::regStatus +``` +**描述:** +注册状态,具体查看[RilRegStatus](_ril.md#rilregstatus) diff --git a/zh-cn/device-dev/reference/hdi-apis/_quant_d_type_cast.md b/zh-cn/device-dev/reference/hdi-apis/_quant_d_type_cast.md new file mode 100644 index 0000000000000000000000000000000000000000..c6f8c06ef9e3afd49f3269079dd28e595673b321 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_quant_d_type_cast.md @@ -0,0 +1,58 @@ +# QuantDTypeCast + + +## 概述 + +数据类型转换。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_QUANT_DTYPE_CAST。 + +输入: + +- x,n维tensor。 + +输出: + +- output,类型转换之后的tensor。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [srcT](#srct) | long
定义输入的数据类型。  | +| [dstT](#dstt) | long
定义输出的数据类型。  | + + +## 类成员变量说明 + + +### dstT + + +``` +long QuantDTypeCast::dstT +``` +**描述:** +定义输出的数据类型。 + + +### srcT + + +``` +long QuantDTypeCast::srcT +``` +**描述:** +定义输入的数据类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_quant_param.md b/zh-cn/device-dev/reference/hdi-apis/_quant_param.md new file mode 100644 index 0000000000000000000000000000000000000000..8948bdfc90a6e616273d320466655b1d2f2bd2d7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_quant_param.md @@ -0,0 +1,92 @@ +# QuantParam + + +## 概述 + +量化参数结构体。 + +相关的公式如下,q为量化后的参数,r为真实参数,$ r_{max} $为待量化数据的最大值,$ r_{min} $待量化数据的最小值,$ round(x) $为x四舍五入取整,$ clamp(x,min,max) $为如下运算: + +$ \text{clamp}(x,min,max) = \begin{cases} \text{max} & \text{ if } x > \text{ max } \\ \text{min} & \text{ if } x < \text{ min } \\ x & \text{ otherwise } \\ \end{cases} $ + +- 浮点到定点的量化公式: + $ \text{q}(x_i) = clamp(round(\frac{r}{scale}+zeroPoint), min , max) $ + +- 定点到浮点的反量化公式: + $ \text{r}= (q-zeroPoint)\*scale $ + +- 量化参数scale由如下公式计算: + $ scale = \frac{r_{max}-r_{min}}{q_{max}-q_{min}} $ + +- 量化参数zeroPoint由如下公式计算: + $ zeroPoint = round(q_{min}-\frac{r_{min}}{scale}) $ + +- 量化参数 \( q_{min},q_{max} \) 如下公式计算: + $ q_{min} = -(1<<(numBits-1)) $ + + $ q_{max} = (1<<(numBits-1))-1 $ + +特殊情况:当$ r_{min} $和$ r_{max} $同时为0时,scale 和 zeroPoint均为0。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [numBits](#numbits) | int
量化的bit数 | +| [zeroPoint](#zeropoint) | int
零值 | +| [scale](#scale) | double
量化器的步长 | + + +## 类成员变量说明 + + +### numBits + + +``` +int QuantParam::numBits +``` + +**描述:** + +量化的bit数 + + +### scale + + +``` +double QuantParam::scale +``` + +**描述:** + +量化器的步长 + + +### zeroPoint + + +``` +int QuantParam::zeroPoint +``` + +**描述:** + +零值 diff --git a/zh-cn/device-dev/reference/hdi-apis/_r_g_b_color.md b/zh-cn/device-dev/reference/hdi-apis/_r_g_b_color.md index 2dad0607e021b2ba53ffc416191414cc21f9b20c..62f737aca9be537b4a6b4078c10ef768bf1c920e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_r_g_b_color.md +++ b/zh-cn/device-dev/reference/hdi-apis/_r_g_b_color.md @@ -1,37 +1,33 @@ # RGBColor -## **概述** +## 概述 定义灯的RGB模式。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [brightness](#brightness) | 亮度值,范围为0-255。 | -| [r](#r) | 红色值,范围为0-255。 | -| [g](#g) | 绿色值,范围为0-255。 | -| [b](#b) | 蓝色值,范围为0-255。 | +| [brightness](#brightness) | int
亮度值,范围为0-255。  | +| [r](#r) | int
红色值,范围为0-255。  | +| [g](#g) | int
绿色值,范围为0-255。  | +| [b](#b) | int
蓝色值,范围为0-255。  | -## **类成员变量说明** +## 类成员变量说明 ### b @@ -40,9 +36,7 @@ ``` int RGBColor::b ``` - -**描述:** - +**描述:** 蓝色值,范围为0-255。 @@ -52,9 +46,7 @@ int RGBColor::b ``` int RGBColor::brightness ``` - -**描述:** - +**描述:** 亮度值,范围为0-255。 @@ -64,9 +56,7 @@ int RGBColor::brightness ``` int RGBColor::g ``` - -**描述:** - +**描述:** 绿色值,范围为0-255。 @@ -76,7 +66,5 @@ int RGBColor::g ``` int RGBColor::r ``` - -**描述:** - +**描述:** 红色值,范围为0-255。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_radio_protocol.md b/zh-cn/device-dev/reference/hdi-apis/_radio_protocol.md new file mode 100644 index 0000000000000000000000000000000000000000..a6a7b354d332c6d80e638ea805730a797215d73a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_radio_protocol.md @@ -0,0 +1,112 @@ +# RadioProtocol + + +## 概述 + +主副卡协议栈信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [slotId](#slotid) | int
卡槽ID  | +| [sessionId](#sessionid) | int
会话ID  | +| [phase](#phase) | enum [RadioProtocolPhase](_ril.md#radioprotocolphase)
Radio协议参数,具体查看[RadioProtocolPhase](_ril.md#radioprotocolphase) | +| [technology](#technology) | int
Radio协议技术信息。 | +| [modemId](#modemid) | int
modem ID,底层与slotId的对应字段  | +| [status](#status) | enum [RadioProtocolStatus](_ril.md#radioprotocolstatus)
Radio协议状态,具体查看[RadioProtocolStatus](_ril.md#radioprotocolstatus) | + + +## 类成员变量说明 + + +### modemId + + +``` +int RadioProtocol::modemId +``` +**描述:** +modem ID,底层与slotId的对应字段 + + +### phase + + +``` +enum RadioProtocolPhase RadioProtocol::phase +``` +**描述:** +Radio协议参数,具体查看[RadioProtocolPhase](_ril.md#radioprotocolphase) + + +### sessionId + + +``` +int RadioProtocol::sessionId +``` +**描述:** +会话ID + + +### slotId + + +``` +int RadioProtocol::slotId +``` +**描述:** +卡槽ID + + +### status + + +``` +enum RadioProtocolStatus RadioProtocol::status +``` +**描述:** +Radio协议状态,具体查看[RadioProtocolStatus](_ril.md#radioprotocolstatus) + + +### technology + + +``` +int RadioProtocol::technology +``` +**描述:** +Radio协议技术信息。 + +- 1:GSM + +- 2:1XRTT + +- 4:WCDMA + +- 8:HSPA + +- 16:HSPAP + +- 32:TDSCDMA + +- 64:EVDO + +- 128:EHRPD + +- 256:LTE + +- 512:LTE_CA + +- 1024:IWLAN + +- 2048:NR diff --git a/zh-cn/device-dev/reference/hdi-apis/_range_value.md b/zh-cn/device-dev/reference/hdi-apis/_range_value.md index 5afe5c033bd0a41a78f7e27f7cfd3bcf030781a4..72fdae20b70884fbf8ea1cf61b387956a91380f0 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_range_value.md +++ b/zh-cn/device-dev/reference/hdi-apis/_range_value.md @@ -1,27 +1,27 @@ # RangeValue -## **概述** +## 概述 取值范围的定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [min](#min) | 最小值。 | -| [max](#max) | 最大值。 | +| [min](#min) | int32_t
最小值。  | +| [max](#max) | int32_t
最大值。  | -## **类成员变量说明** +## 类成员变量说明 ### max @@ -30,9 +30,7 @@ ``` int32_t RangeValue::max ``` - -**描述:** - +**描述:** 最大值。 @@ -42,7 +40,5 @@ int32_t RangeValue::max ``` int32_t RangeValue::min ``` - -**描述:** - +**描述:** 最小值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_rect.md b/zh-cn/device-dev/reference/hdi-apis/_rect.md index 350fd817c80e9404dfa0e74ba9fe4111432ec635..d9b9e5f6d1d126102d7459ff49d08a93d8fbad51 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_rect.md +++ b/zh-cn/device-dev/reference/hdi-apis/_rect.md @@ -1,27 +1,27 @@ # Rect -## **概述** +## 概述 矩形的定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [width](#width) | 矩形的宽。 | -| [height](#height) | 矩形的高。 | +| [width](#width) | int32_t
矩形的宽。  | +| [height](#height) | int32_t
矩形的高。  | -## **类成员变量说明** +## 类成员变量说明 ### height @@ -30,9 +30,7 @@ ``` int32_t Rect::height ``` - -**描述:** - +**描述:** 矩形的高。 @@ -42,7 +40,5 @@ int32_t Rect::height ``` int32_t Rect::width ``` - -**描述:** - +**描述:** 矩形的宽。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_rectangle.md b/zh-cn/device-dev/reference/hdi-apis/_rectangle.md index 3f26acf96fe0616a6adcca985d4fada805616e80..b74013266e8c0bd69af0c763508d2412fe01bf51 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_rectangle.md +++ b/zh-cn/device-dev/reference/hdi-apis/_rectangle.md @@ -1,7 +1,7 @@ # Rectangle -## **概述** +## 概述 矩形描述结构体定义,用于硬件加速绘制矩形。 @@ -10,12 +10,12 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [rect](_display.md#rect-13) | 矩形区域 | -| [color](_display.md#color-35) | 矩形颜色 | +| [rect](_display.md#rect-13) | [IRect](_i_rect.md)
矩形区域 | +| [color](_display.md#color-35) | uint32_t
矩形颜色 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_reduce_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_reduce_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..570e0a0ba78b22a7fff1a4caa5d4b1a6f388ed67 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_reduce_fusion.md @@ -0,0 +1,96 @@ +# ReduceFusion + + +## 概述 + +减小x张量的维度。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_REDUCE_FUSION。 + +参数说明:mode若为REDUCE_ALL,REDUCE_PROD和REDUCE_MEAN,则reduce_to_end为true时,Reduce之后的输出乘以coeff为最终输出。 + +输入: + +- x,n维tensor,n<8。 + +- axis,1维tensor,指定reduce的维度,axis中每个元素的取值范围为[-n,n)。 + +输出: + +- output,执行Reduce之后的m维的tensor,其数据类型和x相同。当keepDims为false时,m<n;当keepDims为true时,m==n。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [keepDims](#keepdims) | boolean
维度是否保持不变。 | +| [mode](#mode) | enum [ReduceMode](_n_n_rt.md#reducemode)
减小张量维度的算法,详情请参考:[ReduceMode](_n_n_rt.md#reducemode)。 | +| [reduceToEnd](#reducetoend) | boolean
如果为true,则从axis取第一个元素并设置为i,然后axis会被修改为[i,i+1,...,n-1,n]。 | +| [coeff](#coeff) | float
系数 | + + +## 类成员变量说明 + + +### coeff + + +``` +float ReduceFusion::coeff +``` + +**描述:** + +系数 + + +### keepDims + + +``` +boolean ReduceFusion::keepDims +``` + +**描述:** + +维度是否保持不变。 + + +### mode + + +``` +enum ReduceMode ReduceFusion::mode +``` + +**描述:** + +减小张量维度的算法,详情请参考:[ReduceMode](_n_n_rt.md#reducemode)。 + + +### reduceToEnd + + +``` +boolean ReduceFusion::reduceToEnd +``` + +**描述:** + +如果为true,则从axis取第一个元素并设置为i,然后axis会被修改为[i,i+1,...,n-1,n],例如reduceToEnd=True,axis=[2,4],x的维度为7,则axis会被修改为[2,3,4,5,6]。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_request_cell_db.md b/zh-cn/device-dev/reference/hdi-apis/_request_cell_db.md new file mode 100644 index 0000000000000000000000000000000000000000..ec93aed96cd31d76ab1d659528154d3a8f155aab --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_request_cell_db.md @@ -0,0 +1,65 @@ +# RequestCellDb + + +## 概述 + +定义请求基站离线数据库数据的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [requestSize](#requestsize) | int
请求基站离线数据库的大小。 | +| [location](#location) | struct [GeoLocationInfo](_geo_location_info.md)
设备最新的位置信息。详见[GeoLocationInfo](_geo_location_info.md)。 | +| [cellInfo](#cellinfo) | struct [GeofenceCellInfo](_geofence_cell_info.md)[]
设备最新的基站数据信息。详见[GeofenceCellInfo](_geofence_cell_info.md)。 | + + +## 类成员变量说明 + + +### cellInfo + + +``` +struct GeofenceCellInfo [] RequestCellDb::cellInfo +``` + +**描述:** + +设备最新的基站数据信息。详见[GeofenceCellInfo](_geofence_cell_info.md)。 + + +### location + + +``` +struct GeoLocationInfo RequestCellDb::location +``` + +**描述:** + +设备最新的位置信息。详见[GeoLocationInfo](_geo_location_info.md)。 + + +### requestSize + + +``` +int RequestCellDb::requestSize +``` + +**描述:** + +请求基站离线数据库的大小。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_reshape.md b/zh-cn/device-dev/reference/hdi-apis/_reshape.md new file mode 100644 index 0000000000000000000000000000000000000000..baf8cdffc29324904981c44b56fccfae250dbe58 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_reshape.md @@ -0,0 +1,26 @@ +# Reshape + + +## 概述 + +根据inputShape调整input的形状。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_RESHAPE。 + +输入: + +- x,一个n维输入tensor。 + +- InputShape,一个1维tensor,表示输出tensor的shape,需要是一个常量tensor。 + +输出: + +- output,数据类型和input一致,shape由inputShape决定。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_resize.md b/zh-cn/device-dev/reference/hdi-apis/_resize.md new file mode 100644 index 0000000000000000000000000000000000000000..c5d3c6c9c92ecddfa0e140401413d622b634e35d --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_resize.md @@ -0,0 +1,137 @@ +# Resize + + +## 概述 + +按给定的参数对输入的张量进行变形。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_RESIZE。 + +参数指导:该算子的参数组合可以实现常用的Resize函数。 例如,实现精确对齐图像的4个角的双线性插值则设置: method = RESIZE_METHOD_LINEAR coordinateTransformMode = COORDINATE_TRANSFORM_MODE_ALIGN_CORNERS + +输入: + +- x,一个4维tensor,tensor排布必须是[batchSize,height,width,channels](NHWC)。 + +输出: + +- output,n维输出tensor,它的的shape和数据类型与x相同。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [method](#method) | enum [ResizeMethod](_n_n_rt.md#resizemethod)
调整尺寸的方法,详情请参考:[ResizeMethod](_n_n_rt.md#resizemethod)。  | +| [newHeight](#newheight) | long
resize之后4维tensor的height值。  | +| [newWidth](#newwidth) | long
resize之后4维tensor的width值。  | +| [preserveAspectRatio](#preserveaspectratio) | boolean
一个布尔值,指示resize操作是否保持x张量的height/width比例。  | +| [coordinateTransformMode](#coordinatetransformmode) | enum [CoordinateTransformMode](_n_n_rt.md#coordinatetransformmode)
坐标变换方法,详情请参考:[CoordinateTransformMode](_n_n_rt.md#coordinatetransformmode)。  | +| [cubicCoeff](#cubiccoeff) | float
立方系数,当method为RESIZE_METHOD_CUBIC时使用。  | +| [excludeOutside](#excludeoutside) | long
当excludeOutside==1时,超出x的边界的采样权重被置为0,其余权重重新归一化处理。  | +| [extrapolationValue](#extrapolationvalue) | float
外插值,当仅用于裁剪x的时候使用,超出边界的采样权重被置为extrapolationValue。  | +| [nearestMode](#nearestmode) | enum [NearestMode](_n_n_rt.md#nearestmode)
最近邻近算法,当method==RESIZE_METHOD_NEAREST时使用,详情请参考:[NearestMode](_n_n_rt.md#nearestmode)。  | + + +## 类成员变量说明 + + +### coordinateTransformMode + + +``` +enum CoordinateTransformMode Resize::coordinateTransformMode +``` +**描述:** +坐标变换方法,详情请参考:[CoordinateTransformMode](_n_n_rt.md#coordinatetransformmode)。 + + +### cubicCoeff + + +``` +float Resize::cubicCoeff +``` +**描述:** +立方系数,当method为RESIZE_METHOD_CUBIC时使用。 + + +### excludeOutside + + +``` +long Resize::excludeOutside +``` +**描述:** +当excludeOutside==1时,超出x的边界的采样权重被置为0,其余权重重新归一化处理。 + + +### extrapolationValue + + +``` +float Resize::extrapolationValue +``` +**描述:** +外插值,当仅用于裁剪x的时候使用,超出边界的采样权重被置为extrapolationValue。 + + +### method + + +``` +enum ResizeMethod Resize::method +``` +**描述:** +调整尺寸的方法,详情请参考:[ResizeMethod](_n_n_rt.md#resizemethod)。 + + +### nearestMode + + +``` +enum NearestMode Resize::nearestMode +``` +**描述:** +最近邻近算法,当method==RESIZE_METHOD_NEAREST时使用,详情请参考:[NearestMode](_n_n_rt.md#nearestmode)。 + + +### newHeight + + +``` +long Resize::newHeight +``` +**描述:** +resize之后4维tensor的height值。 + + +### newWidth + + +``` +long Resize::newWidth +``` +**描述:** +resize之后4维tensor的width值。 + + +### preserveAspectRatio + + +``` +boolean Resize::preserveAspectRatio +``` +**描述:** +一个布尔值,指示resize操作是否保持x张量的height/width比例。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_ril.md b/zh-cn/device-dev/reference/hdi-apis/_ril.md new file mode 100644 index 0000000000000000000000000000000000000000..e9d2b614d899db9f92fc753a06ea5fb365bb93ae --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ril.md @@ -0,0 +1,513 @@ +# Ril + + +## 概述 + +Ril模块接口定义。 + +Ril模块为上层电话服务提供相关调用接口,涉及电话、短信、彩信、网络搜索、SIM卡等功能接口及各种回调等。 + +**Since:** + +3.2 + +**Version:** + +1.0 + + +## 汇总 + + +### 文件 + +| 名称 | 描述 | +| -------- | -------- | +| [IRil.idl](_i_ril_8idl.md) | Ril模块的请求接口。 | +| [IRilCallback.idl](_i_ril_callback_8idl.md) | Ril模块的回调接口 | +| [Types.idl](_ril_types_8idl.md) | Ril模块HDI接口使用的数据类型。 | + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IRil](interface_i_ril.md) | interface
Ril模块的请求接口。 | +| [IRilCallback](interface_i_ril_callback.md) | interface
Ril模块的回调接口。 | +| [EmergencyCall](_emergency_call.md) | struct
紧急呼叫号码。 | +| [EmergencyInfoList](_emergency_info_list.md) | struct
紧急呼叫号码列表。 | +| [RilRadioResponseInfo](_ril_radio_response_info.md) | struct
响应通用信息。 | +| [SetupDataCallResultInfo](_setup_data_call_result_info.md) | struct
数据业务激活结果信息。 | +| [DataCallResultList](_data_call_result_list.md) | struct
数据业务激活结果列表。 | +| [DataProfileDataInfo](_data_profile_data_info.md) | struct
PDP上下文信息。 | +| [DataProfilesInfo](_data_profiles_info.md) | struct
PDP上下文信息列表。 | +| [DataCallInfo](_data_call_info.md) | struct
数据业务信息。 | +| [DataLinkBandwidthInfo](_data_link_bandwidth_info.md) | struct
网络频率信息。 | +| [DataLinkBandwidthReportingRule](_data_link_bandwidth_reporting_rule.md) | struct
网络频率上报规则。 | +| [DataPerformanceInfo](_data_performance_info.md) | struct
数据业务性能模式。 | +| [DataSleepInfo](_data_sleep_info.md) | struct
数据业务睡眠模式。 | +| [UniInfo](_uni_info.md) | struct
通用信息。 | +| [VoiceRadioTechnology](_voice_radio_technology.md) | struct
电路域接入技术。 | +| [DialInfo](_dial_info.md) | struct
拨号信息。 | +| [CallInfo](_call_info.md) | struct
通话状态信息。 | +| [CallInfoList](_call_info_list.md) | struct
通话状态信息列表。 | +| [GetClipResult](_get_clip_result.md) | struct
主叫号码显示结果信息。 | +| [GetClirResult](_get_clir_result.md) | struct
主叫号码显示限制结果信息。 | +| [CallWaitResult](_call_wait_result.md) | struct
呼叫等待结果信息。 | +| [CallRestrictionInfo](_call_restriction_info.md) | struct
呼叫限制信息。 | +| [CallRestrictionResult](_call_restriction_result.md) | struct
呼叫限制结果信息。 | +| [CallForwardSetInfo](_call_forward_set_info.md) | struct
呼叫转移信息。 | +| [CallForwardQueryResult](_call_forward_query_result.md) | struct
呼叫转移查询结果信息。 | +| [CallForwardQueryInfoList](_call_forward_query_info_list.md) | struct
呼叫转移信息列表。 | +| [UssdNoticeInfo](_ussd_notice_info.md) | struct
非结构化补充数据业务(USSD)业务信息。 | +| [SsNoticeInfo](_ss_notice_info.md) | struct
补充业务信息。 | +| [SrvccStatus](_srvcc_status.md) | struct
SRVCC(Single Radio Voice Call Continuity)状态信息。 | +| [RingbackVoice](_ringback_voice.md) | struct
回铃音信息。 | +| [DtmfInfo](_dtmf_info.md) | struct
发送双音多频(DTMF)信息。 | +| [SetBarringInfo](_set_barring_info.md) | struct
设置呼叫限制密码的信息。 | +| [CardStatusInfo](_card_status_info.md) | struct
SIM卡状态信息。 | +| [SimIoRequestInfo](_sim_io_request_info.md) | struct
SIM数据请求信息。 | +| [IccIoResultInfo](_icc_io_result_info.md) | struct
SIM数据的响应结果信息。 | +| [SimLockInfo](_sim_lock_info.md) | struct
SIM卡锁信息。 | +| [SimPasswordInfo](_sim_password_info.md) | struct
SIM卡密码信息。 | +| [SimPinInputTimes](_sim_pin_input_times.md) | struct
SIM密码输入次数信息。 | +| [ApduSimIORequestInfo](_apdu_sim_i_o_request_info.md) | struct
APDU数据传输请求信息。 | +| [SimAuthenticationRequestInfo](_sim_authentication_request_info.md) | struct
SIM卡鉴权请求信息。 | +| [OpenLogicalChannelResponse](_open_logical_channel_response.md) | struct
APDU打开逻辑通道响应信息。 | +| [LockStatusResp](_lock_status_resp.md) | struct
SIM卡解锁响应 | +| [RadioProtocol](_radio_protocol.md) | struct
主副卡协议栈信息。 | +| [GsmRssi](_gsm_rssi.md) | struct
GSM信号强度。 | +| [CdmaRssi](_cdma_rssi.md) | struct
CDMA信号强度。 | +| [WcdmaRssi](_wcdma_rssi.md) | struct
WCDMA信号强度。 | +| [LteRssi](_lte_rssi.md) | struct
LTE信号强度。 | +| [TdScdmaRssi](_td_scdma_rssi.md) | struct
TDSCDMA信号强度。 | +| [NrRssi](_nr_rssi.md) | struct
NR信号强度。 | +| [Rssi](_rssi.md) | struct
接收信号强度信息。 | +| [CsRegStatusInfo](_cs_reg_status_info.md) | struct
CS注册状态信息。 | +| [PsRegStatusInfo](_ps_reg_status_info.md) | struct
PS注册状态信息。 | +| [OperatorInfo](_operator_info.md) | struct
运营商信息。 | +| [AvailableNetworkInfo](_available_network_info.md) | struct
可用网络信息。 | +| [AvailableNetworkList](_available_network_list.md) | struct
可用网络列表。 | +| [SetNetworkModeInfo](_set_network_mode_info.md) | struct
设置网络模式信息。 | +| [CellListRatGsm](_cell_list_rat_gsm.md) | struct
GSM小区信息。 | +| [CellListRatLte](_cell_list_rat_lte.md) | struct
LTE小区信息。 | +| [CellListRatWcdma](_cell_list_rat_wcdma.md) | struct
WCDMA小区信息。 | +| [CellListRatCdma](_cell_list_rat_cdma.md) | struct
CDMA小区信息。 | +| [CellListRatTdscdma](_cell_list_rat_tdscdma.md) | struct
TDSCDMA小区信息。 | +| [CellListRatNr](_cell_list_rat_nr.md) | struct
NR小区信息。 | +| [ServiceCellParas](union_service_cell_paras.md) | union
多种网络模式的小区信息。 | +| [CellNearbyInfo](_cell_nearby_info.md) | struct
相邻小区信息。 | +| [CellListNearbyInfo](_cell_list_nearby_info.md) | struct
附近小区信息列表。 | +| [CellRatGsm](_cell_rat_gsm.md) | struct
GSM蜂窝信息。 | +| [CellRatLte](_cell_rat_lte.md) | struct
LTE蜂窝信息。 | +| [CellRatWcdma](_cell_rat_wcdma.md) | struct
WCDMA蜂窝信息。 | +| [CellRatCdma](_cell_rat_cdma.md) | struct
CDMA蜂窝信息。 | +| [CellRatTdscdma](_cell_rat_tdscdma.md) | struct
TDSCDMA蜂窝信息。 | +| [CellRatNr](_cell_rat_nr.md) | struct
NR蜂窝信息。 | +| [CurrentServiceCellParas](union_current_service_cell_paras.md) | union
当前蜂窝数据信息。 | +| [CurrentCellInfo](_current_cell_info.md) | struct
当前小区信息。 | +| [CellListCurrentInfo](_cell_list_current_info.md) | struct
当前小区信息列表。 | +| [PreferredNetworkTypeInfo](_preferred_network_type_info.md) | struct
首选网络类型信息。 | +| [PhysicalChannelConfig](_physical_channel_config.md) | struct
物理通道配置。 | +| [ChannelConfigInfoList](_channel_config_info_list.md) | struct
通道配置信息列表。 | +| [GsmSmsMessageInfo](_gsm_sms_message_info.md) | struct
发送GSM短信信息。 | +| [SendCdmaSmsMessageInfo](_send_cdma_sms_message_info.md) | struct
发送CDMA短信信息。 | +| [SmsMessageIOInfo](_sms_message_i_o_info.md) | struct
SIM卡短信信息 | +| [ServiceCenterAddress](_service_center_address.md) | struct
短信中心地址信息。 | +| [CBConfigInfo](_c_b_config_info.md) | struct
GSM小区广播配置信息。 | +| [CdmaCBConfigInfo](_cdma_c_b_config_info.md) | struct
CDMA小区广播配置信息。 | +| [CdmaCBConfigInfoList](_cdma_c_b_config_info_list.md) | struct
CDMA小区广播配置信息列表。 | +| [CBConfigReportInfo](_c_b_config_report_info.md) | struct
小区广播上报信息。 | +| [SmsMessageInfo](_sms_message_info.md) | struct
上报短信信息。 | +| [ModeData](_mode_data.md) | struct
接收短信处理模式。 | +| [SendSmsResultInfo](_send_sms_result_info.md) | struct
发送短信响应信息。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [EccType](#ecctype) {
TYPE_CATEGORY = 0 , TYPE_POLICE = 1 , TYPE_AMBULANCE = 2 , TYPE_FIRE = 4 ,TYPE_SEA = 8 , TYPE_MOUNTAIN = 16
} | 紧急呼叫类型。 | +| [SimpresentType](#simpresenttype) { TYPE_NO_CARD = 0 , TYPE_HAS_CARD = 1 } | 表示号码是有卡时有效还是无卡时有效。 | +| [AbnormalServiceType](#abnormalservicetype) { TYPE_ALL = 0 , TYPE_ONLY_CS = 1 } | 表示号码有效性是否区分电路(CS)域非正常服务状态。 | +| [RilErrType](#rilerrtype) {
NONE = 0 , RIL_ERR_GENERIC_FAILURE = 1 , RIL_ERR_INVALID_PARAMETER = 2 , RIL_ERR_MEMORY_FULL = 3 ,
RIL_ERR_CMD_SEND_FAILURE = 4 , RIL_ERR_CMD_NO_CARRIER = 5 , RIL_ERR_INVALID_RESPONSE = 6 , RIL_ERR_REPEAT_STATUS = 7 ,
RIL_ERR_NETWORK_SEARCHING = 8 , RIL_ERR_NETWORK_SEARCHING_INTERRUPTED = 9 , RIL_ERR_MODEM_DEVICE_CLOSE = 10 , RIL_ERR_NO_SIMCARD_INSERTED = 11 , RIL_ERR_NEED_PIN_CODE = 12 , RIL_ERR_NEED_PUK_CODE = 13 , RIL_ERR_NETWORK_SEARCH_TIMEOUT = 14 , RIL_ERR_PINPUK_PASSWORD_NOCORRECT = 15 ,
RIL_ERR_INVALID_MODEM_PARAMETER = 50 , RIL_ERR_HDF_IPC_FAILURE = 300 , RIL_ERR_NULL_POINT = 301 , RIL_ERR_VENDOR_NOT_IMPLEMENT = 302
} | Ril错误码。 | +| [RilResponseTypes](#rilresponsetypes) {
RIL_RESPONSE_REQUEST = 0 , RIL_RESPONSE_NOTICE = 1 , RIL_RESPONSE_REQUEST_ACK = 2 , RIL_RESPONSE_REQUEST_MUST_ACK = 3 , RIL_RESPONSE_NOTICE_MUST_ACK = 4
} | 响应类型。 | +| [RilSrvStatus](#rilsrvstatus) {
RIL_NO_SRV_SERVICE = 0 , RIL_RESTRICTED_SERVICE = 1 , RIL_SERVICE_VALID = 2 , RIL_REGIONAL_SERVICE = 3 , RIL_ENERGY_SAVING_SERVICE = 4
} | Ril系统服务状态。 | +| [RilSrvDomain](#rilsrvdomain) {
RIL_NO_DOMAIN_SERVICE = 0 , RIL_CS_SERVICE = 1 , RIL_PS_SERVICE = 2 , RIL_CS_PS_SERVICE = 3 , RIL_CS_PS_SEARCHING = 4 , RIL_CDMA_NOT_SUPPORT = 255
} | 系统服务域。 | +| [RilRoamStatus](#rilroamstatus) { RIL_NO_ROAM = 0 , RIL_ROAMING = 1 , RIL_ROAM_UNKNOWN = 2 } | 漫游状态。 | +| [RilSimLockStatus](#rilsimlockstatus) { RIL_SIM_CARD_UNLOCK = 0 , RIL_SIM_CARD_LOCK = 1 } | SIM卡锁定状态。 | +| [RilSysMode](#rilsysmode) {
RIL_NO_SYSMODE_SERVICE = 0 , RIL_GSM_MODE = 1 , RIL_CDMA_MODE = 2 , RIL_WCDMA_MODE = 3 , RIL_TDSCDMA_MODE = 4 , RIL_WIMAX_MODE = 5 , RIL_LTE_MODE = 6 , RIL_LTE_CA_MODE = 7 , RIL_NR_MODE = 8
} | 系统制式。 | +| [RilRadioTech](#rilradiotech) {
RADIO_TECHNOLOGY_INVALID = 65535 , RADIO_TECHNOLOGY_UNKNOWN = 0 , RADIO_TECHNOLOGY_GSM = 1 , RADIO_TECHNOLOGY_1XRTT = 2 , RADIO_TECHNOLOGY_WCDMA = 3 , RADIO_TECHNOLOGY_HSPA = 4 , RADIO_TECHNOLOGY_HSPAP = 5 , RADIO_TECHNOLOGY_TD_SCDMA = 6 , RADIO_TECHNOLOGY_EVDO = 7 , RADIO_TECHNOLOGY_EHRPD = 8 , RADIO_TECHNOLOGY_LTE = 9 , RADIO_TECHNOLOGY_LTE_CA = 10 , RADIO_TECHNOLOGY_IWLAN = 11 , RADIO_TECHNOLOGY_NR = 12
} | 语音接入技术类型。 | +| [RilSimStatus](#rilsimstatus) {
RIL_USIM_INVALID = 0 , RIL_USIM_VALID = 1 , RIL_USIM_CS_INVALID = 2 , RIL_USIM_PS_INVALID = 3 , RIL_USIM_CS_PS_INVALID = 4 , RIL_ROM_SIM = 240 , RIL_NO_USIM = 255
} | SIM卡状态。 | +| [RilRegStatus](#rilregstatus) {
NO_REG_MT_NO_SEARCH = 0 , REG_MT_HOME = 1 , NO_REG_MT_SEARCHING = 2 , REG_MT_REJECTED = 3 , REG_MT_UNKNOWN = 4 , REG_MT_ROAMING = 5 , REG_MT_EMERGENCY = 6
} | 描述网络注册状态。 | +| [RilCellConnectionStatus](#rilcellconnectionstatus) { RIL_SERVING_CELL_UNKNOWN = 0 , RIL_SERVING_CELL_PRIMARY = 1 , RIL_SERVING_CELL_SECONDARY = 2 } | 小区连接状态。 | +| [RilRegNotifyMode](#rilregnotifymode) { REG_NOT_NOTIFY = 0 , REG_NOTIFY_STAT_ONLY = 1 , REG_NOTIFY_STAT_LAC_CELLID = 2 } | 上报模式。 | +| [RadioProtocolPhase](#radioprotocolphase) {
RADIO_PROTOCOL_PHASE_INITIAL , RADIO_PROTOCOL_PHASE_CHECK , RADIO_PROTOCOL_PHASE_UPDATE , RADIO_PROTOCOL_PHASE_NOTIFY , RADIO_PROTOCOL_PHASE_COMPLETE
} | 设置Radio协议动作参数。 | +| [RadioProtocolStatus](#radioprotocolstatus) { RADIO_PROTOCOL_STATUS_NONE , RADIO_PROTOCOL_STATUS_SUCCESS , RADIO_PROTOCOL_STATUS_FAIL } | Radio协议状态。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.ril.v1_0 | Ril模块接口的包路径。 | + + +## 枚举类型说明 + + +### AbnormalServiceType + + +``` +enum AbnormalServiceType +``` + +**描述:** + +表示号码有效性是否区分电路(CS)域非正常服务状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| TYPE_ALL | 所有状态均有效 | +| TYPE_ONLY_CS | 仅在CS域非正常服务时有效 | + + +### EccType + + +``` +enum EccType +``` + +**描述:** + +紧急呼叫类型。 + + | 枚举值 | 描述 | +| -------- | -------- | +| TYPE_CATEGORY | 默认 | +| TYPE_POLICE | 匪警 | +| TYPE_AMBULANCE | 救护 | +| TYPE_FIRE | 火警 | +| TYPE_SEA | 海警 | +| TYPE_MOUNTAIN | 高山营救 | + + +### RadioProtocolPhase + + +``` +enum RadioProtocolPhase +``` + +**描述:** + +设置Radio协议动作参数。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RADIO_PROTOCOL_PHASE_INITIAL | 初始化 | +| RADIO_PROTOCOL_PHASE_CHECK | 检查 | +| RADIO_PROTOCOL_PHASE_UPDATE | 更新 | +| RADIO_PROTOCOL_PHASE_NOTIFY | 上报 | +| RADIO_PROTOCOL_PHASE_COMPLETE | 结束 | + + +### RadioProtocolStatus + + +``` +enum RadioProtocolStatus +``` + +**描述:** + +Radio协议状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RADIO_PROTOCOL_STATUS_NONE | 无状态 | +| RADIO_PROTOCOL_STATUS_SUCCESS | 成功 | +| RADIO_PROTOCOL_STATUS_FAIL | 失败 | + + +### RilCellConnectionStatus + + +``` +enum RilCellConnectionStatus +``` + +**描述:** + +小区连接状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_SERVING_CELL_UNKNOWN | 未知连接状态 | +| RIL_SERVING_CELL_PRIMARY | 主要连接状态 | +| RIL_SERVING_CELL_SECONDARY | 次要连接状态 | + + +### RilErrType + + +``` +enum RilErrType +``` + +**描述:** + +Ril错误码。 + + | 枚举值 | 描述 | +| -------- | -------- | +| NONE | 调用成功 | +| RIL_ERR_GENERIC_FAILURE | 通用错误 | +| RIL_ERR_INVALID_PARAMETER | 参数错误 | +| RIL_ERR_MEMORY_FULL | 内存满载 | +| RIL_ERR_CMD_SEND_FAILURE | 命令发送失败 | +| RIL_ERR_CMD_NO_CARRIER | 命令连接终止 | +| RIL_ERR_INVALID_RESPONSE | 非法响应 | +| RIL_ERR_REPEAT_STATUS | 状态已存在 | +| RIL_ERR_NETWORK_SEARCHING | 网络搜索中 | +| RIL_ERR_NETWORK_SEARCHING_INTERRUPTED | 网络搜索中断 | +| RIL_ERR_MODEM_DEVICE_CLOSE | Modem设备关闭 | +| RIL_ERR_NO_SIMCARD_INSERTED | SIM卡未插入 | +| RIL_ERR_NEED_PIN_CODE | 需要输入PIN码 | +| RIL_ERR_NEED_PUK_CODE | 需要输入PUK码 | +| RIL_ERR_NETWORK_SEARCH_TIMEOUT | 搜网超时 | +| RIL_ERR_PINPUK_PASSWORD_NOCORRECT | PIN码或PUK码错误 | +| RIL_ERR_INVALID_MODEM_PARAMETER | Modem参数错误 | +| RIL_ERR_HDF_IPC_FAILURE | IPC错误 | +| RIL_ERR_NULL_POINT | 空指针 | +| RIL_ERR_VENDOR_NOT_IMPLEMENT | 厂商库未实现 | + + +### RilRadioTech + + +``` +enum RilRadioTech +``` + +**描述:** + +语音接入技术类型。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RADIO_TECHNOLOGY_INVALID | 非法 | +| RADIO_TECHNOLOGY_UNKNOWN | 未知 | +| RADIO_TECHNOLOGY_GSM | GSM | +| RADIO_TECHNOLOGY_1XRTT | 无线电传输技术(1XRTT) | +| RADIO_TECHNOLOGY_WCDMA | WCDMA | +| RADIO_TECHNOLOGY_HSPA | 高速分组接入(HSPA) | +| RADIO_TECHNOLOGY_HSPAP | 高速下行分组接入(HSPAP) | +| RADIO_TECHNOLOGY_TD_SCDMA | 同步码分多址的无线接入技术(SCDMA) | +| RADIO_TECHNOLOGY_EVDO | 仅演进数据(EVDO) | +| RADIO_TECHNOLOGY_EHRPD | 演进的高速分组网络(EHRPD) | +| RADIO_TECHNOLOGY_LTE | LTE | +| RADIO_TECHNOLOGY_LTE_CA | CA | +| RADIO_TECHNOLOGY_IWLAN | 工业无线局域网(IWLAN) | +| RADIO_TECHNOLOGY_NR | NR | + + +### RilRegNotifyMode + + +``` +enum RilRegNotifyMode +``` + +**描述:** + +上报模式。 + + | 枚举值 | 描述 | +| -------- | -------- | +| REG_NOT_NOTIFY | 禁止主动上报 | +| REG_NOTIFY_STAT_ONLY | 网络注册状态发生改变时上报 | +| REG_NOTIFY_STAT_LAC_CELLID | 小区信息发生改变时上报 | + + +### RilRegStatus + + +``` +enum RilRegStatus +``` + +**描述:** + +描述网络注册状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| NO_REG_MT_NO_SEARCH | 没有注册,MT(Mobile Terminal)现在没有搜索和注册新的运营商 | +| REG_MT_HOME | 注册了归属网络 | +| NO_REG_MT_SEARCHING | 没有注册,MT正在搜索并注册新的运营商 | +| REG_MT_REJECTED | 注册被拒绝 | +| REG_MT_UNKNOWN | 未知状态 | +| REG_MT_ROAMING | 注册了漫游网络 | +| REG_MT_EMERGENCY | 处于紧急模式 | + + +### RilResponseTypes + + +``` +enum RilResponseTypes +``` + +**描述:** + +响应类型。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_RESPONSE_REQUEST | 请求响应 | +| RIL_RESPONSE_NOTICE | 通知响应 | +| RIL_RESPONSE_REQUEST_ACK | 应答请求响应 | +| RIL_RESPONSE_REQUEST_MUST_ACK | 必须应答请求响应 | +| RIL_RESPONSE_NOTICE_MUST_ACK | 必须应答通知响应 | + + +### RilRoamStatus + + +``` +enum RilRoamStatus +``` + +**描述:** + +漫游状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_NO_ROAM | 非漫游状态 | +| RIL_ROAMING | 漫游状态 | +| RIL_ROAM_UNKNOWN | 未知 | + + +### RilSimLockStatus + + +``` +enum RilSimLockStatus +``` + +**描述:** + +SIM卡锁定状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_SIM_CARD_UNLOCK | 未被CardLock功能锁定 | +| RIL_SIM_CARD_LOCK | 被CardLock功能锁定 | + + +### RilSimStatus + + +``` +enum RilSimStatus +``` + +**描述:** + +SIM卡状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_USIM_INVALID | USIM卡状态无效 | +| RIL_USIM_VALID | USIM卡状态有效 | +| RIL_USIM_CS_INVALID | USIM卡在CS下无效 | +| RIL_USIM_PS_INVALID | USIM卡在PS下无效 | +| RIL_USIM_CS_PS_INVALID | USIM卡在CS+PS下均无效 | +| RIL_ROM_SIM | 仿真SIM卡 | +| RIL_NO_USIM | USIM卡不存在 | + + +### RilSrvDomain + + +``` +enum RilSrvDomain +``` + +**描述:** + +系统服务域。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_NO_DOMAIN_SERVICE | 无服务 | +| RIL_CS_SERVICE | 仅CS服务 | +| RIL_PS_SERVICE | 仅分组(PS)服务 | +| RIL_CS_PS_SERVICE | CS+PS服务 | +| RIL_CS_PS_SEARCHING | CS、PS均未注册 | +| RIL_CDMA_NOT_SUPPORT | CDMA不支持 | + + +### RilSrvStatus + + +``` +enum RilSrvStatus +``` + +**描述:** + +Ril系统服务状态。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_NO_SRV_SERVICE | 无服务 | +| RIL_RESTRICTED_SERVICE | 有限制服务 | +| RIL_SERVICE_VALID | 服务有效 | +| RIL_REGIONAL_SERVICE | 有限制的区域服务 | +| RIL_ENERGY_SAVING_SERVICE | 省电和睡眠状态 | + + +### RilSysMode + + +``` +enum RilSysMode +``` + +**描述:** + +系统制式。 + + | 枚举值 | 描述 | +| -------- | -------- | +| RIL_NO_SYSMODE_SERVICE | 服务不存在 | +| RIL_GSM_MODE | 全球移动通信系统 (GSM) | +| RIL_CDMA_MODE | 码分多址(CDMA) | +| RIL_WCDMA_MODE | 宽带码分多址(WCDMA) | +| RIL_TDSCDMA_MODE | 时分同步码分多址(TDSCDMA) | +| RIL_WIMAX_MODE | 全球微波接入互操作性(WIMAX) | +| RIL_LTE_MODE | 长期演进(LTE) | +| RIL_LTE_CA_MODE | 载波聚合(CA) | +| RIL_NR_MODE | 5G新空口(NR) | + + +### SimpresentType + + +``` +enum SimpresentType +``` + +**描述:** + +表示号码是有卡时有效还是无卡时有效。 + + | 枚举值 | 描述 | +| -------- | -------- | +| TYPE_NO_CARD | 无卡时有效 | +| TYPE_HAS_CARD | 有卡时有效 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_ril_radio_response_info.md b/zh-cn/device-dev/reference/hdi-apis/_ril_radio_response_info.md new file mode 100644 index 0000000000000000000000000000000000000000..4dfc1d34da4ef1d864d5c4877e4ad49076d4f2d5 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ril_radio_response_info.md @@ -0,0 +1,77 @@ +# RilRadioResponseInfo + + +## 概述 + +响应通用信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [slotId](#slotid) | int
卡槽ID  | +| [flag](#flag) | int
响应标识  | +| [serial](#serial) | int
请求的序列号  | +| [error](#error) | enum [RilErrType](_ril.md#rilerrtype)
错误码  | +| [type](#type) | enum [RilResponseTypes](_ril.md#rilresponsetypes)
响应类型,具体查看[RilResponseTypes](_ril.md#rilresponsetypes) | + + +## 类成员变量说明 + + +### error + + +``` +enum RilErrType RilRadioResponseInfo::error +``` +**描述:** +错误码 + + +### flag + + +``` +int RilRadioResponseInfo::flag +``` +**描述:** +响应标识 + + +### serial + + +``` +int RilRadioResponseInfo::serial +``` +**描述:** +请求的序列号 + + +### slotId + + +``` +int RilRadioResponseInfo::slotId +``` +**描述:** +卡槽ID + + +### type + + +``` +enum RilResponseTypes RilRadioResponseInfo::type +``` +**描述:** +响应类型,具体查看[RilResponseTypes](_ril.md#rilresponsetypes) diff --git a/zh-cn/device-dev/reference/hdi-apis/_ril_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_ril_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..c615cf1657d723fed7b7f5b087374091c114e864 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ril_types_8idl.md @@ -0,0 +1,144 @@ +# Types.idl + + +## 概述 + +Ril模块HDI接口使用的数据类型。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [EmergencyCall](_emergency_call.md) | struct
紧急呼叫号码。 | +| [EmergencyInfoList](_emergency_info_list.md) | struct
紧急呼叫号码列表。 | +| [RilRadioResponseInfo](_ril_radio_response_info.md) | struct
响应通用信息。 | +| [SetupDataCallResultInfo](_setup_data_call_result_info.md) | struct
数据业务激活结果信息。 | +| [DataCallResultList](_data_call_result_list.md) | struct
数据业务激活结果列表。 | +| [DataProfileDataInfo](_data_profile_data_info.md) | struct
PDP上下文信息。 | +| [DataProfilesInfo](_data_profiles_info.md) | struct
PDP上下文信息列表。 | +| [DataCallInfo](_data_call_info.md) | struct
数据业务信息。 | +| [DataLinkBandwidthInfo](_data_link_bandwidth_info.md) | struct
网络频率信息。 | +| [DataLinkBandwidthReportingRule](_data_link_bandwidth_reporting_rule.md) | struct
网络频率上报规则。 | +| [DataPerformanceInfo](_data_performance_info.md) | struct
数据业务性能模式。 | +| [DataSleepInfo](_data_sleep_info.md) | struct
数据业务睡眠模式。 | +| [UniInfo](_uni_info.md) | struct
通用信息。 | +| [VoiceRadioTechnology](_voice_radio_technology.md) | struct
电路域接入技术。 | +| [DialInfo](_dial_info.md) | struct
拨号信息。 | +| [CallInfo](_call_info.md) | struct
通话状态信息。 | +| [CallInfoList](_call_info_list.md) | struct
通话状态信息列表。 | +| [GetClipResult](_get_clip_result.md) | struct
主叫号码显示结果信息。 | +| [GetClirResult](_get_clir_result.md) | struct
主叫号码显示限制结果信息。 | +| [CallWaitResult](_call_wait_result.md) | struct
呼叫等待结果信息。 | +| [CallRestrictionInfo](_call_restriction_info.md) | struct
呼叫限制信息。 | +| [CallRestrictionResult](_call_restriction_result.md) | struct
呼叫限制结果信息。 | +| [CallForwardSetInfo](_call_forward_set_info.md) | struct
呼叫转移信息。 | +| [CallForwardQueryResult](_call_forward_query_result.md) | struct
呼叫转移查询结果信息。 | +| [CallForwardQueryInfoList](_call_forward_query_info_list.md) | struct
呼叫转移信息列表。 | +| [UssdNoticeInfo](_ussd_notice_info.md) | struct
非结构化补充数据业务(USSD)业务信息。 | +| [SsNoticeInfo](_ss_notice_info.md) | struct
补充业务信息。 | +| [SrvccStatus](_srvcc_status.md) | struct
SRVCC(Single Radio Voice Call Continuity)状态信息。 | +| [RingbackVoice](_ringback_voice.md) | struct
回铃音信息。 | +| [DtmfInfo](_dtmf_info.md) | struct
发送双音多频(DTMF)信息。 | +| [SetBarringInfo](_set_barring_info.md) | struct
设置呼叫限制密码的信息。 | +| [CardStatusInfo](_card_status_info.md) | struct
SIM卡状态信息。 | +| [SimIoRequestInfo](_sim_io_request_info.md) | struct
SIM数据请求信息。 | +| [IccIoResultInfo](_icc_io_result_info.md) | struct
SIM数据的响应结果信息。 | +| [SimLockInfo](_sim_lock_info.md) | struct
SIM卡锁信息。 | +| [SimPasswordInfo](_sim_password_info.md) | struct
SIM卡密码信息。 | +| [SimPinInputTimes](_sim_pin_input_times.md) | struct
SIM密码输入次数信息。 | +| [ApduSimIORequestInfo](_apdu_sim_i_o_request_info.md) | struct
APDU数据传输请求信息。 | +| [SimAuthenticationRequestInfo](_sim_authentication_request_info.md) | struct
SIM卡鉴权请求信息。 | +| [OpenLogicalChannelResponse](_open_logical_channel_response.md) | struct
APDU打开逻辑通道响应信息。 | +| [LockStatusResp](_lock_status_resp.md) | struct
SIM卡解锁响应 | +| [RadioProtocol](_radio_protocol.md) | struct
主副卡协议栈信息。 | +| [GsmRssi](_gsm_rssi.md) | struct
GSM信号强度。 | +| [CdmaRssi](_cdma_rssi.md) | struct
CDMA信号强度。 | +| [WcdmaRssi](_wcdma_rssi.md) | struct
WCDMA信号强度。 | +| [LteRssi](_lte_rssi.md) | struct
LTE信号强度。 | +| [TdScdmaRssi](_td_scdma_rssi.md) | struct
TDSCDMA信号强度。 | +| [NrRssi](_nr_rssi.md) | struct
NR信号强度。 | +| [Rssi](_rssi.md) | struct
接收信号强度信息。 | +| [CsRegStatusInfo](_cs_reg_status_info.md) | struct
CS注册状态信息。 | +| [PsRegStatusInfo](_ps_reg_status_info.md) | struct
PS注册状态信息。 | +| [OperatorInfo](_operator_info.md) | struct
运营商信息。 | +| [AvailableNetworkInfo](_available_network_info.md) | struct
可用网络信息。 | +| [AvailableNetworkList](_available_network_list.md) | struct
可用网络列表。 | +| [SetNetworkModeInfo](_set_network_mode_info.md) | struct
设置网络模式信息。 | +| [CellListRatGsm](_cell_list_rat_gsm.md) | struct
GSM小区信息。 | +| [CellListRatLte](_cell_list_rat_lte.md) | struct
LTE小区信息。 | +| [CellListRatWcdma](_cell_list_rat_wcdma.md) | struct
WCDMA小区信息。 | +| [CellListRatCdma](_cell_list_rat_cdma.md) | struct
CDMA小区信息。 | +| [CellListRatTdscdma](_cell_list_rat_tdscdma.md) | struct
TDSCDMA小区信息。 | +| [CellListRatNr](_cell_list_rat_nr.md) | struct
NR小区信息。 | +| [ServiceCellParas](union_service_cell_paras.md) | union
多种网络模式的小区信息。 | +| [CellNearbyInfo](_cell_nearby_info.md) | struct
相邻小区信息。 | +| [CellListNearbyInfo](_cell_list_nearby_info.md) | struct
附近小区信息列表。 | +| [CellRatGsm](_cell_rat_gsm.md) | struct
GSM蜂窝信息。 | +| [CellRatLte](_cell_rat_lte.md) | struct
LTE蜂窝信息。 | +| [CellRatWcdma](_cell_rat_wcdma.md) | struct
WCDMA蜂窝信息。 | +| [CellRatCdma](_cell_rat_cdma.md) | struct
CDMA蜂窝信息。 | +| [CellRatTdscdma](_cell_rat_tdscdma.md) | struct
TDSCDMA蜂窝信息。 | +| [CellRatNr](_cell_rat_nr.md) | struct
NR蜂窝信息。 | +| [CurrentServiceCellParas](union_current_service_cell_paras.md) | union
当前蜂窝数据信息。 | +| [CurrentCellInfo](_current_cell_info.md) | struct
当前小区信息。 | +| [CellListCurrentInfo](_cell_list_current_info.md) | struct
当前小区信息列表。 | +| [PreferredNetworkTypeInfo](_preferred_network_type_info.md) | struct
首选网络类型信息。 | +| [PhysicalChannelConfig](_physical_channel_config.md) | struct
物理通道配置。 | +| [ChannelConfigInfoList](_channel_config_info_list.md) | struct
通道配置信息列表。 | +| [GsmSmsMessageInfo](_gsm_sms_message_info.md) | struct
发送GSM短信信息。 | +| [SendCdmaSmsMessageInfo](_send_cdma_sms_message_info.md) | struct
发送CDMA短信信息。 | +| [SmsMessageIOInfo](_sms_message_i_o_info.md) | struct
SIM卡短信信息 | +| [ServiceCenterAddress](_service_center_address.md) | struct
短信中心地址信息。 | +| [CBConfigInfo](_c_b_config_info.md) | struct
GSM小区广播配置信息。 | +| [CdmaCBConfigInfo](_cdma_c_b_config_info.md) | struct
CDMA小区广播配置信息。 | +| [CdmaCBConfigInfoList](_cdma_c_b_config_info_list.md) | struct
CDMA小区广播配置信息列表。 | +| [CBConfigReportInfo](_c_b_config_report_info.md) | struct
小区广播上报信息。 | +| [SmsMessageInfo](_sms_message_info.md) | struct
上报短信信息。 | +| [ModeData](_mode_data.md) | struct
接收短信处理模式。 | +| [SendSmsResultInfo](_send_sms_result_info.md) | struct
发送短信响应信息。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [EccType](_ril.md#ecctype) {
TYPE_CATEGORY = 0 , TYPE_POLICE = 1 , TYPE_AMBULANCE = 2 , TYPE_FIRE = 4 ,TYPE_SEA = 8 , TYPE_MOUNTAIN = 16
} | 紧急呼叫类型。 | +| [SimpresentType](_ril.md#simpresenttype) { TYPE_NO_CARD = 0 , TYPE_HAS_CARD = 1 } | 表示号码是有卡时有效还是无卡时有效。 | +| [AbnormalServiceType](_ril.md#abnormalservicetype) { TYPE_ALL = 0 , TYPE_ONLY_CS = 1 } | 表示号码有效性是否区分电路(CS)域非正常服务状态。 | +| [RilErrType](_ril.md#rilerrtype) {
NONE = 0 , RIL_ERR_GENERIC_FAILURE = 1 , RIL_ERR_INVALID_PARAMETER = 2 , RIL_ERR_MEMORY_FULL = 3 ,
RIL_ERR_CMD_SEND_FAILURE = 4 , RIL_ERR_CMD_NO_CARRIER = 5 , RIL_ERR_INVALID_RESPONSE = 6 , RIL_ERR_REPEAT_STATUS = 7 ,
RIL_ERR_NETWORK_SEARCHING = 8 , RIL_ERR_NETWORK_SEARCHING_INTERRUPTED = 9 , RIL_ERR_MODEM_DEVICE_CLOSE = 10 , RIL_ERR_NO_SIMCARD_INSERTED = 11 , RIL_ERR_NEED_PIN_CODE = 12 , RIL_ERR_NEED_PUK_CODE = 13 , RIL_ERR_NETWORK_SEARCH_TIMEOUT = 14 , RIL_ERR_PINPUK_PASSWORD_NOCORRECT = 15 ,
RIL_ERR_INVALID_MODEM_PARAMETER = 50 , RIL_ERR_HDF_IPC_FAILURE = 300 , RIL_ERR_NULL_POINT = 301 , RIL_ERR_VENDOR_NOT_IMPLEMENT = 302
} | Ril错误码。 | +| [RilResponseTypes](_ril.md#rilresponsetypes) {
RIL_RESPONSE_REQUEST = 0 , RIL_RESPONSE_NOTICE = 1 , RIL_RESPONSE_REQUEST_ACK = 2 , RIL_RESPONSE_REQUEST_MUST_ACK = 3 , RIL_RESPONSE_NOTICE_MUST_ACK = 4
} | 响应类型。 | +| [RilSrvStatus](_ril.md#rilsrvstatus) {
RIL_NO_SRV_SERVICE = 0 , RIL_RESTRICTED_SERVICE = 1 , RIL_SERVICE_VALID = 2 , RIL_REGIONAL_SERVICE = 3 , RIL_ENERGY_SAVING_SERVICE = 4
} | Ril系统服务状态。 | +| [RilSrvDomain](_ril.md#rilsrvdomain) {
RIL_NO_DOMAIN_SERVICE = 0 , RIL_CS_SERVICE = 1 , RIL_PS_SERVICE = 2 , RIL_CS_PS_SERVICE = 3 , RIL_CS_PS_SEARCHING = 4 , RIL_CDMA_NOT_SUPPORT = 255
} | 系统服务域。 | +| [RilRoamStatus](_ril.md#rilroamstatus) { RIL_NO_ROAM = 0 , RIL_ROAMING = 1 , RIL_ROAM_UNKNOWN = 2 } | 漫游状态。 | +| [RilSimLockStatus](_ril.md#rilsimlockstatus) { RIL_SIM_CARD_UNLOCK = 0 , RIL_SIM_CARD_LOCK = 1 } | SIM卡锁定状态。 | +| [RilSysMode](_ril.md#rilsysmode) {
RIL_NO_SYSMODE_SERVICE = 0 , RIL_GSM_MODE = 1 , RIL_CDMA_MODE = 2 , RIL_WCDMA_MODE = 3 , RIL_TDSCDMA_MODE = 4 , RIL_WIMAX_MODE = 5 , RIL_LTE_MODE = 6 , RIL_LTE_CA_MODE = 7 , RIL_NR_MODE = 8
} | 系统制式。 | +| [RilRadioTech](_ril.md#rilradiotech) {
RADIO_TECHNOLOGY_INVALID = 65535 , RADIO_TECHNOLOGY_UNKNOWN = 0 , RADIO_TECHNOLOGY_GSM = 1 , RADIO_TECHNOLOGY_1XRTT = 2 , RADIO_TECHNOLOGY_WCDMA = 3 , RADIO_TECHNOLOGY_HSPA = 4 , RADIO_TECHNOLOGY_HSPAP = 5 , RADIO_TECHNOLOGY_TD_SCDMA = 6 , RADIO_TECHNOLOGY_EVDO = 7 , RADIO_TECHNOLOGY_EHRPD = 8 , RADIO_TECHNOLOGY_LTE = 9 , RADIO_TECHNOLOGY_LTE_CA = 10 , RADIO_TECHNOLOGY_IWLAN = 11 , RADIO_TECHNOLOGY_NR = 12
} | 语音接入技术类型。 | +| [RilSimStatus](_ril.md#rilsimstatus) {
RIL_USIM_INVALID = 0 , RIL_USIM_VALID = 1 , RIL_USIM_CS_INVALID = 2 , RIL_USIM_PS_INVALID = 3 , RIL_USIM_CS_PS_INVALID = 4 , RIL_ROM_SIM = 240 , RIL_NO_USIM = 255
} | SIM卡状态。 | +| [RilRegStatus](_ril.md#rilregstatus) {
NO_REG_MT_NO_SEARCH = 0 , REG_MT_HOME = 1 , NO_REG_MT_SEARCHING = 2 , REG_MT_REJECTED = 3 , REG_MT_UNKNOWN = 4 , REG_MT_ROAMING = 5 , REG_MT_EMERGENCY = 6
} | 描述网络注册状态。 | +| [RilCellConnectionStatus](_ril.md#rilcellconnectionstatus) { RIL_SERVING_CELL_UNKNOWN = 0 , RIL_SERVING_CELL_PRIMARY = 1 , RIL_SERVING_CELL_SECONDARY = 2 } | 小区连接状态。 | +| [RilRegNotifyMode](_ril.md#rilregnotifymode) { REG_NOT_NOTIFY = 0 , REG_NOTIFY_STAT_ONLY = 1 , REG_NOTIFY_STAT_LAC_CELLID = 2 } | 上报模式。 | +| [RadioProtocolPhase](_ril.md#radioprotocolphase) {
RADIO_PROTOCOL_PHASE_INITIAL , RADIO_PROTOCOL_PHASE_CHECK , RADIO_PROTOCOL_PHASE_UPDATE , RADIO_PROTOCOL_PHASE_NOTIFY , RADIO_PROTOCOL_PHASE_COMPLETE
} | 设置Radio协议动作参数。 | +| [RadioProtocolStatus](_ril.md#radioprotocolstatus) { RADIO_PROTOCOL_STATUS_NONE , RADIO_PROTOCOL_STATUS_SUCCESS , RADIO_PROTOCOL_STATUS_FAIL } | Radio协议状态。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.ril.v1_0 | Ril模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_ringback_voice.md b/zh-cn/device-dev/reference/hdi-apis/_ringback_voice.md new file mode 100644 index 0000000000000000000000000000000000000000..e46ef5818f627416f6909b38d160c43359dbe7a2 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ringback_voice.md @@ -0,0 +1,37 @@ +# RingbackVoice + + +## 概述 + +回铃音信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [status](#status) | int
回铃音状态 | + + +## 类成员变量说明 + + +### status + + +``` +int RingbackVoice::status +``` +**描述:** +回铃音状态 + +- 0:网络回铃音 + +- 1:本地回铃音 diff --git a/zh-cn/device-dev/reference/hdi-apis/_rsqrt.md b/zh-cn/device-dev/reference/hdi-apis/_rsqrt.md new file mode 100644 index 0000000000000000000000000000000000000000..e99190b00edbe563e1b2136a54f2b0b4ea516a4d --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_rsqrt.md @@ -0,0 +1,28 @@ +# Rsqrt + + +## 概述 + +求x的平方根的倒数。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_RSQRT。 + +输入: + +- x,n维输入tensor,input中的每个元素不能小于0,n<8。 + +输出: + +- output,n维输出tensor,output的shape和数据类型和input相同。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_rssi.md b/zh-cn/device-dev/reference/hdi-apis/_rssi.md new file mode 100644 index 0000000000000000000000000000000000000000..ff248ff2828ef023aee0315ca6746311651b0e89 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_rssi.md @@ -0,0 +1,88 @@ +# Rssi + + +## 概述 + +接收信号强度信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [gw](#gw) | struct [GsmRssi](_gsm_rssi.md)
GSM信号强度信息,具体查看[GsmRssi](_gsm_rssi.md) | +| [cdma](#cdma) | struct [CdmaRssi](_cdma_rssi.md)
CDMA信号强度信息,具体查看[CdmaRssi](_cdma_rssi.md) | +| [wcdma](#wcdma) | struct [WcdmaRssi](_wcdma_rssi.md)
WCDMA信号强度信息,具体查看[WcdmaRssi](_wcdma_rssi.md) | +| [lte](#lte) | struct [LteRssi](_lte_rssi.md)
LTE信号强度信息,具体查看[LteRssi](_lte_rssi.md) | +| [tdScdma](#tdscdma) | struct [TdScdmaRssi](_td_scdma_rssi.md)
TDSCDMA信号强度信息,具体查看[TdScdmaRssi](_td_scdma_rssi.md) | +| [nr](#nr) | struct [NrRssi](_nr_rssi.md)
NR信号强度信息,具体查看[NrRssi](_nr_rssi.md) | + + +## 类成员变量说明 + + +### cdma + + +``` +struct CdmaRssi Rssi::cdma +``` +**描述:** +CDMA信号强度信息,具体查看[CdmaRssi](_cdma_rssi.md) + + +### gw + + +``` +struct GsmRssi Rssi::gw +``` +**描述:** +GSM信号强度信息,具体查看[GsmRssi](_gsm_rssi.md) + + +### lte + + +``` +struct LteRssi Rssi::lte +``` +**描述:** +LTE信号强度信息,具体查看[LteRssi](_lte_rssi.md) + + +### nr + + +``` +struct NrRssi Rssi::nr +``` +**描述:** +NR信号强度信息,具体查看[NrRssi](_nr_rssi.md) + + +### tdScdma + + +``` +struct TdScdmaRssi Rssi::tdScdma +``` +**描述:** +TDSCDMA信号强度信息,具体查看[TdScdmaRssi](_td_scdma_rssi.md) + + +### wcdma + + +``` +struct WcdmaRssi Rssi::wcdma +``` +**描述:** +WCDMA信号强度信息,具体查看[WcdmaRssi](_wcdma_rssi.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_scale_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_scale_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..77863d5a5b9caf2f17ee9c845ddfa4bb0e1f814c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_scale_fusion.md @@ -0,0 +1,62 @@ +# ScaleFusion + + +## 概述 + +给定一个tensor,计算其缩放后的值。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SCALE_FUSION。 + +输入: + +- x,n维tensor。 + +- scale,缩放tensor。 + +- bias,偏置tensor。 + +输出: + +- output, scale的计算结果,一个n维tensor,类型和x一致,shape由axis决定。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long
指定缩放的维度。  | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType ScaleFusion::activationType +``` +**描述:** +激活函数,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 + + +### axis + + +``` +long ScaleFusion::axis +``` +**描述:** +指定缩放的维度。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_schedule_info.md b/zh-cn/device-dev/reference/hdi-apis/_schedule_info.md index 3c44bee576d39e82ce87ee18ad846d0761c5866f..b7feb844ca1fde9bb8b98054d87cca4caf557aa2 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_schedule_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_schedule_info.md @@ -1,39 +1,39 @@ # ScheduleInfo -## **概述** +## 概述 调度信息。 -**Since:** +**Since:** 3.2 -**Version:** +**Version:** 1.0 -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [scheduleId](#scheduleid) | 调度ID,用于标识一次操作请求的执行器调度过程。 | -| [templateIds](#templateids) | 模版ID列表。 | -| [authType](#authtype) | 用户认证凭据类型。 | -| [executorMatcher](#executormatcher) | 执行器匹配器。 | -| [scheduleMode](#schedulemode) | 调度模式,支持注册、认证和识别模式。 | -| [executors](#executors) | 执行器信息列表。 | +| [scheduleId](#scheduleid) | unsigned long
调度ID,用于标识一次操作请求的执行器调度过程。 | +| [templateIds](#templateids) | unsigned long[]
模版id列表。 | +| [authType](#authtype) | enum [AuthType](_hdf_user_auth.md#authtype)
用户认证凭据类型。 | +| [executorMatcher](#executormatcher) | unsigned int
执行器匹配器。 | +| [scheduleMode](#schedulemode) | unsigned int
调度模式,支持注册、认证和识别模式。 | +| [executors](#executors) | struct [ExecutorInfo](_executor_info_userauth.md)[]
执行器信息列表。 | -## **类成员变量说明** +## 类成员变量说明 ### authType @@ -43,33 +43,33 @@ enum AuthType ScheduleInfo::authType ``` -**描述:** +**描述:** -用户认证凭据类型。 +用户认证凭据类型[AuthType](_hdf_user_auth.md#authtype)。 -### executors +### executorMatcher ``` -struct ExecutorInfo [] ScheduleInfo::executors +unsigned int ScheduleInfo::executorMatcher ``` -**描述:** +**描述:** -执行器信息列表。 +执行器匹配器。 -### executorMatcher +### executors ``` -unsigned int ScheduleInfo::executorMatcher +struct ExecutorInfo [] ScheduleInfo::executors ``` -**描述:** +**描述:** -执行器匹配器。 +执行器信息列表[ExecutorInfo](_executor_info_userauth.md)。 ### scheduleId @@ -79,7 +79,7 @@ unsigned int ScheduleInfo::executorMatcher unsigned long ScheduleInfo::scheduleId ``` -**描述:** +**描述:** 调度ID,用于标识一次操作请求的执行器调度过程。 @@ -91,7 +91,7 @@ unsigned long ScheduleInfo::scheduleId unsigned int ScheduleInfo::scheduleMode ``` -**描述:** +**描述:** 调度模式,支持注册、认证和识别模式。 @@ -103,6 +103,6 @@ unsigned int ScheduleInfo::scheduleMode unsigned long [] ScheduleInfo::templateIds ``` -**描述:** +**描述:** -模版ID列表。 +模版id列表。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_send_cdma_sms_message_info.md b/zh-cn/device-dev/reference/hdi-apis/_send_cdma_sms_message_info.md new file mode 100644 index 0000000000000000000000000000000000000000..7899e41e29911240708909c89a3d0577ac875067 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_send_cdma_sms_message_info.md @@ -0,0 +1,55 @@ +# SendCdmaSmsMessageInfo + + +## 概述 + +发送CDMA短信信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [state](#state) | int
状态  | +| [smscPdu](#smscpdu) | String
短信业务中心  | + + +## 类成员变量说明 + + +### serial + + +``` +int SendCdmaSmsMessageInfo::serial +``` +**描述:** +请求的序列号 + + +### smscPdu + + +``` +String SendCdmaSmsMessageInfo::smscPdu +``` +**描述:** +短信业务中心 + + +### state + + +``` +int SendCdmaSmsMessageInfo::state +``` +**描述:** +状态 diff --git a/zh-cn/device-dev/reference/hdi-apis/_send_sms_result_info.md b/zh-cn/device-dev/reference/hdi-apis/_send_sms_result_info.md new file mode 100644 index 0000000000000000000000000000000000000000..51d2da5ea3a7ed20bd9761a0916fc954196e06c3 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_send_sms_result_info.md @@ -0,0 +1,66 @@ +# SendSmsResultInfo + + +## 概述 + +发送短信响应信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [msgRef](#msgref) | int
信息参考号  | +| [pdu](#pdu) | String
协议数据单元  | +| [errCode](#errcode) | int
错误码  | +| [flag](#flag) | int
短信响应标识  | + + +## 类成员变量说明 + + +### errCode + + +``` +int SendSmsResultInfo::errCode +``` +**描述:** +错误码 + + +### flag + + +``` +int SendSmsResultInfo::flag +``` +**描述:** +短信响应标识 + + +### msgRef + + +``` +int SendSmsResultInfo::msgRef +``` +**描述:** +信息参考号 + + +### pdu + + +``` +String SendSmsResultInfo::pdu +``` +**描述:** +协议数据单元 diff --git a/zh-cn/device-dev/reference/hdi-apis/sensor.md b/zh-cn/device-dev/reference/hdi-apis/_sensor.md similarity index 57% rename from zh-cn/device-dev/reference/hdi-apis/sensor.md rename to zh-cn/device-dev/reference/hdi-apis/_sensor.md index 5c37da3a27dd00fe925aba5de15f35a8a52d1a88..6f3eaf788e73bffada2fe60dba3958b748f22cff 100644 --- a/zh-cn/device-dev/reference/hdi-apis/sensor.md +++ b/zh-cn/device-dev/reference/hdi-apis/_sensor.md @@ -1,22 +1,24 @@ # Sensor -## **概述** +## 概述 传感器设备驱动对传感器服务提供通用的接口能力。 -模块提供传感器服务对传感器驱动访问统一接口,服务获取驱动对象或者代理后,通过其提供的各类方法,以传感器ID区分访问不同类型传感器设备,实现获取传感器设备信息、订阅/取消订阅传感器数据、 使能/去使能传感器、设置传感器模式、设置传感器精度、量程等可选配置等。 +模块提供传感器服务对传感器驱动访问统一接口,服务获取驱动对象或者代理后,通过其提供的各类方法, 以传感器ID区分访问不同类型传感器设备,实现获取传感器设备信息、订阅/取消订阅传感器数据、 使能/去使能传感器、设置传感器模式、设置传感器精度、量程等可选配置等。 -**Since**: +**Since:** 2.2 -**Version**: +**Version:** 1.0 +**Since:** -## **汇总** + +## 汇总 ### 文件 @@ -24,7 +26,7 @@ | 名称 | 描述 | | -------- | -------- | | [ISensorCallback.idl](_i_sensor_callback_8idl.md) | Sensor模块为Sensor服务提供数据上报的回调函数。 | -| [ISensorInterface.idl](_i_sensor_interface_8idl.md) | Sensor模块对外通用的接口声明文件,提供获取传感器设备信息、订阅/取消订阅传感器数据、使能/去使能传感器、设置传感器模式、设置传感器精度,量程等可选配置接口定义。 | +| [ISensorInterface.idl](_i_sensor_interface_8idl.md) | Sensor模块对外通用的接口声明文件,提供获取传感器设备信息、订阅/取消订阅传感器数据、 使能/去使能传感器、设置传感器模式、设置传感器精度,量程等可选配置接口定义。 | | [SensorTypes.idl](_sensor_types_8idl.md) | 定义传感器模块所使用的传感器类型,传感器信息,传感器数据结构等数据类型。 | @@ -32,19 +34,19 @@ | 名称 | 描述 | | -------- | -------- | -| [ISensorCallback](interface_i_sensor_callback.md) | 定义用于上报传感器数据的回调函数。 | -| [ISensorInterface](interface_i_sensor_interface.md) | 提供Sensor设备基本控制操作接口。 | -| [HdfSensorInformation](_hdf_sensor_information.md) | 定义传感器的基本信息。 | -| [HdfSensorEvents](_hdf_sensor_events.md) | 定义传感器上报的数据。 | +| [ISensorCallback](interface_i_sensor_callback.md) | interface
定义用于上报传感器数据的回调函数。 | +| [ISensorInterface](interface_i_sensor_interface.md) | interface
提供Sensor设备基本控制操作接口。 | +| [HdfSensorInformation](_hdf_sensor_information.md) | struct
定义传感器的基本信息。 | +| [HdfSensorEvents](_hdf_sensor_events.md) | struct
定义传感器上报的数据。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [HdfSensorTypeTag](#hdfsensortypetag) {   HDF_SENSOR_TYPE_NONE = 0, HDF_SENSOR_TYPE_ACCELEROMETER = 1, HDF_SENSOR_TYPE_GYROSCOPE = 2, HDF_SENSOR_TYPE_PHOTOPLETHYSMOGRAPH = 3,   HDF_SENSOR_TYPE_ELECTROCARDIOGRAPH = 4, HDF_SENSOR_TYPE_AMBIENT_LIGHT = 5, HDF_SENSOR_TYPE_MAGNETIC_FIELD = 6, HDF_SENSOR_TYPE_CAPACITIVE = 7,   HDF_SENSOR_TYPE_BAROMETER = 8, HDF_SENSOR_TYPE_TEMPERATURE = 9, HDF_SENSOR_TYPE_HALL = 10, HDF_SENSOR_TYPE_GESTURE = 11,   HDF_SENSOR_TYPE_PROXIMITY = 12, HDF_SENSOR_TYPE_HUMIDITY = 13, HDF_SENSOR_TYPE_MEDICAL_BEGIN = 128, HDF_SENSOR_TYPE_MEDICAL_END = 160,   HDF_SENSOR_TYPE_PHYSICAL_MAX = 255, HDF_SENSOR_TYPE_ORIENTATION = 256, HDF_SENSOR_TYPE_GRAVITY = 257, HDF_SENSOR_TYPE_LINEAR_ACCELERATION = 258,   HDF_SENSOR_TYPE_ROTATION_VECTOR = 259, HDF_SENSOR_TYPE_AMBIENT_TEMPERATURE = 260, HDF_SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 261, HDF_SENSOR_TYPE_GAME_ROTATION_VECTOR = 262,   HDF_SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 263, HDF_SENSOR_TYPE_SIGNIFICANT_MOTION = 264, HDF_SENSOR_TYPE_PEDOMETER_DETECTION = 265, HDF_SENSOR_TYPE_PEDOMETER = 266,   HDF_SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 277, HDF_SENSOR_TYPE_HEART_RATE = 278, HDF_SENSOR_TYPE_DEVICE_ORIENTATION = 279, HDF_SENSOR_TYPE_WEAR_DETECTION = 280,   HDF_SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 281, HDF_SENSOR_TYPE_MAX } | 定义传感器类型标识。 | +| [HdfSensorTypeTag](#hdfsensortypetag) { HDF_SENSOR_TYPE_NONE = 0, HDF_SENSOR_TYPE_ACCELEROMETER = 1, HDF_SENSOR_TYPE_GYROSCOPE = 2, HDF_SENSOR_TYPE_PHOTOPLETHYSMOGRAPH = 3,   HDF_SENSOR_TYPE_ELECTROCARDIOGRAPH = 4, HDF_SENSOR_TYPE_AMBIENT_LIGHT = 5, HDF_SENSOR_TYPE_MAGNETIC_FIELD = 6, HDF_SENSOR_TYPE_CAPACITIVE = 7,   HDF_SENSOR_TYPE_BAROMETER = 8, HDF_SENSOR_TYPE_TEMPERATURE = 9, HDF_SENSOR_TYPE_HALL = 10, HDF_SENSOR_TYPE_GESTURE = 11,   HDF_SENSOR_TYPE_PROXIMITY = 12, HDF_SENSOR_TYPE_HUMIDITY = 13, HDF_SENSOR_TYPE_MEDICAL_BEGIN = 128, HDF_SENSOR_TYPE_MEDICAL_END = 160,   HDF_SENSOR_TYPE_PHYSICAL_MAX = 255, HDF_SENSOR_TYPE_ORIENTATION = 256, HDF_SENSOR_TYPE_GRAVITY = 257, HDF_SENSOR_TYPE_LINEAR_ACCELERATION = 258,   HDF_SENSOR_TYPE_ROTATION_VECTOR = 259, HDF_SENSOR_TYPE_AMBIENT_TEMPERATURE = 260, HDF_SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 261, HDF_SENSOR_TYPE_GAME_ROTATION_VECTOR = 262,   HDF_SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 263, HDF_SENSOR_TYPE_SIGNIFICANT_MOTION = 264, HDF_SENSOR_TYPE_PEDOMETER_DETECTION = 265, HDF_SENSOR_TYPE_PEDOMETER = 266,   HDF_SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 277, HDF_SENSOR_TYPE_HEART_RATE = 278, HDF_SENSOR_TYPE_DEVICE_ORIENTATION = 279, HDF_SENSOR_TYPE_WEAR_DETECTION = 280,   HDF_SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 281, HDF_SENSOR_TYPE_MAX } | 定义传感器类型标识。 | | [HdfSensorGroupType](#hdfsensorgrouptype) { HDF_TRADITIONAL_SENSOR_TYPE = 0, HDF_MEDICAL_SENSOR_TYPE = 1, HDF_SENSOR_GROUP_TYPE_MAX } | 枚举传感器的硬件服务组。 | -| [HdfSensorModeType](#hdfsensormodetype) {   SENSOR_MODE_DEFAULT = 0, SENSOR_MODE_REALTIME = 1, SENSOR_MODE_ON_CHANGE = 2, SENSOR_MODE_ONE_SHOT = 3,   SENSOR_MODE_FIFO_MODE = 4, SENSOR_MODE_MAX } | 传感器的工作模式。 | +| [HdfSensorModeType](#hdfsensormodetype) { SENSOR_MODE_DEFAULT = 0, SENSOR_MODE_REALTIME = 1, SENSOR_MODE_ON_CHANGE = 2, SENSOR_MODE_ONE_SHOT = 3,   SENSOR_MODE_FIFO_MODE = 4, SENSOR_MODE_MAX } | 传感器的工作模式。 | ### 关键字 @@ -54,7 +56,7 @@ | package ohos.hdi.sensor.v1_0 | Sensor模块接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### HdfSensorGroupType @@ -64,7 +66,7 @@ enum HdfSensorGroupType ``` -**描述:** +**描述:** 枚举传感器的硬件服务组。 @@ -82,7 +84,7 @@ enum HdfSensorGroupType enum HdfSensorModeType ``` -**描述:** +**描述:** 传感器的工作模式。 @@ -103,7 +105,7 @@ enum HdfSensorModeType enum HdfSensorTypeTag ``` -**描述:** +**描述:** 定义传感器类型标识。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sensor_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_sensor_types_8idl.md index 8eadb3a7c36ddf82a854b6a9e9c264e2abf80b9b..ffbc007a5d5160ad22d263cf5aed0ebaeeebd15b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_sensor_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_sensor_types_8idl.md @@ -1,7 +1,7 @@ # SensorTypes.idl -## **概述** +## 概述 定义传感器模块所使用的传感器类型,传感器信息,传感器数据结构等数据类型。 @@ -15,27 +15,27 @@ **相关模块:** -[Sensor](sensor.md) +[Sensor](_sensor.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [HdfSensorInformation](_hdf_sensor_information.md) | 定义传感器的基本信息。 | -| [HdfSensorEvents](_hdf_sensor_events.md) | 定义传感器上报的数据。 | +| [HdfSensorInformation](_hdf_sensor_information.md) | struct
定义传感器的基本信息。 | +| [HdfSensorEvents](_hdf_sensor_events.md) | struct
定义传感器上报的数据。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [HdfSensorTypeTag](sensor.md#hdfsensortypetag) {   HDF_SENSOR_TYPE_NONE = 0, HDF_SENSOR_TYPE_ACCELEROMETER = 1, HDF_SENSOR_TYPE_GYROSCOPE = 2, HDF_SENSOR_TYPE_PHOTOPLETHYSMOGRAPH = 3,   HDF_SENSOR_TYPE_ELECTROCARDIOGRAPH = 4, HDF_SENSOR_TYPE_AMBIENT_LIGHT = 5, HDF_SENSOR_TYPE_MAGNETIC_FIELD = 6, HDF_SENSOR_TYPE_CAPACITIVE = 7,   HDF_SENSOR_TYPE_BAROMETER = 8, HDF_SENSOR_TYPE_TEMPERATURE = 9, HDF_SENSOR_TYPE_HALL = 10, HDF_SENSOR_TYPE_GESTURE = 11,   HDF_SENSOR_TYPE_PROXIMITY = 12, HDF_SENSOR_TYPE_HUMIDITY = 13, HDF_SENSOR_TYPE_MEDICAL_BEGIN = 128, HDF_SENSOR_TYPE_MEDICAL_END = 160,   HDF_SENSOR_TYPE_PHYSICAL_MAX = 255, HDF_SENSOR_TYPE_ORIENTATION = 256, HDF_SENSOR_TYPE_GRAVITY = 257, HDF_SENSOR_TYPE_LINEAR_ACCELERATION = 258,   HDF_SENSOR_TYPE_ROTATION_VECTOR = 259, HDF_SENSOR_TYPE_AMBIENT_TEMPERATURE = 260, HDF_SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 261, HDF_SENSOR_TYPE_GAME_ROTATION_VECTOR = 262,   HDF_SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 263, HDF_SENSOR_TYPE_SIGNIFICANT_MOTION = 264, HDF_SENSOR_TYPE_PEDOMETER_DETECTION = 265, HDF_SENSOR_TYPE_PEDOMETER = 266,   HDF_SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 277, HDF_SENSOR_TYPE_HEART_RATE = 278, HDF_SENSOR_TYPE_DEVICE_ORIENTATION = 279, HDF_SENSOR_TYPE_WEAR_DETECTION = 280,   HDF_SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 281, HDF_SENSOR_TYPE_MAX } | 定义传感器类型标识。 | -| [HdfSensorGroupType](sensor.md#hdfsensorgrouptype) { HDF_TRADITIONAL_SENSOR_TYPE = 0, HDF_MEDICAL_SENSOR_TYPE = 1, HDF_SENSOR_GROUP_TYPE_MAX } | 枚举传感器的硬件服务组。 | -| [HdfSensorModeType](sensor.md#hdfsensormodetype) {   SENSOR_MODE_DEFAULT = 0, SENSOR_MODE_REALTIME = 1, SENSOR_MODE_ON_CHANGE = 2, SENSOR_MODE_ONE_SHOT = 3,   SENSOR_MODE_FIFO_MODE = 4, SENSOR_MODE_MAX } | 传感器的工作模式。 | +| [HdfSensorTypeTag](_sensor.md#hdfsensortypetag) { HDF_SENSOR_TYPE_NONE = 0, HDF_SENSOR_TYPE_ACCELEROMETER = 1, HDF_SENSOR_TYPE_GYROSCOPE = 2, HDF_SENSOR_TYPE_PHOTOPLETHYSMOGRAPH = 3,   HDF_SENSOR_TYPE_ELECTROCARDIOGRAPH = 4, HDF_SENSOR_TYPE_AMBIENT_LIGHT = 5, HDF_SENSOR_TYPE_MAGNETIC_FIELD = 6, HDF_SENSOR_TYPE_CAPACITIVE = 7,   HDF_SENSOR_TYPE_BAROMETER = 8, HDF_SENSOR_TYPE_TEMPERATURE = 9, HDF_SENSOR_TYPE_HALL = 10, HDF_SENSOR_TYPE_GESTURE = 11,   HDF_SENSOR_TYPE_PROXIMITY = 12, HDF_SENSOR_TYPE_HUMIDITY = 13, HDF_SENSOR_TYPE_MEDICAL_BEGIN = 128, HDF_SENSOR_TYPE_MEDICAL_END = 160,   HDF_SENSOR_TYPE_PHYSICAL_MAX = 255, HDF_SENSOR_TYPE_ORIENTATION = 256, HDF_SENSOR_TYPE_GRAVITY = 257, HDF_SENSOR_TYPE_LINEAR_ACCELERATION = 258,   HDF_SENSOR_TYPE_ROTATION_VECTOR = 259, HDF_SENSOR_TYPE_AMBIENT_TEMPERATURE = 260, HDF_SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 261, HDF_SENSOR_TYPE_GAME_ROTATION_VECTOR = 262,   HDF_SENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 263, HDF_SENSOR_TYPE_SIGNIFICANT_MOTION = 264, HDF_SENSOR_TYPE_PEDOMETER_DETECTION = 265, HDF_SENSOR_TYPE_PEDOMETER = 266,   HDF_SENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 277, HDF_SENSOR_TYPE_HEART_RATE = 278, HDF_SENSOR_TYPE_DEVICE_ORIENTATION = 279, HDF_SENSOR_TYPE_WEAR_DETECTION = 280,   HDF_SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 281, HDF_SENSOR_TYPE_MAX } | 定义传感器类型标识。 | +| [HdfSensorGroupType](_sensor.md#hdfsensorgrouptype) { HDF_TRADITIONAL_SENSOR_TYPE = 0, HDF_MEDICAL_SENSOR_TYPE = 1, HDF_SENSOR_GROUP_TYPE_MAX } | 枚举传感器的硬件服务组。 | +| [HdfSensorModeType](_sensor.md#hdfsensormodetype) { SENSOR_MODE_DEFAULT = 0, SENSOR_MODE_REALTIME = 1, SENSOR_MODE_ON_CHANGE = 2, SENSOR_MODE_ONE_SHOT = 3,   SENSOR_MODE_FIFO_MODE = 4, SENSOR_MODE_MAX } | 传感器的工作模式。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_service_center_address.md b/zh-cn/device-dev/reference/hdi-apis/_service_center_address.md new file mode 100644 index 0000000000000000000000000000000000000000..dff3fa05dc281d6192dfc1fe1f607af5bf87468e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_service_center_address.md @@ -0,0 +1,55 @@ +# ServiceCenterAddress + + +## 概述 + +短信中心地址信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [tosca](#tosca) | int
短信中心地址类型,参考3GPP TS 24.011 [6]  | +| [address](#address) | String
短信中心地址,参考3GPP TS 24.011 [6]  | + + +## 类成员变量说明 + + +### address + + +``` +String ServiceCenterAddress::address +``` +**描述:** +短信中心地址,参考3GPP TS 24.011 [6] + + +### serial + + +``` +int ServiceCenterAddress::serial +``` +**描述:** +请求的序列号 + + +### tosca + + +``` +int ServiceCenterAddress::tosca +``` +**描述:** +短信中心地址类型,参考3GPP TS 24.011 [6] diff --git a/zh-cn/device-dev/reference/hdi-apis/_set_barring_info.md b/zh-cn/device-dev/reference/hdi-apis/_set_barring_info.md new file mode 100644 index 0000000000000000000000000000000000000000..0c27f2b6329d3803230cc0fb96ba19b8bbb5beeb --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_set_barring_info.md @@ -0,0 +1,55 @@ +# SetBarringInfo + + +## 概述 + +设置呼叫限制密码的信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [fac](#fac) | String
操作对象  | +| [oldPassword](#oldpassword) | String
旧密码  | +| [newPassword](#newpassword) | String
新密码  | + + +## 类成员变量说明 + + +### fac + + +``` +String SetBarringInfo::fac +``` +**描述:** +操作对象 + + +### newPassword + + +``` +String SetBarringInfo::newPassword +``` +**描述:** +新密码 + + +### oldPassword + + +``` +String SetBarringInfo::oldPassword +``` +**描述:** +旧密码 diff --git a/zh-cn/device-dev/reference/hdi-apis/_set_network_mode_info.md b/zh-cn/device-dev/reference/hdi-apis/_set_network_mode_info.md new file mode 100644 index 0000000000000000000000000000000000000000..1ab1fea6e19faf7c21b2496a23784a88e3f3bc52 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_set_network_mode_info.md @@ -0,0 +1,55 @@ +# SetNetworkModeInfo + + +## 概述 + +设置网络模式信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [selectMode](#selectmode) | int
网络模式,具体查看[PreferredNetworkTypeInfo](_preferred_network_type_info.md) | +| [oper](#oper) | String
网络运营商  | +| [flag](#flag) | int
标志  | + + +## 类成员变量说明 + + +### flag + + +``` +int SetNetworkModeInfo::flag +``` +**描述:** +标志 + + +### oper + + +``` +String SetNetworkModeInfo::oper +``` +**描述:** +网络运营商 + + +### selectMode + + +``` +int SetNetworkModeInfo::selectMode +``` +**描述:** +网络模式,具体查看[PreferredNetworkTypeInfo](_preferred_network_type_info.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_setup_data_call_result_info.md b/zh-cn/device-dev/reference/hdi-apis/_setup_data_call_result_info.md new file mode 100644 index 0000000000000000000000000000000000000000..1fa7bb87d0fe15a2a55ef77e7d0a9d351fc28bc6 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_setup_data_call_result_info.md @@ -0,0 +1,187 @@ +# SetupDataCallResultInfo + + +## 概述 + +数据业务激活结果信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [flag](#flag) | int
激活结果信息标识  | +| [reason](#reason) | int
数据业务激活失败原因码,参考3GPP TS 24.008  | +| [retryTime](#retrytime) | int
数据业务激活重试次数  | +| [cid](#cid) | int
分组报文协议(PDP)上下文标识符  | +| [active](#active) | int
是否激活成功,0表示激活失败,1表示激活成功  | +| [maxTransferUnit](#maxtransferunit) | int
最大传输数据单元  | +| [pduSessionId](#pdusessionid) | int
数据单元标识  | +| [type](#type) | String
数据业务类型,“default”表示默认数据业务,“mms”表示彩信数据业务  | +| [netPortName](#netportname) | String
网络设备名称  | +| [address](#address) | String
网络地址  | +| [dns](#dns) | String
域名服务地址  | +| [dnsSec](#dnssec) | String
备用域名服务地址  | +| [gateway](#gateway) | String
网关地址  | +| [pCscfPrimAddr](#pcscfprimaddr) | String
首选代理呼叫控制功能模块(P-CSCF)地址  | +| [pCscfSecAddr](#pcscfsecaddr) | String
备用P-CSCF地址  | + + +## 类成员变量说明 + + +### active + + +``` +int SetupDataCallResultInfo::active +``` +**描述:** +是否激活成功,0表示激活失败,1表示激活成功 + + +### address + + +``` +String SetupDataCallResultInfo::address +``` +**描述:** +网络地址 + + +### cid + + +``` +int SetupDataCallResultInfo::cid +``` +**描述:** +分组报文协议(PDP)上下文标识符 + + +### dns + + +``` +String SetupDataCallResultInfo::dns +``` +**描述:** +域名服务地址 + + +### dnsSec + + +``` +String SetupDataCallResultInfo::dnsSec +``` +**描述:** +备用域名服务地址 + + +### flag + + +``` +int SetupDataCallResultInfo::flag +``` +**描述:** +激活结果信息标识 + + +### gateway + + +``` +String SetupDataCallResultInfo::gateway +``` +**描述:** +网关地址 + + +### maxTransferUnit + + +``` +int SetupDataCallResultInfo::maxTransferUnit +``` +**描述:** +最大传输数据单元 + + +### netPortName + + +``` +String SetupDataCallResultInfo::netPortName +``` +**描述:** +网络设备名称 + + +### pCscfPrimAddr + + +``` +String SetupDataCallResultInfo::pCscfPrimAddr +``` +**描述:** +首选代理呼叫控制功能模块(P-CSCF)地址 + + +### pCscfSecAddr + + +``` +String SetupDataCallResultInfo::pCscfSecAddr +``` +**描述:** +备用P-CSCF地址 + + +### pduSessionId + + +``` +int SetupDataCallResultInfo::pduSessionId +``` +**描述:** +数据单元标识 + + +### reason + + +``` +int SetupDataCallResultInfo::reason +``` +**描述:** +数据业务激活失败原因码,参考3GPP TS 24.008 + + +### retryTime + + +``` +int SetupDataCallResultInfo::retryTime +``` +**描述:** +数据业务激活重试次数 + + +### type + + +``` +String SetupDataCallResultInfo::type +``` +**描述:** +数据业务类型,“default”表示默认数据业务,“mms”表示彩信数据业务 diff --git a/zh-cn/device-dev/reference/hdi-apis/_shape.md b/zh-cn/device-dev/reference/hdi-apis/_shape.md new file mode 100644 index 0000000000000000000000000000000000000000..1d412e84de4c4d361787eead6c95754ae36d2806 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_shape.md @@ -0,0 +1,24 @@ +# Shape + + +## 概述 + +输出输入tensor的形状。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SHAPE。 + +输入: + +- x,n维tensor + +输出: + +- output,输出x的维度,一个整型数组。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_shared_buffer.md b/zh-cn/device-dev/reference/hdi-apis/_shared_buffer.md new file mode 100644 index 0000000000000000000000000000000000000000..a220872c9c91b6c98783c8677dfa5d32bfb2b760 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_shared_buffer.md @@ -0,0 +1,70 @@ +# SharedBuffer + + +## 概述 + +共享内存数据的结构体。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [fd](#fd) | FileDescriptor
共享内存的文件描述符  | +| [bufferSize](#buffersize) | unsigned int
共享内存的空间大小,单位字节  | +| [offset](#offset) | unsigned int
有效数据起始地址在共享内存中的偏移  | +| [dataSize](#datasize) | unsigned int
有效数据的占用空间大小,单位字节  | + + +## 类成员变量说明 + + +### bufferSize + + +``` +unsigned int SharedBuffer::bufferSize +``` +**描述:** +共享内存的空间大小,单位字节 + + +### dataSize + + +``` +unsigned int SharedBuffer::dataSize +``` +**描述:** +有效数据的占用空间大小,单位字节 + + +### fd + + +``` +FileDescriptor SharedBuffer::fd +``` +**描述:** +共享内存的文件描述符 + + +### offset + + +``` +unsigned int SharedBuffer::offset +``` +**描述:** +有效数据起始地址在共享内存中的偏移 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sim_authentication_request_info.md b/zh-cn/device-dev/reference/hdi-apis/_sim_authentication_request_info.md new file mode 100644 index 0000000000000000000000000000000000000000..5dd2b947916fa53c2c788561f2bbf2b15ca029f6 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sim_authentication_request_info.md @@ -0,0 +1,55 @@ +# SimAuthenticationRequestInfo + + +## 概述 + +SIM卡鉴权请求信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [aid](#aid) | String
应用标识  | +| [authData](#authdata) | String
认证数据信息  | + + +## 类成员变量说明 + + +### aid + + +``` +String SimAuthenticationRequestInfo::aid +``` +**描述:** +应用标识 + + +### authData + + +``` +String SimAuthenticationRequestInfo::authData +``` +**描述:** +认证数据信息 + + +### serial + + +``` +int SimAuthenticationRequestInfo::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sim_io_request_info.md b/zh-cn/device-dev/reference/hdi-apis/_sim_io_request_info.md new file mode 100644 index 0000000000000000000000000000000000000000..7f2a5810876fc056115ed9fd90da9e738fb06f6c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sim_io_request_info.md @@ -0,0 +1,132 @@ +# SimIoRequestInfo + + +## 概述 + +SIM数据请求信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [command](#command) | int
ME(Mobile Equipment)传递给SIM的命令,参考GSM 51.011[28]  | +| [fileId](#fileid) | int
SIM卡上基本数据文件的标识符  | +| [p1](#p1) | int
SIM数据请求命令参数1,参考3GPP TS 51.011[28]  | +| [p2](#p2) | int
SIM数据请求命令参数2,参考3GPP TS 51.011[28]  | +| [p3](#p3) | int
SIM数据请求命令参数3,参考3GPP TS 51.011[28]  | +| [serial](#serial) | int
请求的序列号  | +| [data](#data) | String
要写入SIM的数据信息  | +| [path](#path) | String
SIM卡文件路径,参考ETSI TS 102 221 [60]  | +| [pin2](#pin2) | String
PIN2码  | +| [aid](#aid) | String
应用标识  | + + +## 类成员变量说明 + + +### aid + + +``` +String SimIoRequestInfo::aid +``` +**描述:** +应用标识 + + +### command + + +``` +int SimIoRequestInfo::command +``` +**描述:** +ME(Mobile Equipment)传递给SIM的命令,参考GSM 51.011[28] + + +### data + + +``` +String SimIoRequestInfo::data +``` +**描述:** +要写入SIM的数据信息 + + +### fileId + + +``` +int SimIoRequestInfo::fileId +``` +**描述:** +SIM卡上基本数据文件的标识符 + + +### p1 + + +``` +int SimIoRequestInfo::p1 +``` +**描述:** +SIM数据请求命令参数1,参考3GPP TS 51.011[28] + + +### p2 + + +``` +int SimIoRequestInfo::p2 +``` +**描述:** +SIM数据请求命令参数2,参考3GPP TS 51.011[28] + + +### p3 + + +``` +int SimIoRequestInfo::p3 +``` +**描述:** +SIM数据请求命令参数3,参考3GPP TS 51.011[28] + + +### path + + +``` +String SimIoRequestInfo::path +``` +**描述:** +SIM卡文件路径,参考ETSI TS 102 221 [60] + + +### pin2 + + +``` +String SimIoRequestInfo::pin2 +``` +**描述:** +PIN2码 + + +### serial + + +``` +int SimIoRequestInfo::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sim_lock_info.md b/zh-cn/device-dev/reference/hdi-apis/_sim_lock_info.md new file mode 100644 index 0000000000000000000000000000000000000000..452814245cbd787ff95856f96daa53a21f2dc966 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sim_lock_info.md @@ -0,0 +1,138 @@ +# SimLockInfo + + +## 概述 + +SIM卡锁信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [classx](#classx) | int
业务类别,取值为该类信息的整数之和,默认为255。 | +| [serial](#serial) | int
请求的序列号  | +| [fac](#fac) | String
SIM锁类型。 | +| [mode](#mode) | int
模式。 | +| [status](#status) | int
SIM卡锁状态。 当fac参数为PN,PU,PP时,表示的是锁网锁卡前三层锁的激活状态。 | +| [passwd](#passwd) | String
密码文本  | + + +## 类成员变量说明 + + +### classx + + +``` +int SimLockInfo::classx +``` +**描述:** +业务类别,取值为该类信息的整数之和,默认为255。 + +- 1:电话服务。 + +- 2:数据服务。 + +- 4:传真服务。 + +- 8:短消息服务。 + +- 16:数据电路同步。 + +- 32:数据电路异步。 + +- 64:专用分组访问。 + +- 128:专用便携式设备(PAD)访问 + + +### fac + + +``` +String SimLockInfo::fac +``` +**描述:** +SIM锁类型。 + +- AO:禁止所有呼出 + +- OI:禁止所有国际呼出。 + +- OX:禁止所有国际呼出,归属国除外 + +- AI:禁止所有呼入 + +- IR:归属地以外漫游时,禁止所有呼入。 + +- AB:禁止所有业务(仅在模式大于等于0时适用) + +- AG:禁止呼出业务(仅在模式大于等于0时适用) + +- AC:禁止呼入业务(仅在模式大于等于0时适用) + +- FD:FDN,固定号码拨号 + +- PN:锁网络 + +- PU:锁子网 + +- PP:锁定SP + + +### mode + + +``` +int SimLockInfo::mode +``` +**描述:** +模式。 + +- 0:去激活(当fac参数为PN,PU,PP时,为解锁操作)。 + +- 1:激活(当fac参数为PN,PU,PP时,不支持激活)。 + +- 2:查询 + + +### passwd + + +``` +String SimLockInfo::passwd +``` +**描述:** +密码文本 + + +### serial + + +``` +int SimLockInfo::serial +``` +**描述:** +请求的序列号 + + +### status + + +``` +int SimLockInfo::status +``` +**描述:** +SIM卡锁状态。 当fac参数为PN,PU,PP时,表示的是锁网锁卡前三层锁的激活状态。 + +- 0:未激活。 + +- 1:激活 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sim_password_info.md b/zh-cn/device-dev/reference/hdi-apis/_sim_password_info.md new file mode 100644 index 0000000000000000000000000000000000000000..71e85c85d47b8bd0a98902122ebe48836d21390a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sim_password_info.md @@ -0,0 +1,101 @@ +# SimPasswordInfo + + +## 概述 + +SIM卡密码信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [fac](#fac) | String
SIM锁类型。 | +| [oldPassword](#oldpassword) | String
旧密码文本  | +| [newPassword](#newpassword) | String
新密码文本  | +| [serial](#serial) | int
请求的序列号  | +| [passwordLength](#passwordlength) | int
旧密码或新密码的最大长度  | + + +## 类成员变量说明 + + +### fac + + +``` +String SimPasswordInfo::fac +``` +**描述:** +SIM锁类型。 + +- AO:禁止所有呼出 + +- OI:禁止所有国际呼出。 + +- OX:禁止所有国际呼出,归属国除外 + +- AI:禁止所有呼入 + +- IR:归属地以外漫游时,禁止所有呼入。 + +- AB:禁止所有业务(仅在模式大于等于0时适用) + +- AG:禁止呼出业务(仅在模式大于等于0时适用) + +- AC:禁止呼入业务(仅在模式大于等于0时适用) + +- FD:FDN,固定号码拨号 + +- PN:锁网络 + +- PU:锁子网 + +- PP:锁定SP + + +### newPassword + + +``` +String SimPasswordInfo::newPassword +``` +**描述:** +新密码文本 + + +### oldPassword + + +``` +String SimPasswordInfo::oldPassword +``` +**描述:** +旧密码文本 + + +### passwordLength + + +``` +int SimPasswordInfo::passwordLength +``` +**描述:** +旧密码或新密码的最大长度 + + +### serial + + +``` +int SimPasswordInfo::serial +``` +**描述:** +请求的序列号 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sim_pin_input_times.md b/zh-cn/device-dev/reference/hdi-apis/_sim_pin_input_times.md new file mode 100644 index 0000000000000000000000000000000000000000..561b5bc51f92bb16eab5262c6f2070ff8c7dde24 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sim_pin_input_times.md @@ -0,0 +1,99 @@ +# SimPinInputTimes + + +## 概述 + +SIM密码输入次数信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [times](#times) | int
剩余次数  | +| [pukTimes](#puktimes) | int
PUK码剩余次数  | +| [pinTimes](#pintimes) | int
PIN码剩余次数  | +| [puk2Times](#puk2times) | int
PUK2码剩余次数  | +| [pin2Times](#pin2times) | int
PIN2码剩余次数  | +| [code](#code) | String
请求字段,例如: SIM PIN2:表示SIM卡PIN2码请求  | + + +## 类成员变量说明 + + +### code + + +``` +String SimPinInputTimes::code +``` +**描述:** +请求字段,例如: SIM PIN2:表示SIM卡PIN2码请求 + + +### pin2Times + + +``` +int SimPinInputTimes::pin2Times +``` +**描述:** +PIN2码剩余次数 + + +### pinTimes + + +``` +int SimPinInputTimes::pinTimes +``` +**描述:** +PIN码剩余次数 + + +### puk2Times + + +``` +int SimPinInputTimes::puk2Times +``` +**描述:** +PUK2码剩余次数 + + +### pukTimes + + +``` +int SimPinInputTimes::pukTimes +``` +**描述:** +PUK码剩余次数 + + +### serial + + +``` +int SimPinInputTimes::serial +``` +**描述:** +请求的序列号 + + +### times + + +``` +int SimPinInputTimes::times +``` +**描述:** +剩余次数 diff --git a/zh-cn/device-dev/reference/hdi-apis/_slice_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_slice_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..2450ed45cefda672dec38b8f087c670db0972ff0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_slice_fusion.md @@ -0,0 +1,51 @@ +# SliceFusion + + +## 概述 + +在x各维度,在axes维度中,以begin为起点,截取size长度的切片。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SLICE_FUSION。 + +输入: + +- x,n维输入tensor。 + +- begin,一组不小于0的整数,指定axes维度上的起始切分点。 + +- size,一组不小于1的整数,指定axes维度上切片的长度。假设某一维度i,1<=size[i]<=input.shape[i]-begin[i]。 + +输出: + +- output,切片得到的n维tensor。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axes](#axes) | long[]
作用的维度。  | + + +## 类成员变量说明 + + +### axes + + +``` +long [] SliceFusion::axes +``` +**描述:** +作用的维度。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sms_message_i_o_info.md b/zh-cn/device-dev/reference/hdi-apis/_sms_message_i_o_info.md new file mode 100644 index 0000000000000000000000000000000000000000..0eb8d169672ddd6def1f1d9be47e510f310f82c0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sms_message_i_o_info.md @@ -0,0 +1,77 @@ +# SmsMessageIOInfo + + +## 概述 + +SIM卡短信信息 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [smscPdu](#smscpdu) | String
短信业务中心  | +| [pdu](#pdu) | String
协议数据单元  | +| [state](#state) | int
状态  | +| [index](#index) | int
消息索引  | + + +## 类成员变量说明 + + +### index + + +``` +int SmsMessageIOInfo::index +``` +**描述:** +消息索引 + + +### pdu + + +``` +String SmsMessageIOInfo::pdu +``` +**描述:** +协议数据单元 + + +### serial + + +``` +int SmsMessageIOInfo::serial +``` +**描述:** +请求的序列号 + + +### smscPdu + + +``` +String SmsMessageIOInfo::smscPdu +``` +**描述:** +短信业务中心 + + +### state + + +``` +int SmsMessageIOInfo::state +``` +**描述:** +状态 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sms_message_info.md b/zh-cn/device-dev/reference/hdi-apis/_sms_message_info.md new file mode 100644 index 0000000000000000000000000000000000000000..ec3322c21ea8d91f099bf0bef0c50ece74b63deb --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sms_message_info.md @@ -0,0 +1,59 @@ +# SmsMessageInfo + + +## 概述 + +上报短信信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [indicationType](#indicationtype) | int
响应类型 | +| [size](#size) | int
总数  | +| [pdu](#pdu) | List< unsigned char >
协议数据单元  | + + +## 类成员变量说明 + + +### indicationType + + +``` +int SmsMessageInfo::indicationType +``` +**描述:** +响应类型 + +- 0:查询上报 + +- 1:主动上报 + + +### pdu + + +``` +List SmsMessageInfo::pdu +``` +**描述:** +协议数据单元 + + +### size + + +``` +int SmsMessageInfo::size +``` +**描述:** +总数 diff --git a/zh-cn/device-dev/reference/hdi-apis/_softmax.md b/zh-cn/device-dev/reference/hdi-apis/_softmax.md new file mode 100644 index 0000000000000000000000000000000000000000..520406c9230b7bbdb27e0eafc6a28c56bb375289 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_softmax.md @@ -0,0 +1,47 @@ +# Softmax + + +## 概述 + +给定一个tensor,计算其softmax结果。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SOFTMAX。 + +输入: + +- x,n维tensor + +输出: + +- output,softmax的计算结果,一个n维tensor,类型和shape和x一致。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long[]
指定计算softmax的维度。整数取值范围为[-n,n)。  | + + +## 类成员变量说明 + + +### axis + + +``` +long [] Softmax::axis +``` +**描述:** +指定计算softmax的维度。整数取值范围为[-n,n)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_space_to_batch_n_d.md b/zh-cn/device-dev/reference/hdi-apis/_space_to_batch_n_d.md new file mode 100644 index 0000000000000000000000000000000000000000..da451a3d56bfd4daa0a39f1a9d440516a8f3652b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_space_to_batch_n_d.md @@ -0,0 +1,75 @@ +# SpaceToBatchND + + +## 概述 + +将4维张量在空间维度上进行切分成多个小块,然后在batch维度上拼接这些小块。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SPACE_TO_BATCH_ND。 + +输入: + +- x,n维tensor + + 输出: +- output:一个4维tensor,数据类型和input一致。shape由input、blockShape和paddings共同决定,假设input shape为[n,c,h,w],则有: + + $ output.shape[0] = n \* blockShape[0] \* blockShape[1] $ + + $ output.shape[1] = c $ + + $ output.shape[2] = (h + paddings[0][0] + paddings[0][1]) / blockShape[0] $ + + $ output.shape[3] = (w + paddings[1][0] + paddings[1][1]) / blockShape[1] $ + + 要求$ (h + paddings[0][0] + paddings[0][1]) $能被$ blockShape[0] $整除,$ (w + paddings[1][0] + paddings[1][1]) $能被$ blockShape[1] $整除。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [blockShape](#blockshape) | long[]
描述空间维度为分割的个数,取值需大于1。 | +| [paddings](#paddings) | long[][]
空间维度的填充大小。 | + + +## 类成员变量说明 + + +### blockShape + + +``` +long [] SpaceToBatchND::blockShape +``` + +**描述:** + +描述空间维度为分割的个数,取值需大于1。 + + +### paddings + + +``` +long [][] SpaceToBatchND::paddings +``` + +**描述:** + +空间维度的填充大小。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_split.md b/zh-cn/device-dev/reference/hdi-apis/_split.md new file mode 100644 index 0000000000000000000000000000000000000000..016d02e10ccd7f817adc471f95cd43c6f3964f7d --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_split.md @@ -0,0 +1,81 @@ +# Split + + +## 概述 + +算子沿 axis 维度将x拆分成多个张量,张量数量由outputNum指定。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SPLIT。 + +输入: + +- x,n维tensor + +输出: + +- outputs,一组n维张量,每一个张量类型和维度相同,每个张量的类型和x一致。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [outputNum](#outputnum) | long
指定分割数量。 | +| [sizeSplits](#sizesplits) | long[]
指定输入的张量沿axis轴拆分后,每个张量的大小。 | +| [axis](#axis) | long
指定分割的维度。 | + + +## 类成员变量说明 + + +### axis + + +``` +long Split::axis +``` + +**描述:** + +指定分割的维度。 + + +### outputNum + + +``` +long Split::outputNum +``` + +**描述:** + +指定分割数量。 + + +### sizeSplits + + +``` +long [] Split::sizeSplits +``` + +**描述:** + +指定输入的张量沿 axis 轴拆分后,每个张量的大小。 + +如果 sizeSplits 的数据为空,则 sizeSplits 被拆分成大小均等的 张量,此时要求 x.shape[axis] 可以被 outputNum 整除;如果 sizeSplits 不为空,则要求 sizeSplits 所有元素之和等于 x.shape[axis]。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sqrt.md b/zh-cn/device-dev/reference/hdi-apis/_sqrt.md new file mode 100644 index 0000000000000000000000000000000000000000..7190027f319a7b5b5a9e14fd1f7e8ec52760684c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sqrt.md @@ -0,0 +1,24 @@ +# Sqrt + + +## 概述 + +给定一个tensor,计算其平方根。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SQRT。 + +输入: + +- x,n维tensor。 + +输出: + +- output,一个n维tensor,类型和shape和x一致。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_squared_difference.md b/zh-cn/device-dev/reference/hdi-apis/_squared_difference.md new file mode 100644 index 0000000000000000000000000000000000000000..5c455a717c365f22823d4cae82ba9b0c4637eb16 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_squared_difference.md @@ -0,0 +1,26 @@ +# SquaredDifference + + +## 概述 + +计算两个输入的差值并返回差值的平方。SquaredDifference算子支持tensor和tensor相减。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SQUEEZE。 + +输入: + +- x,被减数,是一个tensor,tensor的类型可以是实数或DATA_TYPE_BOOL。 + +- y,减数,是一个tensor,tensor的类型可以是实数或DATA_TYPE_BOOL。 + +输出: + +- output,output的shape由x1和y共同决定,x1和y的shape相同时, output的shape和x1、y相同;shape不同时,需要将x1或y做broadcast操作后,相减得到output。 output的精度由两个输入中更高精度的决定。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_squeeze.md b/zh-cn/device-dev/reference/hdi-apis/_squeeze.md new file mode 100644 index 0000000000000000000000000000000000000000..73464d52e61791d400f2f098ceea1c2536ce3fd8 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_squeeze.md @@ -0,0 +1,49 @@ +# Squeeze + + +## 概述 + +去除axis中,长度为1的维度。支持int8量化输入。 + +假设输入的x的shape为[2,1,1,2,2],axis为[0,1],则输出的output的shape为[2,1,2,2],意思是第0维到第1维之间,长度为1的维度被去除。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SQUARED_DIFFERENCE。 + +输入: + +- x,n维tensor + +输出: + +- output,去除axis中长度为1的维度之后得到的tensor。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long[]
指定删除的维度。axis可以是一个整数或数组,整数的取值范围为[-n,n)。  | + + +## 类成员变量说明 + + +### axis + + +``` +long [] Squeeze::axis +``` +**描述:** +指定删除的维度。axis可以是一个整数或数组,整数的取值范围为[-n,n)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_srvcc_status.md b/zh-cn/device-dev/reference/hdi-apis/_srvcc_status.md new file mode 100644 index 0000000000000000000000000000000000000000..fb6109d5be653e3f1397b1d25db9eda6721c78a2 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_srvcc_status.md @@ -0,0 +1,41 @@ +# SrvccStatus + + +## 概述 + +SRVCC(Single Radio Voice Call Continuity)状态信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [status](#status) | int
SRVCC(Single Radio Voice Call Continuity)状态 | + + +## 类成员变量说明 + + +### status + + +``` +int SrvccStatus::status +``` +**描述:** +SRVCC(Single Radio Voice Call Continuity)状态 + +- 0:开始 + +- 1:成功 + +- 2:失败 + +- 3:取消 diff --git a/zh-cn/device-dev/reference/hdi-apis/_ss_notice_info.md b/zh-cn/device-dev/reference/hdi-apis/_ss_notice_info.md new file mode 100644 index 0000000000000000000000000000000000000000..d55d0bc4fc5a7cb944bdc323ddb01f9005fdd651 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ss_notice_info.md @@ -0,0 +1,84 @@ +# SsNoticeInfo + + +## 概述 + +补充业务信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serviceType](#servicetype) | int
业务类型 | +| [requestType](#requesttype) | int
请求类型 | +| [serviceClass](#serviceclass) | int
服务类别,参考3GPP TS 27.007  | +| [result](#result) | int
查询结果,具体查看[RilErrType](_ril.md#rilerrtype) | + + +## 类成员变量说明 + + +### requestType + + +``` +int SsNoticeInfo::requestType +``` +**描述:** +请求类型 + +- 0:去激活 + +- 1:激活 + +- 2:状态查询 + +- 3:注册 + +- 4:删除 + + +### result + + +``` +int SsNoticeInfo::result +``` +**描述:** +查询结果,具体查看[RilErrType](_ril.md#rilerrtype) + + +### serviceClass + + +``` +int SsNoticeInfo::serviceClass +``` +**描述:** +服务类别,参考3GPP TS 27.007 + + +### serviceType + + +``` +int SsNoticeInfo::serviceType +``` +**描述:** +业务类型 + +- 0:无条件 + +- 1:遇忙时 + +- 2:无应答时 + +- 3:不可达时(无网络服务或者关机时) diff --git a/zh-cn/device-dev/reference/hdi-apis/_stack.md b/zh-cn/device-dev/reference/hdi-apis/_stack.md new file mode 100644 index 0000000000000000000000000000000000000000..b932887dd8e9bd0da9e3476695ed7e104c3ddb40 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_stack.md @@ -0,0 +1,47 @@ +# Stack + + +## 概述 + +将一组tensor沿axis维度进行堆叠,堆叠前每个tensor的维数为n,则堆叠后output维数为n+1。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_STACK。 + +输入: + +- 多个输入n维tensor,每个tensor要求shape相同且类型相同。 + +输出: + +- output,将输入的张量沿axis维度堆叠的输出,n+1维tensor,数据类型与精度和输入相同。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long
一个整数,指定tensor堆叠的维度。axis可以是负数,axis取值范围为[-(n+1),(n+1))。  | + + +## 类成员变量说明 + + +### axis + + +``` +long Stack::axis +``` +**描述:** +一个整数,指定tensor堆叠的维度。axis可以是负数,axis取值范围为[-(n+1),(n+1))。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_stream_attribute.md b/zh-cn/device-dev/reference/hdi-apis/_stream_attribute.md index 0f27781eb80cac98f6a7ed813503f715d4220486..fa85df5b51b91d9edeb8c8b62b383e8fbb80dfec 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_stream_attribute.md +++ b/zh-cn/device-dev/reference/hdi-apis/_stream_attribute.md @@ -1,34 +1,34 @@ # StreamAttribute -## **概述** +## 概述 流的属性。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [streamId_](#streamid) | 流的ID,用于在设备内唯一标识一条流。 | -| [width_](#width) | 图像宽度。 | -| [height_](#height) | 图像高度。 | -| [overrideFormat_](#overrideformat) | 重写的图像格式。 | -| [overrideDataspace_](#overridedataspace) | 重写的图像颜色空间 | -| [producerUsage_](#producerusage) | 重写后的生产者的使用方式。 | -| [producerBufferCount_](#producerbuffercount) | 重写后的生产者缓存数量。 | -| [maxBatchCaptureCount_](#maxbatchcapturecount) | 连拍支持的最大捕获帧数量。 | -| [maxCaptureCount_](#maxcapturecount) | 最大的并发捕获请求个数,默认为1。 | +| [streamId_](#streamid_) | int
流的ID,用于在设备内唯一标识一条流。  | +| [width_](#width_) | int
图像宽度。  | +| [height_](#height_) | int
图像高度。  | +| [overrideFormat_](#overrideformat_) | int
重写的图像格式。  | +| [overrideDataspace_](#overridedataspace_) | int
重写的图像颜色空间。  | +| [producerUsage_](#producerusage_) | int
重写后的生产者的使用方式。  | +| [producerBufferCount_](#producerbuffercount_) | int
重写后的生产者缓存数量。  | +| [maxBatchCaptureCount_](#maxbatchcapturecount_) | int
连拍支持的最大捕获帧数量。  | +| [maxCaptureCount_](#maxcapturecount_) | int
最大的并发捕获请求个数,默认为1。  | -## **类成员变量说明** +## 类成员变量说明 ### height_ @@ -37,9 +37,7 @@ ``` int StreamAttribute::height_ ``` - -**描述:** - +**描述:** 图像高度。 @@ -49,9 +47,7 @@ int StreamAttribute::height_ ``` int StreamAttribute::maxBatchCaptureCount_ ``` - -**描述:** - +**描述:** 连拍支持的最大捕获帧数量。 @@ -61,9 +57,7 @@ int StreamAttribute::maxBatchCaptureCount_ ``` int StreamAttribute::maxCaptureCount_ ``` - -**描述:** - +**描述:** 最大的并发捕获请求个数,默认为1。 @@ -73,9 +67,7 @@ int StreamAttribute::maxCaptureCount_ ``` int StreamAttribute::overrideDataspace_ ``` - -**描述:** - +**描述:** 重写的图像颜色空间。 @@ -85,9 +77,7 @@ int StreamAttribute::overrideDataspace_ ``` int StreamAttribute::overrideFormat_ ``` - -**描述:** - +**描述:** 重写的图像格式。 @@ -97,9 +87,7 @@ int StreamAttribute::overrideFormat_ ``` int StreamAttribute::producerBufferCount_ ``` - -**描述:** - +**描述:** 重写后的生产者缓存数量。 @@ -109,9 +97,7 @@ int StreamAttribute::producerBufferCount_ ``` int StreamAttribute::producerUsage_ ``` - -**描述:** - +**描述:** 重写后的生产者的使用方式。 @@ -121,9 +107,7 @@ int StreamAttribute::producerUsage_ ``` int StreamAttribute::streamId_ ``` - -**描述:** - +**描述:** 流的ID,用于在设备内唯一标识一条流。 @@ -133,7 +117,5 @@ int StreamAttribute::streamId_ ``` int StreamAttribute::width_ ``` - -**描述:** - +**描述:** 图像宽度。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_stream_info.md b/zh-cn/device-dev/reference/hdi-apis/_stream_info.md index 2d4f5c39bf016824e2f3fa98e49673f90f9f5bb1..8831c0071496e4b0c8aee0b7edeffe9f8202d316 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_stream_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_stream_info.md @@ -1,35 +1,35 @@ # StreamInfo -## **概述** +## 概述 流信息,用于创建流时传入相关的配置参数。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [streamId_](#streamid_) | 流的ID,用于在设备内唯一标识一条流。 | -| [width_](#width_) | 图像宽度。 | -| [height_](#height_) | 图像高度。 | -| [format_](#format_) | 图像格式。 | -| [dataspace_](#dataspace_) | 图像颜色空间。 | -| [intent_](#intent_) | 流类型。 | -| [tunneledMode_](#tunneledmode_) | 隧道模式,值为true时开启,false关闭。 | -| [bufferQueue_](#bufferqueue_) | 图形提供的生产者句柄。 | -| [minFrameDuration_](#minframeduration_) | 最小帧间隔。 | -| [encodeType_](#encodetype_) | 编码类型。 | +| [streamId_](#streamid_) | int
流的ID,用于在设备内唯一标识一条流。 | +| [width_](#width_) | int
图像宽度。 | +| [height_](#height_) | int
图像高度。 | +| [format_](#format_) | int
图像格式。 | +| [dataspace_](#dataspace_) | int
图像颜色空间。 | +| [intent_](#intent_) | enum [StreamIntent](_camera.md#streamintent)
流类型。 | +| [tunneledMode_](#tunneledmode_) | boolean
隧道模式。 | +| [bufferQueue_](#bufferqueue_) | BufferProducerSequenceable
图形提供的生产者句柄。 | +| [minFrameDuration_](#minframeduration_) | int
最小帧间隔。 | +| [encodeType_](#encodetype_) | enum [EncodeType](_camera.md#encodetype)
编码类型。 | -## **类成员变量说明** +## 类成员变量说明 ### bufferQueue_ @@ -39,7 +39,7 @@ BufferProducerSequenceable StreamInfo::bufferQueue_ ``` -**描述:** +**描述:** 图形提供的生产者句柄。 @@ -51,7 +51,7 @@ BufferProducerSequenceable StreamInfo::bufferQueue_ int StreamInfo::dataspace_ ``` -**描述:** +**描述:** 图像颜色空间。 @@ -63,7 +63,7 @@ int StreamInfo::dataspace_ enum EncodeType StreamInfo::encodeType_ ``` -**描述:** +**描述:** 编码类型。 @@ -75,7 +75,7 @@ enum EncodeType StreamInfo::encodeType_ int StreamInfo::format_ ``` -**描述:** +**描述:** 图像格式。 @@ -87,7 +87,7 @@ int StreamInfo::format_ int StreamInfo::height_ ``` -**描述:** +**描述:** 图像高度。 @@ -99,7 +99,7 @@ int StreamInfo::height_ enum StreamIntent StreamInfo::intent_ ``` -**描述:** +**描述:** 流类型。 @@ -111,7 +111,7 @@ enum StreamIntent StreamInfo::intent_ int StreamInfo::minFrameDuration_ ``` -**描述:** +**描述:** 最小帧间隔。 @@ -123,7 +123,7 @@ int StreamInfo::minFrameDuration_ int StreamInfo::streamId_ ``` -**描述:** +**描述:** 流的ID,用于在设备内唯一标识一条流。 @@ -135,9 +135,11 @@ int StreamInfo::streamId_ boolean StreamInfo::tunneledMode_ ``` -**描述:** +**描述:** -隧道模式,值为true时开启,false关闭。 开启隧道模式后,HAL不直接和上层交互,通过图形提供的生产者句柄来传递帧数据, 对于一些IOT设备,可能不需要或者不支持预览流的图像数据缓存流转,此时需要关闭隧道模式。 +隧道模式。 + +值为true时开启,false关闭。 开启隧道模式后,HAL不直接和上层交互,通过图形提供的生产者句柄来传递帧数据,对于一些IOT设备,可能不需要或者不支持预览流的图像数据缓存流转,此时需要关闭隧道模式。 ### width_ @@ -147,6 +149,6 @@ boolean StreamInfo::tunneledMode_ int StreamInfo::width_ ``` -**描述:** +**描述:** 图像宽度。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_strided_slice.md b/zh-cn/device-dev/reference/hdi-apis/_strided_slice.md new file mode 100644 index 0000000000000000000000000000000000000000..6ec90c19e1f3fa0ec4357e156a8ac6ba7caa2612 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_strided_slice.md @@ -0,0 +1,123 @@ +# StridedSlice + + +## 概述 + +根据步长和索引对输入张量进行切片提取。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_STRIDED_SLICE。 + +输入: + +- x,n维tensor。 + +- begin,1维tensor,begin的长度等于n,begin[i]指定第i维上截取的起点。 + +- end,1维tensor,end的长度等于n,end[i]指定第i维上截取的终点。 + +- strides,1维张量,strides的长度等于n,strides[i]指定第i维上截取的步长,允许存在负值。 + > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** + > 输入的张量有如下情况:begin, end 和 strides 的shape必须相同。 begin,end 是从0开始进行索引。 strides 的元素必须非零。 + +输出: + +- output,堆叠运算后的tensor,数据类型与x相同。输出维度rank(x[0])+1维。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [beginMask](#beginmask) | long
表示切片的起始索引。 | +| [endMask](#endmask) | long
表示切片的结束索引。 | +| [ellipsisMask](#ellipsismask) | long
一个整数,用于解除begin和end的限制。 | +| [newAxisMask](#newaxismask) | long
用于新增维度。 | +| [shrinkAxisMask](#shrinkaxismask) | long
用于压缩指定维度。 | + + +## 类成员变量说明 + + +### beginMask + + +``` +long StridedSlice::beginMask +``` + +**描述:** + +表示切片的起始索引。 + +beginMask使用二进制编码方式对输入x的不同维度进行标志,beginMask的第i位设置为1则begin[i]参数对应的第i维度设置无效,表示该维度的起始索引从0开始。默认值为0。 + + +### ellipsisMask + + +``` +long StridedSlice::ellipsisMask +``` + +**描述:** + +一个整数,用于解除begin和end的限制。 + +不为0的维度不需要进行切片操作。 将ellipsisMask转成二进制表示,如果ellipsisMask的第i位为1,则对于第i维,从第一个元素开始,以strides[i]为步长,截取元素直到tensor边界。 + + +### endMask + + +``` +long StridedSlice::endMask +``` + +**描述:** + +表示切片的结束索引。 + +功能类似begin_mask。 endMask使用二进制编码方式对输入x的不同维度进行标志,第i位设置为1则end参数对应的该维度设置无效,表示该维度切分的结束索引到列表最后,即切分到尽可能大的维度。默认值为0。 + + +### newAxisMask + + +``` +long StridedSlice::newAxisMask +``` + +**描述:** + +用于新增维度。 + +newAxisMask使用二进制编码方式对输入x的不同维度进行标志,如果第i位出现1,则begin、end、stride对所有维度参数无效,并在第i位上增加一个大小为1的维度。 + + +### shrinkAxisMask + + +``` +long StridedSlice::shrinkAxisMask +``` + +**描述:** + +用于压缩指定维度。 + +将shrinkAxisMask转成二进制表示,如果shrinkAxisMask的第i位位1,则舍去第i维所有元素,第i维长度压缩至1。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sub_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_sub_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..16323cea7ddd01e7009405f61c5edb27d469c418 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sub_fusion.md @@ -0,0 +1,49 @@ +# SubFusion + + +## 概述 + +计算两个输入的差值。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_SUB_FUSION。 + +输入: + +- x,被减数,是int或float类型的张量。 + +- y,减数,是int或float类型的张量。 + +输出: + +- output,两个input相减的差。output的shape由x和y共同决定,x和y的shape相同时,output的shape和x、y相同; shape不同时,需要将x或y做broadcast操作后,相减得到output。output的精度为x和y中精度更高的决定。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [activationType](#activationtype) | enum [ActivationType](_n_n_rt.md#activationtype)
激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。  | + + +## 类成员变量说明 + + +### activationType + + +``` +enum ActivationType SubFusion::activationType +``` +**描述:** +激活函数类型,详情请参考:[ActivationType](_n_n_rt.md#activationtype)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_sub_graph.md b/zh-cn/device-dev/reference/hdi-apis/_sub_graph.md new file mode 100644 index 0000000000000000000000000000000000000000..64531a425079e2c7c4d4d7d2ce8e3d64de811200 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_sub_graph.md @@ -0,0 +1,70 @@ +# SubGraph + + +## 概述 + +子图结构体。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [name](#name) | String
子图的名称。  | +| [inputIndices](#inputindices) | unsigned int[]
子图的输入子图在[Model](_model.md)的subGraph数组中的下标。  | +| [outputIndices](#outputindices) | unsigned int[]
子图的输出子图在[Model](_model.md)的subGraph数组中的下标。  | +| [nodeIndices](#nodeindices) | unsigned int[]
子图包含的算子节点在[Model](_model.md)的nodes数组中的下标。  | + + +## 类成员变量说明 + + +### inputIndices + + +``` +unsigned int [] SubGraph::inputIndices +``` +**描述:** +子图的输入子图在[Model](_model.md)的subGraph数组中的下标。 + + +### name + + +``` +String SubGraph::name +``` +**描述:** +子图的名称。 + + +### nodeIndices + + +``` +unsigned int [] SubGraph::nodeIndices +``` +**描述:** +子图包含的算子节点在[Model](_model.md)的nodes数组中的下标。 + + +### outputIndices + + +``` +unsigned int [] SubGraph::outputIndices +``` +**描述:** +子图的输出子图在[Model](_model.md)的subGraph数组中的下标。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_support_buffer_type.md b/zh-cn/device-dev/reference/hdi-apis/_support_buffer_type.md index d185ae8f897719c5e443d35bef17317916d79566..dca24e2c9313ff93374bbd266958107349474b5b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_support_buffer_type.md +++ b/zh-cn/device-dev/reference/hdi-apis/_support_buffer_type.md @@ -1,29 +1,29 @@ # SupportBufferType -## **概述** +## 概述 SupportBuffer类型定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [size](#size) | 结构体大小 | -| [version](#version) | 组件版本信息 | -| [portIndex](#portindex) | 端口索引 | -| [bufferTypes](#buffertypes) | 支持的所有Buffer类型 | +| [size](#size) | uint32_t
结构体大小。  | +| [version](#version) | union OMX_VERSIONTYPE
组件版本信息。  | +| [portIndex](#portindex) | uint32_t
端口索引。  | +| [bufferTypes](#buffertypes) | uint32_t
支持的所有Buffer类型。  | -## **类成员变量说明** +## 类成员变量说明 ### bufferTypes @@ -32,9 +32,7 @@ SupportBuffer类型定义。 ``` uint32_t SupportBufferType::bufferTypes ``` - -**描述:** - +**描述:** 支持的所有Buffer类型。 @@ -44,9 +42,7 @@ uint32_t SupportBufferType::bufferTypes ``` uint32_t SupportBufferType::portIndex ``` - -**描述:** - +**描述:** 端口索引。 @@ -56,9 +52,7 @@ uint32_t SupportBufferType::portIndex ``` uint32_t SupportBufferType::size ``` - -**描述:** - +**描述:** 结构体大小。 @@ -68,7 +62,5 @@ uint32_t SupportBufferType::size ``` union OMX_VERSIONTYPE SupportBufferType::version ``` - -**描述:** - +**描述:** 组件版本信息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_td_scdma_rssi.md b/zh-cn/device-dev/reference/hdi-apis/_td_scdma_rssi.md new file mode 100644 index 0000000000000000000000000000000000000000..165ab6e40090b562e165de79e4bad13550e432c0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_td_scdma_rssi.md @@ -0,0 +1,33 @@ +# TdScdmaRssi + + +## 概述 + +TDSCDMA信号强度。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [rscp](#rscp) | int
表示接收信号码功率  | + + +## 类成员变量说明 + + +### rscp + + +``` +int TdScdmaRssi::rscp +``` +**描述:** +表示接收信号码功率 diff --git a/zh-cn/device-dev/reference/hdi-apis/_template_info.md b/zh-cn/device-dev/reference/hdi-apis/_template_info.md deleted file mode 100644 index eefb0c607c9e6f08ae07274f7711a98d0dcf7793..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_template_info.md +++ /dev/null @@ -1,82 +0,0 @@ -# TemplateInfo - - -## **概述** - -凭据模版信息。 - -**Since:** - -3.2 - -**Version:** - -1.0 - -**所属模块:** - -[HdfFaceAuth](_hdf_face_auth.md) | [HdfPinAuth](_hdf_pin_auth.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [executorType](#executortype) | 执行器类型,根据执行器支持的算法类型进行分类。 | -| [freezingTime](#freezingtime) | 认证方式被冻结的时间。 | -| [remainTimes](#remaintimes) | 认证方式距离被冻结的可处理认证请求次数。 | -| [extraInfo](#extrainfo) | 其他相关信息,用于支持信息扩展。 | - - -## **类成员变量说明** - - -### executorType - - -``` -unsigned int TemplateInfo::executorType -``` - -**描述:** - -执行器类型,根据执行器支持的算法类型进行分类。 - - -### extraInfo - - -``` -unsigned char [] TemplateInfo::extraInfo -``` - -**描述:** - -其他相关信息,用于支持信息扩展。 - - -### freezingTime - - -``` -int TemplateInfo::freezingTime -``` - -**描述:** - -认证方式被冻结的时间。 - - -### remainTimes - - -``` -int TemplateInfo::remainTimes -``` - -**描述:** - -认证方式距离被冻结的可处理认证请求次数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_template_info_faceauth.md b/zh-cn/device-dev/reference/hdi-apis/_template_info_faceauth.md new file mode 100644 index 0000000000000000000000000000000000000000..da191dc21a231f4e40e3cd4e7837e8ffd477639c --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_template_info_faceauth.md @@ -0,0 +1,82 @@ +# TemplateInfo + + +## 概述 + +凭据模版信息。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[HdfFaceAuth](_hdf_face_auth.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [executorType](#executortype) | unsigned int
执行器类型,根据执行器支持的能力进行分类。 | +| [freezingTime](#freezingtime) | int
认证方式被冻结的时间。 | +| [remainTimes](#remaintimes) | int
认证方式距离被冻结的可处理认证请求次数。 | +| [extraInfo](#extrainfo) | unsigned char[]
其他相关信息,用于支持信息扩展。 | + + +## 类成员变量说明 + + +### executorType + + +``` +unsigned int TemplateInfo::executorType +``` + +**描述:** + +执行器类型,根据执行器支持的能力进行分类。 + + +### extraInfo + + +``` +unsigned char [] TemplateInfo::extraInfo +``` + +**描述:** + +其他相关信息,用于支持信息扩展。 + + +### freezingTime + + +``` +int TemplateInfo::freezingTime +``` + +**描述:** + +认证方式被冻结的时间。 + + +### remainTimes + + +``` +int TemplateInfo::remainTimes +``` + +**描述:** + +认证方式距离被冻结的可处理认证请求次数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_template_info_pinauth.md b/zh-cn/device-dev/reference/hdi-apis/_template_info_pinauth.md new file mode 100644 index 0000000000000000000000000000000000000000..5d1737da37952ddea5d6e02590dc66bb8b79c1fc --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_template_info_pinauth.md @@ -0,0 +1,82 @@ +# TemplateInfo + + +## 概述 + +凭据模版信息,口令模版在用户注册口令认证凭据时生成并存储,用于支持通过口令认证方式验证用户身份。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[HdfPinAuth](_hdf_pin_auth.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [executorType](#executortype) | unsigned int
执行器类型,根据执行器支持的算法类型进行分类。 | +| [freezingTime](#freezingtime) | int
认证方式被冻结的时间。 | +| [remainTimes](#remaintimes) | int
认证方式距离被冻结的可处理认证请求次数。 | +| [extraInfo](#extrainfo) | unsigned char[]
其他相关信息,用于支持信息扩展。 | + + +## 类成员变量说明 + + +### executorType + + +``` +unsigned int TemplateInfo::executorType +``` + +**描述:** + +执行器类型,根据执行器支持的算法类型进行分类。 + + +### extraInfo + + +``` +unsigned char [] TemplateInfo::extraInfo +``` + +**描述:** + +其他相关信息,用于支持信息扩展。 + + +### freezingTime + + +``` +int TemplateInfo::freezingTime +``` + +**描述:** + +认证方式被冻结的时间。 + + +### remainTimes + + +``` +int TemplateInfo::remainTimes +``` + +**描述:** + +认证方式距离被冻结的可处理认证请求次数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_tensor.md b/zh-cn/device-dev/reference/hdi-apis/_tensor.md new file mode 100644 index 0000000000000000000000000000000000000000..4683dbedb87b842b6aed1c2afa6c9965aea6cd33 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_tensor.md @@ -0,0 +1,110 @@ +# Tensor + + +## 概述 + +张量结构体。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [name](#name) | String
张量名称。 | +| [dataType](#datatype) | enum [DataType](_n_n_rt.md#datatype)
张量数据类型,详情请参考:[DataType](_n_n_rt.md#datatype)。 | +| [dims](#dims) | int[]
张量维度数组。 | +| [format](#format) | enum [Format](_n_n_rt.md#format)
张量数据的排列,详情请参考:[Format](_n_n_rt.md#format)。 | +| [data](#data) | struct [SharedBuffer](_shared_buffer.md)
进程通信时用于张量数据传输的结构体,详情请参考:[SharedBuffer](_shared_buffer.md)。 | +| [quantParams](#quantparams) | struct [QuantParam](_quant_param.md)[]
张量的量化参数数组。详情请参考:[QuantParam](_quant_param.md)。 | + + +## 类成员变量说明 + + +### data + + +``` +struct SharedBuffer Tensor::data +``` + +**描述:** + +进程通信时用于张量数据传输的结构体,详情请参考:[SharedBuffer](_shared_buffer.md)。 + + +### dataType + + +``` +enum DataType Tensor::dataType +``` + +**描述:** + +张量数据类型,详情请参考:[DataType](_n_n_rt.md#datatype)。 + + +### dims + + +``` +int [] Tensor::dims +``` + +**描述:** + +张量维度数组。 + + +### format + + +``` +enum Format Tensor::format +``` + +**描述:** + +张量数据的排列,详情请参考:[Format](_n_n_rt.md#format)。 + + +### name + + +``` +String Tensor::name +``` + +**描述:** + +张量名称。 + + +### quantParams + + +``` +struct QuantParam [] Tensor::quantParams +``` + +**描述:** + +张量的量化参数数组。详情请参考:[QuantParam](_quant_param.md)。 + +分为两种情况,如果长度为一,则所有轴公用一个量化; 若长度不为一,则数组中的每一个量化参数和轴一一对应。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_thermal_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_thermal_types_8idl.md index 8a9f62560247133588da745fba6962eaf13b0120..44e846c9bb36e8b6f5c1165865cb159d03ef5d18 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_thermal_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_thermal_types_8idl.md @@ -1,7 +1,7 @@ # ThermalTypes.idl -## **概述** +## 概述 设备发热状态相关的数据类型。 @@ -20,15 +20,15 @@ [Thermal](thermal.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ThermalZoneInfo](_thermal_zone_info.md) | 设备发热的信息。 | -| [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) | 设备发热的信息列表。 | +| [ThermalZoneInfo](_thermal_zone_info.md) | struct
设备发热的信息。 | +| [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) | struct
设备发热的信息列表。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_thermal_zone_info.md b/zh-cn/device-dev/reference/hdi-apis/_thermal_zone_info.md index 55c9cd68298c64581d78f868a3678c556f2b17dd..e0195877cb89ae2eaaf49e839fb601a9581bf0b2 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_thermal_zone_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_thermal_zone_info.md @@ -1,31 +1,29 @@ # ThermalZoneInfo -## **概述** +## 概述 设备发热的信息。 **Since:** - 3.1 - **相关模块:** [Thermal](thermal.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [type](#type) | 发热器件的类型。 | -| [temp](#temp) | 器件的温度值。 | +| [type](#type) | String
发热器件的类型。  | +| [temp](#temp) | int
器件的温度值。  | -## **类成员变量说明** +## 类成员变量说明 ### temp @@ -34,9 +32,7 @@ ``` int ThermalZoneInfo::temp ``` - -**描述:** - +**描述:** 器件的温度值。 @@ -46,7 +42,5 @@ int ThermalZoneInfo::temp ``` String ThermalZoneInfo::type ``` - -**描述:** - +**描述:** 发热器件的类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_tile_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_tile_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..17507ea3b87520ffc4622d66e4dfcafa5cd4ea4d --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_tile_fusion.md @@ -0,0 +1,49 @@ +# TileFusion + + +## 概述 + +以multiples指定的次数拷贝输入张量。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_TILE_FUSION。 + +输入: + +- x,n维tensor。 + +- multiples, 1维tensor,指定各个维度拷贝的次数。其长度m不小于x的维数n。 + +输出: + +- Tensor,m维tensor,OperandType与input相同。如果input和multiples长度相同, 则output和input维数一致,都是n维tensor;如果multiples长度大于n,则用1填充input的维度, 再在各个维度上拷贝相应的次数,得到m维tensor。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [dims](#dims) | long[]
它和multiples功能相同,1维tensor,指定各个维度拷贝的次数。其长度m不小于x的维数n。  | + + +## 类成员变量说明 + + +### dims + + +``` +long [] TileFusion::dims +``` +**描述:** +它和multiples功能相同,1维tensor,指定各个维度拷贝的次数。其长度m不小于x的维数n。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_top_k_fusion.md b/zh-cn/device-dev/reference/hdi-apis/_top_k_fusion.md new file mode 100644 index 0000000000000000000000000000000000000000..98a7a4d9990e4e6308f0843ae489ee0e84238842 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_top_k_fusion.md @@ -0,0 +1,60 @@ +# TopKFusion + + +## 概述 + +查找沿axis轴的前K个最大值和对应索引。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_TOPK_FUSION。 + +输入: + +- x,n维tensor。 + +输出: + +- output0,axis维度的前K个最大值。 + +- output1,axis维度的前K个最大值的索引。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [sorted](#sorted) | boolean
如果为True,按照大到小排序,如果为False,按照小到大排序。  | +| [axis](#axis) | long
作用的轴  | + + +## 类成员变量说明 + + +### axis + + +``` +long TopKFusion::axis +``` +**描述:** +作用的轴 + + +### sorted + + +``` +boolean TopKFusion::sorted +``` +**描述:** +如果为True,按照大到小排序,如果为False,按照小到大排序。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_transpose.md b/zh-cn/device-dev/reference/hdi-apis/_transpose.md new file mode 100644 index 0000000000000000000000000000000000000000..45a7e64a072d2be8bcb2332bada4f27575bbb6c2 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_transpose.md @@ -0,0 +1,26 @@ +# Transpose + + +## 概述 + +根据perm对x进行数据重排。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_TRANSPOSE。 + +输入: + +- x,n维tensor,待重排的tensor。 + +- perm,1维tensor,其长度和x的维数一致。 + +输出: + +- output,n维tensor,output的数据类型,量化等参数与x相同,shape由x的shape和perm共同决定。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..c207232835f54776bbad0e40d980fce7083ad2fe --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_types_8idl.md @@ -0,0 +1,57 @@ +# Types.idl + + +## 概述 + +Camera模块HDI接口使用的数据类型。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Camera](_camera.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [StreamInfo](_stream_info.md) | struct
流信息,用于创建流时传入相关的配置参数。 | +| [StreamAttribute](_stream_attribute.md) | struct
流的属性。 | +| [CaptureInfo](_capture_info.md) | struct
捕获请求的相关信息。 | +| [CaptureEndedInfo](_capture_ended_info.md) | struct
捕获结束相关信息,用于捕获结束回调[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)。 | +| [CaptureErrorInfo](_capture_error_info.md) | struct
流错误信息,用于回调[OnCaptureError](interface_i_stream_operator_callback.md#oncaptureerror)。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [CamRetCode](_camera.md#camretcode) {   NO_ERROR = 0, CAMERA_BUSY = -1, INSUFFICIENT_RESOURCES = -2, INVALID_ARGUMENT = -3,   METHOD_NOT_SUPPORTED = -4, CAMERA_CLOSED = -5, DEVICE_ERROR = -6, NO_PERMISSION = -7 } | HDI接口的返回值。 | +| [ResultCallbackMode](_camera.md#resultcallbackmode) { PER_FRAME = 0, ON_CHANGED = 1 } | metadata的上报模式。 | +| [OperationMode](_camera.md#operationmode) { NORMAL = 0 } | 流的使用模式。 | +| [StreamIntent](_camera.md#streamintent) { PREVIEW = 0, VIDEO = 1, STILL_CAPTURE = 2, POST_VIEW = 3,   ANALYZE = 4, CUSTOM = 5 } | 流的类型。 | +| [EncodeType](_camera.md#encodetype) { ENCODE_TYPE_NULL = 0, ENCODE_TYPE_H264 = 1, ENCODE_TYPE_H265 = 2, ENCODE_TYPE_JPEG = 3 } | 流数据的编码类型。 | +| [StreamSupportType](_camera.md#streamsupporttype) { DYNAMIC_SUPPORTED = 0, RE_CONFIGURED_REQUIRED = 1, NOT_SUPPORTED = 2 } | 对动态配置流的支持类型,使用场景参考[IsStreamsSupported](interface_i_stream_operator.md#isstreamssupported)。 | +| [CameraStatus](_camera.md#camerastatus) { UN_AVAILABLE = 0, AVAILABLE = 1 } | Camera设备状态。 | +| [FlashlightStatus](_camera.md#flashlightstatus) { FLASHLIGHT_OFF = 0, FLASHLIGHT_ON = 1, FLASHLIGHT_UNAVAILABLE = 2 } | 闪光灯状态。 | +| [CameraEvent](_camera.md#cameraevent) { CAMERA_EVENT_DEVICE_ADD = 0, CAMERA_EVENT_DEVICE_RMV = 1 } | Camera事件。 | +| [ErrorType](_camera.md#errortype) {   FATAL_ERROR = 0, REQUEST_TIMEOUT = 1, DRIVER_ERROR = 2, DEVICE_PREEMPT = 3,   DEVICE_DISCONNECT = 4, DCAMERA_ERROR_BEGIN = 1024, DCAMERA_ERROR_DEVICE_IN_USE, DCAMERA_ERROR_NO_PERMISSION } | 设备错误类型,用于设备错误回调[OnError](interface_i_camera_device_callback.md#onerror)。 | +| [StreamError](_camera.md#streamerror) { UNKNOWN_ERROR = 0, BUFFER_LOST = 1 } | 流错误类型,用于流错误类型[CaptureErrorInfo](_capture_error_info.md)。 | + + +### 变量 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.camera.v1_0 | Camera设备接口的包路径。 | +| sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable | ohos.hdi.camera.v1_0序列,可用缓冲区生成器。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/usb.md b/zh-cn/device-dev/reference/hdi-apis/_u_s_b.md similarity index 57% rename from zh-cn/device-dev/reference/hdi-apis/usb.md rename to zh-cn/device-dev/reference/hdi-apis/_u_s_b.md index 494b00f32ef88eed39019685303d6435bbf0ffc9..2459fcfebfcf990e4176b76ff277b6b3e30e9fe1 100644 --- a/zh-cn/device-dev/reference/hdi-apis/usb.md +++ b/zh-cn/device-dev/reference/hdi-apis/_u_s_b.md @@ -1,22 +1,22 @@ # USB -## **概述** +## 概述 提供统一的USB驱动标准接口,实现USB驱动接入。 上层USB服务开发人员可以根据USB驱动模块提供的标准接口获取如下功能:打开/关闭设备,获取设备描述符,获取文件描述符,打开/关闭接口,批量读取/写入数据, 设置/获取设备功能,绑定/解绑订阅者等。 -**Since**: +**Since:** 3.2 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 @@ -33,14 +33,14 @@ | 名称 | 描述 | | -------- | -------- | -| [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) | USB驱动的回调函数。 | -| [IUsbdSubscriber](interface_i_usbd_subscriber.md) | 定义USB驱动的订阅类相关函数。 | -| [IUsbInterface](interface_i_usb_interface.md) | 定义USB驱动基本的操作功能。 | -| [PortInfo](_port_info.md) | USB设备端口信息。 | -| [UsbDev](_usb_dev.md) | USB设备地址信息。 | -| [UsbPipe](_usb_pipe.md) | USB设备管道信息。 | -| [UsbCtrlTransfer](_usb_ctrl_transfer.md) | USB设备控制传输信息。 | -| [USBDeviceInfo](_u_s_b_device_info.md) | USB设备信息。 | +| [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) | interface
USB驱动的回调函数。 | +| [IUsbdSubscriber](interface_i_usbd_subscriber.md) | interface
定义USB驱动的订阅类相关函数。 | +| [IUsbInterface](interface_i_usb_interface.md) | interface
定义USB驱动基本的操作功能。 | +| [PortInfo](_port_info.md) | struct
USB设备端口信息。 | +| [UsbDev](_usb_dev.md) | struct
USB设备地址信息。 | +| [UsbPipe](_usb_pipe.md) | struct
USB设备管道信息。 | +| [UsbCtrlTransfer](_usb_ctrl_transfer.md) | struct
USB设备控制传输信息。 | +| [USBDeviceInfo](_u_s_b_device_info.md) | struct
USB设备信息。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_u_s_b_device_info.md b/zh-cn/device-dev/reference/hdi-apis/_u_s_b_device_info.md index deb045d7748f4af7f67570f90c437bdeeeccaa9a..b17821b0380ecf24271ae18e9f3d34fef9039381 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_u_s_b_device_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_u_s_b_device_info.md @@ -1,36 +1,32 @@ # USBDeviceInfo -## **概述** +## 概述 USB设备信息。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [status](#status) | USB设备状态。 | -| [busNum](#busnum) | USB设备总线编号。 | -| [devNum](#devnum) | USB设备编号。 | +| [status](#status) | int
USB设备状态。  | +| [busNum](#busnum) | int
USB设备总线编号。  | +| [devNum](#devnum) | int
USB设备编号。  | -## **类成员变量说明** +## 类成员变量说明 ### busNum @@ -39,9 +35,7 @@ USB设备信息。 ``` int USBDeviceInfo::busNum ``` - -**描述:** - +**描述:** USB设备总线编号。 @@ -51,9 +45,7 @@ USB设备总线编号。 ``` int USBDeviceInfo::devNum ``` - -**描述:** - +**描述:** USB设备编号。 @@ -63,7 +55,5 @@ USB设备编号。 ``` int USBDeviceInfo::status ``` - -**描述:** - +**描述:** USB设备状态。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_uni_info.md b/zh-cn/device-dev/reference/hdi-apis/_uni_info.md new file mode 100644 index 0000000000000000000000000000000000000000..d8df18d5aa025187dc9579c9f5dcd9f8ffbb4eb1 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_uni_info.md @@ -0,0 +1,88 @@ +# UniInfo + + +## 概述 + +通用信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [serial](#serial) | int
请求的序列号  | +| [gsmIndex](#gsmindex) | int
GSM索引  | +| [flag](#flag) | boolean
通用信息标识  | +| [arg1](#arg1) | int
参数一  | +| [arg2](#arg2) | int
参数二  | +| [strTmp](#strtmp) | String
字符串  | + + +## 类成员变量说明 + + +### arg1 + + +``` +int UniInfo::arg1 +``` +**描述:** +参数一 + + +### arg2 + + +``` +int UniInfo::arg2 +``` +**描述:** +参数二 + + +### flag + + +``` +boolean UniInfo::flag +``` +**描述:** +通用信息标识 + + +### gsmIndex + + +``` +int UniInfo::gsmIndex +``` +**描述:** +GSM索引 + + +### serial + + +``` +int UniInfo::serial +``` +**描述:** +请求的序列号 + + +### strTmp + + +``` +String UniInfo::strTmp +``` +**描述:** +字符串 diff --git a/zh-cn/device-dev/reference/hdi-apis/_unsqueeze.md b/zh-cn/device-dev/reference/hdi-apis/_unsqueeze.md new file mode 100644 index 0000000000000000000000000000000000000000..08fd85944b8bd46be1a9bdc584c864254732c2db --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_unsqueeze.md @@ -0,0 +1,47 @@ +# Unsqueeze + + +## 概述 + +根据输入axis的值。增加一个维度。 + +该算子对应的[NodeType](_n_n_rt.md#nodetype)为NODE_TYPE_UNSQUEEZE。 + +输入: + +- x,n维tensor。 + +输出: + +- output,输出tensor。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [axis](#axis) | long[]
axis,指定增加的维度。axis可以是一个整数或一组整数,整数的取值范围为[-n,n)。  | + + +## 类成员变量说明 + + +### axis + + +``` +long [] Unsqueeze::axis +``` +**描述:** +axis,指定增加的维度。axis可以是一个整数或一组整数,整数的取值范围为[-n,n)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_usb_ctrl_transfer.md b/zh-cn/device-dev/reference/hdi-apis/_usb_ctrl_transfer.md index 99202a9155522e5e3dca0223a93e744ba3547979..9268b1241e434c8d4176e51b7b2bee459c1f8eb0 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_usb_ctrl_transfer.md +++ b/zh-cn/device-dev/reference/hdi-apis/_usb_ctrl_transfer.md @@ -1,38 +1,34 @@ # UsbCtrlTransfer -## **概述** +## 概述 USB设备控制传输信息。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [requestType](#requesttype) | 请求类型。 | -| [requestCmd](#requestcmd) | 请求命令。 | -| [value](#value) | 请求值。 | -| [index](#index) | 索引值。 | -| [timeout](#timeout) | 超时时间。 | +| [requestType](#requesttype) | int
请求类型。  | +| [requestCmd](#requestcmd) | int
请求命令。  | +| [value](#value) | int
请求值。  | +| [index](#index) | int
索引值。  | +| [timeout](#timeout) | int
超时时间。  | -## **类成员变量说明** +## 类成员变量说明 ### index @@ -41,9 +37,7 @@ USB设备控制传输信息。 ``` int UsbCtrlTransfer::index ``` - -**描述:** - +**描述:** 索引值。 @@ -53,9 +47,7 @@ int UsbCtrlTransfer::index ``` int UsbCtrlTransfer::requestCmd ``` - -**描述:** - +**描述:** 请求命令。 @@ -65,9 +57,7 @@ int UsbCtrlTransfer::requestCmd ``` int UsbCtrlTransfer::requestType ``` - -**描述:** - +**描述:** 请求类型。 @@ -77,9 +67,7 @@ int UsbCtrlTransfer::requestType ``` int UsbCtrlTransfer::timeout ``` - -**描述:** - +**描述:** 超时时间。 @@ -89,7 +77,5 @@ int UsbCtrlTransfer::timeout ``` int UsbCtrlTransfer::value ``` - -**描述:** - +**描述:** 请求值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_usb_dev.md b/zh-cn/device-dev/reference/hdi-apis/_usb_dev.md index 996d138ed2b6d2d3f5614c3de4d88a52a89abb00..726c29820ea7aab51a61989ca094143704eb53bf 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_usb_dev.md +++ b/zh-cn/device-dev/reference/hdi-apis/_usb_dev.md @@ -1,35 +1,31 @@ # UsbDev -## **概述** +## 概述 USB设备地址信息。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [busNum](#busnum) | USB设备总线编号。 | -| [devAddr](#devaddr) | USB设备地址。 | +| [busNum](#busnum) | unsigned char
USB设备总线编号。  | +| [devAddr](#devaddr) | unsigned char
USB设备地址。  | -## **类成员变量说明** +## 类成员变量说明 ### busNum @@ -38,9 +34,7 @@ USB设备地址信息。 ``` unsigned char UsbDev::busNum ``` - -**描述:** - +**描述:** USB设备总线编号。 @@ -50,7 +44,5 @@ USB设备总线编号。 ``` unsigned char UsbDev::devAddr ``` - -**描述:** - +**描述:** USB设备地址。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_usb_pipe.md b/zh-cn/device-dev/reference/hdi-apis/_usb_pipe.md index 983703acd118e39830f6bea2ea9ebfc699aec1a1..dac59f8d24a5880f3602005306418a99a1610322 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_usb_pipe.md +++ b/zh-cn/device-dev/reference/hdi-apis/_usb_pipe.md @@ -1,35 +1,31 @@ # UsbPipe -## **概述** +## 概述 USB设备管道信息。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [intfId](#intfid) | USB设备接口ID。 | -| [endpointId](#endpointid) | USB设备端点ID。 | +| [intfId](#intfid) | unsigned char
USB设备接口ID。  | +| [endpointId](#endpointid) | unsigned char
USB设备端点ID。  | -## **类成员变量说明** +## 类成员变量说明 ### endpointId @@ -38,9 +34,7 @@ USB设备管道信息。 ``` unsigned char UsbPipe::endpointId ``` - -**描述:** - +**描述:** USB设备端点ID。 @@ -50,7 +44,5 @@ USB设备端点ID。 ``` unsigned char UsbPipe::intfId ``` - -**描述:** - +**描述:** USB设备接口ID。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_usb_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_usb_types_8idl.md index b5e18db841fdd6735867dcfc5c257030401df1f2..1f708087f2ef0fcd6156b233038260d48082d916 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_usb_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_usb_types_8idl.md @@ -1,7 +1,7 @@ # UsbTypes.idl -## **概述** +## 概述 USB驱动相关的数据类型。 @@ -15,21 +15,21 @@ USB驱动相关的数据类型。 **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [PortInfo](_port_info.md) | USB设备端口信息。 | -| [UsbDev](_usb_dev.md) | USB设备地址信息。 | -| [UsbPipe](_usb_pipe.md) | USB设备管道信息。 | -| [UsbCtrlTransfer](_usb_ctrl_transfer.md) | USB设备控制传输信息。 | -| [USBDeviceInfo](_u_s_b_device_info.md) | USB设备信息。 | +| [PortInfo](_port_info.md) | struct
USB设备端口信息。 | +| [UsbDev](_usb_dev.md) | struct
USB设备地址信息。 | +| [UsbPipe](_usb_pipe.md) | struct
USB设备管道信息。 | +| [UsbCtrlTransfer](_usb_ctrl_transfer.md) | struct
USB设备控制传输信息。 | +| [USBDeviceInfo](_u_s_b_device_info.md) | struct
USB设备信息。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_use_buffer_type.md b/zh-cn/device-dev/reference/hdi-apis/_use_buffer_type.md index 1ded6ee6683da725b0f7d5018e586857715a02c3..20f43ec1833f4ab809af6b2c9e2d1153b147537a 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_use_buffer_type.md +++ b/zh-cn/device-dev/reference/hdi-apis/_use_buffer_type.md @@ -1,29 +1,29 @@ # UseBufferType -## **概述** +## 概述 UseBuffer类型定义。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [size](#size) | 结构体大小。 | -| [version](#version) | 组件版本信息。 | -| [portIndex](#portindex) | 端口索引。 | -| [bufferType](#buffertype) | Buffer类型。 | +| [size](#size) | uint32_t
结构体大小。  | +| [version](#version) | union OMX_VERSIONTYPE
组件版本信息。  | +| [portIndex](#portindex) | uint32_t
端口索引。  | +| [bufferType](#buffertype) | uint32_t
Buffer类型。  | -## **类成员变量说明** +## 类成员变量说明 ### bufferType @@ -32,9 +32,7 @@ UseBuffer类型定义。 ``` uint32_t UseBufferType::bufferType ``` - -**描述:** - +**描述:** Buffer类型。 @@ -44,9 +42,7 @@ Buffer类型。 ``` uint32_t UseBufferType::portIndex ``` - -**描述:** - +**描述:** 端口索引。 @@ -56,9 +52,7 @@ uint32_t UseBufferType::portIndex ``` uint32_t UseBufferType::size ``` - -**描述:** - +**描述:** 结构体大小。 @@ -68,7 +62,5 @@ uint32_t UseBufferType::size ``` union OMX_VERSIONTYPE UseBufferType::version ``` - -**描述:** - +**描述:** 组件版本信息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_user_auth_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_user_auth_types_8idl.md index 9100113265ad2a7134733b9f1b0c3c5d65f925d7..9a0a6759639ea826ea6ec689f6ec29eb18ba40ce 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_user_auth_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_user_auth_types_8idl.md @@ -1,46 +1,46 @@ # UserAuthTypes.idl -## **概述** +## 概述 定义用户认证驱动的枚举类和数据结构。 -**Since:** +**Since:** 3.2 -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [ExecutorRegisterInfo](_executor_register_info.md) | 执行器注册信息。 | -| [ExecutorInfo](_user_executor_info.md) | 执行器信息。 | -| [ScheduleInfo](_schedule_info.md) | 调度信息。 | -| [AuthSolution](_auth_solution.md) | 认证方案。 | -| [ExecutorSendMsg](_executor_send_msg.md) | 执行器发送的消息。 | -| [AuthResultInfo](_auth_result_info.md) | 用户身份认证结果信息。 | -| [IdentifyResultInfo](_identify_result_info.md) | 用户身份识别结果信息。 | -| [EnrollParam](_enroll_param.md) | 注册认证凭据参数。 | -| [CredentialInfo](_credential_info.md) | 认证凭据信息。 | -| [EnrolledInfo](_enrolled_info.md) | 注册信息。 | -| [EnrollResultInfo](_enroll_resultinfo.md) | 录入结果信息。 | +| [ExecutorRegisterInfo](_executor_register_info.md) | struct
执行器注册信息。 | +| [ExecutorInfo](_executor_info_userauth.md) | struct
执行器信息。 | +| [ScheduleInfo](_schedule_info.md) | struct
调度信息。 | +| [AuthSolution](_auth_solution.md) | struct
认证方案。 | +| [ExecutorSendMsg](_executor_send_msg.md) | struct
执行器发送的消息。 | +| [AuthResultInfo](_auth_result_info.md) | struct
用户身份认证结果信息。 | +| [IdentifyResultInfo](_identify_result_info.md) | struct
用户身份识别结果信息。 | +| [EnrollParam](_enroll_param.md) | struct
注册认证凭据参数。 | +| [CredentialInfo](_credential_info.md) | struct
认证凭据信息。 | +| [EnrolledInfo](_enrolled_info.md) | struct
注册信息。 | +| [EnrollResultInfo](_enroll_result_info.md) | struct
录入结果信息。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [AuthType](_hdf_user_auth.md#authtype): int { PIN = 1, FACE = 2, FINGERPRINT = 4, ALL = 0 } | 枚举用户认证凭据类型。 | -| [ExecutorRole](_hdf_user_auth.md#executorrole): int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | -| [ExecutorSecureLevel](_hdf_user_auth.md#executorsecurelevel): int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | +| [AuthType](_hdf_user_auth.md#authtype) : int {  ALL = 0, PIN = 1, FACE = 2, FINGERPRINT = 4 } | 枚举用户认证凭据类型。 | +| [ExecutorRole](_hdf_user_auth.md#executorrole) : int { COLLECTOR = 1, VERIFIER = 2, ALL_IN_ONE = 3 } | 枚举执行器角色。 | +| [ExecutorSecureLevel](_hdf_user_auth.md#executorsecurelevel) : int { ESL0 = 0, ESL1 = 1, ESL2 = 2, ESL3 = 3 } | 枚举执行器安全等级。 | | [PinSubType](_hdf_user_auth.md#pinsubtype) : int { PIN_SIX = 10000, PIN_NUMBER = 10001, PIN_MIX = 10002 } | 口令认证子类型。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_user_executor_info.md b/zh-cn/device-dev/reference/hdi-apis/_user_executor_info.md deleted file mode 100644 index f19e9e25e402e9ee90326ba0be87827ca0e795ea..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_user_executor_info.md +++ /dev/null @@ -1,56 +0,0 @@ -# ExecutorInfo - - -## **概述** - -执行器信息。 - -**Since:** - -3.2 - -**Version:** - -1.0 - -**所属模块:** - -[HdfUserAuth](_hdf_user_auth.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [executorIndex](#executorindex) | 用户认证框架的执行器索引。 | -| [info](#info) | 执行器注册信息。 | - - -## **类成员变量说明** - - -### executorIndex - - -``` -unsigned long ExecutorInfo::executorIndex -``` - -**描述:** - -用户认证框架的执行器索引。 - - -### info - - -``` -struct ExecutorRegisterInfo ExecutorInfo::info -``` - -**描述:** - -执行器注册信息[ExecutorRegisterInfo](_executor_register_info.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_ussd_notice_info.md b/zh-cn/device-dev/reference/hdi-apis/_ussd_notice_info.md new file mode 100644 index 0000000000000000000000000000000000000000..e26fa12c92ee0351efd0409401ae9c713301c6bd --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_ussd_notice_info.md @@ -0,0 +1,56 @@ +# UssdNoticeInfo + + +## 概述 + +非结构化补充数据业务(USSD)业务信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [type](#type) | int
USSD类型 | +| [message](#message) | String
USSD字符串  | + + +## 类成员变量说明 + + +### message + + +``` +String UssdNoticeInfo::message +``` +**描述:** +USSD字符串 + + +### type + + +``` +int UssdNoticeInfo::type +``` +**描述:** +USSD类型 + +- 0:网络不需要客户端回复 + +- 1:网络需要客户端回复 + +- 2:USSD会话被网络释放 + +- 3:其他本地客户端已经作出响应 + +- 4:操作不支持 + +- 5:网络超时 diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_buffer.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_buffer.md index a97cf039e42f39b062e85430da1ad5b162af3c7d..a7580d33de149657cf7a2af5956ee62846f13c1c 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_buffer.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_buffer.md @@ -1,7 +1,7 @@ # VGUBuffer -## **概述** +## 概述 硬件加速渲染位图缓存。 @@ -10,16 +10,16 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [pixelFormat](_display.md#pixelformat) | 像素格式 | -| [width](_display.md#width-89) | 位图宽度 | -| [height](_display.md#height-88) | 位图高度 | -| [stride](_display.md#stride-22) | 位图stride | -| [virAddr](_display.md#viraddr-22) | 位图缓存的虚拟地址 | -| [phyAddr](_display.md#phyaddr-33) | 位图缓存的物理地址 | +| [pixelFormat](_display.md#pixelformat) | [VGUPixelFormat](_display.md#pixelformat)
像素格式 | +| [width](_display.md#width-89) | uint32_t
位图宽度 | +| [height](_display.md#height-88) | uint32_t
位图高度 | +| [stride](_display.md#stride-22) | uint32_t
位图stride | +| [virAddr](_display.md#viraddr-22) | void \*
位图缓存的虚拟地址 | +| [phyAddr](_display.md#phyaddr-33) | uint64_t
位图缓存的物理地址 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_color_stop.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_color_stop.md index 3662d99760a72075354044443a391cda7f5b7467..6a5fd0984ddfc231e4659aab4982d49779bd3b66 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_color_stop.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_color_stop.md @@ -1,7 +1,7 @@ # VGUColorStop -## **概述** +## 概述 渐变颜色分布位置。 @@ -10,12 +10,12 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [stop](_display.md#stop) | 颜色偏移位置, 值范围是 0.0 ~ 1.0 | -| [color](_display.md#color-45) | 偏移位置对应颜色 | +| [stop](_display.md#stop) | float
颜色偏移位置,值范围是 0.0 ~ 1.0 | +| [color](_display.md#color-45) | uint32_t
偏移位置对应颜色 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_conic.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_conic.md index 25f37b5675cc7b63da2b8157e7c4bd1184cd45c0..fc9b58f180a521262db12c4b9f0d3fd835efb9e5 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_conic.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_conic.md @@ -1,7 +1,7 @@ # VGUConic -## **概述** +## 概述 圆锥渐变。 @@ -10,12 +10,12 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [cx](_display.md#cx) | 圆弧中心x坐标 | -| [cy](_display.md#cy) | 圆弧中心y坐标 | +| [cx](_display.md#cx) | [VGUScalar](_display.md#vguscalar)
圆弧中心x坐标 | +| [cy](_display.md#cy) | [VGUScalar](_display.md#vguscalar)
圆弧中心y坐标 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_fill_attr.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_fill_attr.md index 04291c89067099b4f9efa3518f54ef7c7143ae4c..3ad973cad9e77a1f64163371d9da6413d4eec155 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_fill_attr.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_fill_attr.md @@ -1,7 +1,7 @@ # VGUFillAttr -## **概述** +## 概述 填充路径的属性。 @@ -10,11 +10,11 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [rule](_display.md#rule) | 填充规格 | +| [rule](_display.md#rule) | [VGUFillRule](_display.md#vgufillrule)
填充规格 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_funcs.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_funcs.md index c8bc61bb2de2a5599fb9a90aac52d1951253235b..c35df0dc4649e84689a7b97ac6c78366300e5289 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_funcs.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_funcs.md @@ -1,7 +1,7 @@ # VGUFuncs -## **概述** +## 概述 定义2D硬件加速驱动函数。 @@ -10,21 +10,21 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| ([VGUFuncs::InitVgu](_display.md#initvgu) )(void) | 初始化硬件加速。 | -| ([VGUFuncs::DeinitVgu](_display.md#deinitvgu) )(void) | 去初始化硬件加速。 | -| ([VGUFuncs::QueryCapability](_display.md#querycapability))(uint32_t cap) | 查询硬件能力集。 | -| ([VGUFuncs::RenderFill](_display.md#renderfill))(VGUSurface \*target, const VGUPath \*path, const VGUMatrix3 \*matrix, const VGUFillAttr \*attr, const VGUPaintStyle \*style) | 使用指定的渲染对象来填充路径。 | -| ([VGUFuncs::RenderStroke](_display.md#renderstroke) )(VGUSurface \*target, const VGUPath \*path, const VGUMatrix3 \*matrix, const VGUStrokeAttr \*attr, const VGUPaintStyle \*style) | 使用指定的渲染对象来描边路径。 | -| ([VGUFuncs::RenderBlur](_display.md#renderblur) )(VGUSurface \*target, uint16_t blur) | 对目标表面进行模糊处理。 | -| ([VGUFuncs::RenderBlit](_display.md#renderblit) )(VGUSurface \*target, const VGUImage \*src, uint32_t color) | 对图像进行搬移操作。 | -| ([VGUFuncs::RenderBlitN](_display.md#renderblitn) )(VGUSurface \*target, const VGUImage \*src, uint16_t count, uint32_t color) | 对多个源图像进行叠加操作。 | -| ([VGUFuncs::RenderClearRect](_display.md#renderclearrect) )(VGUSurface \*target, const VGURect \*rect, uint32_t color, uint8_t opacity) | 对指定矩形进行颜色清除操作。 | -| ([VGUFuncs::RenderCancel](_display.md#rendercancel) )() | 取消硬件加速渲染。 | -| ([VGUFuncs::RenderSync](_display.md#rendersync) )(int32_t timeOut) | 同步硬件加速模块绘制或搬移操作。 | +| (\* [InitVgu](_display.md#initvgu) )(void) | [VGUResult](_display.md#vguresult)
初始化硬件加速。 | +| (\* [DeinitVgu](_display.md#deinitvgu) )(void) | [VGUResult](_display.md#vguresult)
去初始化硬件加速。 | +| (\* [QueryCapability](_display.md#querycapability) )(uint32_t cap) | int32_t
查询硬件能力集。 | +| (\* [RenderFill](_display.md#renderfill) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUPath](_v_g_u_path.md) \*path, const [VGUMatrix3](_v_g_u_matrix3.md) \*matrix, const [VGUFillAttr](_v_g_u_fill_attr.md) \*attr, const [VGUPaintStyle](_v_g_u_paint_style.md) \*style) | [VGUResult](_display.md#vguresult)
使用指定的渲染对象来填充路径。 | +| (\* [RenderStroke](_display.md#renderstroke) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUPath](_v_g_u_path.md) \*path, const [VGUMatrix3](_v_g_u_matrix3.md) \*matrix, const [VGUStrokeAttr](_v_g_u_stroke_attr.md) \*attr, const [VGUPaintStyle](_v_g_u_paint_style.md) \*style) | [VGUResult](_display.md#vguresult)
使用指定的渲染对象来描边路径。 | +| (\* [RenderBlur](_display.md#renderblur) )([VGUSurface](_v_g_u_surface.md) \*target, uint16_t blur) | [VGUResult](_display.md#vguresult)
对目标表面进行模糊处理。 | +| (\* [RenderBlit](_display.md#renderblit) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUImage](_v_g_u_image.md) \*src, uint32_t color) | [VGUResult](_display.md#vguresult)
对图像进行搬移操作。 | +| (\* [RenderBlitN](_display.md#renderblitn) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGUImage](_v_g_u_image.md) \*src, uint16_t count, uint32_t color) | [VGUResult](_display.md#vguresult)
对多个源图像进行叠加操作。 | +| (\* [RenderClearRect](_display.md#renderclearrect) )([VGUSurface](_v_g_u_surface.md) \*target, const [VGURect](_v_g_u_rect.md) \*rect, uint32_t color, uint8_t opacity) | [VGUResult](_display.md#vguresult)
对指定矩形进行颜色清除操作。 | +| (\* [RenderCancel](_display.md#rendercancel) )() | [VGUResult](_display.md#vguresult)
取消硬件加速渲染。 | +| (\* [RenderSync](_display.md#rendersync) )(int32_t timeOut) | [VGUResult](_display.md#vguresult)
同步硬件加速模块绘制或搬移操作。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_gradient.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_gradient.md index 644e6a342e722b09cd4cd33b780c82bd36d977c0..79e0745dabdf377328f092447a7b26215d90b29b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_gradient.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_gradient.md @@ -1,7 +1,7 @@ # VGUGradient -## **概述** +## 概述 渐变对象。 @@ -10,19 +10,19 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [matrix](_display.md#matrix-22) | 针对渐变对象的变换矩阵 | -| [colorStops](_display.md#colorstops) | 渐变停止颜色数组指针 | -| [stopCount](_display.md#stopcount) | 渐变停止颜色个数 | -| [linear](_display.md#linear) | 线性渐变对象 | -| [radial](_display.md#radial) | 辐射渐变对象 | -| [conic](_display.md#conic) | 圆锥渐变对象 | -| [type](_display.md#type-67) | 渐变类型 | -| [spread](_display.md#spread) | 渐变延伸模式 | -| [opacity](_display.md#opacity-23) | 透明度,范围0~255。 | +| [matrix](_display.md#matrix-22) | [VGUMatrix3](_v_g_u_matrix3.md) \*
针对渐变对象的变换矩阵 | +| [colorStops](_display.md#colorstops) | [VGUColorStop](_v_g_u_color_stop.md) \*
渐变停止颜色数组指针 | +| [stopCount](_display.md#stopcount) | uint16_t
渐变停止颜色个数 | +| [linear](_display.md#linear) | [VGULinear](_v_g_u_linear.md)
线性渐变对象 | +| [radial](_display.md#radial) | [VGURadial](_v_g_u_radial.md)
辐射渐变对象 | +| [conic](_display.md#conic) | [VGUConic](_v_g_u_conic.md)
圆锥渐变对象 | +| [type](_display.md#type-67) | [VGUGradientType](_display.md#vgugradienttype)
渐变类型 | +| [spread](_display.md#spread) | [VGUFillSpread](_display.md#vgufillspread)
渐变延伸模式 | +| [opacity](_display.md#opacity-23) | uint8_t
透明度,范围0~255 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_image.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_image.md index d0de468a5b24d6256b121c39d8242766cb62dc93..66b65e6644abd07f31023c77aecaba68776d762e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_image.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_image.md @@ -1,7 +1,7 @@ # VGUImage -## **概述** +## 概述 图像对象。 @@ -10,14 +10,14 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [buffer](_display.md#buffer-33) | 图像存储缓存。 | -| [matrix](_display.md#matrix-12) | 图像矩阵变换,该参数为空,则内部使用单位变换矩阵。 | -| [rect](_display.md#rect-33) | 图像截取矩形,该参数为空,则截取整个图像。 | -| [opacity](_display.md#opacity-13) | 透明度,范围0~255。 | +| [buffer](_display.md#buffer-33) | [VGUBuffer](_v_g_u_buffer.md) \*
图像存储缓存 | +| [matrix](_display.md#matrix-12) | [VGUMatrix3](_v_g_u_matrix3.md) \*
图像矩阵变换,该参数为空,则内部使用单位变换矩阵 | +| [rect](_display.md#rect-33) | [VGURect](_v_g_u_rect.md) \*
图像截取矩形,该参数为空,则截取整个图像 | +| [opacity](_display.md#opacity-13) | uint8_t
透明度,范围0~255 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_linear.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_linear.md index e666fe236fbe80b1ce0bde1c42152afbb4efd17a..33d0d7ad9f1e76eba9a1d05e0518831ced96f03b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_linear.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_linear.md @@ -1,7 +1,7 @@ # VGULinear -## **概述** +## 概述 线性渐变。 @@ -10,14 +10,14 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [x1](_display.md#x1-23) | 线性渐变起点水平坐标 | -| [y1](_display.md#y1-23) | 线性渐变起点垂直坐标 | -| [x2](_display.md#x2) | 线性渐变终点水平坐标 | -| [y2](_display.md#y2) | 线性渐变终点垂直坐标 | +| [x1](_display.md#x1-23) | [VGUScalar](_display.md#vguscalar)
线性渐变起点水平坐标 | +| [y1](_display.md#y1-23) | [VGUScalar](_display.md#vguscalar)
线性渐变起点垂直坐标 | +| [x2](_display.md#x2) | [VGUScalar](_display.md#vguscalar)
线性渐变终点水平坐标 | +| [y2](_display.md#y2) | [VGUScalar](_display.md#vguscalar)
线性渐变终点垂直坐标 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_mask_layer.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_mask_layer.md index 4dab4c31fb6de03edcc6dfdbf3ce040d2177e26a..3e6c4b8ebf8ec82cc01d776546e24d45466ffd70 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_mask_layer.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_mask_layer.md @@ -1,7 +1,7 @@ # VGUMaskLayer -## **概述** +## 概述 定义蒙版图层。 @@ -10,12 +10,12 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [buffer](_display.md#buffer-13) | 蒙版缓存 | -| [rect](_display.md#rect-23) | 蒙版矩形 | +| [buffer](_display.md#buffer-13) | [VGUBuffer](_v_g_u_buffer.md) \*
蒙版缓存 | +| [rect](_display.md#rect-23) | [VGURect](_v_g_u_rect.md) \*
蒙版矩形 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_matrix3.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_matrix3.md index 96ae437c094298bcfb1bd9e7fc98d528f7e2fd59..e2794f30eaa0a25d23bdeec6e13c69b3e5b47d60 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_matrix3.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_matrix3.md @@ -1,21 +1,21 @@ # VGUMatrix3 -## **概述** +## 概述 -定义变换矩阵。 +变换矩阵。 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [m](_display.md#m) [3][3] | 3x3变换矩阵 | -| [type](_display.md#type-57) | 矩阵变换类型,简单变换为缩放,平移,90度倍数旋转 | +| [m](_display.md#m) [3][3] | float
3x3变换矩阵 | +| [type](_display.md#type-57) | uint32_t
矩阵变换类型,简单变换为缩放,平移,90度倍数旋转 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_paint_style.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_paint_style.md index 96b7fcc92129c17a1d6cd7f6059affdf0280c295..6484569dfc94741d2871242fbee40c6ee5febc74 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_paint_style.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_paint_style.md @@ -1,7 +1,7 @@ # VGUPaintStyle -## **概述** +## 概述 填充或描边路径的渲染风格。 @@ -10,14 +10,14 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [gradient](_display.md#gradient) | 渐变对象 | -| [pattern](_display.md#pattern) | 图片模式对象 | -| [solid](_display.md#solid) | 颜色对象 | -| [type](_display.md#type-77) | 渲染类型 | +| [gradient](_display.md#gradient) | [VGUGradient](_v_g_u_gradient.md) \*
渐变对象 | +| [pattern](_display.md#pattern) | [VGUPattern](_v_g_u_pattern.md) \*
图片模式对象 | +| [solid](_display.md#solid) | [VGUSolid](_v_g_u_solid.md) \*
颜色对象 | +| [type](_display.md#type-77) | [VGUPaintType](_display.md#vgupainttype)
渲染类型 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_path.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_path.md index 6aaf6ea7f61305fa825e664d2a33f0d9f3cd43c4..8a69729d8156f6ee360378f14830e2e96260b4e3 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_path.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_path.md @@ -1,7 +1,7 @@ # VGUPath -## **概述** +## 概述 路径对象,存放路径命令和坐标数据。 @@ -10,16 +10,16 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [segment](_display.md#segment) | 存放路径命令数据 | -| [numSegments](_display.md#numsegments) | 路径命令总数 | -| [data](_display.md#data-22) | 存放路径命令对应坐标数据 | -| [type](_display.md#type-47) | 路径数据存储类型 | -| [enAlias](_display.md#enalias) | 抗锯齿开关 | -| [boundBox](_display.md#boundbox) | 路径最大边界 | +| [segment](_display.md#segment) | uint8_t \*
存放路径命令数据 | +| [numSegments](_display.md#numsegments) | int32_t
路径命令总数 | +| [data](_display.md#data-22) | uint8_t \*
存放路径命令对应坐标数据 | +| [type](_display.md#type-47) | [VGUPathDataType](_display.md#vgupathdatatype)
路径数据存储类型 | +| [enAlias](_display.md#enalias) | bool
抗锯齿开关 | +| [boundBox](_display.md#boundbox) | [VGURect](_v_g_u_rect.md)
路径最大边界 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_pattern.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_pattern.md index 0a703728ea6b9fd15e3c8a4b57b6355177dc6491..c56701205d6aa9f6dac3fdc2bc43ab49657aaf88 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_pattern.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_pattern.md @@ -1,7 +1,7 @@ # VGUPattern -## **概述** +## 概述 图片模式对象。 @@ -10,13 +10,13 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [image](_display.md#image) | 图像对象 | -| [wrapx](_display.md#wrapx) | 图像水平方向平铺类型 | -| [wrapy](_display.md#wrapy) | 图像垂直方向平铺类型 | +| [image](_display.md#image) | [VGUImage](_v_g_u_image.md) \*
图像对象 | +| [wrapx](_display.md#wrapx) | [VGUWrapType](_display.md#vguwraptype)
图像水平方向平铺类型 | +| [wrapy](_display.md#wrapy) | [VGUWrapType](_display.md#vguwraptype)
图像垂直方向平铺类型 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_point.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_point.md index 1d7c6a08a3f967bf5ed110d8e7f84762984ecde4..bf2a27cd742a019241f99a49713de86c6079ee04 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_point.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_point.md @@ -1,7 +1,7 @@ # VGUPoint -## **概述** +## 概述 坐标点对象。 @@ -10,12 +10,12 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [x](_display.md#x-34) | 点水平坐标 | -| [y](_display.md#y-34) | 点垂直坐标 | +| [x](_display.md#x-34) | [VGUScalar](_display.md#vguscalar)
点水平坐标 | +| [y](_display.md#y-34) | [VGUScalar](_display.md#vguscalar)
点垂直坐标 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_radial.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_radial.md index f31d962ebf8de392564085f8651a8b3fdd126fa3..5f6efd05b85bf77a83ed63bcffb769600b382648 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_radial.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_radial.md @@ -1,7 +1,7 @@ # VGURadial -## **概述** +## 概述 辐射渐变。 @@ -10,16 +10,16 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [x0](_display.md#x0-22) | 内圈圆心水平坐标 | -| [y0](_display.md#y0-22) | 内圈圆心垂直坐标 | -| [r0](_display.md#r0) | 内圈圆半径 | -| [x1](_display.md#x1-33) | 外圈圆心水平坐标 | -| [y1](_display.md#y1-33) | 外圈圆心垂直坐标 | -| [r1](_display.md#r1) | 外圈圆半径 | +| [x0](_display.md#x0-22) | [VGUScalar](_display.md#vguscalar)
内圈圆心水平坐标 | +| [y0](_display.md#y0-22) | [VGUScalar](_display.md#vguscalar)
内圈圆心垂直坐标 | +| [r0](_display.md#r0) | [VGUScalar](_display.md#vguscalar)
内圈圆半径 | +| [x1](_display.md#x1-33) | [VGUScalar](_display.md#vguscalar)
外圈圆心水平坐标 | +| [y1](_display.md#y1-33) | [VGUScalar](_display.md#vguscalar)
外圈圆心垂直坐标 | +| [r1](_display.md#r1) | [VGUScalar](_display.md#vguscalar)
外圈圆半径 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_rect.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_rect.md index 161290841e1bd96ba476ae2e5b14001543bfaa70..622ff424d017a2430b8b876626eadf97f144b20d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_rect.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_rect.md @@ -1,7 +1,7 @@ # VGURect -## **概述** +## 概述 矩形对象。 @@ -10,14 +10,14 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [x](_display.md#x-44) | 矩形水平起始坐标 | -| [y](_display.md#y-44) | 矩形垂直起始坐标 | -| [w](_display.md#w-22) | 矩形宽度 | -| [h](_display.md#h-22) | 矩形高度 | +| [x](_display.md#x-44) | [VGUScalar](_display.md#vguscalar)
矩形水平起始坐标 | +| [y](_display.md#y-44) | [VGUScalar](_display.md#vguscalar)
矩形垂直起始坐标 | +| [w](_display.md#w-22) | [VGUScalar](_display.md#vguscalar)
矩形宽度 | +| [h](_display.md#h-22) | [VGUScalar](_display.md#vguscalar)
矩形高度 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_solid.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_solid.md index 676479dc7b2dce3b259fba117e30f8a5a29befae..2d1b530821b1487db7fa062270fefe1d80db0d18 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_solid.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_solid.md @@ -1,7 +1,7 @@ # VGUSolid -## **概述** +## 概述 颜色对象 @@ -10,12 +10,12 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [color](_display.md#color-55) | 颜色值 | -| [opacity](_display.md#opacity-33) | 透明度.,取值范围 0 ~ 255。 | +| [color](_display.md#color-55) | uint32_t
颜色值 | +| [opacity](_display.md#opacity-33) | uint8_t
透明度,值范围 0 ~ 255 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_stroke_attr.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_stroke_attr.md index 50e0672bf8078048db4c8698d1fe41162754668f..9f7e5385bd1258c44a1ac2d12f1e37ef4e29450d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_stroke_attr.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_stroke_attr.md @@ -1,7 +1,7 @@ # VGUStrokeAttr -## **概述** +## 概述 描边路径的属性。 @@ -10,14 +10,14 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [cap](_display.md#cap) | 线帽类型 | -| [join](_display.md#join) | 联结类型 | -| [miterLimit](_display.md#miterlimit) | 最大斜切长度 | -| [width](_display.md#width-99) | 线宽 | +| [cap](_display.md#cap) | [VGULineCap](_display.md#vgulinecap)
线帽类型 | +| [join](_display.md#join) | [VGUJointType](_display.md#vgujointtype)
联结类型 | +| [miterLimit](_display.md#miterlimit) | float
最大斜切长度 | +| [width](_display.md#width-99) | float
线宽 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_surface.md b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_surface.md index bfd04bcea0e682456704e2e100a679be38279eb6..10e061873bb5c93bd48b8f382f34f9d843bdf359 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_v_g_u_surface.md +++ b/zh-cn/device-dev/reference/hdi-apis/_v_g_u_surface.md @@ -1,7 +1,7 @@ # VGUSurface -## **概述** +## 概述 2D硬件加速绘制目标表面。 @@ -10,17 +10,17 @@ [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [buffer](_display.md#buffer-23) | 位图缓存 | -| [clipRect](_display.md#cliprect) | 矩形剪切域,如果为空,整个表面直接渲染。 | -| [clipPath](_display.md#clippath) | 路径剪切域,如果为空,整个表面直接渲染。 | -| [clipType](_display.md#cliptype) | 表面剪切类型 | -| [mask](_display.md#mask) | 蒙版图层, 可以为空。 | -| [blend](_display.md#blend) | 混合叠加模式 | -| [filter](_display.md#filter) | 图像滤波类型 | +| [buffer](_display.md#buffer-23) | [VGUBuffer](_v_g_u_buffer.md) \*
位图缓存 | +| [clipRect](_display.md#cliprect) | [VGURect](_v_g_u_rect.md) \*
矩形剪切域,如果为空,整个表面直接渲染。 | +| [clipPath](_display.md#clippath) | [VGUPath](_v_g_u_path.md) \*
路径剪切域,如果为空,整个表面直接渲染。 | +| [clipType](_display.md#cliptype) | [VGUClipType](_display.md#vgucliptype)
表面剪切类型 | +| [mask](_display.md#mask) | [VGUMaskLayer](_v_g_u_mask_layer.md) \*
蒙版图层,可以为空 | +| [blend](_display.md#blend) | [VGUBlendType](_display.md#blendtype)
混合叠加模式 | +| [filter](_display.md#filter) | [VGUFilter](_display.md#vgufilter)
图像滤波类型 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_verify_alloc_info.md b/zh-cn/device-dev/reference/hdi-apis/_verify_alloc_info.md index afafaf1ca376e5543550c8f8fda49dbfa920bd87..ec88d736e0748ae7e8e5134a1e700688cd4a450c 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_verify_alloc_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_verify_alloc_info.md @@ -1,23 +1,23 @@ # VerifyAllocInfo -## **概述** +## 概述 -用于验证内存分配信息的结构体定义。 +用于验证内存分配信息的结构体定义 **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [width](_display.md#width-79) | 分配内存的宽度 | -| [height](_display.md#height-78) | 分配内存的高度 | -| [usage](_display.md#usage-22) | 内存的用处 | -| [format](_display.md#format-22) | 分配内存的像素格式 | +| [width](_display.md#width-79) | uint32_t
分配内存的宽度 | +| [height](_display.md#height-78) | uint32_t
分配内存的高度 | +| [usage](_display.md#usage-22) | uint64_t
内存的用处 | +| [format](_display.md#format-22) | [PixelFormat](_display.md#pixelformat)
分配内存的像素格式 | diff --git a/zh-cn/device-dev/reference/hdi-apis/vibrator.md b/zh-cn/device-dev/reference/hdi-apis/_vibrator.md similarity index 83% rename from zh-cn/device-dev/reference/hdi-apis/vibrator.md rename to zh-cn/device-dev/reference/hdi-apis/_vibrator.md index 2d6e1c4eb804fe204f991cb2644e6ef13612028c..e8b27e100cb9e68f2b4041f418edf48e42001cff 100644 --- a/zh-cn/device-dev/reference/hdi-apis/vibrator.md +++ b/zh-cn/device-dev/reference/hdi-apis/_vibrator.md @@ -1,22 +1,22 @@ # Vibrator -## **概述** +## 概述 马达驱动对马达服务提供通用的接口能力。 模块提供马达服务对马达驱动访问的统一接口,服务获取驱动对象或者代理后,控制马达的单次振动、周期性振动、停止振动、设置马达振幅与频率。 -**Since**: +**Since:** 3.2 -**Version**: +**Version:** 1.1 -## **汇总** +## 汇总 ### 文件 @@ -31,8 +31,8 @@ | 名称 | 描述 | | -------- | -------- | -| [IVibratorInterface](interface_i_vibrator_interface.md) | Vibrator模块向上层服务提供统一的接口。 | -| [HdfVibratorInfo](_hdf_vibrator_info.md) | 定义马达参数。 | +| [IVibratorInterface](interface_i_vibrator_interface.md) | interface
Vibrator模块向上层服务提供统一的接口。 | +| [HdfVibratorInfo](_hdf_vibrator_info.md) | struct
定义马达参数。 | ### 枚举 @@ -49,7 +49,7 @@ | package ohos.hdi.vibrator.v1_1 | 马达模块接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### HdfVibratorMode diff --git a/zh-cn/device-dev/reference/hdi-apis/_vibrator_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_vibrator_types_8idl.md index fcb8a8a80b0538a70f9221b15f7ad8ed36df28ed..968573eddbb293a26af71c10239a4528a596b31e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_vibrator_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_vibrator_types_8idl.md @@ -1,7 +1,7 @@ # VibratorTypes.idl -## **概述** +## 概述 定义马达数据结构,包括马达振动模式和马达参数。 @@ -15,24 +15,24 @@ **相关模块:** -[Vibrator](vibrator.md) +[Vibrator](_vibrator.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [HdfVibratorInfo](_hdf_vibrator_info.md) | 定义马达参数。 | +| [HdfVibratorInfo](_hdf_vibrator_info.md) | struct
定义马达参数。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [HdfVibratorMode](vibrator.md#hdfvibratormode) { HDF_VIBRATOR_MODE_ONCE, HDF_VIBRATOR_MODE_PRESET, HDF_VIBRATOR_MODE_BUTT } | 枚举马达的振动模式。 | +| [HdfVibratorMode](_vibrator.md#hdfvibratormode) { HDF_VIBRATOR_MODE_ONCE, HDF_VIBRATOR_MODE_PRESET, HDF_VIBRATOR_MODE_BUTT } | 枚举马达的振动模式。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_video_port_cap.md b/zh-cn/device-dev/reference/hdi-apis/_video_port_cap.md index e97bf3ac18a1d93424dc80ab64fb7d13d9bc671b..f89ab6330596dde6f648d7296f40e65f43d1a09b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_video_port_cap.md +++ b/zh-cn/device-dev/reference/hdi-apis/_video_port_cap.md @@ -1,32 +1,32 @@ # VideoPortCap -## **概述** +## 概述 定义视频编解码能力。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [minSize](#minsize) | 支持的最小分辨率 | -| [maxSize](#maxsize) | 支持的最大分辨率 | -| [whAlignment](#whalignment) | 宽高对齐值 | -| [blockCount](#blockcount) | 支持的块数量范围 | -| [blocksPerSecond](#blockspersecond) | 每秒可处理的块数量范围 | -| [blockSize](#blocksize) | 支持的块大小 | -| [supportPixFmts](#supportpixfmts) [[PIX_FORMAT_NUM](codec.md#gadb8c6478388b68c09835ebe093a8920a)] | 支持的像素格式 | +| [minSize](#minsize) | [Rect](_rect.md)
支持的最小分辨率。 | +| [maxSize](#maxsize) | [Rect](_rect.md)
支持的最大分辨率。 | +| [whAlignment](#whalignment) | [Alignment](_alignment.md)
宽高对齐值。 | +| [blockCount](#blockcount) | [RangeValue](_range_value.md)
支持的块数量范围。 | +| [blocksPerSecond](#blockspersecond) | [RangeValue](_range_value.md)
每秒可处理的块数量范围。 | +| [blockSize](#blocksize) | [Rect](_rect.md)
支持的块大小。 | +| [supportPixFmts](#supportpixfmts) [[PIX_FORMAT_NUM](_codec.md#pix_format_num)] | int32_t
支持的像素格式,详见OMX_COLOR_FORMATTYPE。 | -## **类成员变量说明** +## 类成员变量说明 ### blockCount @@ -36,7 +36,7 @@ RangeValue VideoPortCap::blockCount ``` -**描述:** +**描述:** 支持的块数量范围。 @@ -48,7 +48,7 @@ RangeValue VideoPortCap::blockCount Rect VideoPortCap::blockSize ``` -**描述:** +**描述:** 支持的块大小。 @@ -60,7 +60,7 @@ Rect VideoPortCap::blockSize RangeValue VideoPortCap::blocksPerSecond ``` -**描述:** +**描述:** 每秒可处理的块数量范围。 @@ -72,7 +72,7 @@ RangeValue VideoPortCap::blocksPerSecond Rect VideoPortCap::maxSize ``` -**描述:** +**描述:** 支持的最大分辨率。 @@ -84,7 +84,7 @@ Rect VideoPortCap::maxSize Rect VideoPortCap::minSize ``` -**描述:** +**描述:** 支持的最小分辨率。 @@ -96,9 +96,9 @@ Rect VideoPortCap::minSize int32_t VideoPortCap::supportPixFmts[PIX_FORMAT_NUM] ``` -**描述:** +**描述:** -支持的像素格式,详见**OMX_COLOR_FORMATTYPE**。 +支持的像素格式,详见OMX_COLOR_FORMATTYPE。 ### whAlignment @@ -108,6 +108,6 @@ int32_t VideoPortCap::supportPixFmts[PIX_FORMAT_NUM] Alignment VideoPortCap::whAlignment ``` -**描述:** +**描述:** 宽高对齐值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_voice_radio_technology.md b/zh-cn/device-dev/reference/hdi-apis/_voice_radio_technology.md new file mode 100644 index 0000000000000000000000000000000000000000..bed2ccda864369a3abb93292239aef71f78b1bef --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_voice_radio_technology.md @@ -0,0 +1,132 @@ +# VoiceRadioTechnology + + +## 概述 + +电路域接入技术。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [srvStatus](#srvstatus) | enum [RilSrvStatus](_ril.md#rilsrvstatus)
系统服务状态  | +| [srvDomain](#srvdomain) | enum [RilSrvDomain](_ril.md#rilsrvdomain)
系统服务域  | +| [roamStatus](#roamstatus) | enum [RilRoamStatus](_ril.md#rilroamstatus)
漫游状态  | +| [simStatus](#simstatus) | enum [RilSimStatus](_ril.md#rilsimstatus)
SIM卡状态  | +| [lockStatus](#lockstatus) | enum [RilSimLockStatus](_ril.md#rilsimlockstatus)
SIM卡的LOCK状态  | +| [sysMode](#sysmode) | enum [RilSysMode](_ril.md#rilsysmode)
系统制式  | +| [sysModeName](#sysmodename) | String
系统制式对应字符串  | +| [actType](#acttype) | enum [RilRadioTech](_ril.md#rilradiotech)
语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) | +| [actName](#actname) | String
语音接入技术类型对应字符串  | +| [flag](#flag) | int
接入技术标识  | + + +## 类成员变量说明 + + +### actName + + +``` +String VoiceRadioTechnology::actName +``` +**描述:** +语音接入技术类型对应字符串 + + +### actType + + +``` +enum RilRadioTech VoiceRadioTechnology::actType +``` +**描述:** +语音接入技术类型,具体查看[RilRadioTech](_ril.md#rilradiotech) + + +### flag + + +``` +int VoiceRadioTechnology::flag +``` +**描述:** +接入技术标识 + + +### lockStatus + + +``` +enum RilSimLockStatus VoiceRadioTechnology::lockStatus +``` +**描述:** +SIM卡的LOCK状态 + + +### roamStatus + + +``` +enum RilRoamStatus VoiceRadioTechnology::roamStatus +``` +**描述:** +漫游状态 + + +### simStatus + + +``` +enum RilSimStatus VoiceRadioTechnology::simStatus +``` +**描述:** +SIM卡状态 + + +### srvDomain + + +``` +enum RilSrvDomain VoiceRadioTechnology::srvDomain +``` +**描述:** +系统服务域 + + +### srvStatus + + +``` +enum RilSrvStatus VoiceRadioTechnology::srvStatus +``` +**描述:** +系统服务状态 + + +### sysMode + + +``` +enum RilSysMode VoiceRadioTechnology::sysMode +``` +**描述:** +系统制式 + + +### sysModeName + + +``` +String VoiceRadioTechnology::sysModeName +``` +**描述:** +系统制式对应字符串 diff --git a/zh-cn/device-dev/reference/hdi-apis/_w_l_a_n.md b/zh-cn/device-dev/reference/hdi-apis/_w_l_a_n.md new file mode 100644 index 0000000000000000000000000000000000000000..ee3feb8a5b3368a38b164d5b39291c07628b59df --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_w_l_a_n.md @@ -0,0 +1,55 @@ +# WLAN + + +## 概述 + +WLAN模块向上层WLAN服务提供了统一接口。 + +上层WLAN服务开发人员可根据WLAN模块提供的向上统一接口获取如下能力:建立/关闭WLAN热点,扫描/关联WLAN热点,WLAN平台芯片管理,网络数据缓冲的申请、释放、移动等操作,网络设备管理,电源管理等。 + +**Since:** + +3.2 + +**Version:** + +1.0 + + +## 汇总 + + +### 文件 + + | 名称 | 描述 | +| -------- | -------- | +| [IWlanCallback.idl](_i_wlan_callback_8idl.md) | WLAN模块为WLAN服务提供的重启驱动、扫描结果、Netlink消息处理的回调。 | +| [IWlanInterface.idl](_i_wlan_interface_8idl.md) | 建立/关闭WLAN热点,扫描/关联/去关联WLAN热点,设置国家码,管理网络设备等操作的接口。 | +| [WlanTypes.idl](_wlan_types_8idl.md) | WLAN模块相关的数据类型。 | + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [IWlanCallback](interface_i_wlan_callback.md) | interface
定义WLAN模块的回调函数。 | +| [IWlanInterface](interface_i_wlan_interface.md) | interface
WLAN模块向上层WLAN服务提供了统一接口。 | +| [HdfFeatureInfo](_hdf_feature_info.md) | struct
feature对象信息。 | +| [HdfStaInfo](_hdf_sta_info.md) | struct
STA的信息。 | +| [HdfWifiDriverScanSsid](_hdf_wifi_driver_scan_ssid.md) | struct
WiFi扫描参数SSID信息。 | +| [HdfWifiScan](_hdf_wifi_scan.md) | struct
WiFi扫描参数。 | +| [HdfNetDeviceInfo](_hdf_net_device_info.md) | struct
网络设备信息。 | +| [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) | struct
网络设备信息集合。 | +| [HdfWifiScanResult](_hdf_wifi_scan_result.md) | struct
WiFi扫描结果。 | +| [HdfWifiInfo](_hdf_wifi_info.md) | struct
WiFi频段信息。 | +| [MeasChannelParam](_meas_channel_param.md) | struct
信道测量参数。 | +| [MeasChannelResult](_meas_channel_result.md) | struct
信道测量结果。 | +| [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) | struct
投屏参数。 | +| [WifiStationInfo](_wifi_station_info.md) | struct
STA的信息。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.wlan.v1_0 | WLAN模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_w_r_g_b_color.md b/zh-cn/device-dev/reference/hdi-apis/_w_r_g_b_color.md index a083af89d8eaca3564777e6d1274f1e21076157f..2ae663415cd765778f01067bdfa54d94d00fec28 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_w_r_g_b_color.md +++ b/zh-cn/device-dev/reference/hdi-apis/_w_r_g_b_color.md @@ -1,37 +1,33 @@ # WRGBColor -## **概述** +## 概述 定义灯的WRGB模式。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [w](#w) | 白色值,范围为0-255。 | -| [r](#r) | 红色值,范围为0-255。 | -| [g](#g) | 绿色值,范围为0-255。 | -| [b](#b) | 蓝色值,范围为0-255。 | +| [w](#w) | int
白色值,范围为0-255。  | +| [r](#r) | int
红色值,范围为0-255。  | +| [g](#g) | int
绿色值,范围为0-255。  | +| [b](#b) | int
蓝色值,范围为0-255。  | -## **类成员变量说明** +## 类成员变量说明 ### b @@ -40,9 +36,7 @@ ``` int WRGBColor::b ``` - -**描述:** - +**描述:** 蓝色值,范围为0-255。 @@ -52,9 +46,7 @@ int WRGBColor::b ``` int WRGBColor::g ``` - -**描述:** - +**描述:** 绿色值,范围为0-255。 @@ -64,9 +56,7 @@ int WRGBColor::g ``` int WRGBColor::r ``` - -**描述:** - +**描述:** 红色值,范围为0-255。 @@ -76,7 +66,5 @@ int WRGBColor::r ``` int WRGBColor::w ``` - -**描述:** - +**描述:** 白色值,范围为0-255。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_wcdma_rssi.md b/zh-cn/device-dev/reference/hdi-apis/_wcdma_rssi.md new file mode 100644 index 0000000000000000000000000000000000000000..e69de0ff3b3fec343904c6beb9f2b02907eab552 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_wcdma_rssi.md @@ -0,0 +1,66 @@ +# WcdmaRssi + + +## 概述 + +WCDMA信号强度。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [rxlev](#rxlev) | int
信号接收强度,取值范围0~99  | +| [ecio](#ecio) | int
每个PN码片的接收能量与总接收功率谱密度之比  | +| [rscp](#rscp) | int
接收信号码功率,取值范围0~96  | +| [ber](#ber) | int
误码率,取值范围0~7  | + + +## 类成员变量说明 + + +### ber + + +``` +int WcdmaRssi::ber +``` +**描述:** +误码率,取值范围0~7 + + +### ecio + + +``` +int WcdmaRssi::ecio +``` +**描述:** +每个PN码片的接收能量与总接收功率谱密度之比 + + +### rscp + + +``` +int WcdmaRssi::rscp +``` +**描述:** +接收信号码功率,取值范围0~96 + + +### rxlev + + +``` +int WcdmaRssi::rxlev +``` +**描述:** +信号接收强度,取值范围0~99 diff --git a/zh-cn/device-dev/reference/hdi-apis/_wifi_station_info.md b/zh-cn/device-dev/reference/hdi-apis/_wifi_station_info.md index 3ae0f0f9ae61ea3f63febc2fadae143602c7b36e..7728fa06146f0e07c5d6c525a6c09129d2b4f805 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_wifi_station_info.md +++ b/zh-cn/device-dev/reference/hdi-apis/_wifi_station_info.md @@ -1,42 +1,38 @@ # WifiStationInfo -## **概述** +## 概述 STA的信息。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [rxRate](#rxrate) | 接收速率。 | -| [txRate](#txrate) | 发送速率。 | -| [flags](#flags) | 速率传输类型。 | -| [rxVhtmcs](#rxvhtmcs) | 接收VHT-MCS(Very High Throughput Modulation and Coding Scheme)配置。 | -| [txVhtmcs](#txvhtmcs) | 发送VHT-MCS(Very High Throughput Modulation and Coding Scheme)配置。 | -| [rxMcs](#rxmcs) | 接收MCS(Modulation and Coding Scheme)索引。 | -| [txMcs](#txmcs) | 发送MCS(Modulation and Coding Scheme)索引。 | -| [rxVhtNss](#rxvhtnss) | 接收VHT-NSS(Very High Throughput Number of Spatial Streams)配置。 | -| [txVhtNss](#txvhtnss) | 发送VHT-NSS(Very High Throughput Number of Spatial Streams)配置。 | +| [rxRate](#rxrate) | unsigned int
接收速率。  | +| [txRate](#txrate) | unsigned int
发送速率。  | +| [flags](#flags) | unsigned int
速率传输类型。  | +| [rxVhtmcs](#rxvhtmcs) | unsigned char
接收VHT-MCS(Very High Throughput Modulation and Coding Scheme)配置。  | +| [txVhtmcs](#txvhtmcs) | unsigned char
发送VHT-MCS(Very High Throughput Modulation and Coding Scheme)配置。  | +| [rxMcs](#rxmcs) | unsigned char
接收MCS(Modulation and Coding Scheme)索引。  | +| [txMcs](#txmcs) | unsigned char
发送MCS(Modulation and Coding Scheme)索引。  | +| [rxVhtNss](#rxvhtnss) | unsigned char
接收VHT-NSS(Very High Throughput Number of Spatial Streams)配置。  | +| [txVhtNss](#txvhtnss) | unsigned char
发送VHT-NSS(Very High Throughput Number of Spatial Streams)配置。  | -## **类成员变量说明** +## 类成员变量说明 ### flags @@ -45,9 +41,7 @@ STA的信息。 ``` unsigned int WifiStationInfo::flags ``` - -**描述:** - +**描述:** 速率传输类型。 @@ -57,9 +51,7 @@ unsigned int WifiStationInfo::flags ``` unsigned char WifiStationInfo::rxMcs ``` - -**描述:** - +**描述:** 接收MCS(Modulation and Coding Scheme)索引。 @@ -69,9 +61,7 @@ unsigned char WifiStationInfo::rxMcs ``` unsigned int WifiStationInfo::rxRate ``` - -**描述:** - +**描述:** 接收速率。 @@ -81,9 +71,7 @@ unsigned int WifiStationInfo::rxRate ``` unsigned char WifiStationInfo::rxVhtmcs ``` - -**描述:** - +**描述:** 接收VHT-MCS(Very High Throughput Modulation and Coding Scheme)配置。 @@ -93,9 +81,7 @@ unsigned char WifiStationInfo::rxVhtmcs ``` unsigned char WifiStationInfo::rxVhtNss ``` - -**描述:** - +**描述:** 接收VHT-NSS(Very High Throughput Number of Spatial Streams)配置。 @@ -105,9 +91,7 @@ unsigned char WifiStationInfo::rxVhtNss ``` unsigned char WifiStationInfo::txMcs ``` - -**描述:** - +**描述:** 发送MCS(Modulation and Coding Scheme)索引。 @@ -117,9 +101,7 @@ unsigned char WifiStationInfo::txMcs ``` unsigned int WifiStationInfo::txRate ``` - -**描述:** - +**描述:** 发送速率。 @@ -129,9 +111,7 @@ unsigned int WifiStationInfo::txRate ``` unsigned char WifiStationInfo::txVhtmcs ``` - -**描述:** - +**描述:** 发送VHT-MCS(Very High Throughput Modulation and Coding Scheme)配置。 @@ -141,7 +121,5 @@ unsigned char WifiStationInfo::txVhtmcs ``` unsigned char WifiStationInfo::txVhtNss ``` - -**描述:** - +**描述:** 发送VHT-NSS(Very High Throughput Number of Spatial Streams)配置。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_wififence_request.md b/zh-cn/device-dev/reference/hdi-apis/_wififence_request.md new file mode 100644 index 0000000000000000000000000000000000000000..4475a26ad2766b0d3ce4fc27ba32c5c57cbb3ad0 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_wififence_request.md @@ -0,0 +1,65 @@ +# WififenceRequest + + +## 概述 + +定义添加Wi-Fi围栏的数据结构。 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceWififence](_hdi_lpfence_wififence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [wififenceId](#wififenceid) | int
Wi-Fi围栏的ID号,用于标识某个Wi-Fi围栏,不可重复添加相同ID号的围栏。 | +| [algoType](#algotype) | int
Wi-Fi围栏的匹配算法。详见[WififenceAlgoType](_hdi_lpfence_wififence.md#wififencealgotype)。 | +| [bssid](#bssid) | unsigned char[]
若使用[TYPE_ONE_BSSID](_hdi_lpfence_wififence.md#wififencealgotype)类型算法,则是多组Wi-Fi MAC地址。 若使用[TYPE_ONE_BSSID](_hdi_lpfence_wififence.md#wififencealgotype)类型算法,则是多组的Wi-Fi MAC地址和对应RSSI值。 | + + +## 类成员变量说明 + + +### algoType + + +``` +int WififenceRequest::algoType +``` + +**描述:** + +Wi-Fi围栏的匹配算法。详见[WififenceAlgoType](_hdi_lpfence_wififence.md#wififencealgotype)。 + + +### bssid + + +``` +unsigned char [] WififenceRequest::bssid +``` + +**描述:** + +若使用[TYPE_ONE_BSSID](_hdi_lpfence_wififence.md#wififencealgotype)类型算法,则是多组Wi-Fi MAC地址。 若使用[TYPE_ONE_BSSID](_hdi_lpfence_wififence.md#wififencealgotype)类型算法,则是多组的Wi-Fi MAC地址和对应RSSI值。 + + +### wififenceId + + +``` +int WififenceRequest::wififenceId +``` + +**描述:** + +Wi-Fi围栏的ID号,用于标识某个Wi-Fi围栏,不可重复添加相同ID号的围栏。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_wififence_size.md b/zh-cn/device-dev/reference/hdi-apis/_wififence_size.md new file mode 100644 index 0000000000000000000000000000000000000000..a59f694649f16175aa2e6acb8e4e47d64e182d0a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_wififence_size.md @@ -0,0 +1,46 @@ +# WififenceSize + + +## 概述 + +定义Wi-Fi围栏使用信息的数据结构。 + +**Since:** +4.0 +**相关模块:** + +[HdiLpfenceWififence](_hdi_lpfence_wififence.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [maxNum](#maxnum) | unsigned int
设备支持添加Wi-Fi围栏的最大个数。  | +| [usedNum](#usednum) | unsigned int
设备当前已添加的Wi-Fi围栏个数。  | + + +## 类成员变量说明 + + +### maxNum + + +``` +unsigned int WififenceSize::maxNum +``` +**描述:** +设备支持添加Wi-Fi围栏的最大个数。 + + +### usedNum + + +``` +unsigned int WififenceSize::usedNum +``` +**描述:** +设备当前已添加的Wi-Fi围栏个数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/_wififence_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_wififence_types_8idl.md new file mode 100644 index 0000000000000000000000000000000000000000..ed2a51f6a7fc86efedbaefa0c2e0de7cbc30d4bb --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_wififence_types_8idl.md @@ -0,0 +1,44 @@ +# WififenceTypes.idl + + +## 概述 + +定义Wi-Fi围栏使用的数据类型。 + +**Since:** + +4.0 + +**Version:** + +1.0 + +**相关模块:** + +[HdiLpfenceWififence](_hdi_lpfence_wififence.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [WififenceRequest](_wififence_request.md) | struct
定义添加Wi-Fi围栏的数据结构。 | +| [WififenceSize](_wififence_size.md) | struct
定义Wi-Fi围栏使用信息的数据结构。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [WififenceTransition](_hdi_lpfence_wififence.md#wififencetransition) { WIFIFENCE_TRANSITION_ENTERED = (1 << 0) , WIFIFENCE_TRANSITION_EXITED = (1 << 1) } | 枚举Wi-Fi围栏状态事件。 | +| [WififenceAlgoType](_hdi_lpfence_wififence.md#wififencealgotype) { TYPE_ONE_BSSID = 1 , TYPE_FP_MATCH = 2 } | 枚举Wi-Fi围栏的匹配算法。 | + + +### 关键字 + + | 名称 | 描述 | +| -------- | -------- | +| package ohos.hdi.location.lpfence.wififence.v1_0 | Wi-Fi围栏模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_wlan_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/_wlan_types_8idl.md index 03cc663f0672292fae1a77a5f912f80050ee946f..6e41052c18f1d39e4c68d0b689e9301539ca9312 100644 --- a/zh-cn/device-dev/reference/hdi-apis/_wlan_types_8idl.md +++ b/zh-cn/device-dev/reference/hdi-apis/_wlan_types_8idl.md @@ -1,7 +1,9 @@ # WlanTypes.idl -## **概述** +## 概述 + +WLAN模块相关的数据类型。 WLAN模块中使用的数据类型,包括feature对象信息、STA信息、扫描信息、网络设备信息等。 @@ -15,28 +17,28 @@ WLAN模块中使用的数据类型,包括feature对象信息、STA信息、扫 **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [HdfFeatureInfo](_hdf_feature_info.md) | feature对象信息。 | -| [HdfStaInfo](_hdf_sta_info.md) | STA的信息。 | -| [HdfWifiDriverScanSsid](_hdf_wifi_driver_scan_ssid.md) | WiFi扫描参数SSID信息。 | -| [HdfWifiScan](_hdf_wifi_scan.md) | WiFi扫描参数。 | -| [HdfNetDeviceInfo](_hdf_net_device_info.md) | 网络设备信息。 | -| [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) | 网络设备信息集合。 | -| [HdfWifiScanResult](_hdf_wifi_scan_result.md) | WiFi扫描结果。 | -| [HdfWifiInfo](_hdf_wifi_info.md) | WiFi频段信息。 | -| [MeasChannelParam](_meas_channel_param.md) | 信道测量参数。 | -| [MeasChannelResult](_meas_channel_result.md) | 信道测量结果。 | -| [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) | 投屏参数。 | -| [WifiStationInfo](_wifi_station_info.md) | STA的信息。 | +| [HdfFeatureInfo](_hdf_feature_info.md) | struct
feature对象信息。 | +| [HdfStaInfo](_hdf_sta_info.md) | struct
STA的信息。 | +| [HdfWifiDriverScanSsid](_hdf_wifi_driver_scan_ssid.md) | struct
WiFi扫描参数SSID信息。 | +| [HdfWifiScan](_hdf_wifi_scan.md) | struct
WiFi扫描参数。 | +| [HdfNetDeviceInfo](_hdf_net_device_info.md) | struct
网络设备信息。 | +| [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) | struct
网络设备信息集合。 | +| [HdfWifiScanResult](_hdf_wifi_scan_result.md) | struct
WiFi扫描结果。 | +| [HdfWifiInfo](_hdf_wifi_info.md) | struct
WiFi频段信息。 | +| [MeasChannelParam](_meas_channel_param.md) | struct
信道测量参数。 | +| [MeasChannelResult](_meas_channel_result.md) | struct
信道测量结果。 | +| [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) | struct
投屏参数。 | +| [WifiStationInfo](_wifi_station_info.md) | struct
STA的信息。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/_yun_desc_info_.md b/zh-cn/device-dev/reference/hdi-apis/_yun_desc_info_.md deleted file mode 100644 index 248ce34a95277a447f7a2c07d77b4155ee135898..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/_yun_desc_info_.md +++ /dev/null @@ -1,26 +0,0 @@ -# YUVDescInfo - - -## **概述** - -YUV描述信息结构体定义。 - -**相关模块:** - -[Display](_display.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [baseAddr](_display.md#baseaddr) | 内存的初始地址 | -| [yOffset](_display.md#yoffset) | Y的偏移量 | -| [uOffset](_display.md#uoffset) | U的偏移量 | -| [vOffset](_display.md#voffset) | V的偏移量 | -| [yStride](_display.md#ystride) | Y的stride信息 | -| [uvStride](_display.md#uvstride) | UV的stride信息 | -| [uvStep](_display.md#uvstep) | UV的step信息 | diff --git a/zh-cn/device-dev/reference/hdi-apis/_yuv_desc_info.md b/zh-cn/device-dev/reference/hdi-apis/_yuv_desc_info.md new file mode 100644 index 0000000000000000000000000000000000000000..35c62866082bb6342034299fb6041330b36cdb24 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/_yuv_desc_info.md @@ -0,0 +1,26 @@ +# YUVDescInfo + + +## 概述 + +YUV描述信息结构体定义 + +**相关模块:** + +[Display](_display.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [baseAddr](_display.md#baseaddr) | void \*
内存的初始地址 | +| [yOffset](_display.md#yoffset) | size_t
Y的偏移量 | +| [uOffset](_display.md#uoffset) | size_t
U的偏移量 | +| [vOffset](_display.md#voffset) | size_t
V的偏移量 | +| [yStride](_display.md#ystride) | size_t
Y的stride信息 | +| [uvStride](_display.md#uvstride) | size_t
UV的stride信息 | +| [uvStep](_display.md#uvstep) | size_t
UV的step信息 | diff --git a/zh-cn/device-dev/reference/hdi-apis/activity_recognition_types_idl.md b/zh-cn/device-dev/reference/hdi-apis/activity_recognition_types_idl.md deleted file mode 100644 index b57d375dc22f3750b7c3423b7e91224934b44c65..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/activity_recognition_types_idl.md +++ /dev/null @@ -1,43 +0,0 @@ -# ActivityRecognitionTypes.idl - - -## **概述** - -定义行为识别模块使用的数据类型。 - -**Since**: - -3.2 - -**Version**: - -1.0 - -**相关模块:** - -[HdiActivityRecognition](activity_recognition.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [ActRecognitionEvent](_act_recognition_event.md) | 定义行为事件上报的数据结构。 | - - -### 枚举 - - | 名称 | 描述 | -| -------- | -------- | -| [ActRecognitionEventType](activity_recognition.md#actrecognitioneventtype) { ACT_RECOGNITION_EVENT_ENTER = 0x01, ACT_RECOGNITION_EVENT_EXIT = 0x02 } | 枚举行为事件的类型。 | -| [ActRecognitionPowerMode](activity_recognition.md#actrecognitionpowermode) { ACT_RECOGNITION_NORMAL_MODE = 0, ACT_RECOGNITION_LOW_POWER_MODE = 1 } | 枚举功耗模式的类型。 | - - -### 关键字 - - | 名称 | 描述 | -| -------- | -------- | -| package ohos.hdi.activity_recognition.v1_0 | 行为识别模块接口的包路径。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__adapter_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__adapter_8h.md deleted file mode 100644 index c0b214a7cd1bb4ac363ddbcd0086614b7f24ba42..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__adapter_8h.md +++ /dev/null @@ -1,28 +0,0 @@ -# audio_adapter.h - - -## **概述** - -Audio适配器的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioAdapter](_audio_adapter.md) | AudioAdapter音频适配器接口 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__attribute_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__attribute_8h.md deleted file mode 100644 index b17a4f40f36f38c8056a2444c545dafce407eb94..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__attribute_8h.md +++ /dev/null @@ -1,28 +0,0 @@ -# audio_attribute.h - - -## **概述** - -Audio属性的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioAttribute](_audio_attribute.md) | AudioAttribute音频属性接口 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__capture_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__capture_8h.md deleted file mode 100644 index d4579c7564d0c68e2822d437b78c59d792348bed..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__capture_8h.md +++ /dev/null @@ -1,28 +0,0 @@ -# audio_capture.h - - -## **概述** - -Audio录音的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioCapture](_audio_capture.md) | AudioCapture音频录音接口 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__control_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__control_8h.md deleted file mode 100644 index ae8509fca29ab27aaa8d7cbaf26b4b23a90ca89e..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__control_8h.md +++ /dev/null @@ -1,28 +0,0 @@ -# audio_control.h - - -## **概述** - -Audio控制的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioControl](_audio_control.md) | AudioControl音频控制接口 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__manager_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__manager_8h.md deleted file mode 100644 index 921f549ce6aa3caeaf9129910c921ac999674d9c..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__manager_8h.md +++ /dev/null @@ -1,35 +0,0 @@ -# audio_manager.h - - -## **概述** - -Audio适配器管理及加载的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioManager](_audio_manager.md) | AudioManager音频适配器管理接口 | - - -### 函数 - - | 名称 | 描述 | -| -------- | -------- | -| [GetAudioManagerFuncs](_audio.md#getaudiomanagerfuncs) (void) | 获取音频适配器管理接口的操作函数列表,详情参考[AudioManager](_audio_manager.md)。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__render_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__render_8h.md deleted file mode 100644 index 873f032825cf98823f9e3518f79416f366745e77..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__render_8h.md +++ /dev/null @@ -1,28 +0,0 @@ -# audio_render.h - - -## **概述** - -Audio播放的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioRender](_audio_render.md) | AudioRender音频播放接口 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__scene_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__scene_8h.md deleted file mode 100644 index fefc2bec5aa19e1e1abbe0537f02fc995fc346e0..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__scene_8h.md +++ /dev/null @@ -1,28 +0,0 @@ -# audio_scene.h - - -## **概述** - -Audio场景的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioScene](_audio_scene.md) | AudioScene音频场景接口 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__types_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__types_8h.md deleted file mode 100644 index 2d61f62b539d810e3c92d314d6c40a19912f47f5..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__types_8h.md +++ /dev/null @@ -1,70 +0,0 @@ -# audio_types.h - - -## **概述** - -Audio模块接口定义中使用的自定义数据类型,包括音频端口、适配器描述符、设备描述符、场景描述符、采样属性、时间戳等。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioPort](_audio_port.md) | 音频端口 | -| [AudioAdapterDescriptor](_audio_adapter_descriptor.md) | 音频适配器描述符 | -| [AudioDeviceDescriptor](_audio_device_descriptor.md) | 音频设备描述符 | -| [AudioSceneDescriptor](_audio_scene_descriptor.md) | 音频场景描述符 | -| [AudioSceneDescriptor::SceneDesc](union_audio_scene_descriptor_1_1_scene_desc.md) | 音频场景描述 | -| [AudioSampleAttributes](_audio_sample_attributes.md) | 音频采样属性 | -| [AudioTimeStamp](_audio_time_stamp.md) | 音频时间戳 | -| [AudioSubPortCapability](_audio_sub_port_capability.md) | 音频子端口的支持能力 | -| [AudioPortCapability](_audio_port_capability.md) | 音频端口的支持能力 | -| [AudioMmapBufferDescriptor](_audio_mmap_buffer_descriptor.md) | mmap缓冲区描述符 | -| [AudioDevExtInfo](_audio_dev_ext_info.md) | 音频设备拓展信息. | -| [AudioMixExtInfo](_audio_mix_ext_info.md) | 音轨拓展信息 | -| [AudioSessionExtInfo](_audio_session_ext_info.md) | 会话拓展信息 | -| [AudioRouteNode](_audio_route_node.md) | 音频路由节点. | -| [AudioRoute](_audio_route.md) | 音频路由信息. | - - -### 类型定义 - - | 名称 | 描述 | -| -------- | -------- | -| AudioHandle | 音频句柄 | -| ([RenderCallback](_audio.md#rendercallback)) (enum AudioCallbackType, void \*reserved, void \*cookie) | 回调函数指针 | - - -### 枚举 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioPortDirection](_audio.md#audioportdirection) { PORT_OUT = 0x1u, PORT_IN = 0x2u, PORT_OUT_IN = 0x3u } | 音频端口的类型 | -| [AudioPortPin](_audio.md#audioportpin) { PIN_NONE = 0x0u, PIN_OUT_SPEAKER = 0x1u, PIN_OUT_HEADSET = 0x2u, PIN_OUT_LINEOUT = 0x4u,   PIN_OUT_HDMI = 0x8u, PIN_OUT_USB = 0x10u, PIN_OUT_USB_EXT = 0x20u, PIN_IN_MIC = 0x8000001u,   PIN_IN_HS_MIC = 0x8000002u, PIN_IN_LINEIN = 0x8000004u, PIN_IN_USB_EXT = 0x8000008u } | 音频适配器端口的PIN脚 | -| [AudioCategory](_audio.md#audiocategory) { AUDIO_IN_MEDIA = 0, AUDIO_IN_COMMUNICATION, AUDIO_IN_RINGTONE, AUDIO_IN_CALL } | 音频类型(category) | -| [AudioFormat](_audio.md#audioformat){ AUDIO_FORMAT_PCM_8_BIT = 0x1u, AUDIO_FORMAT_PCM_16_BIT = 0x2u, AUDIO_FORMAT_PCM_24_BIT = 0x3u, AUDIO_FORMAT_PCM_32_BIT = 0x4u,   AUDIO_FORMAT_AAC_MAIN = 0x1000001u, AUDIO_FORMAT_AAC_LC = 0x1000002u, AUDIO_FORMAT_AAC_LD = 0x1000003u, AUDIO_FORMAT_AAC_ELD = 0x1000004u,   AUDIO_FORMAT_AAC_HE_V1 = 0x1000005u, AUDIO_FORMAT_AAC_HE_V2 = 0x1000006u, AUDIO_FORMAT_G711A = 0x2000001u, AUDIO_FORMAT_G711U = 0x2000002u,   AUDIO_FORMAT_G726 = 0x2000003u } | 音频格式 | -| [AudioChannelMask](_audio.md#audiochannelmask){ AUDIO_CHANNEL_FRONT_LEFT = 0x1, AUDIO_CHANNEL_FRONT_RIGHT = 0x2, AUDIO_CHANNEL_MONO = 0x1u, AUDIO_CHANNEL_STEREO = 0x3u } | 音频通道掩码(mask) | -| [AudioSampleRatesMask](_audio.md#audiosampleratesmask){ AUDIO_SAMPLE_RATE_MASK_8000 = 0x1u, AUDIO_SAMPLE_RATE_MASK_12000 = 0x2u, AUDIO_SAMPLE_RATE_MASK_11025 = 0x4u, AUDIO_SAMPLE_RATE_MASK_16000 = 0x8u,   AUDIO_SAMPLE_RATE_MASK_22050 = 0x10u, AUDIO_SAMPLE_RATE_MASK_24000 = 0x20u, AUDIO_SAMPLE_RATE_MASK_32000 = 0x40u, AUDIO_SAMPLE_RATE_MASK_44100 = 0x80u,   AUDIO_SAMPLE_RATE_MASK_48000 = 0x100u, AUDIO_SAMPLE_RATE_MASK_64000 = 0x200u, AUDIO_SAMPLE_RATE_MASK_96000 = 0x400u, AUDIO_SAMPLE_RATE_MASK_INVALID = 0xFFFFFFFFu } | 音频采样频率MASK | -| [AudioPortPassthroughMode](_audio.md#audioportpassthroughmode){ PORT_PASSTHROUGH_LPCM = 0x1, PORT_PASSTHROUGH_RAW = 0x2, PORT_PASSTHROUGH_HBR2LBR = 0x4, PORT_PASSTHROUGH_AUTO = 0x8 } | 音频端口的数据透传模式 | -| [AudioSampleFormat](_audio.md#audiosampleformat){ AUDIO_SAMPLE_FORMAT_S8, AUDIO_SAMPLE_FORMAT_S8P, AUDIO_SAMPLE_FORMAT_U8, AUDIO_SAMPLE_FORMAT_U8P,   AUDIO_SAMPLE_FORMAT_S16, AUDIO_SAMPLE_FORMAT_S16P, AUDIO_SAMPLE_FORMAT_U16, AUDIO_SAMPLE_FORMAT_U16P,   AUDIO_SAMPLE_FORMAT_S24, AUDIO_SAMPLE_FORMAT_S24P, AUDIO_SAMPLE_FORMAT_U24, AUDIO_SAMPLE_FORMAT_U24P,   AUDIO_SAMPLE_FORMAT_S32, AUDIO_SAMPLE_FORMAT_S32P, AUDIO_SAMPLE_FORMAT_U32, AUDIO_SAMPLE_FORMAT_U32P,   AUDIO_SAMPLE_FORMAT_S64, AUDIO_SAMPLE_FORMAT_S64P, AUDIO_SAMPLE_FORMAT_U64, AUDIO_SAMPLE_FORMAT_U64P,   AUDIO_SAMPLE_FORMAT_F32, AUDIO_SAMPLE_FORMAT_F32P, AUDIO_SAMPLE_FORMAT_F64, AUDIO_SAMPLE_FORMAT_F64P } | 原始音频样本格式 | -| [AudioChannelMode](_audio.md#audiochannelmode){  AUDIO_CHANNEL_NORMAL = 0, AUDIO_CHANNEL_BOTH_LEFT, AUDIO_CHANNEL_BOTH_RIGHT, AUDIO_CHANNEL_EXCHANGE,   AUDIO_CHANNEL_MIX, AUDIO_CHANNEL_LEFT_MUTE, AUDIO_CHANNEL_RIGHT_MUTE, AUDIO_CHANNEL_BOTH_MUTE } | 音频播放的通道模式 | -| [AudioDrainNotifyType](_audio.md#audiodrainnotifytype){ AUDIO_DRAIN_NORMAL_MODE, AUDIO_DRAIN_EARLY_MODE } | DrainBuffer函数结束类型 | -| [AudioCallbackType](_audio.md#audiocallbacktype){ AUDIO_NONBLOCK_WRITE_COMPLETED, AUDIO_DRAIN_COMPLETED, AUDIO_FLUSH_COMPLETED, AUDIO_RENDER_FULL,   AUDIO_ERROR_OCCUR } | 回调函数通知事件类型 | -| [AudioPortRole](_audio.md#audioportrole){ AUDIO_PORT_UNASSIGNED_ROLE = 0, AUDIO_PORT_SOURCE_ROLE = 1, AUDIO_PORT_SINK_ROLE = 2 } | 音频端口角色 | -| [AudioPortType](_audio.md#audioporttype){ AUDIO_PORT_UNASSIGNED_TYPE = 0, AUDIO_PORT_DEVICE_TYPE = 1, AUDIO_PORT_MIX_TYPE = 2, AUDIO_PORT_SESSION_TYPE = 3 } | 音频端口类型. | -| [AudioSessionType](_audio.md#audiosessiontype){ AUDIO_OUTPUT_STAGE_SESSION = 0, AUDIO_OUTPUT_MIX_SESSION, AUDIO_ALLOCATE_SESSION, AUDIO_INVALID_SESSION } | 端口会话类型 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio__volume_8h.md b/zh-cn/device-dev/reference/hdi-apis/audio__volume_8h.md deleted file mode 100644 index 429de22809856c4523e327aa2861ce4590e3950d..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio__volume_8h.md +++ /dev/null @@ -1,28 +0,0 @@ -# audio_volume.h - - -## **概述** - -Audio音量的接口定义文件。 - -**Since:** - -1.0 - -**Version:** - -1.0 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [AudioVolume](_audio_volume.md) | AudioVolume音频音量接口 | diff --git a/zh-cn/device-dev/reference/hdi-apis/audio_portcap.md b/zh-cn/device-dev/reference/hdi-apis/audio_portcap.md deleted file mode 100644 index 2b1d6cf7178cf68030c31ef537da5b9c6e2caa13..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/audio_portcap.md +++ /dev/null @@ -1,79 +0,0 @@ -# AudioPortCap - - -## **概述** - -定义音频编解码能力。 - -**所属模块:** - -[Codec](codec.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [sampleFormats](#sampleformats) [SAMPLE_FMT_NUM] | 支持的音频采样格式,详见[AudioSampleFormat](codec.md#audiosampleformat)。 | -| [sampleRate](#samplerate) [SAMPLE_RATE_NUM] | 支持的音频采样率,详见[AudioSampleRate](codec.md#audiosamplerate)。 | -| [channelLayouts](#channellayouts) [CHANNEL_NUM] | 支持的音频通道数channel layouts。 | -| [channelCount](#channelcount) [CHANNEL_NUM] | 支持的音频通道数。 | - - -## **详细描述** - -定义音频编解码能力。 - - -## **类成员变量说明** - - -### channelCount - - -``` -int32_t AudioPortCap::channelCount[CHANNEL_NUM] -``` - -**描述:** - -支持的音频通道数 - - -### channelLayouts - - -``` -int32_t AudioPortCap::channelLayouts[CHANNEL_NUM] -``` - -**描述:** - -支持的音频通道数channel layouts - - -### sampleFormats - - -``` -int32_t AudioPortCap::sampleFormats[SAMPLE_FMT_NUM] -``` - -**描述:** - -支持的音频采样格式,详见[AudioSampleFormat](codec.md#audiosampleformat) - - -### sampleRate - - -``` -int32_t AudioPortCap::sampleRate[SAMPLE_RATE_NUM] -``` - -**描述:** - -支持的音频采样率,详见[AudioSampleRate](codec.md#audiosamplerate) diff --git a/zh-cn/device-dev/reference/hdi-apis/battery.md b/zh-cn/device-dev/reference/hdi-apis/battery.md index bb3e111a477ae5f1171dee8f2cead9e2072528d7..d094cbdfc9482e3eca28fea8cc71997188cb42b3 100644 --- a/zh-cn/device-dev/reference/hdi-apis/battery.md +++ b/zh-cn/device-dev/reference/hdi-apis/battery.md @@ -1,47 +1,47 @@ # Battery -## **概述** +## 概述 电池模块为电池服务提供的获取、订阅电池信息的接口。 服务获取此模块的对象或代理后,可以调用相关的接口获取电池信息、订阅电池信息的变化。 -**Since**: +**Since:** -3.2 +3.1 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 - | 名称 | 描述 | +| 名称 | 描述 | | -------- | -------- | -| [IBatteryCallback.idl](_i_battery_callback_8idl.md) | 电池信息的回调。 | -| [IBatteryInterface.idl](_i_battery_interface_8idl.md) | 获取、订阅电池信息的接口。 | -| [BatteryTypes.idl](battery_types_idl.md) | 电池信息相关数据类型。 | +| [IBatteryCallback.idl](_i_battery_callback_8idl.md) | 电池信息的回调。 | +| [IBatteryInterface.idl](_i_battery_interface_8idl.md) | 获取、订阅电池信息的接口。 | +| [Types.idl](_battery_types_8idl.md) | 电池信息相关数据类型。 | ### 类 | 名称 | 描述 | | -------- | -------- | -| [IBatteryCallback](interface_i_battery_callback.md) | 电池信息的回调。 | -| [IBatteryInterface](interface_i_battery_interface.md) | 获取、订阅电池信息的接口。 | -| [BatteryInfo](_battery_info.md) | 电池相关信息。 | +| [IBatteryCallback](interface_i_battery_callback.md) | interface
电池信息的回调。 | +| [IBatteryInterface](interface_i_battery_interface.md) | interface
获取、订阅电池信息的接口。 | +| [BatteryInfo](_battery_info.md) | struct
电池相关信息。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [BatteryHealthState](#batteryhealthstate) {   BATTERY_HEALTH_UNKNOWN = 0, BATTERY_HEALTH_GOOD, BATTERY_HEALTH_OVERHEAT, BATTERY_HEALTH_OVERVOLTAGE,   BATTERY_HEALTH_COLD, BATTERY_HEALTH_DEAD, BATTERY_HEALTH_RESERVED } | 电池的健康状态。 | -| [BatteryChargeState](#batterychargestate) {   CHARGE_STATE_NONE = 0, CHARGE_STATE_ENABLE, CHARGE_STATE_DISABLE, CHARGE_STATE_FULL,   CHARGE_STATE_RESERVED } | 电池的充电状态。 | -| [BatteryPluggedType](#batterypluggedtype) {   PLUGGED_TYPE_NONE = 0, PLUGGED_TYPE_AC, PLUGGED_TYPE_USB, PLUGGED_TYPE_WIRELESS,   PLUGGED_TYPE_BUTT } | 电池的充电设备类型。 | +| [BatteryHealthState](#batteryhealthstate) { BATTERY_HEALTH_UNKNOWN = 0, BATTERY_HEALTH_GOOD, BATTERY_HEALTH_OVERHEAT, BATTERY_HEALTH_OVERVOLTAGE,   BATTERY_HEALTH_COLD, BATTERY_HEALTH_DEAD, BATTERY_HEALTH_RESERVED } | 电池的健康状态。 | +| [BatteryChargeState](#batterychargestate) { CHARGE_STATE_NONE = 0, CHARGE_STATE_ENABLE, CHARGE_STATE_DISABLE, CHARGE_STATE_FULL, CHARGE_STATE_RESERVED } | 电池的充电状态。 | +| [BatteryPluggedType](#batterypluggedtype) { PLUGGED_TYPE_NONE = 0, PLUGGED_TYPE_AC, PLUGGED_TYPE_USB, PLUGGED_TYPE_WIRELESS,   PLUGGED_TYPE_BUTT } | 电池的充电设备类型。 | ### 关键字 @@ -51,17 +51,17 @@ | package ohos.hdi.battery.v1_0 | 电池模块接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### BatteryChargeState - + ``` enum BatteryChargeState ``` -**描述:** +**描述:** 电池的充电状态。 @@ -76,12 +76,12 @@ enum BatteryChargeState ### BatteryHealthState - + ``` enum BatteryHealthState ``` -**描述:** +**描述:** 电池的健康状态。 @@ -98,12 +98,12 @@ enum BatteryHealthState ### BatteryPluggedType - + ``` enum BatteryPluggedType ``` -**描述:** +**描述:** 电池的充电设备类型。 diff --git a/zh-cn/device-dev/reference/hdi-apis/camera_2v1__0_2_types_8idl.md b/zh-cn/device-dev/reference/hdi-apis/camera_2v1__0_2_types_8idl.md deleted file mode 100644 index 51e4d8c25dee501dab05ef3101f224e828c374b8..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/camera_2v1__0_2_types_8idl.md +++ /dev/null @@ -1,57 +0,0 @@ -# Types.idl - - -## **概述** - -Camera模块HDI接口使用的数据类型。 - -**Since:** - -3.2 - -**Version:** - -1.0 - -**相关模块:** - -[Camera](camera.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [StreamInfo](_stream_info.md) | 流信息,用于创建流时传入相关的配置参数。 | -| [StreamAttribute](_stream_attribute.md) | 流的属性。 | -| [CaptureInfo](_capture_info.md) | 捕获请求的相关信息。 | -| [CaptureEndedInfo](_capture_ended_info.md) | 捕获结束相关信息,用于捕获结束回调[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)。 | -| [CaptureErrorInfo](_capture_error_info.md) | 流错误信息,用于回调[OnCaptureError](interface_i_stream_operator_callback.md#oncaptureerror)。 | - - -### 枚举 - - | 名称 | 描述 | -| -------- | -------- | -| [CamRetCode](camera.md#camretcode) {   NO_ERROR = 0, CAMERA_BUSY = -1, INSUFFICIENT_RESOURCES = -2, INVALID_ARGUMENT = -3,   METHOD_NOT_SUPPORTED = -4, CAMERA_CLOSED = -5, DEVICE_ERROR = -6, NO_PERMISSION = -7 } | HDI接口的返回值。 | -| [ResultCallbackMode](camera.md#resultcallbackmode) { PER_FRAME = 0, ON_CHANGED = 1 } | metadata的上报模式。 | -| [OperationMode](camera.md#operationmode) { NORMAL = 0 } | 流的使用模式。 | -| [StreamIntent](camera.md#streamintent) { PREVIEW = 0, VIDEO = 1, STILL_CAPTURE = 2, POST_VIEW = 3,   ANALYZE = 4, CUSTOM = 5 } | 流的类型。 | -| [EncodeType](camera.md#encodetype) { ENCODE_TYPE_NULL = 0, ENCODE_TYPE_H264 = 1, ENCODE_TYPE_H265 = 2, ENCODE_TYPE_JPEG = 3 } | 流数据的编码类型。 | -| [StreamSupportType](camera.md#streamsupporttype) { DYNAMIC_SUPPORTED = 0, RE_CONFIGURED_REQUIRED = 1, NOT_SUPPORTED = 2 } | 对动态配置流的支持类型,使用场景参考[IsStreamsSupported](interface_i_stream_operator.md#isstreamssupported)。 | -| [CameraStatus](camera.md#camerastatus) { UN_AVAILABLE = 0, AVAILABLE = 1 } | Camera设备状态。 | -| [FlashlightStatus](camera.md#flashlightstatus) { FLASHLIGHT_OFF = 0, FLASHLIGHT_ON = 1, FLASHLIGHT_UNAVAILABLE = 2 } | 闪光灯状态。 | -| [CameraEvent](camera.md#cameraevent) { CAMERA_EVENT_DEVICE_ADD = 0, CAMERA_EVENT_DEVICE_RMV = 1 } | Camera事件。 | -| [ErrorType](camera.md#errortype) {   FATAL_ERROR = 0, REQUEST_TIMEOUT = 1, DRIVER_ERROR = 2, DEVICE_PREEMPT = 3,   DEVICE_DISCONNECT = 4, DCAMERA_ERROR_BEGIN = 1024, DCAMERA_ERROR_DEVICE_IN_USE, DCAMERA_ERROR_NO_PERMISSION } | 设备错误类型,用于设备错误回调[OnError](interface_i_camera_device_callback.md#onerror)。 | -| [StreamError](camera.md#streamerror) { UNKNOWN_ERROR = 0, BUFFER_LOST = 1 } | 流错误类型,用于流错误类型[CaptureErrorInfo](_capture_error_info.md)。 | - - -### 关键字 - - | 名称 | 描述 | -| -------- | -------- | -| package ohos.hdi.camera.v1_0 | Camera设备接口的包路径。 | -| sequenceable ohos.hdi.camera.v1_0.BufferProducerSequenceable | ohos.hdi.camera.v1_0序列,可用缓冲区生成器。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec__callback__if_8h.md b/zh-cn/device-dev/reference/hdi-apis/codec__callback__if_8h.md new file mode 100644 index 0000000000000000000000000000000000000000..d2851c60b38444d815491ce5ebe84479887172ba --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/codec__callback__if_8h.md @@ -0,0 +1,34 @@ +# codec_callback_if.h + + +## 概述 + +主要包括回调函数接口定义。 + +Codec模块事件上报、上报输入buffer和输出buffer处理完毕等接口定义。 + +**Since:** +3.1 +**Version:** +2.0 +**相关模块:** + +[Codec](_codec.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [CodecCallbackType](_codec_callback_type.md) | struct
Codec回调接口定义。  | + + +### 函数 + + | 名称 | 描述 | +| -------- | -------- | +| [CodecCallbackTypeGet](_codec.md#codeccallbacktypeget) (struct HdfRemoteService \*remote) | struct [CodecCallbackType](_codec_callback_type.md) \*
实例化CodecCallbackType对象。  | +| [CodecCallbackTypeRelease](_codec.md#codeccallbacktyperelease) (struct [CodecCallbackType](_codec_callback_type.md) \*instance) | void
释放CodecCallbackType对象。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec__common__type_8h.md b/zh-cn/device-dev/reference/hdi-apis/codec__common__type_8h.md new file mode 100644 index 0000000000000000000000000000000000000000..eac28f722c87c332e0a02c21adfdf478019544d9 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/codec__common__type_8h.md @@ -0,0 +1,41 @@ +# codec_common_type.h + + +## 概述 + +Codec模块接口定义中使用的自定义数据类型,包括编解码类型、音视频参数、buffer定义等。 + +**Since:** + +3.1 + +**Version:** + +2.0 + +**相关模块:** + +[Codec](_codec.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [Alignment](_alignment.md) | struct
对齐结构定义,包含宽高的对齐值。 | +| [Rect](_rect.md) | struct
矩形的定义。 | +| [RangeValue](_range_value.md) | struct
取值范围的定义。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [CodecType](_codec.md#codectype) { VIDEO_DECODER, VIDEO_ENCODER, AUDIO_DECODER, AUDIO_ENCODER,   INVALID_TYPE } | 枚举编解码的类型。 | +| [Profile](_codec.md#profile) { INVALID_PROFILE = 0, AAC_LC_PROFILE = 0x1000, AAC_MAIN_PROFILE, AAC_HE_V1_PROFILE,   AAC_HE_V2_PROFILE, AAC_LD_PROFILE, AAC_ELD_PROFILE, AVC_BASELINE_PROFILE = 0x2000,   AVC_MAIN_PROFILE, AVC_HIGH_PROFILE, HEVC_MAIN_PROFILE = 0x3000, HEVC_MAIN_10_PROFILE } | 枚举Codec规格。 | +| [AudioSampleRate](_codec.md#audiosamplerate) { AUD_SAMPLE_RATE_8000 = 8000, AUD_SAMPLE_RATE_12000 = 12000, AUD_SAMPLE_RATE_11025 = 11025, AUD_SAMPLE_RATE_16000 = 16000,   AUD_SAMPLE_RATE_22050 = 22050, AUD_SAMPLE_RATE_24000 = 24000, AUD_SAMPLE_RATE_32000 = 32000, AUD_SAMPLE_RATE_44100 = 44100,   AUD_SAMPLE_RATE_48000 = 48000, AUD_SAMPLE_RATE_64000 = 64000, AUD_SAMPLE_RATE_96000 = 96000, AUD_SAMPLE_RATE_INVALID } | 枚举音频采样率。 | +| [CodecCapsMask](_codec.md#codeccapsmask) { CODEC_CAP_ADAPTIVE_PLAYBACK = 0x1, CODEC_CAP_SECURE_PLAYBACK = 0x2, CODEC_CAP_TUNNEL_PLAYBACK = 0x4, CODEC_CAP_MULTI_PLANE = 0x10000 } | 枚举播放能力。 | +| [CodecProcessMode](_codec.md#codecprocessmode) { PROCESS_BLOCKING_INPUT_BUFFER = 0X1, PROCESS_BLOCKING_OUTPUT_BUFFER = 0X2, PROCESS_BLOCKING_CONTROL_FLOW = 0X4, PROCESS_NONBLOCKING_INPUT_BUFFER = 0X100,   PROCESS_NONBLOCKING_OUTPUT_BUFFER = 0X200, PROCESS_NONBLOCKING_CONTROL_FLOW = 0X400 } | 枚举编解码处理模式。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec__component__if_8h.md b/zh-cn/device-dev/reference/hdi-apis/codec__component__if_8h.md new file mode 100644 index 0000000000000000000000000000000000000000..cf8ee8e8bd0400139f2e0388dce8b3669ebc962b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/codec__component__if_8h.md @@ -0,0 +1,34 @@ +# codec_component_if.h + + +## 概述 + +主要包括Codec组件接口定义。 + +Codec模块提供了获取组件信息、给组件发送命令、组件参数设置、buffer轮转和控制等接口定义。创建组件后,可使用下列接口进行编解码处理。 + +**Since:** +3.1 +**Version:** +2.0 +**相关模块:** + +[Codec](_codec.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [CodecComponentType](_codec_component_type.md) | struct
Codec组件接口定义。  | + + +### 函数 + + | 名称 | 描述 | +| -------- | -------- | +| [CodecComponentTypeGet](_codec.md#codeccomponenttypeget) (struct HdfRemoteService \*remote) | struct [CodecComponentType](_codec_component_type.md) \*
实例化CodecComponentType对象。  | +| [CodecComponentTypeRelease](_codec.md#codeccomponenttyperelease) (struct [CodecComponentType](_codec_component_type.md) \*instance) | void
释放CodecComponentType对象。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec__component__manager_8h.md b/zh-cn/device-dev/reference/hdi-apis/codec__component__manager_8h.md new file mode 100644 index 0000000000000000000000000000000000000000..9e5c2c2d033ad3632437ee1e5ed254fc87b2a81f --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/codec__component__manager_8h.md @@ -0,0 +1,34 @@ +# codec_component_manager.h + + +## 概述 + +主要包括Codec组件管理类接口。 + +Codec模块获取组件编解码能力集、创建组件和销毁组件等接口定义。 + +**Since:** +3.1 +**Version:** +2.0 +**相关模块:** + +[Codec](_codec.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [CodecComponentManager](_codec_component_manager.md) | struct
Codec组件管理类接口定义。  | + + +### 函数 + + | 名称 | 描述 | +| -------- | -------- | +| [GetCodecComponentManager](_codec.md#getcodeccomponentmanager) (void) | struct [CodecComponentManager](_codec_component_manager.md) \*
实例化CodecComponentManager对象。  | +| [CodecComponentManagerRelease](_codec.md#codeccomponentmanagerrelease) (void) | void
释放CodecComponentManager对象。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec__component__manager_h.md b/zh-cn/device-dev/reference/hdi-apis/codec__component__manager_h.md deleted file mode 100644 index 27d7f244b3cdb5e768f53319582e80b79834a3ca..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/codec__component__manager_h.md +++ /dev/null @@ -1,38 +0,0 @@ -# codec_component_manager.h - - -## **概述** - -主要包括Codec组件管理类接口。 - -Codec模块获取组件编解码能力集、创建组件和销毁组件等接口定义。 - -**Since**: - -3.1 - -**Version**: - -2.0 - -**相关模块:** - -[Codec](codec.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [CodecComponentManager](_codec_component_manager.md) | Codec组件管理类接口定义。 | - - -### 函数 - - | 名称 | 描述 | -| -------- | -------- | -| [GetCodecComponentManager](codec.md#getcodeccomponentmanager) (void) | 实例化CodecComponentManager对象。 | -| [CodecComponentManagerRelease](codec.md#codeccomponentmanagerrelease) (void) | 释放CodecComponentManager对象。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec__component__type_8h.md b/zh-cn/device-dev/reference/hdi-apis/codec__component__type_8h.md new file mode 100644 index 0000000000000000000000000000000000000000..494946725e876fd313c1e7cd07126ce2401518fe --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/codec__component__type_8h.md @@ -0,0 +1,65 @@ +# codec_component_type.h + + +## 概述 + +Codec模块接口定义中使用的自定义数据类型。 + +Codec模块接口定义中使用的自定义数据类型,包括编解码类型、音视频参数、buffer定义等。 + +**Since:** + +3.1 + +**Version:** + +2.0 + +**相关模块:** + +[Codec](_codec.md) + + +## 汇总 + + +### 类 + + | 名称 | 描述 | +| -------- | -------- | +| [VideoPortCap](_video_port_cap.md) | struct
定义视频编解码能力。 | +| [AudioPortCap](_audio_port_cap.md) | struct
定义音频编解码能力。 | +| [PortCap](union_port_cap.md) | union
定义音视频编解码能力。 | +| [CodecCompCapability](_codec_comp_capability.md) | struct
定义Codec编解码能力。 | +| [OmxCodecBuffer](_omx_codec_buffer.md) | struct
Codec buffer信息的定义。 | +| [CompVerInfo](_comp_ver_info.md) | struct
定义组件版本信息。 | +| [EventInfo](_event_info.md) | struct
定义事件上报信息。 | +| [SupportBufferType](_support_buffer_type.md) | struct
SupportBuffer类型定义。 | +| [UseBufferType](_use_buffer_type.md) | struct
UseBuffer类型定义。 | +| [GetBufferHandleUsageParams](_get_buffer_handle_usage_params.md) | struct
BufferHandleUsage类型定义。 | + + +### 宏定义 + + | 名称 | 描述 | +| -------- | -------- | +| [SAMPLE_FMT_NUM](_codec.md#sample_fmt_num)   32 | 采样格式最大值。 | +| [UUID_LENGTH](_codec.md#uuid_length)   128 | 定义UUID长度。 | +| [PIX_FORMAT_NUM](_codec.md#pix_format_num)   16 | 支持的像素格式数组大小。 | +| [SAMPLE_FORMAT_NUM](_codec.md#sample_format_num)   12 | 支持的音频采样格式数组大小。 | +| [SAMPLE_RATE_NUM](_codec.md#sample_rate_num)   16 | 支持的音频采样率数组大小。 | +| [CHANNEL_NUM](_codec.md#channel_num)   16 | 支持的音频通道数组大小。 | +| [NAME_LENGTH](_codec.md#name_length)   32 | 组件名称大小。 | +| [PROFILE_NUM](_codec.md#profile_num)   256 | 支持的profile数组大小。 | + + +### 枚举 + + | 名称 | 描述 | +| -------- | -------- | +| [AvCodecRole](_codec.md#avcodecrole) { MEDIA_ROLETYPE_IMAGE_JPEG = 0, MEDIA_ROLETYPE_VIDEO_AVC, MEDIA_ROLETYPE_VIDEO_HEVC, MEDIA_ROLETYPE_AUDIO_FIRST = 0x10000,   MEDIA_ROLETYPE_AUDIO_AAC = 0x10000, MEDIA_ROLETYPE_AUDIO_G711A, MEDIA_ROLETYPE_AUDIO_G711U, MEDIA_ROLETYPE_AUDIO_G726,   MEDIA_ROLETYPE_AUDIO_PCM, MEDIA_ROLETYPE_AUDIO_MP3, MEDIA_ROLETYPE_INVALID } | 枚举音视频编解码组件类型。 | +| [AudioSampleFormat](_codec.md#audiosampleformat) {
AUDIO_SAMPLE_FMT_U8 , AUDIO_SAMPLE_FMT_S16 , AUDIO_SAMPLE_FMT_S32 , AUDIO_SAMPLE_FMT_FLOAT ,
AUDIO_SAMPLE_FMT_DOUBLE , AUDIO_SAMPLE_FMT_U8P , AUDIO_SAMPLE_FMT_S16P , AUDIO_SAMPLE_FMT_S32P ,
AUDIO_SAMPLE_FMT_FLOATP , AUDIO_SAMPLE_FMT_DOUBLEP , AUDIO_SAMPLE_FMT_INVALID
} | 枚举音频采样格式。 | +| [CodecBufferType](_codec.md#codecbuffertype) { CODEC_BUFFER_TYPE_INVALID = 0, CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, CODEC_BUFFER_TYPE_HANDLE = 0x4,   CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8 } | 定义buffer类型。 | +| [ShareMemTypes](_codec.md#sharememtypes) { READ_WRITE_TYPE = 0x1, READ_ONLY_TYPE = 0x2 } | 枚举共享内存类型。 | +| [OmxIndexCodecExType](_codec.md#omxindexcodecextype) { OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, OMX_IndexParamSupportBufferType, OMX_IndexParamUseBufferType, OMX_IndexParamGetBufferHandleUsage } | 枚举Codec扩展index。 | +| [OmxVideoExType](_codec.md#omxvideoextype) { OMX_VIDEO_CodingHEVC = 11 } | 枚举Codec扩展编码类型。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec__component__type_h.md b/zh-cn/device-dev/reference/hdi-apis/codec__component__type_h.md deleted file mode 100644 index b6ddc54e8b1acbe57d7207ef04e78df87a3a85c6..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/codec__component__type_h.md +++ /dev/null @@ -1,64 +0,0 @@ -# codec_component_type.h - - -## **概述** - - -Codec模块接口定义中使用的自定义数据类型,包括编解码类型、音视频参数、buffer定义等。 - -**Since**: - -3.1 - -**Version**: - -2.0 - -**相关模块:** - -[Codec](codec.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [VideoPortCap](_video_port_cap.md) | 定义视频编解码能力。 | -| [AudioPortCap](audio_portcap.md) | 定义音频编解码能力。 | -| [PortCap](union_port_cap.md) | 定义音视频编解码能力。 | -| [CodecCompCapability](_codec_comp_capability.md) | 定义Codec编解码能力。 | -| [OmxCodecBuffer](_omx_codec_buffer.md) | Codec buffer信息的定义。 | -| [CompVerInfo](_comp_ver_info.md) | 定义组件版本信息。 | -| [EventInfo](_event_info.md) | 定义事件上报信息。 | -| [SupportBufferType](_support_buffer_type.md) | SupportBuffer类型定义。 | -| [UseBufferType](_use_buffer_type.md) | UseBuffer类型定义。 | -| [GetBufferHandleUsageParams](_get_buffer_handle_usage_params.md) | BufferHandleUsage类型定义。 | - - -### 宏定义 - - | 名称 | 描述 | -| -------- | -------- | -| [SAMPLE_FMT_NUM](codec.md#宏定义)   32 | 采样格式最大值。 | -| [UUID_LENGTH](codec.md#宏定义)   128 | 定义UUID长度。 | -| [PIX_FORMAT_NUM](codec.md#宏定义)   16 | 支持的像素格式数组大小。 | -| [SAMPLE_FORMAT_NUM](codec.md#宏定义)   12 | 支持的音频采样格式数组大小。 | -| [SAMPLE_RATE_NUM](codec.md#宏定义)   16 | 支持的音频采样率数组大小。 | -| [CHANNEL_NUM](codec.md#宏定义)   16 | 支持的音频通道数组大小。 | -| [NAME_LENGTH](codec.md#宏定义)   32 | 组件名称大小。 | -| [PROFILE_NUM](codec.md#宏定义)   256 | 支持的profile数组大小。 | - - -### 枚举 - - | 名称 | 描述 | -| -------- | -------- | -| [AvCodecRole](codec.md#avcodecrole) { MEDIA_ROLETYPE_IMAGE_JPEG = 0, MEDIA_ROLETYPE_VIDEO_AVC, MEDIA_ROLETYPE_VIDEO_HEVC, MEDIA_ROLETYPE_AUDIO_FIRST = 0x10000,   MEDIA_ROLETYPE_AUDIO_AAC = 0x10000, MEDIA_ROLETYPE_AUDIO_G711A, MEDIA_ROLETYPE_AUDIO_G711U, MEDIA_ROLETYPE_AUDIO_G726,   MEDIA_ROLETYPE_AUDIO_PCM, MEDIA_ROLETYPE_AUDIO_MP3, MEDIA_ROLETYPE_INVALID } | 枚举音视频编解码组件类型。 | -| [AudioSampleFormat](codec.md#audiosampleformat) { AUDIO_SAMPLE_FORMAT_S8 = 0, AUDIO_SAMPLE_FORMAT_S8P = 1, AUDIO_SAMPLE_FORMAT_U8 = 2, AUDIO_SAMPLE_FORMAT_U8P = 3,   AUDIO_SAMPLE_FORMAT_S16 = 4, AUDIO_SAMPLE_FORMAT_S16P = 5, AUDIO_SAMPLE_FORMAT_U16 = 6, AUDIO_SAMPLE_FORMAT_U16P = 7,   AUDIO_SAMPLE_FORMAT_S24 = 8, AUDIO_SAMPLE_FORMAT_S24P = 9, AUDIO_SAMPLE_FORMAT_U24 = 10, AUDIO_SAMPLE_FORMAT_U24P = 11,   AUDIO_SAMPLE_FORMAT_S32 = 12, AUDIO_SAMPLE_FORMAT_S32P = 13, AUDIO_SAMPLE_FORMAT_U32 = 14, AUDIO_SAMPLE_FORMAT_U32P = 15,   AUDIO_SAMPLE_FORMAT_S64 = 16, AUDIO_SAMPLE_FORMAT_S64P = 17, AUDIO_SAMPLE_FORMAT_U64 = 18, AUDIO_SAMPLE_FORMAT_U64P = 19,   AUDIO_SAMPLE_FORMAT_F32 = 20, AUDIO_SAMPLE_FORMAT_F32P = 21, AUDIO_SAMPLE_FORMAT_F64 = 22, AUDIO_SAMPLE_FORMAT_F64P = 23,   AUDIO_SAMPLE_FMT_U8, AUDIO_SAMPLE_FMT_S16, AUDIO_SAMPLE_FMT_S32, AUDIO_SAMPLE_FMT_FLOAT,   AUDIO_SAMPLE_FMT_DOUBLE, AUDIO_SAMPLE_FMT_U8P, AUDIO_SAMPLE_FMT_S16P, AUDIO_SAMPLE_FMT_S32P,   AUDIO_SAMPLE_FMT_FLOATP, AUDIO_SAMPLE_FMT_DOUBLEP, AUDIO_SAMPLE_FMT_INVALID } | 枚举音频采样格式。 | -| [CodecBufferType](codec.md#codecbuffertype) { CODEC_BUFFER_TYPE_INVALID = 0, CODEC_BUFFER_TYPE_VIRTUAL_ADDR = 0x1, CODEC_BUFFER_TYPE_AVSHARE_MEM_FD = 0x2, CODEC_BUFFER_TYPE_HANDLE = 0x4,   CODEC_BUFFER_TYPE_DYNAMIC_HANDLE = 0x8 } | 定义buffer类型。 | -| [ShareMemTypes](codec.md#sharememtypes) { READ_WRITE_TYPE = 0x1, READ_ONLY_TYPE = 0x2 } | 枚举共享内存类型。 | -| [OmxIndexCodecExType](codec.md#omxindexcodecextype) { OMX_IndexExtBufferTypeStartUnused = OMX_IndexKhronosExtensions + 0x00a00000, OMX_IndexParamSupportBufferType, OMX_IndexParamUseBufferType, OMX_IndexParamGetBufferHandleUsage } | 枚举Codec扩展index。 | -| [OmxVideoExType](codec.md#omxvideoextype) { OMX_VIDEO_CodingHEVC = 11 } | 枚举Codec扩展编码类型。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec_callback_if_h.md b/zh-cn/device-dev/reference/hdi-apis/codec_callback_if_h.md deleted file mode 100644 index a7939a857bd0ce8d162e7d3a326ac0b60d73d2f7..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/codec_callback_if_h.md +++ /dev/null @@ -1,38 +0,0 @@ -# codec_callback_if.h - - -## **概述** - -主要包括回调函数接口定义。 - -Codec模块事件上报、上报输入buffer和输出buffer处理完毕等接口定义。 - -**Since**: - -3.1 - -**Version**: - -2.0 - -**相关模块:** - -[Codec](codec.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [CodecCallbackType](_codec_callback_type.md) | Codec回调接口定义。 | - - -### 函数 - - | 名称 | 描述 | -| -------- | -------- | -| [CodecCallbackTypeGet](codec.md#codeccallbacktypeget) (struct HdfRemoteService \*remote) | 实例化CodecCallbackType对象。 | -| [CodecCallbackTypeRelease](codec.md#codeccallbacktyperelease) (struct [CodecCallbackType](_codec_callback_type.md) \*instance) | 释放CodecCallbackType对象。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec_common_type_h.md b/zh-cn/device-dev/reference/hdi-apis/codec_common_type_h.md deleted file mode 100644 index e603fbceb5d28d40eaee42bc5607b1f7cd6bd0fc..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/codec_common_type_h.md +++ /dev/null @@ -1,41 +0,0 @@ -# codec_common_type.h - - -## **概述** - -Codec模块接口定义中使用的自定义数据类型,包括编解码类型、音视频参数、buffer定义等。 - -**Since**: - -3.1 - -**Version**: - -2.0 - -**相关模块:** - -[Codec](codec.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [Alignment](_alignment.md) | 对齐结构定义,包含宽高的对齐值。 | -| [Rect](_rect.md) | 矩形的定义。 | -| [RangeValue](_range_value.md) | 取值范围的定义。 | - - -### 枚举 - - | 名称 | 描述 | -| -------- | -------- | -| [CodecType](codec.md#codectype) { VIDEO_DECODER, VIDEO_ENCODER, AUDIO_DECODER, AUDIO_ENCODER,   INVALID_TYPE  } | 枚举编解码的类型。 | -| [Profile](codec.md#profile) { INVALID_PROFILE = 0, AAC_LC_PROFILE = 0x1000, AAC_MAIN_PROFILE, AAC_HE_V1_PROFILE,   AAC_HE_V2_PROFILE, AAC_LD_PROFILE, AAC_ELD_PROFILE, AVC_BASELINE_PROFILE = 0x2000,   AVC_MAIN_PROFILE, AVC_HIGH_PROFILE, HEVC_MAIN_PROFILE = 0x3000, HEVC_MAIN_10_PROFILE } | 枚举Codec规格。 | -| [AudioSampleRate](codec.md#audiosamplerate) { AUD_SAMPLE_RATE_8000 = 8000, AUD_SAMPLE_RATE_12000 = 12000, AUD_SAMPLE_RATE_11025 = 11025, AUD_SAMPLE_RATE_16000 = 16000,   AUD_SAMPLE_RATE_22050 = 22050, AUD_SAMPLE_RATE_24000 = 24000, AUD_SAMPLE_RATE_32000 = 32000, AUD_SAMPLE_RATE_44100 = 44100,   AUD_SAMPLE_RATE_48000 = 48000, AUD_SAMPLE_RATE_64000 = 64000, AUD_SAMPLE_RATE_96000 = 96000, AUD_SAMPLE_RATE_INVALID } | 枚举音频采样率。 | -| [CodecCapsMask](codec.md#codeccapsmask) { CODEC_CAP_ADAPTIVE_PLAYBACK = 0x1, CODEC_CAP_SECURE_PLAYBACK = 0x2, CODEC_CAP_TUNNEL_PLAYBACK = 0x4, CODEC_CAP_MULTI_PLANE = 0x10000 } | 枚举播放能力。 | -| [CodecProcessMode](codec.md#codecprocessmode) { PROCESS_BLOCKING_INPUT_BUFFER = 0X1, PROCESS_BLOCKING_OUTPUT_BUFFER = 0X2, PROCESS_BLOCKING_CONTROL_FLOW = 0X4, PROCESS_NONBLOCKING_INPUT_BUFFER = 0X100,   PROCESS_NONBLOCKING_OUTPUT_BUFFER = 0X200, PROCESS_NONBLOCKING_CONTROL_FLOW = 0X400 } | 枚举编解码处理模式。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/codec_component_if_h.md b/zh-cn/device-dev/reference/hdi-apis/codec_component_if_h.md deleted file mode 100644 index 9be7901fd0dd367ba09dc8983ec89b0aab9408d4..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/codec_component_if_h.md +++ /dev/null @@ -1,38 +0,0 @@ -# codec_component_if.h - - -## **概述** - -主要包括Codec组件接口定义。 - -Codec模块提供了获取组件信息、给组件发送命令、组件参数设置、buffer轮转和控制等接口定义。创建组件后,可使用下列接口进行编解码处理。 - -**Since**: - -3.1 - -**Version**: - -2.0 - -**相关模块:** - -[Codec](codec.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [CodecComponentType](_codec_component_type.md) | Codec组件接口定义。 | - - -### 函数 - - | 名称 | 描述 | -| -------- | -------- | -| [CodecComponentTypeGet](codec.md#codeccomponenttypeget) (struct HdfRemoteService \*remote) | 实例化CodecComponentType对象。 | -| [CodecComponentTypeRelease](codec.md#codeccomponenttyperelease) (struct [CodecComponentType](_codec_component_type.md) \*instance) | 释放CodecComponentType对象。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/display__device_8h.md b/zh-cn/device-dev/reference/hdi-apis/display__device_8h.md index d4dbfccb78d814df1741d41ff282bd9f83109253..2f94e64f53136f53e56c65dd9a7f22e771e97e5c 100644 --- a/zh-cn/device-dev/reference/hdi-apis/display__device_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/display__device_8h.md @@ -1,7 +1,7 @@ # display_device.h -## **概述** +## 概述 显示设备控制接口声明。 @@ -18,28 +18,28 @@ [Display](_display.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [DeviceFuncs](_device_funcs.md) | 显示设备控制接口结构体,定义显示设备控制接口函数指针。 | +| [DeviceFuncs](_device_funcs.md) | struct
显示设备控制接口结构体,定义显示设备控制接口函数指针。 | ### 类型定义 | 名称 | 描述 | | -------- | -------- | -| ([HotPlugCallback](_display.md#hotplugcallback)) (uint32_t devId, bool connected, void \*data) | 热插拔事件回调 | -| ([VBlankCallback](_display.md#vblankcallback)) (unsigned int sequence, uint64_t ns, void \*data) | VBlank 事件回调。 | -| ([RefreshCallback](_display.md#refreshcallback)) (uint32_t devId, void \*data) | 刷新请求回调 | +| (\* [HotPlugCallback](_display.md#hotplugcallback)) (uint32_t devId, bool connected, void \*data) | typedef void \*
热插拔事件回调 | +| (\* [VBlankCallback](_display.md#vblankcallback)) (unsigned int sequence, uint64_t ns, void \*data) | typedef void \*
VBlank 事件回调。 | +| (\* [RefreshCallback](_display.md#refreshcallback)) (uint32_t devId, void \*data) | typedef void \*
刷新请求回调 | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [DeviceInitialize](_display.md#deviceinitialize)(DeviceFuncs \*\*funcs) | 实现显示设备控制接口的初始化,申请操作显示设备控制接口的资源,并获取对应的操作接口。 | -| [DeviceUninitialize](_display.md#deviceuninitialize)(DeviceFuncs \*funcs) | 取消显示设备控制接口的初始化,释放控制接口使用到的资源。 | +| [DeviceInitialize](_display.md#deviceinitialize) ([DeviceFuncs](_device_funcs.md) \*\*funcs) | int32_t
实现显示设备控制接口的初始化,申请操作显示设备控制接口的资源,并获取对应的操作接口。 | +| [DeviceUninitialize](_display.md#deviceuninitialize) ([DeviceFuncs](_device_funcs.md) \*funcs) | int32_t
取消显示设备控制接口的初始化,释放控制接口使用到的资源。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/display__gfx_8h.md b/zh-cn/device-dev/reference/hdi-apis/display__gfx_8h.md index e26796cb53997141fd676af7ccd1051d8ba66784..271ec507f3e44bdba78fff9beb99b8e4999addb0 100644 --- a/zh-cn/device-dev/reference/hdi-apis/display__gfx_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/display__gfx_8h.md @@ -1,36 +1,32 @@ # display_gfx.h -## **概述** +## 概述 显示硬件加速驱动接口声明。 **Since:** - 1.0 - **Version:** - 1.0 - **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [GfxFuncs](_gfx_funcs.md) | 显示硬件加速驱动接口结构体,定义硬件加速驱动接口函数指针。 | +| [GfxFuncs](_gfx_funcs.md) | struct
显示硬件加速驱动接口结构体,定义硬件加速驱动接口函数指针。  | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [GfxInitialize](_display.md#gfxinitialize)(GfxFuncs \*\*funcs) | 获取硬件加速相关的操作接口指针。 | -| [GfxUninitialize](_display.md#gfxuninitialize)(GfxFuncs \*funcs) | 释放硬件加速相关的操作接口指针。 | +| [GfxInitialize](_display.md#gfxinitialize) ([GfxFuncs](_gfx_funcs.md) \*\*funcs) | int32_t
获取硬件加速相关的操作接口指针。  | +| [GfxUninitialize](_display.md#gfxuninitialize) ([GfxFuncs](_gfx_funcs.md) \*funcs) | int32_t
释放硬件加速相关的操作接口指针。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/display__gralloc_8h.md b/zh-cn/device-dev/reference/hdi-apis/display__gralloc_8h.md index 5b6ae08c24a3de8b4602cb6c78666012066a656d..ca73590ff984b022250d0458fcaedb7ed7d8d168 100644 --- a/zh-cn/device-dev/reference/hdi-apis/display__gralloc_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/display__gralloc_8h.md @@ -1,36 +1,32 @@ # display_gralloc.h -## **概述** +## 概述 显示内存驱动接口声明。 **Since:** - 1.0 - **Version:** - 2.0 - **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [GrallocFuncs](_gralloc_funcs.md) | 显示内存驱动接口结构体,定义显示内存驱动接口函数指针。 | +| [GrallocFuncs](_gralloc_funcs.md) | struct
显示内存驱动接口结构体,定义显示内存驱动接口函数指针。  | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [GrallocInitialize](_display.md#grallocinitialize)(GrallocFuncs \*\*funcs) | 初始化内存模块,并获取内存提供的操作接口。 | -| [GrallocUninitialize](_display.md#grallocuninitialize)(GrallocFuncs \*funcs) | 取消初始化内存模块,并释放内存操作接口指针。 | +| [GrallocInitialize](_display.md#grallocinitialize) ([GrallocFuncs](_gralloc_funcs.md) \*\*funcs) | int32_t
初始化内存模块,并获取内存提供的操作接口。  | +| [GrallocUninitialize](_display.md#grallocuninitialize) ([GrallocFuncs](_gralloc_funcs.md) \*funcs) | int32_t
取消初始化内存模块,并释放内存操作接口指针。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/display__layer_8h.md b/zh-cn/device-dev/reference/hdi-apis/display__layer_8h.md index 4924bc32fa02d6b8140a8bd09a1f12f498d489ce..1aaaf9614a6abece9db6a96494d97120a1fff0ec 100644 --- a/zh-cn/device-dev/reference/hdi-apis/display__layer_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/display__layer_8h.md @@ -1,36 +1,32 @@ # display_layer.h -## **概述** +## 概述 显示图层驱动接口声明。 **Since:** - 1.0 - **Version:** - 2.0 - **相关模块:** [Display](_display.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [LayerFuncs](_layer_funcs.md) | 显示图层驱动接口结构体,定义显示图层驱动接口函数指针。 | +| [LayerFuncs](_layer_funcs.md) | struct
显示图层驱动接口结构体,定义显示图层驱动接口函数指针。  | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [LayerInitialize](_display.md#layerinitialize)(LayerFuncs \*\*funcs) | 实现图层初始化功能,申请图层使用的资源,并获取图层提供的操作接口。 | -| [LayerUninitialize](_display.md#layeruninitialize)(LayerFuncs \*funcs) | 取消图层初始化功能,释放图层使用到的资源,并释放图层操作接口指针。 | +| [LayerInitialize](_display.md#layerinitialize) ([LayerFuncs](_layer_funcs.md) \*\*funcs) | int32_t
实现图层初始化功能,申请图层使用的资源,并获取图层提供的操作接口。  | +| [LayerUninitialize](_display.md#layeruninitialize) ([LayerFuncs](_layer_funcs.md) \*funcs) | int32_t
取消图层初始化功能,释放图层使用到的资源,并释放图层操作接口指针。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/display__type_8h.md b/zh-cn/device-dev/reference/hdi-apis/display__type_8h.md index bbf2dabaf247dda3f019bb5b8341ee96019e5f2a..43145fe1ee14f89eb6ceeb82de565ceab4d8b425 100644 --- a/zh-cn/device-dev/reference/hdi-apis/display__type_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/display__type_8h.md @@ -1,7 +1,7 @@ # display_type.h -## **概述** +## 概述 显示类型定义,定义显示驱动接口所使用的数据类型。 @@ -18,63 +18,63 @@ [Display](_display.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [DisplayInfo](_display_info.md) | 定义显示信息结构体。 | -| [LayerInfo](_layer_info.md) | 定义图层信息结构体。 | -| [LayerAlpha](_layer_alpha.md) | 定义图层Alpha信息的结构体。 | -| [BufferData](_buffer_data.md) | 定义一层的缓冲区数据,包括虚拟和物理内存地址。 | -| [LayerBuffer](_layer_buffer.md) | 图层Buffer,用于存放图层数据。 | -| [IRect](_i_rect.md) | 定义矩形信息。 | -| [ISurface](_i_surface.md) | 用于存放窗口相关信息的结构体定义,提供给硬件加速使用,例如图像合成,位图搬移等操作。 | -| [ILine](_i_line.md) | 线条描述结构体定义,用于硬件加速绘制直线。 | -| [ICircle](_i_circle.md) | 圆形描述结构体定义,用于硬件加速绘制圆形。 | -| [Rectangle](_rectangle.md) | 矩形描述结构体定义,用于硬件加速绘制矩形。 | -| [GfxOpt](_gfx_opt.md) | 图像硬件加速相关的操作选项结构体定义,用于图像硬件加速时的操作选项。 | -| [PropertyObject](_property_object.md) | 定义包含名称、属性ID和值的属性对象。 | -| [DisplayCapability](_display_capability.md) | 定义输出性能。 | -| [DisplayModeInfo](_display_mode_info.md) | 定义输出模式信息。 | -| [AllocInfo](_alloc_info.md) | 定义关于要分配的内存的信息。 | -| [HDRCapability](_h_d_r_capability.md) | HDR属性结构体定义。 | -| [HDRMetaData](_h_d_r_meta_data.md) | HDR元数据结构体定义。 | -| [VerifyAllocInfo](_verify_alloc_info.md) | 用于验证内存分配信息的结构体定义。 | -| [PresentTimestamp](_present_timestamp.md) | 上屏时间戳结构体定义。 | -| [ExtDataHandle](_ext_data_handle.md) | 扩展数据句柄结构体定义。 | -| [YUVDescInfo](_yun_desc_info_.md) | YUV描述信息结构体定义。 | +| [DisplayInfo](_display_info.md) | struct
定义显示信息结构体 | +| [ExtDataHandle](_ex_data_handle.md) | struct
扩展数据句柄结构体定义。 | +| [LayerInfo](_layer_info.md) | struct
定义图层信息结构体 | +| [LayerAlpha](_layer_alpha.md) | struct
定义图层Alpha信息的结构体 | +| [BufferData](_buffer_data.md) | struct
定义一层的缓冲区数据,包括虚拟和物理内存地址。 | +| [LayerBuffer](_layer_buffer.md) | struct
图层Buffer,用于存放图层数据。 | +| [IRect](_i_rect.md) | struct
定义矩形信息 | +| [ISurface](_i_surface.md) | struct
用于存放窗口相关信息的结构体定义,提供给硬件加速使用,例如图像合成,位图搬移等操作。 | +| [ILine](_i_line.md) | struct
线条描述结构体定义,用于硬件加速绘制直线。 | +| [ICircle](_i_circle.md) | struct
圆形描述结构体定义,用于硬件加速绘制圆形。 | +| [Rectangle](_rectangle.md) | struct
矩形描述结构体定义,用于硬件加速绘制矩形, | +| [GfxOpt](_gfx_opt.md) | struct
图像硬件加速相关的操作选项结构体定义,用于图像硬件加速时的操作选项。 | +| [PropertyObject](_property_object.md) | struct
定义包含名称、属性ID和值的属性对象。 | +| [DisplayCapability](_display_capability.md) | struct
定义输出性能。 | +| [DisplayModeInfo](_display_mode_info.md) | struct
定义输出模式信息。 | +| [AllocInfo](_alloc_info.md) | struct
定义关于要分配的内存的信息。 | +| [HDRCapability](_h_d_r_capability.md) | struct
HDR属性结构体定义 | +| [HDRMetaData](_h_d_r_meta_data.md) | struct
HDR元数据结构体定义 | +| [VerifyAllocInfo](_verify_alloc_info.md) | struct
用于验证内存分配信息的结构体定义 | +| [PresentTimestamp](_present_timestamp.md) | struct
上屏时间戳结构体定义 | +| [YUVDescInfo](_yuv_desc_info.md) | struct
扩展数据句柄结构体定义 | ### 宏定义 | 名称 | 描述 | | -------- | -------- | -| [PROPERTY_NAME_LEN](_display.md#property_name_len)  50 | 属性名字长度。 | +| [PROPERTY_NAME_LEN](_display.md#property_name_len)   50 | 属性名字长度。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [DispErrCode](_display.md#disperrcode){ DISPLAY_SUCCESS = 0, DISPLAY_FAILURE = -1, DISPLAY_FD_ERR = -2, DISPLAY_PARAM_ERR = -3,   DISPLAY_NULL_PTR = -4, DISPLAY_NOT_SUPPORT = -5, DISPLAY_NOMEM = -6, DISPLAY_SYS_BUSY = -7,   DISPLAY_NOT_PERM = -8 } | 返回值类型定义。 | -| [LayerType](_display.md#layertype){ LAYER_TYPE_GRAPHIC, LAYER_TYPE_OVERLAY, LAYER_TYPE_SDIEBAND, LAYER_TYPE_CURSOR,   LAYER_TYPE_BUTT } | 图层类型定义。 | +| [DispErrCode](_display.md#disperrcode) { DISPLAY_SUCCESS = 0, DISPLAY_FAILURE = -1, DISPLAY_FD_ERR = -2, DISPLAY_PARAM_ERR = -3,   DISPLAY_NULL_PTR = -4, DISPLAY_NOT_SUPPORT = -5, DISPLAY_NOMEM = -6, DISPLAY_SYS_BUSY = -7,   DISPLAY_NOT_PERM = -8 } | 返回值类型定义。 | +| [LayerType](_display.md#layertype) { LAYER_TYPE_GRAPHIC, LAYER_TYPE_OVERLAY, LAYER_TYPE_SDIEBAND, LAYER_TYPE_CURSOR, LAYER_TYPE_BUTT } | 图层类型定义。 | | { HBM_USE_CPU_READ = (1 << 0), HBM_USE_CPU_WRITE = (1 << 1), HBM_USE_MEM_MMZ = (1 << 2), HBM_USE_MEM_DMA = (1 << 3),   HBM_USE_MEM_SHARE = (1 << 4), HBM_USE_MEM_MMZ_CACHE = (1 << 5), HBM_USE_MEM_FB = (1 << 6), HBM_USE_ASSIGN_SIZE = (1 << 7) } | 定义缓冲区使用。 | -| [PixelFormat](_display.md#pixelformat){ PIXEL_FMT_CLUT8 = 0, PIXEL_FMT_CLUT1, PIXEL_FMT_CLUT4, PIXEL_FMT_RGB_565,   PIXEL_FMT_RGBA_5658, PIXEL_FMT_RGBX_4444, PIXEL_FMT_RGBA_4444, PIXEL_FMT_RGB_444,   PIXEL_FMT_RGBX_5551, PIXEL_FMT_RGBA_5551, PIXEL_FMT_RGB_555, PIXEL_FMT_RGBX_8888,   PIXEL_FMT_RGBA_8888, PIXEL_FMT_RGB_888, PIXEL_FMT_BGR_565, PIXEL_FMT_BGRX_4444,   PIXEL_FMT_BGRA_4444, PIXEL_FMT_BGRX_5551, PIXEL_FMT_BGRA_5551, PIXEL_FMT_BGRX_8888,   PIXEL_FMT_BGRA_8888, PIXEL_FMT_YUV_422_I, PIXEL_FMT_YCBCR_422_SP, PIXEL_FMT_YCRCB_422_SP,   PIXEL_FMT_YCBCR_420_SP, PIXEL_FMT_YCRCB_420_SP, PIXEL_FMT_YCBCR_422_P, PIXEL_FMT_YCRCB_422_P,   PIXEL_FMT_YCBCR_420_P, PIXEL_FMT_YCRCB_420_P, PIXEL_FMT_YUYV_422_PKG, PIXEL_FMT_UYVY_422_PKG,   PIXEL_FMT_YVYU_422_PKG, PIXEL_FMT_VYUY_422_PKG, PIXEL_FMT_VENDER_MASK = 0X7FFF0000, PIXEL_FMT_BUTT = 0X7FFFFFFF } | 像素格式类型定义。 | -| [TransformType](_display.md#transformtype){ ROTATE_NONE = 0, ROTATE_90, ROTATE_180, ROTATE_270,   ROTATE_BUTT } | 图层变换类型定义。 | -| [BlendType](_display.md#blendtype){ BLEND_NONE = 0, BLEND_CLEAR, BLEND_SRC, BLEND_SRCOVER,   BLEND_DSTOVER, BLEND_SRCIN, BLEND_DSTIN, BLEND_SRCOUT,   BLEND_DSTOUT, BLEND_SRCATOP, BLEND_DSTATOP, BLEND_ADD,   BLEND_XOR, BLEND_DST, BLEND_AKS, BLEND_AKD,   BLEND_BUTT } | 支持的图像混合类型。 | -| [RopType](_display.md#roptype){ ROP_BLACK = 0, ROP_NOTMERGEPEN, ROP_MASKNOTPEN, ROP_NOTCOPYPEN,   ROP_MASKPENNOT, ROP_NOT, ROP_XORPEN, ROP_NOTMASKPEN,   ROP_MASKPEN, ROP_NOTXORPEN, ROP_NOP, ROP_MERGENOTPEN,   ROP_COPYPE, ROP_MERGEPENNOT, ROP_MERGEPEN, ROP_WHITE,   ROP_BUTT } | 硬件加速支持的ROP操作类型。 | +| [PixelFormat](_display.md#pixelformat) { PIXEL_FMT_CLUT8 = 0, PIXEL_FMT_CLUT1, PIXEL_FMT_CLUT4, PIXEL_FMT_RGB_565,   PIXEL_FMT_RGBA_5658, PIXEL_FMT_RGBX_4444, PIXEL_FMT_RGBA_4444, PIXEL_FMT_RGB_444,   PIXEL_FMT_RGBX_5551, PIXEL_FMT_RGBA_5551, PIXEL_FMT_RGB_555, PIXEL_FMT_RGBX_8888,   PIXEL_FMT_RGBA_8888, PIXEL_FMT_RGB_888, PIXEL_FMT_BGR_565, PIXEL_FMT_BGRX_4444,   PIXEL_FMT_BGRA_4444, PIXEL_FMT_BGRX_5551, PIXEL_FMT_BGRA_5551, PIXEL_FMT_BGRX_8888,   PIXEL_FMT_BGRA_8888, PIXEL_FMT_YUV_422_I, PIXEL_FMT_YCBCR_422_SP, PIXEL_FMT_YCRCB_422_SP,   PIXEL_FMT_YCBCR_420_SP, PIXEL_FMT_YCRCB_420_SP, PIXEL_FMT_YCBCR_422_P, PIXEL_FMT_YCRCB_422_P,   PIXEL_FMT_YCBCR_420_P, PIXEL_FMT_YCRCB_420_P, PIXEL_FMT_YUYV_422_PKG, PIXEL_FMT_UYVY_422_PKG,   PIXEL_FMT_YVYU_422_PKG, PIXEL_FMT_VYUY_422_PKG, PIXEL_FMT_VENDER_MASK = 0X7FFF0000, PIXEL_FMT_BUTT = 0X7FFFFFFF } | 像素格式类型定义。 | +| [TransformType](_display.md#transformtype) { ROTATE_NONE = 0, ROTATE_90, ROTATE_180, ROTATE_270, ROTATE_BUTT } | 图层变换类型定义。 | +| [BlendType](_display.md#blendtype) { BLEND_NONE = 0, BLEND_CLEAR, BLEND_SRC, BLEND_SRCOVER,   BLEND_DSTOVER, BLEND_SRCIN, BLEND_DSTIN, BLEND_SRCOUT,   BLEND_DSTOUT, BLEND_SRCATOP, BLEND_DSTATOP, BLEND_ADD,   BLEND_XOR, BLEND_DST, BLEND_AKS, BLEND_AKD,   BLEND_BUTT } | 支持的图像混合类型。 | +| [RopType](_display.md#roptype) { ROP_BLACK = 0, ROP_NOTMERGEPEN, ROP_MASKNOTPEN, ROP_NOTCOPYPEN,   ROP_MASKPENNOT, ROP_NOT, ROP_XORPEN, ROP_NOTMASKPEN,   ROP_MASKPEN, ROP_NOTXORPEN, ROP_NOP, ROP_MERGENOTPEN,   ROP_COPYPE, ROP_MERGEPENNOT, ROP_MERGEPEN, ROP_WHITE,   ROP_BUTT } | 硬件加速支持的ROP操作类型。 | | [ColorKey](_display.md#colorkey) { CKEY_NONE = 0, CKEY_SRC, CKEY_DST, CKEY_BUTT } | Color key操作类型定义,即硬件加速支持的Color key操作类型。 | -| [MirrorType](_display.md#mirrortype){ MIRROR_NONE = 0, MIRROR_LR, MIRROR_TB, MIRROR_BUTT } | 硬件加速支持的镜像操作类型定义。 | -| [Connection](_display.md#connection){ CON_INVALID = 0, CONNECTED, DISCONNECTED } | 热插拔连接类型定义。 | -| [InterfaceType](_display.md#interfacetype){ DISP_INTF_HDMI = 0, DISP_INTF_LCD, DISP_INTF_BT1120, DISP_INTF_BT656,   DISP_INTF_YPBPR, DISP_INTF_RGB, DISP_INTF_CVBS, DISP_INTF_SVIDEO,   DISP_INTF_VGA, DISP_INTF_MIPI, DISP_INTF_PANEL, DISP_INTF_BUTT } | 枚举接口类型。 | -| [DispPowerStatus](_display.md#disppowerstatus){ POWER_STATUS_ON, POWER_STATUS_STANDBY, POWER_STATUS_SUSPEND, POWER_STATUS_OFF,   POWER_STATUS_BUTT } | 枚举显示状态。 | -| [CompositionType](_display.md#compositiontype){ COMPOSITION_CLIENT, COMPOSITION_DEVICE, COMPOSITION_CURSOR, COMPOSITION_VIDEO,   COMPOSITION_DEVICE_CLEAR, COMPOSITION_CLIENT_CLEAR, COMPOSITION_TUNNEL, COMPOSITION_BUTT } | 枚举特殊层的组合类型。 | -| [ColorGamut](_display.md#colorgamut){ COLOR_GAMUT_INVALID = -1, COLOR_GAMUT_NATIVE = 0, COLOR_GAMUT_SATNDARD_BT601 = 1, COLOR_GAMUT_STANDARD_BT709 = 2,   COLOR_GAMUT_DCI_P3 = 3, COLOR_GAMUT_SRGB = 4, COLOR_GAMUT_ADOBE_RGB = 5, COLOR_GAMUT_DISPLAY_P3 = 6,   COLOR_GAMUT_BT2020 = 7, COLOR_GAMUT_BT2100_PQ = 8, COLOR_GAMUT_BT2100_HLG = 9, COLOR_GAMUT_DISPLAY_BT2020 = 10 } | 色域类型枚举值。 | -| [GamutMap](_display.md#gamutmap){ GAMUT_MAP_CONSTANT = 0, GAMUT_MAP_EXPANSION = 1, GAMUT_MAP_HDR_CONSTANT = 2, GAMUT_MAP_HDR_EXPANSION = 3 } | 枚举色域的映射类型。 | -| [ColorDataSpace](_display.md#colordataspace){  COLOR_DATA_SPACE_UNKNOWN = 0, GAMUT_BT601 = 0x00000001, GAMUT_BT709 = 0x00000002, GAMUT_DCI_P3 = 0x00000003,   GAMUT_SRGB = 0x00000004, GAMUT_ADOBE_RGB = 0x00000005, GAMUT_DISPLAY_P3 = 0x00000006, GAMUT_BT2020 = 0x00000007,   GAMUT_BT2100_PQ = 0x00000008, GAMUT_BT2100_HLG = 0x00000009, GAMUT_DISPLAY_BT2020 = 0x0000000a, TRANSFORM_FUNC_UNSPECIFIED = 0x00000100,   TRANSFORM_FUNC_LINEAR = 0x00000200, TRANSFORM_FUNC_SRGB = 0x00000300, TRANSFORM_FUNC_SMPTE_170M = 0x00000400, TRANSFORM_FUNC_GM2_2 = 0x00000500,   TRANSFORM_FUNC_GM2_6 = 0x00000600, TRANSFORM_FUNC_GM2_8 = 0x00000700, TRANSFORM_FUNC_ST2084 = 0x00000800, TRANSFORM_FUNC_HLG = 0x00000900,   PRECISION_UNSPECIFIED = 0x00010000, PRECISION_FULL = 0x00020000, PRESION_LIMITED = 0x00030000, PRESION_EXTENDED = 0x00040000,   BT601_SMPTE170M_FULL = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT601_SMPTE170M_LIMITED = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, BT709_LINEAR_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT709_LINEAR_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRESION_EXTENDED,   BT709_SRGB_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT709_SRGB_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRESION_EXTENDED, BT709_SMPTE170M_LIMITED = GAMUT_BT709 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, DCI_P3_LINEAR_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL,   DCI_P3_GAMMA26_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_GM2_6 \| PRECISION_FULL, DISPLAY_P3_LINEAR_FULL = GAMUT_DISPLAY_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, DCI_P3_SRGB_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, ADOBE_RGB_GAMMA22_FULL = GAMUT_ADOBE_RGB \| TRANSFORM_FUNC_GM2_2 \| PRECISION_FULL,   BT2020_LINEAR_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT2020_SRGB_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT2020_SMPTE170M_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT2020_ST2084_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRECISION_FULL,   BT2020_HLG_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_HLG \| PRECISION_FULL, BT2020_ST2084_LIMITED = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRESION_LIMITED } | 枚举颜色空间的类型。 | -| [HDRFormat](_display.md#hdrformat){ NOT_SUPPORT_HDR = 0, DOLBY_VISION = 1, HDR10 = 2, HLG = 3,   HDR10_PLUS = 4, HDR_VIVID = 5 } | 枚举HDR格式。 | -| [HDRMetadataKey](_display.md#hdrmetadatakey){  MATAKEY_RED_PRIMARY_X = 0, MATAKEY_RED_PRIMARY_Y = 1, MATAKEY_GREEN_PRIMARY_X = 2, MATAKEY_GREEN_PRIMARY_Y = 3,   MATAKEY_BLUE_PRIMARY_X = 4, MATAKEY_BLUE_PRIMARY_Y = 5, MATAKEY_WHITE_PRIMARY_X = 6, MATAKEY_WHITE_PRIMARY_Y = 7,   MATAKEY_MAX_LUMINANCE = 8, MATAKEY_MIN_LUMINANCE = 9, MATAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, MATAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,   MATAKEY_HDR10_PLUS = 12, MATAKEY_HDR_VIVID = 13 } | 枚举HDR元数据关键字。 | -| [PresentTimestampType](_display.md#presenttimestamptype){ HARDWARE_DISPLAY_PTS_UNSUPPORTED = 0, HARDWARE_DISPLAY_PTS_DELAY = 1 << 0, HARDWARE_DISPLAY_PTS_TIMESTAMP = 1 << 1 } | 上屏时间戳类型枚举值。 | +| [MirrorType](_display.md#mirrortype) { MIRROR_NONE = 0, MIRROR_LR, MIRROR_TB, MIRROR_BUTT } | 硬件加速支持的镜像操作类型定义 | +| [Connection](_display.md#connection) { CON_INVALID = 0, CONNECTED, DISCONNECTED } | 热插拔连接类型定义 | +| [InterfaceType](_display.md#interfacetype) { DISP_INTF_HDMI = 0, DISP_INTF_LCD, DISP_INTF_BT1120, DISP_INTF_BT656,   DISP_INTF_YPBPR, DISP_INTF_RGB, DISP_INTF_CVBS, DISP_INTF_SVIDEO,   DISP_INTF_VGA, DISP_INTF_MIPI, DISP_INTF_PANEL, DISP_INTF_BUTT } | 枚举接口类型。 | +| [DispPowerStatus](_display.md#disppowerstatus) { POWER_STATUS_ON, POWER_STATUS_STANDBY, POWER_STATUS_SUSPEND, POWER_STATUS_OFF,   POWER_STATUS_BUTT } | 枚举显示状态 | +| [CompositionType](_display.md#compositiontype) { COMPOSITION_CLIENT, COMPOSITION_DEVICE, COMPOSITION_CURSOR, COMPOSITION_VIDEO,   COMPOSITION_DEVICE_CLEAR, COMPOSITION_CLIENT_CLEAR, COMPOSITION_TUNNEL, COMPOSITION_BUTT } | 枚举特殊层的组合类型。 | +| [ColorGamut](_display.md#colorgamut) { COLOR_GAMUT_INVALID = -1, COLOR_GAMUT_NATIVE = 0, COLOR_GAMUT_SATNDARD_BT601 = 1, COLOR_GAMUT_STANDARD_BT709 = 2,   COLOR_GAMUT_DCI_P3 = 3, COLOR_GAMUT_SRGB = 4, COLOR_GAMUT_ADOBE_RGB = 5, COLOR_GAMUT_DISPLAY_P3 = 6,   COLOR_GAMUT_BT2020 = 7, COLOR_GAMUT_BT2100_PQ = 8, COLOR_GAMUT_BT2100_HLG = 9, COLOR_GAMUT_DISPLAY_BT2020 = 10 } | 色域类型枚举值 | +| [GamutMap](_display.md#gamutmap) { GAMUT_MAP_CONSTANT = 0, GAMUT_MAP_EXPANSION = 1, GAMUT_MAP_HDR_CONSTANT = 2, GAMUT_MAP_HDR_EXPANSION = 3 } | 枚举色域的映射类型 | +| [ColorDataSpace](_display.md#colordataspace) { COLOR_DATA_SPACE_UNKNOWN = 0, GAMUT_BT601 = 0x00000001, GAMUT_BT709 = 0x00000002, GAMUT_DCI_P3 = 0x00000003,   GAMUT_SRGB = 0x00000004, GAMUT_ADOBE_RGB = 0x00000005, GAMUT_DISPLAY_P3 = 0x00000006, GAMUT_BT2020 = 0x00000007,   GAMUT_BT2100_PQ = 0x00000008, GAMUT_BT2100_HLG = 0x00000009, GAMUT_DISPLAY_BT2020 = 0x0000000a, TRANSFORM_FUNC_UNSPECIFIED = 0x00000100,   TRANSFORM_FUNC_LINEAR = 0x00000200, TRANSFORM_FUNC_SRGB = 0x00000300, TRANSFORM_FUNC_SMPTE_170M = 0x00000400, TRANSFORM_FUNC_GM2_2 = 0x00000500,   TRANSFORM_FUNC_GM2_6 = 0x00000600, TRANSFORM_FUNC_GM2_8 = 0x00000700, TRANSFORM_FUNC_ST2084 = 0x00000800, TRANSFORM_FUNC_HLG = 0x00000900,   PRECISION_UNSPECIFIED = 0x00010000, PRECISION_FULL = 0x00020000, PRESION_LIMITED = 0x00030000, PRESION_EXTENDED = 0x00040000,   BT601_SMPTE170M_FULL = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT601_SMPTE170M_LIMITED = GAMUT_BT601 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, BT709_LINEAR_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT709_LINEAR_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_LINEAR \| PRESION_EXTENDED,   BT709_SRGB_FULL = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT709_SRGB_EXTENDED = GAMUT_BT709 \| TRANSFORM_FUNC_SRGB \| PRESION_EXTENDED, BT709_SMPTE170M_LIMITED = GAMUT_BT709 \| TRANSFORM_FUNC_SMPTE_170M \| PRESION_LIMITED, DCI_P3_LINEAR_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL,   DCI_P3_GAMMA26_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_GM2_6 \| PRECISION_FULL, DISPLAY_P3_LINEAR_FULL = GAMUT_DISPLAY_P3 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, DCI_P3_SRGB_FULL = GAMUT_DCI_P3 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, ADOBE_RGB_GAMMA22_FULL = GAMUT_ADOBE_RGB \| TRANSFORM_FUNC_GM2_2 \| PRECISION_FULL,   BT2020_LINEAR_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_LINEAR \| PRECISION_FULL, BT2020_SRGB_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SRGB \| PRECISION_FULL, BT2020_SMPTE170M_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_SMPTE_170M \| PRECISION_FULL, BT2020_ST2084_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRECISION_FULL,   BT2020_HLG_FULL = GAMUT_BT2020 \| TRANSFORM_FUNC_HLG \| PRECISION_FULL, BT2020_ST2084_LIMITED = GAMUT_BT2020 \| TRANSFORM_FUNC_ST2084 \| PRESION_LIMITED } | 枚举颜色空间的类型 | +| [HDRFormat](_display.md#hdrformat) { NOT_SUPPORT_HDR = 0, DOLBY_VISION = 1, HDR10 = 2, HLG = 3,   HDR10_PLUS = 4, HDR_VIVID = 5 } | 枚举HDR格式 | +| [HDRMetadataKey](_display.md#hdrmetadatakey) { MATAKEY_RED_PRIMARY_X = 0, MATAKEY_RED_PRIMARY_Y = 1, MATAKEY_GREEN_PRIMARY_X = 2, MATAKEY_GREEN_PRIMARY_Y = 3,   MATAKEY_BLUE_PRIMARY_X = 4, MATAKEY_BLUE_PRIMARY_Y = 5, MATAKEY_WHITE_PRIMARY_X = 6, MATAKEY_WHITE_PRIMARY_Y = 7,   MATAKEY_MAX_LUMINANCE = 8, MATAKEY_MIN_LUMINANCE = 9, MATAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, MATAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,   MATAKEY_HDR10_PLUS = 12, MATAKEY_HDR_VIVID = 13 } | 枚举HDR元数据关键字 | +| [PresentTimestampType](_display.md#presenttimestamptype) { HARDWARE_DISPLAY_PTS_UNSUPPORTED = 0, HARDWARE_DISPLAY_PTS_DELAY = 1 << 0, HARDWARE_DISPLAY_PTS_TIMESTAMP = 1 << 1 } | 上屏时间戳类型枚举值 | diff --git a/zh-cn/device-dev/reference/hdi-apis/display__vgu_8h.md b/zh-cn/device-dev/reference/hdi-apis/display__vgu_8h.md index 46da91de2d965b8b6655f1a9fb1362f71e31503d..fc2471552cff45825ccb66cc434eda3288441c3d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/display__vgu_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/display__vgu_8h.md @@ -1,9 +1,9 @@ # display_vgu.h -## **概述** +## 概述 -定义2D矢量硬件加速模块相关驱动函数。 +该文件定义2D矢量硬件加速模块相关驱动函数。 **Since:** @@ -14,86 +14,86 @@ [Display](_display.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [VGUPoint](_v_g_u_point.md) | 坐标点对象。 | -| [VGURect](_v_g_u_rect.md) | 矩形对象。 | -| [VGUPath](_v_g_u_path.md) | 路径对象,存放路径命令和坐标数据。 | -| [VGUMatrix3](_v_g_u_matrix3.md) | 变换矩阵。 | -| [VGUBuffer](_v_g_u_buffer.md) | 硬件加速渲染位图缓存。 | -| [VGUMaskLayer](_v_g_u_mask_layer.md) | 定义蒙版图层。 | -| [VGUSurface](_v_g_u_surface.md) | 2D硬件加速绘制目标表面。 | -| [VGUColorStop](_v_g_u_color_stop.md) | 渐变颜色分布位置。 | -| [VGULinear](_v_g_u_linear.md) | 线性渐变。 | -| [VGURadial](_v_g_u_radial.md) | 辐射渐变。 | -| [VGUConic](_v_g_u_conic.md) | 圆锥渐变。 | -| [VGUImage](_v_g_u_image.md) | 图像对象。 | -| [VGUPattern](_v_g_u_pattern.md) | 图片模式对象。 | -| [VGUGradient](_v_g_u_gradient.md) | 渐变对象。 | -| [VGUSolid](_v_g_u_solid.md) | 颜色对象。 | -| [VGUPaintStyle](_v_g_u_paint_style.md) | 填充或描边路径的渲染风格。 | -| [VGUFillAttr](_v_g_u_fill_attr.md) | 填充路径的属性。 | -| [VGUStrokeAttr](_v_g_u_stroke_attr.md) | 描边路径的属性。 | -| [VGUFuncs](_v_g_u_funcs.md) | 定义2D硬件加速驱动函数。 | +| [VGUPoint](_v_g_u_point.md) | struct
坐标点对象。 | +| [VGURect](_v_g_u_rect.md) | struct
矩形对象。 | +| [VGUPath](_v_g_u_path.md) | struct
路径对象,存放路径命令和坐标数据。 | +| [VGUMatrix3](_v_g_u_matrix3.md) | struct
变换矩阵。 | +| [VGUBuffer](_v_g_u_buffer.md) | struct
硬件加速渲染位图缓存。 | +| [VGUMaskLayer](_v_g_u_mask_layer.md) | struct
定义蒙版图层。 | +| [VGUSurface](_v_g_u_surface.md) | struct
2D硬件加速绘制目标表面。 | +| [VGUColorStop](_v_g_u_color_stop.md) | struct
渐变颜色分布位置。 | +| [VGULinear](_v_g_u_linear.md) | struct
线性渐变。 | +| [VGURadial](_v_g_u_radial.md) | struct
辐射渐变。 | +| [VGUConic](_v_g_u_conic.md) | struct
圆锥渐变。 | +| [VGUImage](_v_g_u_image.md) | struct
图像对象。 | +| [VGUPattern](_v_g_u_pattern.md) | struct
图片模式对象。 | +| [VGUGradient](_v_g_u_gradient.md) | struct
渐变对象。 | +| [VGUSolid](_v_g_u_solid.md) | struct
颜色对象 | +| [VGUPaintStyle](_v_g_u_paint_style.md) | struct
填充或描边路径的渲染风格。 | +| [VGUFillAttr](_v_g_u_fill_attr.md) | struct
填充路径的属性。 | +| [VGUStrokeAttr](_v_g_u_stroke_attr.md) | struct
描边路径的属性。 | +| [VGUFuncs](_v_g_u_funcs.md) | struct
定义2D硬件加速驱动函数。 | ### 宏定义 | 名称 | 描述 | | -------- | -------- | -| HDI_VGU_SCALAR_IS_FLOAT   1 | VGU标量是否为浮点型 | +| [HDI_VGU_SCALAR_IS_FLOAT](_display.md#hdi_vgu_scalar_is_float)   1 | VGU标量是否为浮点型。 | ### 类型定义 | 名称 | 描述 | | -------- | -------- | -| [VGUScalar](_display.md#vguscalar) | VGU标量 | -| [VGUPixelFormat](_display.md#vgupixelformat) | 像素格式。 | -| [VGUBlendType](_display.md#vgublendtype) | 混合操作类型。 | +| [VGUScalar](_display.md#vguscalar) | typedef float
VGU标量 | +| [VGUPixelFormat](_display.md#vgupixelformat) | typedef [PixelFormat](_display.md#pixelformat)
像素格式 | +| [VGUBlendType](_display.md#vgublendtype) | typedef [BlendType](_display.md#blendtype)
混合操作类型 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [VGUPathDataType](_display.md#vgupathdatatype){ VGU_DATA_TYPE_S16 = 0, VGU_DATA_TYPE_S32, VGU_DATA_TYPE_F32 } | 路径坐标数据类型。 | -| [VGUCapability](_display.md#vgucapability){ VGU_CAP_BLIT = (1 << 0), VGU_CAP_BLIT_NUM = (1 << 1), VGU_CAP_PATH = (1 << 2), VGU_CAP_FILTER_BLUR = (1 << 3) } | 硬件加速能力。 | -| [VGUResult](_display.md#vguresult){   VGU_SUCCESS = 0, VGU_NO_SUPPORT = -1, VGU_OPERATION_FAILED = -2, VGU_OUT_OF_MEMORY = -3,   VGU_TIMEOUT = -4, VGU_INVALID_PARAMETER = -5, VGU_BUSY = -6, VGU_NO_CONTEXT = -7 } | 错误码定义。 | -| [VGULineCap](_display.md#vgulinecap){ VGU_LINECAP_BUTT = 0, VGU_LINECAP_ROUND, VGU_LINECAP_SQUARE } | 线帽。 | -| [VGUJointType](_display.md#vgujointtype){ VGU_LINE_JOIN_MITER = 0, VGU_LINE_JOIN_ROUND, VGU_LINE_JOIN_BEVEL, VGU_LINE_JOIN_BUTT } | 联接类型。 | -| [VGUFilter](_display.md#vgufilter){ VGU_FILTER_BILINEAR = 0, VGU_FILTER_NEAREST, VGU_FILTER_LINEAR, VGU_FILTER_BUTT } | 图像滤波类型。 | -| [VGUFillRule](_display.md#vgufillrule){ VGU_RULE_WINDING = 0, VGU_RULE_EVEN_ODD, VGU_RULE_BUTT } | 填充规则定义。 | -| [VGUFillSpread](_display.md#vgufillspread){ VGU_SPREAD_PAD = 0, VGU_SPREAD_REFLECT, VGU_SPREAD_REPEAT, VGU_SPREAD_BUTT } | 渐变填充区域外的延展类型。 | -| [VGUWrapType](_display.md#vguwraptype){ VGU_WRAP_REFLECT = 0, VGU_WRAP_REPEAT, VGU_WRAP_BUTT } | 图像模式填充延展类型。 | -| [VGUPathCmd](_display.md#vgupathcmd){   VGU_PATH_CMD_CLOSE = 0, VGU_PATH_CMD_MOVE, VGU_PATH_CMD_LINE, VGU_PATH_CMD_HLINE,   VGU_PATH_CMD_VLINE, VGU_PATH_CMD_QUAD, VGU_PATH_CMD_CUBIC, VGU_PATH_CMD_SQUAD,   VGU_PATH_CMD_SCUBIC, VGU_PATH_CMD_BUTT } | 路径绘制指令类型。 | -| [VGUTransformType](_display.md#vgutransformtype){ VGU_TRANSFORM_TRANSLATE = (1 << 0), VGU_TRANSFORM_SCALE = (1 << 1), VGU_TRANSFORM_ROTATE_90 = (1 << 2), VGU_TRANSFORM_ROTATE_180 = (1 << 3),   VGU_TRANSFORM_ROTATE_270 = (1 << 4), VGU_TRANSFORM_OTHER = (1 << 16) } | 变换类型。 | -| [VGUClipType](_display.md#vgucliptype){ VGU_CLIP_RECT = 0, VGU_CLIP_PATH, VGU_CLIP_BUTT } | 绘制表面剪切类型。 | -| [VGUGradientType](_display.md#vgugradienttype){ VGU_GRADIENT_LINEAR = 0, VGU_GRADIENT_RADIAL, VGU_GRADIENT_CONIC, VGU_GRADIENT_BUTT } | 渐变类型。 | -| [VGUPaintType](_display.md#vgupainttype){ VGU_PAINT_SOLID = 0, VGU_PAINT_GRADIENT, VGU_PAINT_PATTERN, VGU_PAINT_BUTT } | 渲染对象。 | +| [VGUPathDataType](_display.md#vgupathdatatype) { VGU_DATA_TYPE_S16 = 0, VGU_DATA_TYPE_S32, VGU_DATA_TYPE_F32 } | 路径坐标数据类型。 | +| [VGUCapability](_display.md#vgucapability) { VGU_CAP_BLIT = (1 << 0), VGU_CAP_BLIT_NUM = (1 << 1), VGU_CAP_PATH = (1 << 2), VGU_CAP_FILTER_BLUR = (1 << 3) } | 硬件加速能力。 | +| [VGUResult](_display.md#vguresult) { VGU_SUCCESS = 0, VGU_NO_SUPPORT = -1, VGU_OPERATION_FAILED = -2, VGU_OUT_OF_MEMORY = -3,   VGU_TIMEOUT = -4, VGU_INVALID_PARAMETER = -5, VGU_BUSY = -6, VGU_NO_CONTEXT = -7 } | 错误码定义。 | +| [VGULineCap](_display.md#vgulinecap) { VGU_LINECAP_BUTT = 0, VGU_LINECAP_ROUND, VGU_LINECAP_SQUARE } | 线帽。 | +| [VGUJointType](_display.md#vgujointtype) { VGU_LINE_JOIN_MITER = 0, VGU_LINE_JOIN_ROUND, VGU_LINE_JOIN_BEVEL, VGU_LINE_JOIN_BUTT } | 联接类型。 | +| [VGUFilter](_display.md#vgufilter) { VGU_FILTER_BILINEAR = 0, VGU_FILTER_NEAREST, VGU_FILTER_LINEAR, VGU_FILTER_BUTT } | 图像滤波类型。 | +| [VGUFillRule](_display.md#vgufillrule) { VGU_RULE_WINDING = 0, VGU_RULE_EVEN_ODD, VGU_RULE_BUTT } | 填充规则定义。 | +| [VGUFillSpread](_display.md#vgufillspread) { VGU_SPREAD_PAD = 0, VGU_SPREAD_REFLECT, VGU_SPREAD_REPEAT, VGU_SPREAD_BUTT } | 渐变填充区域外的延展类型。 | +| [VGUWrapType](_display.md#vguwraptype) { VGU_WRAP_REFLECT = 0, VGU_WRAP_REPEAT, VGU_WRAP_BUTT } | 图像模式填充延展类型。 | +| [VGUPathCmd](_display.md#vgupathcmd) { VGU_PATH_CMD_CLOSE = 0, VGU_PATH_CMD_MOVE, VGU_PATH_CMD_LINE, VGU_PATH_CMD_HLINE,   VGU_PATH_CMD_VLINE, VGU_PATH_CMD_QUAD, VGU_PATH_CMD_CUBIC, VGU_PATH_CMD_SQUAD,   VGU_PATH_CMD_SCUBIC, VGU_PATH_CMD_BUTT } | 路径绘制指令类型。 | +| [VGUTransformType](_display.md#vgutransformtype) { VGU_TRANSFORM_TRANSLATE = (1 << 0), VGU_TRANSFORM_SCALE = (1 << 1), VGU_TRANSFORM_ROTATE_90 = (1 << 2), VGU_TRANSFORM_ROTATE_180 = (1 << 3),   VGU_TRANSFORM_ROTATE_270 = (1 << 4), VGU_TRANSFORM_OTHER = (1 << 16) } | 变换类型。 | +| [VGUClipType](_display.md#vgucliptype) { VGU_CLIP_RECT = 0, VGU_CLIP_PATH, VGU_CLIP_BUTT } | 绘制表面剪切类型。 | +| [VGUGradientType](_display.md#vgugradienttype) { VGU_GRADIENT_LINEAR = 0, VGU_GRADIENT_RADIAL, VGU_GRADIENT_CONIC, VGU_GRADIENT_BUTT } | 渐变类型。 | +| [VGUPaintType](_display.md#vgupainttype) { VGU_PAINT_SOLID = 0, VGU_PAINT_GRADIENT, VGU_PAINT_PATTERN, VGU_PAINT_BUTT } | 渲染对象 | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [VGUPathInit](_display.md#vgupathinit)(VGUPath \*path, VGUPathDataType type, const uint8_t \*segments, int numSegments, const uint8_t \*data, bool enAlias, VGURect boundBox) | 初始化路径对象。 | -| [VGUPathAppend](_display.md#vgupathappend)(VGUPath \*path, const VGUPath \*subpath) | 添加子路径到当前路径中。 | -| [VGUPathClear](_display.md#vgupathclear)(VGUPath \*path) | 清除路径对象内存。 | -| [VGUMatrixIdentity](_display.md#vgumatrixidentity)(VGUMatrix3 \*matrix) | 初始化矩阵对象为单位矩阵。 | -| [VGUMatrixScale](_display.md#vgumatrixscale)(VGUMatrix3 \*matrix, float xScale, float yScale) | 矩阵变换缩放。 | -| [VGUMatrixRotate](_display.md#vgumatrixrotate)(VGUMatrix3 \*matrix, float degree) | 矩阵变换旋转。 | -| [VGUMatrixTranslate](_display.md#vgumatrixtranslate)(VGUMatrix3 \*matrix, float x, float y) | 矩阵变换平移。 | -| [VGUGradientColorStop](_display.md#vgugradientcolorstop)(VGUGradient \*gradient, const VGUColorStop \*colorStop, uint32_t count) | 对渐变添加ColorStop。 | -| [VGUGradientClearStop](_display.md#vgugradientclearstop)(VGUGradient \*gradient) | 清除ColorStop。 | -| [VGUGradientMatrix](_display.md#vgugradientmatrix)(VGUGradient \*gradient, const VGUMatrix3 \*matrix) | 设置渐变对象的变换矩阵。 | -| [VGUGradientLinear](_display.md#vgugradientlinear)(VGUGradient \*gradient, const VGUPoint \*p1, const VGUPoint \*p2) | 创建线性渐变对象。 | -| [VGUGradientRadial](_display.md#vgugradientradial)(VGUGradient \*gradient, const VGUPoint \*p1, VGUScalar r1, const VGUPoint \*p2, VGUScalar r2) | 创建辐射渐变对象 | -| [VGUGradientConic](_display.md#vgugradientconic)(VGUGradient \*gradient, VGUScalar cx, VGUScalar cy) | 创建圆锥渐变对象。 | -| [VGUInitialize](_display.md#vguinitialize)(VGUFuncs \*\*funcs) | 获取硬件加速相关的操作接口指针。 | -| [VGUUninitialize](_display.md#vguuninitialize)(VGUFuncs \*funcs) | 去初始化硬件加速模块,同时释放硬件加速模块操作函数指针。 | +| [VGUPathInit](_display.md#vgupathinit) ([VGUPath](_v_g_u_path.md) \*path, [VGUPathDataType](_display.md#vgupathdatatype) type, const uint8_t \*segments, int numSegments, const uint8_t \*data, bool enAlias, [VGURect](_v_g_u_rect.md) boundBox) | [VGUResult](_display.md#vguresult)
初始化路径对象。 | +| [VGUPathAppend](_display.md#vgupathappend) ([VGUPath](_v_g_u_path.md) \*path, const [VGUPath](_v_g_u_path.md) \*subpath) | [VGUResult](_display.md#vguresult)
添加子路径到当前路径中。 | +| [VGUPathClear](_display.md#vgupathclear) ([VGUPath](_v_g_u_path.md) \*path) | [VGUResult](_display.md#vguresult)
清除路径对象内存。 | +| [VGUMatrixIdentity](_display.md#vgumatrixidentity) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix) | [VGUResult](_display.md#vguresult)
初始化矩阵对象为单位矩阵。 | +| [VGUMatrixScale](_display.md#vgumatrixscale) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float xScale, float yScale) | [VGUResult](_display.md#vguresult)
矩阵变换缩放。 | +| [VGUMatrixRotate](_display.md#vgumatrixrotate) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float degree) | [VGUResult](_display.md#vguresult)
矩阵变换旋转。 | +| [VGUMatrixTranslate](_display.md#vgumatrixtranslate) ([VGUMatrix3](_v_g_u_matrix3.md) \*matrix, float x, float y) | [VGUResult](_display.md#vguresult)
矩阵变换平移。 | +| [VGUGradientColorStop](_display.md#vgugradientcolorstop) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUColorStop](_v_g_u_color_stop.md) \*colorStop, uint32_t count) | [VGUResult](_display.md#vguresult)
对渐变添加ColorStop。 | +| [VGUGradientClearStop](_display.md#vgugradientclearstop) ([VGUGradient](_v_g_u_gradient.md) \*gradient) | [VGUResult](_display.md#vguresult)
清除ColorStop。 | +| [VGUGradientMatrix](_display.md#vgugradientmatrix) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUMatrix3](_v_g_u_matrix3.md) \*matrix) | [VGUResult](_display.md#vguresult)
设置渐变对象的变换矩阵。 | +| [VGUGradientLinear](_display.md#vgugradientlinear) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUPoint](_v_g_u_point.md) \*p1, const [VGUPoint](_v_g_u_point.md) \*p2) | [VGUResult](_display.md#vguresult)
创建线性渐变对象。 | +| [VGUGradientRadial](_display.md#vgugradientradial) ([VGUGradient](_v_g_u_gradient.md) \*gradient, const [VGUPoint](_v_g_u_point.md) \*p1, [VGUScalar](_display.md#vguscalar) r1, const [VGUPoint](_v_g_u_point.md) \*p2, [VGUScalar](_display.md#vguscalar) r2) | [VGUResult](_display.md#vguresult)
创建辐射渐变对象 | +| [VGUGradientConic](_display.md#vgugradientconic) ([VGUGradient](_v_g_u_gradient.md) \*gradient, [VGUScalar](_display.md#vguscalar) cx, [VGUScalar](_display.md#vguscalar) cy) | [VGUResult](_display.md#vguresult)
创建圆锥渐变对象。 | +| [VGUInitialize](_display.md#vguinitialize) ([VGUFuncs](_v_g_u_funcs.md) \*\*funcs) | [VGUResult](_display.md#vguresult)
获取硬件加速相关的操作接口指针。 | +| [VGUUninitialize](_display.md#vguuninitialize) ([VGUFuncs](_v_g_u_funcs.md) \*funcs) | [VGUResult](_display.md#vguresult)
去初始化硬件加速模块,同时释放硬件加速模块操作函数指针。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/input__controller_8h.md b/zh-cn/device-dev/reference/hdi-apis/input__controller_8h.md index 0036ad9e3661c7213b8f1c7906b0f330453b098a..70583dd0a116f2f3871287af4e39cce292a711d1 100644 --- a/zh-cn/device-dev/reference/hdi-apis/input__controller_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/input__controller_8h.md @@ -1,28 +1,24 @@ # input_controller.h -## **概述** +## 概述 描述Input设备业务控制相关的接口声明。 -**Since**: - +**Since:** 1.0 - -**Version**: - +**Version:** 1.0 - **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [InputController](_input_controller.md) | 提供Input设备业务控制相关的接口。 | +| [InputController](_input_controller.md) | struct
提供Input设备业务控制相关的接口。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/input__manager_8h.md b/zh-cn/device-dev/reference/hdi-apis/input__manager_8h.md index a93402294a89293abbfed1fc7bc5b74a7844b96a..515ea4902c5c22bbfbb1b6fbef67e10491dc8260 100644 --- a/zh-cn/device-dev/reference/hdi-apis/input__manager_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/input__manager_8h.md @@ -1,36 +1,32 @@ # input_manager.h -## **概述** +## 概述 描述Input设备管理相关的接口声明。 -**Since**: - +**Since:** 1.0 - -**Version**: - +**Version:** 1.0 - **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [InputManager](_input_manager.md) | 提供Input设备管理相关的接口。 | -| [IInputInterface](_i_input_interface.md) | 定义用于提供Input设备驱动程序功能的接口。 | +| [InputManager](_input_manager.md) | struct
提供Input设备管理相关的接口。  | +| [IInputInterface](_i_input_interface.md) | struct
定义用于提供Input设备驱动程序功能的接口。  | ### 函数 | 名称 | 描述 | | -------- | -------- | -| [GetInputInterface](input.md#getinputinterface) ([IInputInterface](_i_input_interface.md) \*\*interface) | Input服务通过调用此接口获取操作Input设备的所有接口。 | +| [GetInputInterface](_input.md#getinputinterface) ([IInputInterface](_i_input_interface.md) \*\*interface) | int32_t
Input服务通过调用此接口获取操作Input设备的所有接口。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/input__reporter_8h.md b/zh-cn/device-dev/reference/hdi-apis/input__reporter_8h.md index acd441d4b5cea53936c99582849805da425ccfb8..19da2734d22bcff41670a68ca7ca27781672b2ed 100644 --- a/zh-cn/device-dev/reference/hdi-apis/input__reporter_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/input__reporter_8h.md @@ -1,28 +1,24 @@ # input_reporter.h -## **概述** +## 概述 描述Input设备数据上报相关的接口声明。 -**Since**: - +**Since:** 1.0 - -**Version**: - +**Version:** 1.0 - **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [InputReporter](_input_reporter.md) | 提供Input设备数据上报相关的接口。 | +| [InputReporter](_input_reporter.md) | struct
提供Input设备数据上报相关的接口。  | diff --git a/zh-cn/device-dev/reference/hdi-apis/input__type_8h.md b/zh-cn/device-dev/reference/hdi-apis/input__type_8h.md index 44430e50ce053966b1da33e26c65a5ed9147260e..9244830a4149c2d86ff88359a00512cf6cb1fdd7 100644 --- a/zh-cn/device-dev/reference/hdi-apis/input__type_8h.md +++ b/zh-cn/device-dev/reference/hdi-apis/input__type_8h.md @@ -1,67 +1,65 @@ # input_type.h -## **概述** +## 概述 -Input设备相关的类型定义。 +Input设备相关的类型定义,定义了Input设备驱动接口所使用的结构体及枚举类型。 -定义了Input设备驱动接口所使用的结构体及枚举类型。 - -**Since**: +**Since:** 1.0 -**Version**: +**Version:** 1.0 **相关模块:** -[Input](input.md) +[Input](_input.md) -## **汇总** +## 汇总 ### 类 | 名称 | 描述 | | -------- | -------- | -| [InputEventPackage](_input_event_package.md) | Input事件数据包结构。 | -| [InputHotPlugEvent](_input_hot_plug_event.md) | 热插拔事件数据包结构。 | -| [InputDevDesc](_input_dev_desc.md) | Input设备描述信息。 | -| [InputEventCb](_input_event_cb.md) | 此结构体定义了输入事件回调函数并提供给Input服务使用。 | -| [InputHostCb](_input_host_cb.md) | 此结构体定义了热插拔事件上报回调函数并提供给Input服务使用。 | -| [InputDevAbility](_input_dev_ability.md) | Input设备的能力属性,存储支持事件的位图。 | -| [InputDimensionInfo](_input_dimension_info.md) | Input设备的维度信息。 | -| [InputDevIdentify](_input_dev_identify.md) | Input设备的识别信息。 | -| [InputDevAttr](_input_dev_attr.md) | Input设备属性。 | -| [InputDeviceInfo](_input_device_info.md) | Input设备基础设备信息。 | -| [InputExtraCmd](_input_extra_cmd.md) | 扩展指令的数据结构。 | +| [InputEventPackage](_input_event_package.md) | struct
Input事件数据包结构。 | +| [InputHotPlugEvent](_input_hot_plug_event.md) | struct
热插拔事件数据包结构。 | +| [InputDevDesc](_input_dev_desc.md) | struct
Input设备描述信息。 | +| [InputEventCb](_input_event_cb.md) | struct
此结构体定义了输入事件回调函数并提供给Input服务使用。 | +| [InputHostCb](_input_host_cb.md) | struct
此结构体定义了热插拔事件上报回调函数并提供给Input服务使用。 | +| [InputDevAbility](_input_dev_ability.md) | struct
Input设备的能力属性,存储支持事件的位图。 | +| [InputDimensionInfo](_input_dimension_info.md) | struct
Input设备的维度信息。 | +| [InputDevIdentify](_input_dev_identify.md) | struct
Input设备的识别信息。 | +| [InputDevAttr](_input_dev_attr.md) | struct
Input设备属性。 | +| [InputDeviceInfo](_input_device_info.md) | struct
Input设备基础设备信息。 | +| [InputExtraCmd](_input_extra_cmd.md) | struct
扩展指令的数据结构。 | ### 宏定义 | 名称 | 描述 | | -------- | -------- | -| [MAX_INPUT_DEV_NUM](input.md#max_input_dev_num)   32 | Input设备数量的最大值。 | -| [CHIP_INFO_LEN](input.md#chip_info_len)   10 | 芯片信息长度。 | -| [CHIP_NAME_LEN](input.md#chip_name_len)   10 | 芯片名称长度。 | -| [VENDOR_NAME_LEN](input.md#vendor_name_len)   10 | 厂商名称长度。 | -| [DEV_NAME_LEN](input.md#dev_name_len)   64 | Input设备名称长度。 | -| [SELF_TEST_RESULT_LEN](input.md#self_test_result_len)   20 | 自测结果长度。 | -| [DEV_MANAGER_SERVICE_NAME](input.md#dev_manager_service_name)   "hdf_input_host" | Input设备节点服务名称。 | -| [DIV_ROUND_UP](input.md#div_round_up)(nr, d)   (((nr) + (d) - 1) / (d)) | 向上取整计算公式。 | -| [BYTE_HAS_BITS](input.md#byte_has_bits)   8 | 一个字节所包含的比特数。 | -| [BITS_TO_UINT64](input.md#bits_to_uint64)(count)   [DIV_ROUND_UP](input.md#div_round_up)(count, [BYTE_HAS_BITS](input.md#byte_has_bits) \* sizeof(uint64_t)) | 比特与64位无符号整数的转换公式。 | -| [HDF_FF_CNT](input.md#hdf_ff_cnt)   (0x7f + 1) | Input设备发送力反馈命令的数量最大值。 | +| [MAX_INPUT_DEV_NUM](_input.md#max_input_dev_num)   32 | Input设备数量的最大值。 | +| [CHIP_INFO_LEN](_input.md#chip_info_len)   10 | 芯片信息长度。 | +| [CHIP_NAME_LEN](_input.md#chip_name_len)   10 | 芯片名称长度。 | +| [VENDOR_NAME_LEN](_input.md#vendor_name_len)   10 | 厂商名称长度。 | +| [DEV_NAME_LEN](_input.md#dev_name_len)   64 | Input设备名称长度。 | +| [SELF_TEST_RESULT_LEN](_input.md#self_test_result_len)   20 | 自测结果长度。 | +| [DEV_MANAGER_SERVICE_NAME](_input.md#dev_manager_service_name)   "hdf_input_host" | Input设备节点服务名称。 | +| [DIV_ROUND_UP](_input.md#div_round_up)(nr, d)   (((nr) + (d) - 1) / (d)) | 向上取整计算公式。 | +| [BYTE_HAS_BITS](_input.md#byte_has_bits)   8 | 一个字节所包含的比特数。 | +| [BITS_TO_UINT64](_input.md#bits_to_uint64)(count)   [DIV_ROUND_UP](_input.md#div_round_up)(count, [BYTE_HAS_BITS](_input.md#byte_has_bits) \* sizeof(uint64_t)) | 比特与64位无符号整数的转换公式。 | +| [HDF_FF_CNT](_input.md#hdf_ff_cnt)   (0x7f + 1) | Input设备发送力反馈命令的数量最大值。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [RetStatus](input.md#retstatus) { INPUT_SUCCESS = 0, INPUT_FAILURE = -1, INPUT_INVALID_PARAM = -2, INPUT_NOMEM = -3,   INPUT_NULL_PTR = -4, INPUT_TIMEOUT = -5, INPUT_UNSUPPORTED = -6 } | 定义返回值类型。 | -| [InputDevType](input.md#inputdevtype) { INDEV_TYPE_TOUCH, INDEV_TYPE_KEY, INDEV_TYPE_KEYBOARD, INDEV_TYPE_MOUSE,   INDEV_TYPE_BUTTON, INDEV_TYPE_CROWN, INDEV_TYPE_ENCODER, INDEV_TYPE_UNKNOWN } | 定义Input设备类型。 | -| [PowerStatus](input.md#powerstatus) { INPUT_RESUME, INPUT_SUSPEND, INPUT_LOW_POWER, INPUT_POWER_STATUS_UNKNOWN  } | 定义电源状态。 | -| [CapacitanceTest](input.md#capacitancetest) { BASE_TEST, FULL_TEST, MMI_TEST, RUNNING_TEST,   TEST_TYPE_UNKNOWN } | 定义容值测试类型。 | +| [RetStatus](_input.md#retstatus) { INPUT_SUCCESS = 0, INPUT_FAILURE = -1, INPUT_INVALID_PARAM = -2, INPUT_NOMEM = -3,   INPUT_NULL_PTR = -4, INPUT_TIMEOUT = -5, INPUT_UNSUPPORTED = -6 } | 定义返回值类型。 | +| [InputDevType](_input.md#inputdevtype) { INDEV_TYPE_TOUCH, INDEV_TYPE_KEY, INDEV_TYPE_KEYBOARD, INDEV_TYPE_MOUSE,   INDEV_TYPE_BUTTON, INDEV_TYPE_CROWN, INDEV_TYPE_ENCODER, INDEV_TYPE_UNKNOWN } | 定义Input设备类型。 | +| [PowerStatus](_input.md#powerstatus) { INPUT_RESUME, INPUT_SUSPEND, INPUT_LOW_POWER, INPUT_POWER_STATUS_UNKNOWN } | 定义电源状态。 | +| [CapacitanceTest](_input.md#capacitancetest) { BASE_TEST, FULL_TEST, MMI_TEST, RUNNING_TEST,   TEST_TYPE_UNKNOWN } | 定义容值测试类型。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_changed_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_changed_callback.md index 46600f68482f434d220249120b97408550662fae..cdc1db76e9e64e37d851027331c1d79fb0f1e20e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_changed_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_changed_callback.md @@ -1,18 +1,22 @@ # IActivityChangedCallback -## **概述** +## 概述 -定义上报行为事件的回调函数 +定义上报行为事件的回调函数。 用户在获得订阅的行为事件或获取设备缓存的行为事件前,需要先注册该回调函数。只有当订阅的行为发生时,行为数据才会通过回调函数进行上报。 详情可参考[IActivityInterface](interface_i_activity_interface.md)。 +**Since:** + +3.2 + **相关模块:** -[HdiActivityRecognition](activity_recognition.md) +[HdiActivityRecognition](_hdi_activity_recognition.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -22,7 +26,7 @@ | [OnActivityChanged](#onactivitychanged) ([in] struct [ActRecognitionEvent](_act_recognition_event.md)[] event) | 定义上报行为事件的回调函数。 | -## **成员函数说明** +## 成员函数说明 ### OnActivityChanged() @@ -32,7 +36,7 @@ IActivityChangedCallback::OnActivityChanged ([in] struct ActRecognitionEvent[] event) ``` -**描述:** +**描述:** 定义上报行为事件的回调函数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_interface.md index 8893cf8972fa3e4911632190735b53bf0874cd2d..0dc4e03db162e73c1da27ae703fa2a1ea1cdd229 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_activity_interface.md @@ -1,7 +1,7 @@ # IActivityInterface -## **概述** +## 概述 定义对行为识别进行基本操作的接口。 @@ -9,10 +9,10 @@ **相关模块:** -[HdiActivityRecognition](activity_recognition.md) +[HdiActivityRecognition](_hdi_activity_recognition.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -28,7 +28,7 @@ | [FlushActivity](#flushactivity) () | 数据刷新。 | -## **成员函数说明** +## 成员函数说明 ### DisableActRecognitionEvent() @@ -38,9 +38,7 @@ IActivityInterface::DisableActRecognitionEvent ([in] int activity, [in] int eventType ) ``` -**描述:** - -取消订阅某个行为事件。 +**描述:** 取消订阅某个之前订阅过的行为事件。 @@ -49,7 +47,7 @@ IActivityInterface::DisableActRecognitionEvent ([in] int activity, [in] int even | 名称 | 描述 | | -------- | -------- | | activity | 取消订阅的行为,参考[EnableActRecognitionEvent](#enableactrecognitionevent)接口的activity参数。 | -| eventType | 事件类型,参考[ActRecognitionEventType](activity_recognition.md#actrecognitioneventtype)定义。可以填充1(进入)或2(退出),也可以填充3(同时订阅进入和退出)。 | +| eventType | 事件类型,参考[ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype)定义。可以填充1(进入)或2(退出),也可以填充3(同时订阅进入和退出)。 | **返回:** @@ -65,7 +63,7 @@ IActivityInterface::DisableActRecognitionEvent ([in] int activity, [in] int even IActivityInterface::EnableActRecognitionEvent ([in] int activity, [in] int eventType, [in] long maxReportLatencyNs, [in] int powerMode ) ``` -**描述:** +**描述:** 订阅某个行为事件。 @@ -76,9 +74,9 @@ IActivityInterface::EnableActRecognitionEvent ([in] int activity, [in] int event | 名称 | 描述 | | -------- | -------- | | activity | 订阅的行为,通过[GetSupportActivity](#getsupportactivity)得到设备支持的所有行为,然后将行为列表中需要订阅的行为下标作为参数填充。 | -| eventType | 事件类型,参考[ActRecognitionEventType](activity_recognition.md#actrecognitioneventtype)定义。可以填充1(进入)或2(退出),也可以填充3(同时订阅进入和退出)。 | +| eventType | 事件类型,参考[ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype)定义。可以填充1(进入)或2(退出),也可以填充3(同时订阅进入和退出)。 | | maxReportLatencyNs | 最大上报时间间隔,单位是纳秒。若该时间间隔内有订阅的行为事件发生,则会上报。若存在多个订阅的行为,取最小的时间间隔。 | -| powerMode | 功耗模式。参考[ActRecognitionPowerMode](activity_recognition.md#actrecognitionpowermode)定义。 | +| powerMode | 功耗模式。参考[ActRecognitionPowerMode](_hdi_activity_recognition.md#actrecognitionpowermode)定义。 | **返回:** @@ -94,7 +92,7 @@ IActivityInterface::EnableActRecognitionEvent ([in] int activity, [in] int event IActivityInterface::FlushActivity () ``` -**描述:** +**描述:** 数据刷新。 @@ -114,7 +112,7 @@ IActivityInterface::FlushActivity () IActivityInterface::GetCurrentActivity ([out] struct ActRecognitionEvent[] event) ``` -**描述:** +**描述:** 获取当前的行为事件。 @@ -140,7 +138,7 @@ IActivityInterface::GetCurrentActivity ([out] struct ActRecognitionEvent[] event IActivityInterface::GetSupportActivity ([out] String[] activity) ``` -**描述:** +**描述:** 获取设备支持的行为类型。 @@ -148,7 +146,7 @@ IActivityInterface::GetSupportActivity ([out] String[] activity) | 名称 | 描述 | | -------- | -------- | -| activity | 参数类型为字符串,输出设备支持的行为类型。 包括:"inVehicle" 、"onBicycle"、"walking"、"running"、"still"、"fast_walking"、"high_speed_rail" "unknown"、"elevator"、"relative_still"、"walking_handhold"、"lying_posture"、"plane"、"metro"等。对应[ActRecognitionEventType](activity_recognition.md#actrecognitioneventtype)中的类型。 | +| activity | 参数类型为字符串,输出设备支持的行为类型。 包括:"inVehicle" 、"onBicycle"、"walking"、"running"、"still"、"fast_walking"、"high_speed_rail" "unknown"、"elevator"、"relative_still"、"walking_handhold"、"lying_posture"、"plane"、"metro"等。对应[ActRecognitionEventType](_hdi_activity_recognition.md#actrecognitioneventtype)中的类型。 | **返回:** @@ -164,7 +162,7 @@ IActivityInterface::GetSupportActivity ([out] String[] activity) IActivityInterface::RegisterActRecognitionCallback ([in] IActivityChangedCallback callbackObj) ``` -**描述:** +**描述:** 注册回调函数。 @@ -190,7 +188,7 @@ IActivityInterface::RegisterActRecognitionCallback ([in] IActivityChangedCallbac IActivityInterface::UnregisterActRecognitionCallback ([in] IActivityChangedCallback callbackObj) ``` -**描述:** +**描述:** 取消注册回调函数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_adapter.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_adapter.md new file mode 100644 index 0000000000000000000000000000000000000000..9a9710cfd205a76848691b460e2998b2a5a5f4bb --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_adapter.md @@ -0,0 +1,484 @@ +# IAudioAdapter + + +## 概述 + +AudioAdapter音频适配器接口。 + +提供音频适配器(声卡)对外支持的驱动能力,包括初始化端口、创建放音、创建录音、获取端口能力集等。 + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [InitAllPorts](#initallports) () | 初始化一个音频适配器所有的端口驱动。 | +| [CreateRender](#createrender) ([in] struct [AudioDeviceDescriptor](_audio_device_descriptor.md) desc, [in] struct [AudioSampleAttributes](_audio_sample_attributes.md) attrs, [out] [IAudioRender](interface_i_audio_render.md) render) | 创建一个音频播放接口的对象。 | +| [DestroyRender](#destroyrender) () | 销毁一个音频播放接口的对象。 | +| [CreateCapture](#createcapture) ([in] struct [AudioDeviceDescriptor](_audio_device_descriptor.md) desc, [in] struct [AudioSampleAttributes](_audio_sample_attributes.md) attrs, [out] [IAudioCapture](interface_i_audio_capture.md) capture) | 创建一个音频录音接口的对象。 | +| [DestroyCapture](#destroycapture) () | 销毁一个音频录音接口的对象。 | +| [GetPortCapability](#getportcapability) ([in] struct [AudioPort](_audio_port.md) port, [out] struct [AudioPortCapability](_audio_port_capability.md) capability) | 获取一个音频适配器的端口驱动的能力集。 | +| [SetPassthroughMode](#setpassthroughmode) ([in] struct [AudioPort](_audio_port.md) port, [in] enum [AudioPortPassthroughMode](_audio.md#audioportpassthroughmode) mode) | 设置音频端口驱动的数据透传模式。 | +| [GetPassthroughMode](#getpassthroughmode) ([in] struct [AudioPort](_audio_port.md) port, [out] enum [AudioPortPassthroughMode](_audio.md#audioportpassthroughmode) mode) | 获取音频端口驱动的数据透传模式。 | +| [GetDeviceStatus](#getdevicestatus) ([out] struct [AudioDeviceStatus](_audio_device_status.md) status) | 获取一个音频适配器的设备状态。 | +| [UpdateAudioRoute](#updateaudioroute) ([in] struct [AudioRoute](_audio_route.md) route, [out] int routeHandle) | 更新音频路由。 | +| [ReleaseAudioRoute](#releaseaudioroute) ([in] int routeHandle) | 释放音频路由。 | +| [SetMicMute](#setmicmute) ([in] boolean mute) | 设置音频静音。 | +| [GetMicMute](#getmicmute) ([out] boolean mute) | 获取音频静音状态。 | +| [SetVoiceVolume](#setvoicevolume) ([in] float volume) | 设置语音呼叫的音量。 | +| [SetExtraParams](#setextraparams) ([in] enum [AudioExtParamKey](_audio.md#audioextparamkey) key, [in] String condition, [in] String value) | 根据指定的条件设置音频拓展参数。 | +| [GetExtraParams](#getextraparams) ([in] enum [AudioExtParamKey](_audio.md#audioextparamkey) key, [in] String condition, [out] String value) | 根据指定条件获取音频扩展参数的取值。 | +| [RegExtraParamObserver](#regextraparamobserver) ([in] AudioCallback audioCallback, [in] byte cookie) | 注册扩展参数回调函数。 | + + +## 成员函数说明 + + +### CreateCapture() + + +``` +IAudioAdapter::CreateCapture ([in] struct AudioDeviceDescriptor desc, [in] struct AudioSampleAttributes attrs, [out] IAudioCapture capture ) +``` + +**描述:** + +创建一个音频录音接口的对象。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| desc | 待打开的音频设备描述符,详请参考[AudioDeviceDescriptor](_audio_device_descriptor.md)。 | +| attrs | 待打开的音频采样属性,详请参考[AudioSampleAttributes](_audio_sample_attributes.md)。 | +| capture | 获取的音频录音接口的对象实例保存到capture中,详请参考[IAudioCapture](interface_i_audio_capture.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[CreateCapture](#createcapture) + + +### CreateRender() + + +``` +IAudioAdapter::CreateRender ([in] struct AudioDeviceDescriptor desc, [in] struct AudioSampleAttributes attrs, [out] IAudioRender render ) +``` + +**描述:** + +创建一个音频播放接口的对象。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| desc | 待打开的音频设备描述符,详请参考[AudioDeviceDescriptor](_audio_device_descriptor.md)。 | +| attrs | 待打开的音频采样属性,详请参考[AudioSampleAttributes](_audio_sample_attributes.md)。 | +| render | 获取的音频播放接口的对象实例保存到render中,详请参考[IAudioRender](interface_i_audio_render.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetPortCapability](#getportcapability) + +[DestroyRender](#destroyrender) + + +### DestroyCapture() + + +``` +IAudioAdapter::DestroyCapture () +``` + +**描述:** + +销毁一个音频录音接口的对象。 + +**注意:** + +在音频录音过程中,不能销毁该接口对象。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[CreateCapture](#createcapture) + + +### DestroyRender() + + +``` +IAudioAdapter::DestroyRender () +``` + +**描述:** + +销毁一个音频播放接口的对象。 + +**注意:** + +在音频播放过程中,不能销毁该接口对象。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[CreateRender](#createrender) + + +### GetDeviceStatus() + + +``` +IAudioAdapter::GetDeviceStatus ([out] struct AudioDeviceStatus status) +``` + +**描述:** + +获取一个音频适配器的设备状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| status | 获取的设备状态保存到status中,详请参考[AudioDeviceStatus](_audio_device_status.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetExtraParams() + + +``` +IAudioAdapter::GetExtraParams ([in] enum AudioExtParamKey key, [in] String condition, [out] String value ) +``` + +**描述:** + +根据指定条件获取音频扩展参数的取值。 + +- condition为多个键值对组成的字符串,多个键值对之间通过分号分割,键值对的格式为"keytype=keyvalue"。 + +- 当输入的key值为AudioExtParamKey::AUDIO_EXT_PARAM_KEY_VOLUME时,condition的格式必须为: + EVENT_TYPE=xxx;VOLUME_GROUP_ID=xxx;AUDIO_VOLUME_TYPE=xxx; + - EVENT_TYPE 表示音量事件类型: 其中1表示设置音量, 4表示设置静音。 + + - VOLUME_GROUP_ID 表示待查询的音频扩展参数相关的音量组。 + + - AUDIO_VOLUME_TYPE 表示待查询的音频扩展参数相关的音量类型。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| key | 指定的扩展参数键类型,详请参考[AudioExtParamKey](_audio.md#audioextparamkey)。 | +| condition | 指定的扩展参数查询条件。 | +| value | 待返回的指定扩展参数条件的当前值。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetMicMute() + + +``` +IAudioAdapter::GetMicMute ([out] boolean mute) +``` + +**描述:** + +获取音频静音状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mute | 获取的静音状态保存到mute中,true表示静音,false表示非静音。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetMicMute](#getmicmute) + + +### GetPassthroughMode() + + +``` +IAudioAdapter::GetPassthroughMode ([in] struct AudioPort port, [out] enum AudioPortPassthroughMode mode ) +``` + +**描述:** + +获取音频端口驱动的数据透传模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| port | 待获取的端口,详请参考[AudioPort](_audio_port.md)。 | +| mode | 获取的传输模式保存到mode中,详请参考[AudioPortPassthroughMode](_audio.md#audioportpassthroughmode)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetPassthroughMode](#setpassthroughmode) + + +### GetPortCapability() + + +``` +IAudioAdapter::GetPortCapability ([in] struct AudioPort port, [out] struct AudioPortCapability capability ) +``` + +**描述:** + +获取一个音频适配器的端口驱动的能力集。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| port | 待获取的端口,详请参考[AudioPort](_audio_port.md)。 | +| capability | 获取的端口能力保存到capability中,详请参考[AudioPortCapability](_audio_port_capability.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### InitAllPorts() + + +``` +IAudioAdapter::InitAllPorts () +``` + +**描述:** + +初始化一个音频适配器所有的端口驱动。 + +在音频服务中,调用其他驱动接口前需要先调用该接口检查端口是否已经初始化完成,如果端口没有初始化完成, 则需要等待一段时间(例如100ms)后重新进行检查,直到端口初始化完成后再继续操作。 + +**返回:** + +初始化完成返回值0,初始化失败返回负值。 + + +### RegExtraParamObserver() + + +``` +IAudioAdapter::RegExtraParamObserver ([in] AudioCallback audioCallback, [in] byte cookie ) +``` + +**描述:** + +注册扩展参数回调函数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| audioCallback | 待注册的回调函数,详请参考[IAudioCallback](interface_i_audio_callback.md)。 | +| cookie | 用于传递数据。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### ReleaseAudioRoute() + + +``` +IAudioAdapter::ReleaseAudioRoute ([in] int routeHandle) +``` + +**描述:** + +释放音频路由。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| routeHandle | 待释放的音频路由句柄。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### SetExtraParams() + + +``` +IAudioAdapter::SetExtraParams ([in] enum AudioExtParamKey key, [in] String condition, [in] String value ) +``` + +**描述:** + +根据指定的条件设置音频拓展参数。 + +- condition为多个键值对组成的字符串,多个键值对之间通过分号分割,键值对的格式为"keytype=keyvalue"。 + +- 当输入的key值为AudioExtParamKey::AUDIO_EXT_PARAM_KEY_VOLUME时,condition的格式必须为: + EVENT_TYPE=xxx;VOLUME_GROUP_ID=xxx;AUDIO_VOLUME_TYPE=xxx; + - EVENT_TYPE 表示音量事件类型: 其中1表示设置音量, 4表示设置静音。 + + - VOLUME_GROUP_ID 表示待设置的音频扩展参数相关的音量组。 + + - AUDIO_VOLUME_TYPE 表示待设置的音频扩展参数相关的音量类型。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| key | 指定的扩展参数键类型,详请参考[AudioDrainNotifyType](_audio.md#audiodrainnotifytype)。 | +| condition | 指定的扩展参数查询条件。 | +| value | 指定的扩展参数条件值。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### SetMicMute() + + +``` +IAudioAdapter::SetMicMute ([in] boolean mute) +``` + +**描述:** + +设置音频静音。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mute | 表示是否将音频静音,true表示静音,false表示非静音。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetMicMute](#setmicmute) + + +### SetPassthroughMode() + + +``` +IAudioAdapter::SetPassthroughMode ([in] struct AudioPort port, [in] enum AudioPortPassthroughMode mode ) +``` + +**描述:** + +设置音频端口驱动的数据透传模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| port | 待设置的端口,详请参考[AudioPort](_audio_port.md)。 | +| mode | 待设置的传输模式,详请参考[AudioDrainNotifyType](_audio.md#audiodrainnotifytype)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetPassthroughMode](#getpassthroughmode) + + +### SetVoiceVolume() + + +``` +IAudioAdapter::SetVoiceVolume ([in] float volume) +``` + +**描述:** + +设置语音呼叫的音量。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| volume | 待设置的音量值,范围为(0.0-1.0),0.0表示最小音量值,1.0表示最大音量值。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetVoiceVolume](#setvoicevolume) + + +### UpdateAudioRoute() + + +``` +IAudioAdapter::UpdateAudioRoute ([in] struct AudioRoute route, [out] int routeHandle ) +``` + +**描述:** + +更新音频路由。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| route | 待更新的路由,详请参考[AudioRoute](_audio_route.md)。 | +| routeHandle | 更新后的音频路由句柄保存到routeHandle中。 | + +**返回:** + +成功返回值0,失败返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_callback.md new file mode 100644 index 0000000000000000000000000000000000000000..787a172fc54d891718bf61398605df9ea0574770 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_callback.md @@ -0,0 +1,90 @@ +# IAudioCallback + + +## 概述 + +Audio回调接口。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [RenderCallback](#rendercallback) ([in] enum [AudioCallbackType](_audio.md#audiocallbacktype) type, [out] byte reserved, [out] byte cookie) | 放音回调函数。 | +| [ParamCallback](#paramcallback) ([in] enum [AudioExtParamKey](_audio.md#audioextparamkey) key, [in] byte condition, [in] byte value, [out] byte reserved, [out] byte cookie) | 音频扩展参数回调函数。 | + + +## 成员函数说明 + + +### ParamCallback() + + +``` +IAudioCallback::ParamCallback ([in] enum AudioExtParamKey key, [in] byte condition, [in] byte value, [out] byte reserved, [out] byte cookie ) +``` + +**描述:** + +音频扩展参数回调函数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| key | 扩展参数键类型,详请参考[AudioExtParamKey](_audio.md#audioextparamkey)。 | +| condition | 扩展参数条件。 | +| value | 扩展参数条件的值 | +| reserved | 保留字段。 | +| cookie | 用于传递数据。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[ParamCallback](#paramcallback) + + +### RenderCallback() + + +``` +IAudioCallback::RenderCallback ([in] enum AudioCallbackType type, [out] byte reserved, [out] byte cookie ) +``` + +**描述:** + +放音回调函数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| type | 回调函数通知事件类型,详请参考[AudioExtParamKey](_audio.md#audioextparamkey)。 | +| reserved | 保留字段。 | +| cookie | 用于传递数据。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +RegCallback diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_capture.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_capture.md new file mode 100644 index 0000000000000000000000000000000000000000..e90a66bac1633eec7f88c1dbb7a112e8f8e333f5 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_capture.md @@ -0,0 +1,799 @@ +# IAudioCapture + + +## 概述 + +AudioCapture音频录音接口。 + +提供音频录音支持的驱动能力,包括音频控制、音频属性、音频场景、音频音量、录制音频帧数据等。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [CaptureFrame](#captureframe) ([out] byte[] frame, [in] unsigned long requestBytes) | 从音频驱动中录制一帧输入数据(录音,音频上行数据)。 | +| [GetCapturePosition](#getcaptureposition) ([out] unsigned long frames, [out] struct [AudioTimeStamp](_audio_time_stamp.md) time) | 获取音频已输入的帧数。 | +| [CheckSceneCapability](#checkscenecapability) ([in] struct [AudioSceneDescriptor](_audio_scene_descriptor.md) scene, [out] boolean supported) | 判断某个音频场景能力是否支持。 | +| [SelectScene](#selectscene) ([in] struct [AudioSceneDescriptor](_audio_scene_descriptor.md) scene) | 选择音频场景。 | +| [SetMute](#setmute) ([in] boolean mute) | 设置音频的静音状态。 | +| [GetMute](#getmute) ([out] boolean mute) | 获取音频的静音状态。 | +| [SetVolume](#setvolume) ([in] float volume) | 设置一个音频流的音量。 | +| [GetVolume](#getvolume) ([out] float volume) | 获取一个音频流的音量。 | +| [GetGainThreshold](#getgainthreshold) ([out] float min, [out] float max) | 获取音频流增益的阈值。 | +| [GetGain](#getgain) ([out] float gain) | 获取音频流的增益。 | +| [SetGain](#setgain) ([in] float gain) | 设置音频流的增益。 | +| [GetFrameSize](#getframesize) ([out] unsigned long size) | 获取一帧音频数据的长度(字节数)大小。 | +| [GetFrameCount](#getframecount) ([out] unsigned long count) | 获取音频buffer中的音频帧数。 | +| [SetSampleAttributes](#setsampleattributes) ([in] struct [AudioSampleAttributes](_audio_sample_attributes.md) attrs) | 设置音频采样的属性参数。 | +| [GetSampleAttributes](#getsampleattributes) ([out] struct [AudioSampleAttributes](_audio_sample_attributes.md) attrs) | 获取音频采样的属性参数。 | +| [GetCurrentChannelId](#getcurrentchannelid) ([out] unsigned int channelId) | 获取音频的数据通道ID。 | +| [SetExtraParams](#setextraparams) ([in] String keyValueList) | 设置音频拓展参数。 | +| [GetExtraParams](#getextraparams) ([out] String keyValueList) | 获取音频拓展参数。 | +| [ReqMmapBuffer](#reqmmapbuffer) ([in] int reqSize, [in] struct [AudioMmapBufferDescripter](_audio_mmap_buffer_descripter.md) desc) | 请求mmap缓冲区。 | +| [GetMmapPosition](#getmmapposition) ([out] unsigned long frames, [out] struct [AudioTimeStamp](_audio_time_stamp.md) time) | 获取当前mmap的读/写位置。 | +| [AddAudioEffect](#addaudioeffect) ([in] unsigned long effectid) | 添加音频效果。 | +| [RemoveAudioEffect](#removeaudioeffect) ([in] unsigned long effectid) | 移除音频效果。 | +| [GetFrameBufferSize](#getframebuffersize) ([out] unsigned long bufferSize) | 获取缓冲区大小。 | +| [Start](#start) () | 启动一个音频播放或录音处理。 | +| [Stop](#stop) () | 停止一个音频播放或录音处理。 | +| [Pause](#pause) () | 暂停一个音频播放或录音处理。 | +| [Resume](#resume) () | 恢复一个音频播放或录音处理。 | +| [Flush](#flush) () | 刷新音频缓冲区buffer中的数据。 | +| [TurnStandbyMode](#turnstandbymode) () | 设置或去设置设备的待机模式。 | +| [AudioDevDump](#audiodevdump) ([in] int range, [in] int fd) | 保存音频设备信息。 | +| [IsSupportsPauseAndResume](#issupportspauseandresume) ([out] boolean supportPause, [out] boolean supportResume) | 判断声卡是否支持音频录制的暂停和恢复功能。 | + + +## 成员函数说明 + + +### AddAudioEffect() + + +``` +IAudioCapture::AddAudioEffect ([in] unsigned long effectid) +``` + +**描述:** + +添加音频效果。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| effectid | 添加的音频效果实例标识符。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### AudioDevDump() + + +``` +IAudioCapture::AudioDevDump ([in] int range, [in] int fd ) +``` + +**描述:** + +保存音频设备信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| range | 需要保存的信息范围(3 ~ 5),分为简要信息(3)、一般信息(4)、全量信息(5)。 | +| fd | 保存到指定的目标文件。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### CaptureFrame() + + +``` +IAudioCapture::CaptureFrame ([out] byte[] frame, [in] unsigned long requestBytes ) +``` + +**描述:** + +从音频驱动中录制一帧输入数据(录音,音频上行数据)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| frame | 待存放输入数据的音频frame。 | +| requestBytes | 待存放输入数据的音频frame大小(字节数)。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### CheckSceneCapability() + + +``` +IAudioCapture::CheckSceneCapability ([in] struct AudioSceneDescriptor scene, [out] boolean supported ) +``` + +**描述:** + +判断某个音频场景能力是否支持。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| scene | 待判断的音频场景描述符,详请参考[AudioSceneDescriptor](_audio_scene_descriptor.md)。 | +| supported | 是否支持的状态保存到supported中,true表示支持,false表示不支持。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SelectScene](#selectscene) + + +### Flush() + + +``` +IAudioCapture::Flush () +``` + +**描述:** + +刷新音频缓冲区buffer中的数据。 + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetCapturePosition() + + +``` +IAudioCapture::GetCapturePosition ([out] unsigned long frames, [out] struct AudioTimeStamp time ) +``` + +**描述:** + +获取音频已输入的帧数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| frames | 获取的音频帧数保存到frames中。 | +| time | 获取的关联时间戳保存到time中,详请参考[AudioTimeStamp](_audio_time_stamp.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[CaptureFrame](#captureframe) + + +### GetCurrentChannelId() + + +``` +IAudioCapture::GetCurrentChannelId ([out] unsigned int channelId) +``` + +**描述:** + +获取音频的数据通道ID。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| channelId | 获取的通道ID保存到channelId中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetExtraParams() + + +``` +IAudioCapture::GetExtraParams ([out] String keyValueList) +``` + +**描述:** + +获取音频拓展参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| keyValueList | 拓展参数键值对字符串列表,格式为key=value,多个键值对通过分号分割。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetFrameBufferSize() + + +``` +IAudioCapture::GetFrameBufferSize ([out] unsigned long bufferSize) +``` + +**描述:** + +获取缓冲区大小。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| bufferSize | 获取的缓冲区大小保存在bufferSize中,单位为字节。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetFrameCount() + + +``` +IAudioCapture::GetFrameCount ([out] unsigned long count) +``` + +**描述:** + +获取音频buffer中的音频帧数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| count | 一个音频buffer中包含的音频帧数,获取后保存到count中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetFrameSize() + + +``` +IAudioCapture::GetFrameSize ([out] unsigned long size) +``` + +**描述:** + +获取一帧音频数据的长度(字节数)大小。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| size | 获取的音频帧大小(字节数)保存到size中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetGain() + + +``` +IAudioCapture::GetGain ([out] float gain) +``` + +**描述:** + +获取音频流的增益。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| gain | 保存当前获取到的增益到gain中。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetGainThreshold](#getgainthreshold) + +[SetGain](#setgain) + + +### GetGainThreshold() + + +``` +IAudioCapture::GetGainThreshold ([out] float min, [out] float max ) +``` + +**描述:** + +获取音频流增益的阈值。 + +在具体的功能实现中,可以根据芯片平台的实际情况来进行处理: + +- 可以使用实际的增益值,例如增益的范围为-50db ~ 6db。 + +- 也可以将增益范围设定为0.0~1.0,如果增益的范围为-50db ~ 6db, 则增益的映射关系为0.0表示静音(-50db),1.0表示最大增益(6db)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| min | 获取的音频增益的阈值下限保存到min中。 | +| max | 获取的音频增益的阈值上限保存到max中。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetGain](#getgain) + +[SetGain](#setgain) + + +### GetMmapPosition() + + +``` +IAudioCapture::GetMmapPosition ([out] unsigned long frames, [out] struct AudioTimeStamp time ) +``` + +**描述:** + +获取当前mmap的读/写位置。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| frames | 获取的音频帧计数保存到frames中。 | +| time | 获取的关联时间戳保存到time中,详请参考[AudioTimeStamp](_audio_time_stamp.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetMute() + + +``` +IAudioCapture::GetMute ([out] boolean mute) +``` + +**描述:** + +获取音频的静音状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mute | 获取的静音状态保存到mute中,true表示静音操作、false表示取消静音操作。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetMute](#setmute) + + +### GetSampleAttributes() + + +``` +IAudioCapture::GetSampleAttributes ([out] struct AudioSampleAttributes attrs) +``` + +**描述:** + +获取音频采样的属性参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| attrs | 获取的音频采样属性(例如采样频率、采样精度、通道)保存到attrs中,详请参考[AudioSampleAttributes](_audio_sample_attributes.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetSampleAttributes](#setsampleattributes) + + +### GetVolume() + + +``` +IAudioCapture::GetVolume ([out] float volume) +``` + +**描述:** + +获取一个音频流的音量。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| volume | 获取的音量保存到volume中,范围0.0~1.0。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetVolume](#setvolume) + + +### IsSupportsPauseAndResume() + + +``` +IAudioCapture::IsSupportsPauseAndResume ([out] boolean supportPause, [out] boolean supportResume ) +``` + +**描述:** + +判断声卡是否支持音频录制的暂停和恢复功能。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| supportPause | 是否支持暂停功能的状态保存到supportPause中,true表示支持,false表示不支持。 | +| supportResume | 是否支持恢复功能的状态保存到supportResume中,true表示支持,false表示不支持。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### Pause() + + +``` +IAudioCapture::Pause () +``` + +**描述:** + +暂停一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Resume](#resume) + + +### RemoveAudioEffect() + + +``` +IAudioCapture::RemoveAudioEffect ([in] unsigned long effectid) +``` + +**描述:** + +移除音频效果。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| effectid | 移除的音频效果实例标识符。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### ReqMmapBuffer() + + +``` +IAudioCapture::ReqMmapBuffer ([in] int reqSize, [in] struct AudioMmapBufferDescripter desc ) +``` + +**描述:** + +请求mmap缓冲区。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| reqSize | 请求缓冲区的大小,单位:字节。 | +| desc | 缓冲区描述符,详请参考[AudioMmapBufferDescripter](_audio_mmap_buffer_descripter.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### Resume() + + +``` +IAudioCapture::Resume () +``` + +**描述:** + +恢复一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Pause](#pause) + + +### SelectScene() + + +``` +IAudioCapture::SelectScene ([in] struct AudioSceneDescriptor scene) +``` + +**描述:** + +选择音频场景。 + +- 选择一个非常具体的音频场景(应用场景和输出设备的组合),例如同样是使用手机中的喇叭作为输出设备。 + - 在媒体播放场景中,scene为media_speaker。 + - 在语音通话免提场景中,scene为voice_speaker。 + +- 只是选择一个音频场景,例如使用场景为媒体播放(media)、电影播放(movie)、游戏播放(game)。 + +- 只是选择一个音频输出设备,例如输出设备为听筒(receiver)、喇叭(speaker)、有线耳机(headset)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| scene | 待设置的音频场景描述符,详请参考[AudioSceneDescriptor](_audio_scene_descriptor.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[CheckSceneCapability](#checkscenecapability) + + +### SetExtraParams() + + +``` +IAudioCapture::SetExtraParams ([in] String keyValueList) +``` + +**描述:** + +设置音频拓展参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| keyValueList | 拓展参数键值对字符串列表,格式为key=value,多个键值对通过分号分割。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### SetGain() + + +``` +IAudioCapture::SetGain ([in] float gain) +``` + +**描述:** + +设置音频流的增益。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| gain | 待设置的增益,最小为0.0,最大为1.0。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetGainThreshold](#getgainthreshold) + +[GetGain](#getgain) + + +### SetMute() + + +``` +IAudioCapture::SetMute ([in] boolean mute) +``` + +**描述:** + +设置音频的静音状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mute | 待设置的静音状态,true表示静音操作、false表示取消静音操作。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetMute](#getmute) + + +### SetSampleAttributes() + + +``` +IAudioCapture::SetSampleAttributes ([in] struct AudioSampleAttributes attrs) +``` + +**描述:** + +设置音频采样的属性参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| attrs | 待设置的音频采样属性,例如采样频率、采样精度、通道,详请参考[AudioSampleAttributes](_audio_sample_attributes.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetSampleAttributes](#getsampleattributes) + + +### SetVolume() + + +``` +IAudioCapture::SetVolume ([in] float volume) +``` + +**描述:** + +设置一个音频流的音量。 + +音量的取值范围是0.0~1.0,如果音频服务中的音量等级范围是0 ~ 15, 则音量的映射关系为0.0(或0)表示静音,1.0(或15)表示最大音量等级。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| volume | 待设置的音量,范围0.0~1.0。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### Start() + + +``` +IAudioCapture::Start () +``` + +**描述:** + +启动一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Stop](#stop) + + +### Stop() + + +``` +IAudioCapture::Stop () +``` + +**描述:** + +停止一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Start](#start) + + +### TurnStandbyMode() + + +``` +IAudioCapture::TurnStandbyMode () +``` + +**描述:** + +设置或去设置设备的待机模式。 + +**返回:** + +设置设备待机模式成功返回值0,再次执行后去设置待机模式成功返回正值,失败返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_manager.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_manager.md new file mode 100644 index 0000000000000000000000000000000000000000..ca2136efca2be2a652bf90d259cf8387370b0402 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_manager.md @@ -0,0 +1,131 @@ +# IAudioManager + + +## 概述 + +AudioManager音频适配器管理接口。 + +按照音频服务下发的音频适配器(声卡)描述符加载一个具体的音频适配器驱动程序。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [GetAllAdapters](#getalladapters) ([out] struct [AudioAdapterDescriptor](_audio_adapter_descriptor.md)[] descs) | 获取音频驱动中支持的所有适配器的列表。 | +| [LoadAdapter](#loadadapter) ([in] struct [AudioAdapterDescriptor](_audio_adapter_descriptor.md) desc, [out] [IAudioAdapter](interface_i_audio_adapter.md) adapter) | 加载一个音频适配器(声卡)的驱动。 | +| [UnloadAdapter](#unloadadapter) ([in] String adapterName) | 卸载音频适配器(声卡)的驱动。 | +| [ReleaseAudioManagerObject](#releaseaudiomanagerobject) () | 释放音频管理接口对象。 | + + +## 成员函数说明 + + +### GetAllAdapters() + + +``` +IAudioManager::GetAllAdapters ([out] struct AudioAdapterDescriptor[] descs) +``` + +**描述:** + +获取音频驱动中支持的所有适配器的列表。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| descs | 获取到的音频适配器列表保存到descs中,详请参考[AudioAdapterDescriptor](_audio_adapter_descriptor.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[LoadAdapter](#loadadapter) + + +### LoadAdapter() + + +``` +IAudioManager::LoadAdapter ([in] struct AudioAdapterDescriptor desc, [out] IAudioAdapter adapter ) +``` + +**描述:** + +加载一个音频适配器(声卡)的驱动。 + +加载一个具体的音频驱动,例如usb驱动,在具体实现中可能加载的是一个动态链接库(\*.so)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| desc | 待加载的音频适配器描述符,详请参考[AudioAdapterDescriptor](_audio_adapter_descriptor.md)。 | +| adapter | 获取的音频适配器接口的对象实例保存到adapter中,详请参考[IAudioAdapter](interface_i_audio_adapter.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetAllAdapters](#getalladapters) + +[UnloadAdapter](#unloadadapter) + + +### ReleaseAudioManagerObject() + + +``` +IAudioManager::ReleaseAudioManagerObject () +``` + +**描述:** + +释放音频管理接口对象。 + +**返回:** + +功返回值0,失败返回负值。 + + +### UnloadAdapter() + + +``` +IAudioManager::UnloadAdapter ([in] String adapterName) +``` + +**描述:** + +卸载音频适配器(声卡)的驱动。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| adapterName | 待卸载的音频适配器接口的对象名称。 | + +**参见:** + +[LoadAdapter](#loadadapter) diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_render.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_render.md new file mode 100644 index 0000000000000000000000000000000000000000..9a6091f3c3c93904ae9213e7a645845fac53f9f7 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_audio_render.md @@ -0,0 +1,1010 @@ +# IAudioRender + + +## 概述 + +AudioRender音频播放接口。 + +提供音频播放支持的驱动能力,包括音频控制、音频属性、音频场景、音频音量、获取硬件延迟时间、播放音频帧数据等。 + +**Since:** + +3.2 + +**Version:** + +1.0 + +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [GetLatency](#getlatency) ([out] unsigned int ms) | 获取音频硬件驱动的延迟时间。 | +| [RenderFrame](#renderframe) ([in] byte[] frame, [out] unsigned long replyBytes) | 向音频驱动中播放一帧输出数据(放音,音频下行数据)。 | +| [GetRenderPosition](#getrenderposition) ([out] unsigned long frames, [out] struct [AudioTimeStamp](_audio_time_stamp.md) time) | 获取音频已输出的帧数。 | +| [SetRenderSpeed](#setrenderspeed) ([in] float speed) | 设置一个音频的播放速度。 | +| [GetRenderSpeed](#getrenderspeed) ([out] float speed) | 获取一个音频当前的播放速度。 | +| [SetChannelMode](#setchannelmode) ([in] enum [AudioChannelMode](_audio.md#audiochannelmode) mode) | 设置音频播放的通道模式。 | +| [GetChannelMode](#getchannelmode) ([out] enum [AudioChannelMode](_audio.md#audiochannelmode) mode) | 获取音频播放当前的通道模式。 | +| [RegCallback](#regcallback) ([in] [IAudioCallback](interface_i_audio_callback.md) audioCallback, [in] byte cookie) | 注册音频回调函数,用于放音过程中缓冲区数据写、DrainBuffer完成通知。 | +| [DrainBuffer](#drainbuffer) ([out] enum [AudioDrainNotifyType](_audio.md#audiodrainnotifytype) type) | 排空缓冲区中的数据。 | +| [IsSupportsDrain](#issupportsdrain) ([out] boolean support) | 判断是否支持清空缓冲区数据的功能。 | +| [CheckSceneCapability](#checkscenecapability) ([in] struct [AudioSceneDescriptor](_audio_scene_descriptor.md) scene, [out] boolean supported) | 是否支持某个音频场景的配置。 | +| [SelectScene](#selectscene) ([in] struct [AudioSceneDescriptor](_audio_scene_descriptor.md) scene) | 选择音频场景。 | +| [SetMute](#setmute) ([in] boolean mute) | 设置音频的静音状态。 | +| [GetMute](#getmute) ([out] boolean mute) | 获取音频的静音状态。 | +| [SetVolume](#setvolume) ([in] float volume) | 设置一个音频流的音量。 | +| [GetVolume](#getvolume) ([out] float volume) | 获取一个音频流的音量。 | +| [GetGainThreshold](#getgainthreshold) ([out] float min, [out] float max) | 获取音频流增益的阈值。 | +| [GetGain](#getgain) ([out] float gain) | 获取音频流的增益。 | +| [SetGain](#setgain) ([in] float gain) | 设置音频流的增益。 | +| [GetFrameSize](#getframesize) ([out] unsigned long size) | 获取音频帧的大小。 | +| [GetFrameCount](#getframecount) ([out] unsigned long count) | 获取音频buffer中的音频帧数。 | +| [SetSampleAttributes](#setsampleattributes) ([in] struct [AudioSampleAttributes](_audio_sample_attributes.md) attrs) | 设置音频采样的属性参数。 | +| [GetSampleAttributes](#getsampleattributes) ([out] struct [AudioSampleAttributes](_audio_sample_attributes.md) attrs) | 获取音频采样的属性参数。 | +| [GetCurrentChannelId](#getcurrentchannelid) ([out] unsigned int channelId) | 获取音频的数据通道ID。 | +| [SetExtraParams](#setextraparams) ([in] String keyValueList) | 设置音频拓展参数。 | +| [GetExtraParams](#getextraparams) ([out] String keyValueList) | 获取音频拓展参数。 | +| [ReqMmapBuffer](#reqmmapbuffer) ([in] int reqSize, [in] struct [AudioMmapBufferDescripter](_audio_mmap_buffer_descripter.md) desc) | 请求mmap缓冲区。 | +| [GetMmapPosition](#getmmapposition) ([out] unsigned long frames, [out] struct [AudioTimeStamp](_audio_time_stamp.md) time) | 获取当前mmap的读/写位置。 | +| [AddAudioEffect](#addaudioeffect) ([in] unsigned long effectid) | 添加音频效果。 | +| [RemoveAudioEffect](#removeaudioeffect) ([in] unsigned long effectid) | 移除音频效果。 | +| [GetFrameBufferSize](#getframebuffersize) ([out] unsigned long bufferSize) | 获取缓冲区大小。 | +| [Start](#start) () | 启动一个音频播放或录音处理。 | +| [Stop](#stop) () | 停止一个音频播放或录音处理。 | +| [Pause](#pause) () | 暂停一个音频播放或录音处理。 | +| [Resume](#resume) () | 恢复一个音频播放或录音处理。 | +| [Flush](#flush) () | 刷新音频缓冲区buffer中的数据。 | +| [TurnStandbyMode](#turnstandbymode) () | 设置或去设置设备的待机模式。 | +| [AudioDevDump](#audiodevdump) ([in] int range, [in] int fd) | Dump音频设备信息。 | +| [IsSupportsPauseAndResume](#issupportspauseandresume) ([out] boolean supportPause, [out] boolean supportResume) | 判断声卡是否支持音频播放的暂停和恢复功能 | + + +## 成员函数说明 + + +### AddAudioEffect() + + +``` +IAudioRender::AddAudioEffect ([in] unsigned long effectid) +``` + +**描述:** + +添加音频效果。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| effectid | 添加的音频效果实例标识符。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### AudioDevDump() + + +``` +IAudioRender::AudioDevDump ([in] int range, [in] int fd ) +``` + +**描述:** + +Dump音频设备信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| range | Dump信息范围,分为简要信息、全量信息。 | +| fd | 指定Dump目标文件。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### CheckSceneCapability() + + +``` +IAudioRender::CheckSceneCapability ([in] struct AudioSceneDescriptor scene, [out] boolean supported ) +``` + +**描述:** + +是否支持某个音频场景的配置。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| scene | 待判断的音频场景描述符,详请参考[AudioSceneDescriptor](_audio_scene_descriptor.md)。 | +| supported | 是否支持的状态保存到supported中,true表示支持,false表示不支持。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SelectScene](#selectscene) + + +### DrainBuffer() + + +``` +IAudioRender::DrainBuffer ([out] enum AudioDrainNotifyType type) +``` + +**描述:** + +排空缓冲区中的数据。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| type | 播放结束的类型,详请参考[AudioDrainNotifyType](_audio.md#audiodrainnotifytype)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[RegCallback](#regcallback) + + +### Flush() + + +``` +IAudioRender::Flush () +``` + +**描述:** + +刷新音频缓冲区buffer中的数据。 + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetChannelMode() + + +``` +IAudioRender::GetChannelMode ([out] enum AudioChannelMode mode) +``` + +**描述:** + +获取音频播放当前的通道模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mode | 获取的通道模式保存到mode中,详请参考[AudioChannelMode](_audio.md#audiochannelmode)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetChannelMode](#setchannelmode) + + +### GetCurrentChannelId() + + +``` +IAudioRender::GetCurrentChannelId ([out] unsigned int channelId) +``` + +**描述:** + +获取音频的数据通道ID。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| channelId | 获取的通道ID保存到channelId中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetExtraParams() + + +``` +IAudioRender::GetExtraParams ([out] String keyValueList) +``` + +**描述:** + +获取音频拓展参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| keyValueList | 拓展参数键值对字符串列表,格式为key=value,多个键值对通过分号分割。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetFrameBufferSize() + + +``` +IAudioRender::GetFrameBufferSize ([out] unsigned long bufferSize) +``` + +**描述:** + +获取缓冲区大小。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| bufferSize | 获取的缓冲区大小保存在bufferSize中,单位为字节。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetFrameCount() + + +``` +IAudioRender::GetFrameCount ([out] unsigned long count) +``` + +**描述:** + +获取音频buffer中的音频帧数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| count | 一个音频buffer中包含的音频帧数,获取后保存到count中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetFrameSize() + + +``` +IAudioRender::GetFrameSize ([out] unsigned long size) +``` + +**描述:** + +获取音频帧的大小。 + +获取一帧音频数据的长度(字节数)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| size | 获取的音频帧大小(字节数)保存到size中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetGain() + + +``` +IAudioRender::GetGain ([out] float gain) +``` + +**描述:** + +获取音频流的增益。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| gain | 保存当前获取到的增益到gain中。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetGainThreshold](#getgainthreshold) + +[SetGain](#setgain) + + +### GetGainThreshold() + + +``` +IAudioRender::GetGainThreshold ([out] float min, [out] float max ) +``` + +**描述:** + +获取音频流增益的阈值。 + +在具体的功能实现中,可以根据芯片平台的实际情况来进行处理: + +- 1. 可以使用实际的增益值,例如增益的范围为-50db ~ 6db。 + +- 2. 也可以将增益范围设定为0.0~1.0,如果增益的范围为-50db ~ 6db, 则增益的映射关系为0.0表示静音,1.0表示最大增益(6db)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| min | 获取的音频增益的阈值下限保存到min中。 | +| max | 获取的音频增益的阈值上限保存到max中。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetGain](#getgain) + +[SetGain](#setgain) + + +### GetLatency() + + +``` +IAudioRender::GetLatency ([out] unsigned int ms) +``` + +**描述:** + +获取音频硬件驱动的延迟时间。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| ms | 获取的延迟时间(单位:毫秒)保存到ms中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetMmapPosition() + + +``` +IAudioRender::GetMmapPosition ([out] unsigned long frames, [out] struct AudioTimeStamp time ) +``` + +**描述:** + +获取当前mmap的读/写位置。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| frames | 获取的音频帧计数保存到frames中。 | +| time | 获取的关联时间戳保存到time中,详请参考[AudioTimeStamp](_audio_time_stamp.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### GetMute() + + +``` +IAudioRender::GetMute ([out] boolean mute) +``` + +**描述:** + +获取音频的静音状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mute | 获取的静音状态保存到mute中,true表示静音操作、false表示取消静音操作。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetMute](#setmute) + + +### GetRenderPosition() + + +``` +IAudioRender::GetRenderPosition ([out] unsigned long frames, [out] struct AudioTimeStamp time ) +``` + +**描述:** + +获取音频已输出的帧数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| frames | 获取的音频帧数保存到frames中,详请参考[AudioTimeStamp](_audio_time_stamp.md)。 | +| time | 获取的关联时间戳保存到time中。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[RenderFrame](#renderframe) + + +### GetRenderSpeed() + + +``` +IAudioRender::GetRenderSpeed ([out] float speed) +``` + +**描述:** + +获取一个音频当前的播放速度。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| speed | 获取的播放速度保存到speed中。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetRenderSpeed](#setrenderspeed) + + +### GetSampleAttributes() + + +``` +IAudioRender::GetSampleAttributes ([out] struct AudioSampleAttributes attrs) +``` + +**描述:** + +获取音频采样的属性参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| attrs | 获取的音频采样属性(例如采样频率、采样精度、通道) 保存到attrs中,详请参考[AudioSampleAttributes](_audio_sample_attributes.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetSampleAttributes](#setsampleattributes) + + +### GetVolume() + + +``` +IAudioRender::GetVolume ([out] float volume) +``` + +**描述:** + +获取一个音频流的音量。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| volume | 获取的音量保存到volume中,范围0.0~1.0。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[SetVolume](#setvolume) + + +### IsSupportsDrain() + + +``` +IAudioRender::IsSupportsDrain ([out] boolean support) +``` + +**描述:** + +判断是否支持清空缓冲区数据的功能。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| support | 是否支持的状态保存到support中,true表示支持,false表示不支持。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### IsSupportsPauseAndResume() + + +``` +IAudioRender::IsSupportsPauseAndResume ([out] boolean supportPause, [out] boolean supportResume ) +``` + +**描述:** + +判断声卡是否支持音频播放的暂停和恢复功能 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| supportPause | 是否支持暂停功能的状态保存到supportPause中,true表示支持,false表示不支持。 | +| supportResume | 是否支持恢复功能的状态保存到supportResume中,true表示支持,false表示不支持。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### Pause() + + +``` +IAudioRender::Pause () +``` + +**描述:** + +暂停一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Resume](#resume) + + +### RegCallback() + + +``` +IAudioRender::RegCallback ([in] IAudioCallback audioCallback, [in] byte cookie ) +``` + +**描述:** + +注册音频回调函数,用于放音过程中缓冲区数据写、DrainBuffer完成通知。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| audioCallback | 注册的回调函数,详请参考[IAudioCallback](interface_i_audio_callback.md)。 | +| cookie | 回调函数的入参。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[RegCallback](#regcallback) + + +### RemoveAudioEffect() + + +``` +IAudioRender::RemoveAudioEffect ([in] unsigned long effectid) +``` + +**描述:** + +移除音频效果。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| effectid | 移除的音频效果实例标识符。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### RenderFrame() + + +``` +IAudioRender::RenderFrame ([in] byte[] frame, [out] unsigned long replyBytes ) +``` + +**描述:** + +向音频驱动中播放一帧输出数据(放音,音频下行数据)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| frame | 待写入的输出数据的音频frame。 | +| replyBytes | 实际写入的音频数据长度(字节数),获取后保存到replyBytes中。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### ReqMmapBuffer() + + +``` +IAudioRender::ReqMmapBuffer ([in] int reqSize, [in] struct AudioMmapBufferDescripter desc ) +``` + +**描述:** + +请求mmap缓冲区。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| reqSize | 请求缓冲区的大小。 | +| desc | 缓冲区描述符,详请参考[AudioMmapBufferDescripter](_audio_mmap_buffer_descripter.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### Resume() + + +``` +IAudioRender::Resume () +``` + +**描述:** + +恢复一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Pause](#pause) + + +### SelectScene() + + +``` +IAudioRender::SelectScene ([in] struct AudioSceneDescriptor scene) +``` + +**描述:** + +选择音频场景。 + +- 选择一个非常具体的音频场景(应用场景和输出设备的组合),例如同样是使用手机中的喇叭作为输出设备。 + - 在媒体播放场景scene为media_speaker。 + - 在语音通话免提场景scene为voice_speaker。 + +- 只是选择一个音频场景,例如使用场景为媒体播放(media)、电影播放(movie)、游戏播放(game)。 + +- 只是选择一个音频输出设备,例如输出设备为听筒(receiver)、喇叭(speaker)、有线耳机(headset)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| scene | 待设置的音频场景描述符,详请参考[AudioSceneDescriptor](_audio_scene_descriptor.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[CheckSceneCapability](#checkscenecapability) + + +### SetChannelMode() + + +``` +IAudioRender::SetChannelMode ([in] enum AudioChannelMode mode) +``` + +**描述:** + +设置音频播放的通道模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mode | 待设置的通道模式,详请参考[AudioChannelMode](_audio.md#audiochannelmode)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetChannelMode](#getchannelmode) + + +### SetExtraParams() + + +``` +IAudioRender::SetExtraParams ([in] String keyValueList) +``` + +**描述:** + +设置音频拓展参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| keyValueList | 拓展参数键值对字符串列表,格式为key=value,多个键值对通过分号分割。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### SetGain() + + +``` +IAudioRender::SetGain ([in] float gain) +``` + +**描述:** + +设置音频流的增益。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| gain | 待设置的增益,最小为0.0,最大为1.0。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetGainThreshold](#getgainthreshold) + +[GetGain](#getgain) + + +### SetMute() + + +``` +IAudioRender::SetMute ([in] boolean mute) +``` + +**描述:** + +设置音频的静音状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| mute | 待设置的静音状态,true表示静音操作、false表示取消静音操作。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetMute](#getmute) + + +### SetRenderSpeed() + + +``` +IAudioRender::SetRenderSpeed ([in] float speed) +``` + +**描述:** + +设置一个音频的播放速度。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| speed | 待设置的播放速度(倍速),例0.5、0.75、1.0、1.25、1.5、2.0。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetRenderSpeed](#getrenderspeed) + + +### SetSampleAttributes() + + +``` +IAudioRender::SetSampleAttributes ([in] struct AudioSampleAttributes attrs) +``` + +**描述:** + +设置音频采样的属性参数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| attrs | 待设置的音频采样属性,例如采样频率、采样精度、通道,详请参考[AudioSampleAttributes](_audio_sample_attributes.md)。 | + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[GetSampleAttributes](#getsampleattributes) + + +### SetVolume() + + +``` +IAudioRender::SetVolume ([in] float volume) +``` + +**描述:** + +设置一个音频流的音量。 + +音量的取值范围是0.0~1.0,如果音频服务中的音量等级为15级(0 ~ 15), 则音量的映射关系为0.0表示静音,1.0表示最大音量等级(15)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| volume | 待设置的音量,范围0.0~1.0。 | + +**返回:** + +成功返回值0,失败返回负值。 + + +### Start() + + +``` +IAudioRender::Start () +``` + +**描述:** + +启动一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Stop](#stop) + + +### Stop() + + +``` +IAudioRender::Stop () +``` + +**描述:** + +停止一个音频播放或录音处理。 + +**返回:** + +成功返回值0,失败返回负值。 + +**参见:** + +[Start](#start) + + +### TurnStandbyMode() + + +``` +IAudioRender::TurnStandbyMode () +``` + +**描述:** + +设置或去设置设备的待机模式。 + +**返回:** + +设置设备待机模式成功返回值0,失败返回负值;设置取消设备待机模式成功返回正值,失败返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_callback.md index 5a744f65c56a8a585963b582dcb42141ea9408c3..634813264b93d05af2ac11e9254bcaabbaeaa473 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_callback.md @@ -1,32 +1,30 @@ # IBatteryCallback -## **概述** +## 概述 电池信息的回调。 服务创建此回调对象后,可以调用[IBatteryInterface](interface_i_battery_interface.md)的接口注册回调,从而订阅电池信息的变化。 **Since:** - 3.1 - **相关模块:** [Battery](battery.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [Update](#update) ([in] struct [BatteryInfo](_battery_info.md) event) | 电池信息的回调方法。 | +| [Update](#update) ([in] struct [BatteryInfo](_battery_info.md) event) | 电池信息的回调方法。  | -## **成员函数说明** +## 成员函数说明 ### Update() @@ -35,9 +33,7 @@ ``` IBatteryCallback::Update ([in] struct BatteryInfo event) ``` - -**描述:** - +**描述:** 电池信息的回调方法。 当电池信息发生变化时,将通过此方法的参数返回给服务。 @@ -46,7 +42,7 @@ IBatteryCallback::Update ([in] struct BatteryInfo event) | 名称 | 描述 | | -------- | -------- | -| event | 电池信息,如电量,电压,健康状态等。 | +| event | 电池信息,如电量,电压,健康状态等。  | **参见:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_interface.md index 89ef2cb9d5b9aadcae91f5f9729f95c98a026430..b2a932eea16a37b94931dc3fa100a8821a35f78d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_battery_interface.md @@ -1,47 +1,45 @@ # IBatteryInterface -## **概述** +## 概述 获取、订阅电池信息的接口。 服务获取此对象后,可以调用相关的接口获取、订阅电池信息。 **Since:** - 3.1 - **相关模块:** [Battery](battery.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [Register](#register) ([in] [IBatteryCallback](interface_i_battery_callback.md) event) | 注册电池信息的回调。 | -| [UnRegister](#unregister) () | 取消注册电池信息的回调。 | -| [ChangePath](#changepath) ([in] String path) | 设置电池信息节点的路径。 | -| [GetCapacity](#getcapacity) ([out] int capacity) | 获取电池的电量百分比。 | -| [GetVoltage](#getvoltage) ([out] int voltage) | 获取电池的电压,单位微伏。 | -| [GetTemperature](#gettemperature) ([out] int temperature) | 获取电池的充电温度,单位0.1摄氏度。 | -| [GetHealthState](#gethealthstate) ([out] enum [BatteryHealthState](battery.md#batteryhealthstate) healthState) | 获取电池的健康状态。 | -| [GetPluggedType](#getpluggedtype) ([out] enum [BatteryPluggedType](battery.md#batterypluggedtype) pluggedType) | 获取充电设备类型。 | -| [GetChargeState](#getchargestate) ([out] enum [BatteryChargeState](battery.md#batterychargestate) chargeState) | 获取充电状态。 | -| [GetPresent](#getpresent) ([out] boolean present) | 获取是否支持电池或者电池是否在位。 | -| [GetTechnology](#gettechnology) ([out] String technology) | 获取电池的技术型号。 | -| [GetTotalEnergy](#gettotalenergy) ([out] int totalEnergy) | 获取电池的总容量。 | -| [GetCurrentAverage](#getcurrentaverage) ([out] int curAverage) | 获取电池的平均电流。 | -| [GetCurrentNow](#getcurrentnow) ([out] int curNow) | 获取电池的电流。 | -| [GetRemainEnergy](#getremainenergy) ([out] int remainEnergy) | 获取电池的剩余容量。 | -| [GetBatteryInfo](#getbatteryinfo) ([out] struct [BatteryInfo](_battery_info.md) info) | 获取电池的全部信息。 | - - -## **成员函数说明** +| [Register](#register) ([in] [IBatteryCallback](interface_i_battery_callback.md) event) | 注册电池信息的回调。  | +| [UnRegister](#unregister) () | 取消注册电池信息的回调。  | +| [ChangePath](#changepath) ([in] String path) | 设置电池信息节点的路径。  | +| [GetCapacity](#getcapacity) ([out] int capacity) | 获取电池的电量百分比。  | +| [GetVoltage](#getvoltage) ([out] int voltage) | 获取电池的电压,单位微伏。  | +| [GetTemperature](#gettemperature) ([out] int temperature) | 获取电池的充电温度,单位0.1摄氏度。  | +| [GetHealthState](#gethealthstate) ([out] enum [BatteryHealthState](battery.md#batteryhealthstate) healthState) | 获取电池的健康状态。  | +| [GetPluggedType](#getpluggedtype) ([out] enum [BatteryPluggedType](battery.md#batterypluggedtype) pluggedType) | 获取充电设备类型。  | +| [GetChargeState](#getchargestate) ([out] enum [BatteryChargeState](battery.md#batterychargestate) chargeState) | 获取充电状态。  | +| [GetPresent](#getpresent) ([out] boolean present) | 获取是否支持电池或者电池是否在位。  | +| [GetTechnology](#gettechnology) ([out] String technology) | 获取电池的技术型号。  | +| [GetTotalEnergy](#gettotalenergy) ([out] int totalEnergy) | 获取电池的总容量。  | +| [GetCurrentAverage](#getcurrentaverage) ([out] int curAverage) | 获取电池的平均电流。  | +| [GetCurrentNow](#getcurrentnow) ([out] int curNow) | 获取电池的电流。  | +| [GetRemainEnergy](#getremainenergy) ([out] int remainEnergy) | 获取电池的剩余容量。  | +| [GetBatteryInfo](#getbatteryinfo) ([out] struct [BatteryInfo](_battery_info.md) info) | 获取电池的全部信息。  | + + +## 成员函数说明 ### ChangePath() @@ -50,9 +48,7 @@ ``` IBatteryInterface::ChangePath ([in] String path) ``` - -**描述:** - +**描述:** 设置电池信息节点的路径。 **参数:** @@ -72,16 +68,14 @@ HDF_SUCCESS 表示路径设置成功。 ``` IBatteryInterface::GetBatteryInfo ([out] struct BatteryInfo info) ``` - -**描述:** - +**描述:** 获取电池的全部信息。 **参数:** | 名称 | 描述 | | -------- | -------- | -| info | 电池的全部信息。 | +| info | 输出参数,电池的全部信息。 | **返回:** @@ -98,16 +92,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetCapacity ([out] int capacity) ``` - -**描述:** - +**描述:** 获取电池的电量百分比。 **参数:** | 名称 | 描述 | | -------- | -------- | -| capacity | 表示电量的百分比值。 | +| capacity | 输出参数,表示电量的百分比值。 | **返回:** @@ -120,16 +112,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetChargeState ([out] enum BatteryChargeState chargeState) ``` - -**描述:** - +**描述:** 获取充电状态。 **参数:** | 名称 | 描述 | | -------- | -------- | -| chargeState | 表示充电状态。 | +| chargeState | 输出参数,表示充电状态。 | **返回:** @@ -146,16 +136,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetCurrentAverage ([out] int curAverage) ``` - -**描述:** - +**描述:** 获取电池的平均电流。 **参数:** | 名称 | 描述 | | -------- | -------- | -| totalEnergy | 表示电池的平均电流,单位毫安。 | +| totalEnergy | 输出参数,表示电池的平均电流,单位毫安。 | **返回:** @@ -168,16 +156,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetCurrentNow ([out] int curNow) ``` - -**描述:** - +**描述:** 获取电池的电流。 **参数:** | 名称 | 描述 | | -------- | -------- | -| curNow | 表示电池的实时电流,单位毫安。 | +| curNow | 输出参数,表示电池的实时电流,单位毫安。 | **返回:** @@ -190,16 +176,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetHealthState ([out] enum BatteryHealthState healthState) ``` - -**描述:** - +**描述:** 获取电池的健康状态。 **参数:** | 名称 | 描述 | | -------- | -------- | -| healthState | 表示电池健康状态。 | +| healthState | 输出参数,表示电池健康状态。 | **返回:** @@ -216,16 +200,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetPluggedType ([out] enum BatteryPluggedType pluggedType) ``` - -**描述:** - +**描述:** 获取充电设备类型。 **参数:** | 名称 | 描述 | | -------- | -------- | -| pluggedType | 表示充电设备类型。 | +| pluggedType | 输出参数,表示充电设备类型。 | **返回:** @@ -242,16 +224,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetPresent ([out] boolean present) ``` - -**描述:** - +**描述:** 获取是否支持电池或者电池是否在位。 **参数:** | 名称 | 描述 | | -------- | -------- | -| present | 表示是否支持电池或者电池是否在位。true表示支持或在位,false表示不支持或不在位。 | +| present | 输出参数,表示是否支持电池或者电池是否在位。true表示支持或在位,false表示不支持或不在位。 | **返回:** @@ -264,16 +244,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetRemainEnergy ([out] int remainEnergy) ``` - -**描述:** - +**描述:** 获取电池的剩余容量。 **参数:** | 名称 | 描述 | | -------- | -------- | -| remainEnergy | 表示电池的剩余容量,单位毫安时。 | +| remainEnergy | 输出参数,表示电池的剩余容量,单位毫安时。 | **返回:** @@ -286,16 +264,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetTechnology ([out] String technology) ``` - -**描述:** - +**描述:** 获取电池的技术型号。 **参数:** | 名称 | 描述 | | -------- | -------- | -| technology | 当前电池技术型号。 | +| technology | 输出参数,当前电池技术型号。 | **返回:** @@ -308,16 +284,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetTemperature ([out] int temperature) ``` - -**描述:** - +**描述:** 获取电池的充电温度,单位0.1摄氏度。 **参数:** | 名称 | 描述 | | -------- | -------- | -| temperature | 表示电池温度。 | +| temperature | 输出参数,表示电池温度。 | **返回:** @@ -330,16 +304,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetTotalEnergy ([out] int totalEnergy) ``` - -**描述:** - +**描述:** 获取电池的总容量。 **参数:** | 名称 | 描述 | | -------- | -------- | -| totalEnergy | 表示电池的总容量,单位毫安时。 | +| totalEnergy | 输出参数,表示电池的总容量,单位毫安时。 | **返回:** @@ -352,16 +324,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::GetVoltage ([out] int voltage) ``` - -**描述:** - +**描述:** 获取电池的电压,单位微伏。 **参数:** | 名称 | 描述 | | -------- | -------- | -| voltage | 表示电池的电压。 | +| voltage | 输出参数,表示电池的电压。 | **返回:** @@ -374,16 +344,14 @@ HDF_SUCCESS 表示获取成功。 ``` IBatteryInterface::Register ([in] IBatteryCallback event) ``` - -**描述:** - +**描述:** 注册电池信息的回调。 **参数:** | 名称 | 描述 | | -------- | -------- | -| event | 服务注册的回调。 | +| event | 输入参数,服务注册的回调。 | **返回:** @@ -396,9 +364,7 @@ HDF_SUCCESS 表示注册成功。 ``` IBatteryInterface::UnRegister () ``` - -**描述:** - +**描述:** 取消注册电池信息的回调。 **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device.md index dfdbd5798cfab2244627da14132333bc0f9385de..5969be60db5868678da20d8f1d618c114b09fd67 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device.md @@ -1,7 +1,7 @@ # ICameraDevice -## **概述** +## 概述 定义Camera设备基本的操作。 @@ -9,10 +9,10 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -21,14 +21,14 @@ | -------- | -------- | | [GetStreamOperator](#getstreamoperator) ([in] [IStreamOperatorCallback](interface_i_stream_operator_callback.md) callbackObj, [out] [IStreamOperator](interface_i_stream_operator.md) streamOperator) | 获取流操作句柄。 | | [UpdateSettings](#updatesettings) ([in] unsigned char[] settings) | 更新设备控制参数。 | -| [SetResultMode](#setresultmode) ([in] enum [ResultCallbackMode](camera.md#resultcallbackmode) mode) | 设置metadata上报模式,逐帧上报还是设备状态变化时上报。 | +| [SetResultMode](#setresultmode) ([in] enum [ResultCallbackMode](_camera.md#resultcallbackmode) mode) | 设置metadata上报模式,逐帧上报还是设备状态变化时上报。 | | [GetEnabledResults](#getenabledresults) ([out] int[] results) | 查询使能的metadata。 | | [EnableResult](#enableresult) ([in] int[] results) | 打开metadata上报开关。 | | [DisableResult](#disableresult) ([in] int[] results) | 关闭metadata上报开关。 | | [Close](#close) () | 关闭当前Camera设备。 | -## **成员函数说明** +## 成员函数说明 ### Close() @@ -38,7 +38,7 @@ ICameraDevice::Close () ``` -**描述:** +**描述:** 关闭当前Camera设备。 @@ -54,11 +54,11 @@ OpenCamera ICameraDevice::DisableResult ([in] int[] results) ``` -**描述:** +**描述:** 关闭metadata上报开关。 -屏蔽之后,相应的**OnResult**不再上报,需[EnableResult](#enableresult)使能之后才上报。 +屏蔽之后,相应的[OnResult](interface_i_camera_device_callback.md#onresult)不再上报,需[EnableResult](#enableresult)使能之后才上报。 **参数:** @@ -70,7 +70,7 @@ ICameraDevice::DisableResult ([in] int[] results) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -84,11 +84,11 @@ NO_ERROR 表示执行成功。 ICameraDevice::EnableResult ([in] int[] results) ``` -**描述:** +**描述:** 打开metadata上报开关。 -**OnResult**只上报此接口使能后的metadata。 +[OnResult](interface_i_camera_device_callback.md#onresult)只上报此接口使能后的metadata。 **参数:** @@ -100,7 +100,7 @@ ICameraDevice::EnableResult ([in] int[] results) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -114,7 +114,7 @@ NO_ERROR 表示执行成功。 ICameraDevice::GetEnabledResults ([out] int[] results) ``` -**描述:** +**描述:** 查询使能的metadata。 @@ -130,7 +130,7 @@ ICameraDevice::GetEnabledResults ([out] int[] results) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### GetStreamOperator() @@ -140,7 +140,7 @@ NO_ERROR 表示执行成功。 ICameraDevice::GetStreamOperator ([in] IStreamOperatorCallback callbackObj, [out] IStreamOperator streamOperator ) ``` -**描述:** +**描述:** 获取流操作句柄。 @@ -155,7 +155,7 @@ ICameraDevice::GetStreamOperator ([in] IStreamOperatorCallback callbackObj, [out NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### SetResultMode() @@ -165,7 +165,7 @@ NO_ERROR 表示执行成功。 ICameraDevice::SetResultMode ([in] enum ResultCallbackMode mode) ``` -**描述:** +**描述:** 设置metadata上报模式,逐帧上报还是设备状态变化时上报。 @@ -173,13 +173,13 @@ ICameraDevice::SetResultMode ([in] enum ResultCallbackMode mode) | 名称 | 描述 | | -------- | -------- | -| mode | metadata的上报模式,逐帧上报或者设备状态变化时上报,查看[ResultCallbackMode](camera.md#resultcallbackmode)。 | +| mode | metadata的上报模式,逐帧上报或者设备状态变化时上报,查看[ResultCallbackMode](_camera.md#resultcallbackmode)。 | **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### UpdateSettings() @@ -189,7 +189,7 @@ NO_ERROR 表示执行成功。 ICameraDevice::UpdateSettings ([in] unsigned char[] settings) ``` -**描述:** +**描述:** 更新设备控制参数。 @@ -203,4 +203,4 @@ ICameraDevice::UpdateSettings ([in] unsigned char[] settings) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device_callback.md index c8b090ed64b09494756add9d2d8d374d9d61a407..50d777eda4c5101c0903dfbbb0351d508095b82d 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_device_callback.md @@ -1,7 +1,7 @@ # ICameraDeviceCallback -## **概述** +## 概述 定义Camera设备回调操作。 @@ -9,21 +9,21 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OnError](#onerror) ([in] enum [ErrorType](camera.md#errortype) type, [in] int errorCode) | 设备发生错误时调用,由调用者实现,用于返回错误信息给调用者。 | +| [OnError](#onerror) ([in] enum [ErrorType](_camera.md#errortype) type, [in] int errorCode) | 设备发生错误时调用,由调用者实现,用于返回错误信息给调用者。 | | [OnResult](#onresult) ([in] unsigned long timestamp, [in] unsigned char[] result) | 上报Camera设备相关的metadata的回调,上报方式查看[SetResultMode](interface_i_camera_device.md#setresultmode)。 | -## **成员函数说明** +## 成员函数说明 ### OnError() @@ -33,7 +33,7 @@ ICameraDeviceCallback::OnError ([in] enum ErrorType type, [in] int errorCode ) ``` -**描述:** +**描述:** 设备发生错误时调用,由调用者实现,用于返回错误信息给调用者。 @@ -41,7 +41,7 @@ ICameraDeviceCallback::OnError ([in] enum ErrorType type, [in] int errorCode ) | 名称 | 描述 | | -------- | -------- | -| type | 错误类型,具体可参考[ErrorType](camera.md#errortype)。 | +| type | 错误类型,具体可参考[ErrorType](_camera.md#errortype)。 | | errorCode | 错误码,当前暂未使用。 | @@ -52,7 +52,7 @@ ICameraDeviceCallback::OnError ([in] enum ErrorType type, [in] int errorCode ) ICameraDeviceCallback::OnResult ([in] unsigned long timestamp, [in] unsigned char[] result ) ``` -**描述:** +**描述:** 上报Camera设备相关的metadata的回调,上报方式查看[SetResultMode](interface_i_camera_device.md#setresultmode)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host.md index b0b98e04d60e673f47de01a23ca248f26181de4e..15b162db77351938422e33f1236014467fa476f7 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host.md @@ -1,7 +1,7 @@ # ICameraHost -## **概述** +## 概述 定义Camera设备功能操作。 @@ -9,24 +9,24 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [SetCallback](#setcallback) ([in] [ICameraHostCallback](interface_i_camera_host_callback.md) callbackObj) | 设置ICameraHost回调接口,回调函数参考[ICameraHostCallback](interface_i_camera_host_callback.md)。 | -| [GetCameraIds](#getcameraids) ([out] String[] cameraIds) | 获取当前可用的Camera设备ID列表。 | -| [GetCameraAbility](#getcameraability) ([in] String cameraId, [out] unsigned char[] cameraAbility) | 获取Camera设备能力集合。 | -| [OpenCamera](#opencamera) ([in] String cameraId, [in] [ICameraDeviceCallback](interface_i_camera_device_callback.md) callbackObj, [out] [ICameraDevice](interface_i_camera_device.md) device) | 打开Camera设备。 | -| [SetFlashlight](#setflashlight) ([in] String cameraId, [in] boolean isEnable) | 打开或关闭闪光灯。 | +| [SetCallback](#setcallback) ([in] [ICameraHostCallback](interface_i_camera_host_callback.md) callbackObj) | 设置ICameraHost回调接口,回调函数参考[ICameraHostCallback](interface_i_camera_host_callback.md)。  | +| [GetCameraIds](#getcameraids) ([out] String[] cameraIds) | 获取当前可用的Camera设备ID列表。  | +| [GetCameraAbility](#getcameraability) ([in] String cameraId, [out] unsigned char[] cameraAbility) | 获取Camera设备能力集合。  | +| [OpenCamera](#opencamera) ([in] String cameraId, [in] [ICameraDeviceCallback](interface_i_camera_device_callback.md) callbackObj, [out] [ICameraDevice](interface_i_camera_device.md) device) | 打开Camera设备。  | +| [SetFlashlight](#setflashlight) ([in] String cameraId, [in] boolean isEnable) | 打开或关闭闪光灯。  | -## **成员函数说明** +## 成员函数说明 ### GetCameraAbility() @@ -35,23 +35,21 @@ ``` ICameraHost::GetCameraAbility ([in] String cameraId, [out] unsigned char[] cameraAbility ) ``` - -**描述:** - +**描述:** 获取Camera设备能力集合。 **参数:** | 名称 | 描述 | | -------- | -------- | -| cameraId | 用于指定要操作的Camera设备,通过[GetCameraIds](#getcameraids)获取。 | +| cameraId | 用于指定要操作的Camera设备,通过[GetCameraIds](#getcameraids)获取。  | | cameraAbility | 返回cameraId对应Camera设备的能力集合。 | **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -64,9 +62,7 @@ NO_ERROR 表示执行成功。 ``` ICameraHost::GetCameraIds ([out] String[] cameraIds) ``` - -**描述:** - +**描述:** 获取当前可用的Camera设备ID列表。 **参数:** @@ -79,7 +75,7 @@ ICameraHost::GetCameraIds ([out] String[] cameraIds) NO_ERROR 表示执行成功; -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -92,9 +88,7 @@ NO_ERROR 表示执行成功; ``` ICameraHost::OpenCamera ([in] String cameraId, [in] ICameraDeviceCallback callbackObj, [out] ICameraDevice device ) ``` - -**描述:** - +**描述:** 打开Camera设备。 打开指定的Camera设备,通过此接口可以获取到ICameraDevice对象,通过ICameraDevice对象可以操作具体的Camera设备。 @@ -103,15 +97,15 @@ ICameraHost::OpenCamera ([in] String cameraId, [in] ICameraDeviceCallback callba | 名称 | 描述 | | -------- | -------- | -| cameraId | 需要打开的Camera设备ID,可通过[GetCameraIds](#getcameraids)接口获取当前已有Camera设备列表。 | -| callbackObj | Camera设备相关的回调函数,具体参见[ICameraDeviceCallback](interface_i_camera_device_callback.md)。 | +| cameraId | 需要打开的Camera设备ID,可通过[GetCameraIds](#getcameraids)接口获取当前已有Camera设备列表。  | +| callbackObj | Camera设备相关的回调函数,具体参见[ICameraDeviceCallback](interface_i_camera_device_callback.md)。  | | device | 返回当前要打开的Camera设备ID对应的ICameraDevice对象。 | **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -124,9 +118,7 @@ NO_ERROR 表示执行成功。 ``` ICameraHost::SetCallback ([in] ICameraHostCallback callbackObj) ``` - -**描述:** - +**描述:** 设置ICameraHost回调接口,回调函数参考[ICameraHostCallback](interface_i_camera_host_callback.md)。 **参数:** @@ -139,7 +131,7 @@ ICameraHost::SetCallback ([in] ICameraHostCallback callbackObj) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### SetFlashlight() @@ -148,9 +140,7 @@ NO_ERROR 表示执行成功。 ``` ICameraHost::SetFlashlight ([in] String cameraId, [in] boolean isEnable ) ``` - -**描述:** - +**描述:** 打开或关闭闪光灯。 该接口只能由打开cameraId指定Camera设备的调用者调用。 @@ -159,14 +149,14 @@ ICameraHost::SetFlashlight ([in] String cameraId, [in] boolean isEnable ) | 名称 | 描述 | | -------- | -------- | -| cameraId | 闪光灯对应的Camera设备ID。 | +| cameraId | 闪光灯对应的Camera设备ID。  | | isEnable | 表示是否打开闪光灯,true表示打开,false表示关闭。 | **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host_callback.md index 27aa0722f85d4d52c59782e28959586260553bd2..39ab139c2a3b7260f64988a736939a8f7f66fc38 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_camera_host_callback.md @@ -1,7 +1,7 @@ # ICameraHostCallback -## **概述** +## 概述 定义Camera设备功能回调操作。 @@ -9,22 +9,22 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OnCameraStatus](#oncamerastatus) ([in] String cameraId, [in] enum [CameraStatus](camera.md#camerastatus) status) | 用于Camera设备状态变化时上报状态信息给调用者。 | -| [OnFlashlightStatus](#onflashlightstatus) ([in] String cameraId, [in] enum [FlashlightStatus](camera.md#flashlightstatus) status) | 用于在闪光灯状态变化时上报状态信息给调用者。 | -| [OnCameraEvent](#oncameraevent) ([in] String cameraId, [in] enum [CameraEvent](camera.md#cameraevent) event) | 在相机事件发生时调用。 | +| [OnCameraStatus](#oncamerastatus) ([in] String cameraId, [in] enum [CameraStatus](_camera.md#camerastatus) status) | 用于Camera设备状态变化时上报状态信息给调用者。  | +| [OnFlashlightStatus](#onflashlightstatus) ([in] String cameraId, [in] enum [FlashlightStatus](_camera.md#flashlightstatus) status) | 用于在闪光灯状态变化时上报状态信息给调用者。  | +| [OnCameraEvent](#oncameraevent) ([in] String cameraId, [in] enum [CameraEvent](_camera.md#cameraevent) event) | 在相机事件发生时调用。  | -## **成员函数说明** +## 成员函数说明 ### OnCameraEvent() @@ -33,17 +33,15 @@ ``` ICameraHostCallback::OnCameraEvent ([in] String cameraId, [in] enum CameraEvent event ) ``` - -**描述:** - +**描述:** 在相机事件发生时调用。 **参数:** | 名称 | 描述 | | -------- | -------- | -| cameraId | 表示相机事件绑定的相机ID。 | -| event | 表示相机事件类型。事件类型查看[CameraEvent](camera.md#cameraevent)。 | +| cameraId | 表示相机事件绑定的相机ID。  | +| event | 表示相机事件类型。事件类型查看[CameraEvent](_camera.md#cameraevent)。 | ### OnCameraStatus() @@ -52,16 +50,14 @@ ICameraHostCallback::OnCameraEvent ([in] String cameraId, [in] enum CameraEvent ``` ICameraHostCallback::OnCameraStatus ([in] String cameraId, [in] enum CameraStatus status ) ``` - -**描述:** - +**描述:** 用于Camera设备状态变化时上报状态信息给调用者。 **参数:** | 名称 | 描述 | | -------- | -------- | -| cameraId | 状态发生变化的Camera设备ID。 | +| cameraId | 状态发生变化的Camera设备ID。  | | status | 最新的设备状态。 | @@ -71,14 +67,12 @@ ICameraHostCallback::OnCameraStatus ([in] String cameraId, [in] enum CameraStatu ``` ICameraHostCallback::OnFlashlightStatus ([in] String cameraId, [in] enum FlashlightStatus status ) ``` - -**描述:** - +**描述:** 用于在闪光灯状态变化时上报状态信息给调用者。 **参数:** | 名称 | 描述 | | -------- | -------- | -| cameraId | 状态发生变化的闪关灯所绑定的Camera设备ID。 | -| status | 最新的闪光灯状态。状态值查看[CameraStatus](camera.md#camerastatus)。 | +| cameraId | 状态发生变化的闪关灯所绑定的Camera设备ID。  | +| status | 最新的闪光灯状态。状态值查看[CameraStatus](_camera.md#camerastatus)。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_cellbatching_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellbatching_callback.md new file mode 100644 index 0000000000000000000000000000000000000000..9ca65a623b46eb7c7b25e7997444ddecb7c43747 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellbatching_callback.md @@ -0,0 +1,80 @@ +# ICellbatchingCallback + + +## 概述 + +定义基站轨迹数据记录模块的回调函数。 + +用户在开启基站轨迹数据记录功能前,需要先注册该回调函数。当应用主动获取基站轨迹数据时,会通过回调函数进行上报。 详情可参考[ICellbatchingInterface](interface_i_cellbatching_interface.md)。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [OnCellbatchingChanged](#oncellbatchingchanged) ([in] struct [CellTrajectoryData](_cell_trajectory_data.md)[] data) | 定义基站轨迹数据上报的回调函数。 | +| [OnCellbatchingReset](#oncellbatchingreset) () | 定义低功耗围栏服务复位事件通知的回调函数。 | + + +## 成员函数说明 + + +### OnCellbatchingChanged() + + +``` +ICellbatchingCallback::OnCellbatchingChanged ([in] struct CellTrajectoryData[] data) +``` + +**描述:** + +定义基站轨迹数据上报的回调函数。 + +基站轨迹数据会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| data | 上报的基站轨迹数据。详见[CellTrajectoryData](_cell_trajectory_data.md)定义。 | + +**返回:** + +如果回调函数上报数据成功,则返回0。 + +如果回调函数上报数据失败,则返回负值。 + + +### OnCellbatchingReset() + + +``` +ICellbatchingCallback::OnCellbatchingReset () +``` + +**描述:** + +定义低功耗围栏服务复位事件通知的回调函数。 + +低功耗围栏服务发生复位时会通过该回调函数进行事件上报。 + +**返回:** + +如果回调函数上报事件成功,则返回0。 + +如果回调函数上报事件失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_cellbatching_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellbatching_interface.md new file mode 100644 index 0000000000000000000000000000000000000000..ceb3f0f032f136b9d8e59985ea505ca0fabd730b --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellbatching_interface.md @@ -0,0 +1,134 @@ +# ICellbatchingInterface + + +## 概述 + +定义对基站轨迹数据记录模块进行基本操作的接口。 + +接口包含注册回调函数,取消注册回调函数,使能和去使能基站轨迹数据记录,主动获取基站轨迹数据。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellbatching](_hdi_lpfence_cellbatching.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [RegisterCellbatchingCallback](#registercellbatchingcallback) ([in] [ICellbatchingCallback](interface_i_cellbatching_callback.md) callbackObj) | 注册回调函数。 | +| [UnregisterCellbatchingCallback](#unregistercellbatchingcallback) ([in] [ICellbatchingCallback](interface_i_cellbatching_callback.md) callbackObj) | 取消注册回调函数。 | +| [CellbatchingSwitch](#cellbatchingswitch) ([in] struct [CellbatchingRequest](_cellbatching_request.md) req) | 打开/关闭基站轨迹数据记录。 | +| [FlushCellbatching](#flushcellbatching) () | 上报缓存的基站轨迹数据。 | + + +## 成员函数说明 + + +### CellbatchingSwitch() + + +``` +ICellbatchingInterface::CellbatchingSwitch ([in] struct CellbatchingRequest req) +``` + +**描述:** + +打开/关闭基站轨迹数据记录。 + +功能打开后,会将设备接收到的基站数据进行缓存,若接收到的基站数据与上一次接收的数据相同,则不会进行此次的数据缓存。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| req | 设置基站轨迹数据记录参数。详见[CellbatchingRequest](_cellbatching_request.md)。 | + +**返回:** + +如果操作成功,则返回0。 + +如果操作失败,则返回负值。 + + +### FlushCellbatching() + + +``` +ICellbatchingInterface::FlushCellbatching () +``` + +**描述:** + +上报缓存的基站轨迹数据。 + +上报基站数据的个数与设备的缓存buffer大小、设备接收的基站数据个数有关。flush之后,底层缓存基站数据会被清空。 + +**返回:** + +如果操作成功,则返回0。 + +如果操作失败,则返回负值。 + + +### RegisterCellbatchingCallback() + + +``` +ICellbatchingInterface::RegisterCellbatchingCallback ([in] ICellbatchingCallback callbackObj) +``` + +**描述:** + +注册回调函数。 + +用户在开启基站轨迹数据记录功能前,需要先注册该回调函数。当应用主动获取基站轨迹数据时,会通过回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要注册的回调函数,只需成功订阅一次,无需重复订阅。详见[ICellbatchingCallback](interface_i_cellbatching_callback.md)。 | + +**返回:** + +如果注册回调函数成功,则返回0。 + +如果注册回调函数失败,则返回负值。 + + +### UnregisterCellbatchingCallback() + + +``` +ICellbatchingInterface::UnregisterCellbatchingCallback ([in] ICellbatchingCallback callbackObj) +``` + +**描述:** + +取消注册回调函数。 + +取消之前注册的回调函数。当应用不需要使用基站轨迹数据记录功能,或需要更换回调函数时,需要取消注册回调函数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要取消注册的回调函数,只需成功取消订阅一次,无需重复取消订阅。详见[ICellbatchingCallback](interface_i_cellbatching_callback.md)。 | + +**返回:** + +如果取消注册回调函数成功,则返回0。 + +如果取消注册回调函数失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_cellfence_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellfence_callback.md new file mode 100644 index 0000000000000000000000000000000000000000..83c32a7fc8e0ffca626ee6d5e8fa3bf4702e4937 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellfence_callback.md @@ -0,0 +1,107 @@ +# ICellfenceCallback + + +## 概述 + +定义基站围栏模块的回调函数 + +用户在开启基站围栏功能前,需要先注册该回调函数。当基站围栏状态发生变化时,会通过回调函数进行上报。 详情可参考[ICellfenceInterface](interface_i_cellfence_interface.md)。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [OnCellfenceChanged](#oncellfencechanged) ([in] struct [CellfenceStatus](_cellfence_status.md) fences) | 定义基站围栏状态变化通知的回调函数。 | +| [OnGetCellfenceSizeCb](#ongetcellfencesizecb) ([in] struct [CellfenceSize](_cellfence_size.md) size) | 定义基站围栏使用信息的回调函数。 | +| [OnCellfenceReset](#oncellfencereset) () | 定义低功耗围栏服务复位事件通知的回调函数。 | + + +## 成员函数说明 + + +### OnCellfenceChanged() + + +``` +ICellfenceCallback::OnCellfenceChanged ([in] struct CellfenceStatus fences) +``` + +**描述:** + +定义基站围栏状态变化通知的回调函数。 + +设备与基站围栏的状态关系发生变化时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| fences | 上报基站围栏变化的状态。详见[CellfenceStatus](_cellfence_status.md)定义。 | + +**返回:** + +如果回调函数上报数据成功,则返回0。 + +如果回调函数上报数据失败,则返回负值。 + + +### OnCellfenceReset() + + +``` +ICellfenceCallback::OnCellfenceReset () +``` + +**描述:** + +定义低功耗围栏服务复位事件通知的回调函数。 + +低功耗围栏服务发生复位时会通过该回调函数进行事件上报。 + +**返回:** + +如果回调函数调用成功,则返回0。 + +如果回调函数调用失败,则返回负值。 + + +### OnGetCellfenceSizeCb() + + +``` +ICellfenceCallback::OnGetCellfenceSizeCb ([in] struct CellfenceSize size) +``` + +**描述:** + +定义基站围栏使用信息的回调函数。 + +获取基站围栏使用信息时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| size | 基站围栏使用信息。详见[CellfenceSize](_cellfence_size.md)定义。 | + +**返回:** + +如果回调函数上报数据成功,则返回0。 + +如果回调函数上报数据失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_cellfence_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellfence_interface.md new file mode 100644 index 0000000000000000000000000000000000000000..eac1ee7694eaf1b10d55ce4552d54b14dc43c5cb --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_cellfence_interface.md @@ -0,0 +1,161 @@ +# ICellfenceInterface + + +## 概述 + +定义对基站围栏模块进行基本操作的接口。 + +接口包含注册回调函数,取消注册回调函数,添加基站围栏,删除基站围栏和获取基站围栏使用信息。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceCellfence](_hdi_lpfence_cellfence.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [RegisterCellfenceCallback](#registercellfencecallback) ([in] [ICellfenceCallback](interface_i_cellfence_callback.md) callbackObj) | 注册回调函数。 | +| [UnregisterCellfenceCallback](#unregistercellfencecallback) ([in] [ICellfenceCallback](interface_i_cellfence_callback.md) callbackObj) | 取消注册回调函数。 | +| [AddCellfences](#addcellfences) ([in] struct [CellfenceRequest](_cellfence_request.md)[] cellfence) | 添加基站围栏。 | +| [RemoveCellfences](#removecellfences) ([in] int[] cellfenceId) | 删除基站围栏。 | +| [GetCellfenceSize](#getcellfencesize) () | 获取基站围栏使用信息 | + + +## 成员函数说明 + + +### AddCellfences() + + +``` +ICellfenceInterface::AddCellfences ([in] struct CellfenceRequest[] cellfence) +``` + +**描述:** + +添加基站围栏。 + +支持一次添加多个基站围栏,一个基站围栏包含多个基站信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| cellfence | 添加的基站围栏信息。详见[CellfenceRequest](_cellfence_request.md)。 | + +**返回:** + +如果添加成功,则返回0。 + +如果添加失败,则返回负值。 + + +### GetCellfenceSize() + + +``` +ICellfenceInterface::GetCellfenceSize () +``` + +**描述:** + +获取基站围栏使用信息 + +查看当前设备支持添加的基站围栏最大个数和已添加的基站围栏个数。通过回调函数上报通知,详见[OnGetCellfenceSizeCb](interface_i_cellfence_callback.md#ongetcellfencesizecb)。 + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### RegisterCellfenceCallback() + + +``` +ICellfenceInterface::RegisterCellfenceCallback ([in] ICellfenceCallback callbackObj) +``` + +**描述:** + +注册回调函数。 + +用户在开启基站围栏功能前,需要先注册该回调函数。当基站围栏状态发生变化时,会通过回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要注册的回调函数,只需成功订阅一次,无需重复订阅。详见[ICellfenceCallback](interface_i_cellfence_callback.md)。 | + +**返回:** + +如果注册回调函数成功,则返回0。 + +如果注册回调函数失败,则返回负值。 + + +### RemoveCellfences() + + +``` +ICellfenceInterface::RemoveCellfences ([in] int[] cellfenceId) +``` + +**描述:** + +删除基站围栏。 + +支持一次删除多个基站围栏。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| cellfenceId | 基站围栏ID号。详见[CellfenceRequest](_cellfence_request.md)。 | + +**返回:** + +如果删除成功,则返回0。 + +如果删除失败,则返回负值。 + + +### UnregisterCellfenceCallback() + + +``` +ICellfenceInterface::UnregisterCellfenceCallback ([in] ICellfenceCallback callbackObj) +``` + +**描述:** + +取消注册回调函数。 + +取消之前注册的回调函数。当不需要使用基站围栏功能,或需要更换回调函数时,需要取消注册回调函数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要取消注册的回调函数,只需成功取消订阅一次,无需重复取消订阅。详见[ICellfenceCallback](interface_i_cellfence_callback.md)。 | + +**返回:** + +如果取消注册回调函数成功,则返回0。 + +如果取消注册回调函数失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback_faceauth.md similarity index 81% rename from zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback.md rename to zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback_faceauth.md index 639f188b4cbedf4cbf7d4d1efd0884f6578e70d1..ccf21522fd8cc33d6c47a8f299251f82d9dae8ad 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback_faceauth.md @@ -1,11 +1,11 @@ # IExecutorCallback -## **概述** +## 概述 -定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。使用细节见[IExecutor](interface_i_executor.md)。 +定义异步API接口回调,用于返回异步接口的请求处理结果和信息。使用细节见[IExecutor](interface_i_executor_faceauth.md)。 -**Since:** +**Since:** 3.2 @@ -13,12 +13,12 @@ 1.0 -**所属模块:** +**相关模块:** [HdfFaceAuth](_hdf_face_auth.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -29,7 +29,7 @@ | [OnAcquireInfo](#onacquireinfo) ([in] int acquire, [in] unsigned char[] extraInfo) | 定义操作过程信息反馈回调函数。 | -## **成员函数说明** +## 成员函数说明 ### OnAcquireInfo() @@ -39,18 +39,18 @@ IExecutorCallback::OnAcquireInfo ([in] int acquire, [in] unsigned char[] extraInfo ) ``` -**描述:** +**描述:** 定义操作过程信息反馈回调函数。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | acquire | 提示信息编码[FaceTipsCode](_hdf_face_auth.md#facetipscode)。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -64,18 +64,18 @@ IExecutorCallback::OnAcquireInfo ([in] int acquire, [in] unsigned char[] extraIn IExecutorCallback::OnResult ([in] int result, [in] unsigned char[] extraInfo ) ``` -**描述:** +**描述:** -定义操作请求处理结果回调函数。 +定义操作结果回调函数。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | result | 操作请求处理结果。 | | extraInfo | 其他相关信息,如用户认证通过时用于返回执行器签发的认证令牌等。 | -**返回:** +**返回:** 0 表示操作成功。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_pin_i_executor_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback_pinauth.md similarity index 83% rename from zh-cn/device-dev/reference/hdi-apis/interface_pin_i_executor_callback.md rename to zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback_pinauth.md index e0d8afed7239953c8881233d67d6edb244c075a1..d210106ef68b24e1ba421eaba9e4332d6cf27cca 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_pin_i_executor_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_callback_pinauth.md @@ -1,11 +1,11 @@ # IExecutorCallback -## **概述** +## 概述 -定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。使用细节见[IExecutor](interface_pin_i_executor.md)。 +定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。使用细节见[IExecutor](interface_i_executor_pinauth.md)。 -**Since:** +**Since:** 3.2 @@ -13,23 +13,23 @@ 1.0 -**所属模块:** +**相关模块:** [HdfPinAuth](_hdf_pin_auth.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OnResult](#onresult) ([in] int result, [in] unsigned char[] extraInfo) | 定义操作结果回调函数。 | +| [OnResult](#onresult) ([in] int result, [in] unsigned char[] extraInfo) | 定义操作请求处理结果回调函数。 | | [OnGetData](#ongetdata) ([in] unsigned long scheduleId, [in] unsigned char[] salt, [in] unsigned long authSubType) | 定义请求获取口令数据回调函数。 | -## **成员函数说明** +## 成员函数说明 ### OnGetData() @@ -39,18 +39,18 @@ IExecutorCallback::OnGetData ([in] unsigned long scheduleId, [in] unsigned char[] salt, [in] unsigned long authSubType ) ``` -**描述:** +**描述:** 定义请求获取口令数据回调函数。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | salt | 盐值,用于对口令明文进行单向处理。 | | authSubType | 口令子类型,如六位数字PIN码等。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -64,18 +64,18 @@ IExecutorCallback::OnGetData ([in] unsigned long scheduleId, [in] unsigned char[ IExecutorCallback::OnResult ([in] int result, [in] unsigned char[] extraInfo ) ``` -**描述:** +**描述:** 定义操作请求处理结果回调函数。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | result | 操作请求处理结果。 | | extraInfo | 其他相关信息,如用户认证通过时用于返回执行器签发的认证令牌等。 | -**返回:** +**返回:** 0 表示操作成功。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_executor.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_faceauth.md similarity index 54% rename from zh-cn/device-dev/reference/hdi-apis/interface_i_executor.md rename to zh-cn/device-dev/reference/hdi-apis/interface_i_executor_faceauth.md index dbf4350cce0b2562e5e73e933ec224b062dcffc2..55f70fe0dc0107eb231992c3a98d1bdafd3453f8 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_executor.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_faceauth.md @@ -1,11 +1,11 @@ # IExecutor -## **概述** +## 概述 定义执行器接口,用于获取执行器,获取凭据模版信息,注册人脸特征模版,进行用户人脸认证,删除人脸特征模版等。 -**Since:** +**Since:** 3.2 @@ -13,31 +13,30 @@ 1.0 -**所属模块:** +**相关模块:** [HdfFaceAuth](_hdf_face_auth.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [GetExecutorInfo](#getexecutorinfo)([out] struct ExecutorInfo executorInfo) | 获取执行器信息,人脸认证服务将执行器注册到用户认证框架时需要通过该接口获取对应信息。 | -| [GetTemplateInfo](#gettemplateinfo)([in] unsigned long templateId, [out] struct TemplateInfo templateInfo) | 获取凭据模版信息。 | -| [OnRegisterFinish](#onregisterfinish)([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo) | 完成执行器注册,对人脸特征模版进行对账,用于删除无效的人脸特征模板及相关信息。 | -| [Enroll](#enroll)([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj) | 注册人脸特征模版。 | -| [Authenticate](#authenticate)([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj) | 人脸认证。 | -| [Identify](#identify)([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj) | 人脸识别。 | -| [Delete](#delete)([in] unsigned long[] templateIdList) | 删除人脸特征模版。 | -| [Cancel](#cancel)([in] unsigned long scheduleId) | 取消操作请求。 | -| [SendCommand](#sendcommand)([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj) | 发送人脸认证功能相关操作命令。 | -| [SetBufferProducer](#setbufferproducer) ([in] BufferProducerSequenceable bufferProducer) | 设置可用缓冲区生成器。 | +| [GetExecutorInfo](#getexecutorinfo) ([out] struct [ExecutorInfo](_executor_info_faceauth.md) executorInfo) | 获取执行器信息,人脸认证服务将执行器注册到用户认证框架时需要通过该接口获取对应信息。 | +| [GetTemplateInfo](#gettemplateinfo) ([in] unsigned long templateId, [out] struct [TemplateInfo](_template_info_faceauth.md) templateInfo) | 获取凭据模版信息。 | +| [OnRegisterFinish](#onregisterfinish) ([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo) | 完成执行器注册,对人脸特征模版进行对账,用于删除无效的人脸特征模板及相关信息。 | +| [Enroll](#enroll) ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] [IExecutorCallback](interface_i_executor_callback_faceauth.md) callbackObj) | 注册人脸特征模版。 | +| [Authenticate](#authenticate) ([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] [IExecutorCallback](interface_i_executor_callback_faceauth.md) callbackObj) | 人脸认证。 | +| [Identify](#identify) ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] [IExecutorCallback](interface_i_executor_callback_faceauth.md) callbackObj) | 人脸识别。 | +| [Delete](#delete) ([in] unsigned long[] templateIdList) | 删除人脸特征模版。 | +| [Cancel](#cancel) ([in] unsigned long scheduleId) | 取消操作请求。 | +| [SendCommand](#sendcommand) ([in] int commandId, [in] unsigned char[] extraInfo, [in] [IExecutorCallback](interface_i_executor_callback_faceauth.md) callbackObj) | 发送人脸认证功能相关操作命令。 | -## **成员函数说明** +## 成员函数说明 ### Authenticate() @@ -47,20 +46,20 @@ IExecutor::Authenticate ([in] unsigned long scheduleId, [in] unsigned long[] templateIdList, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj ) ``` -**描述:** +**描述:** 人脸认证。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | | templateIdList | 指定要认证的模版ID列表。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback.md)。 | +| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback_faceauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -74,17 +73,17 @@ IExecutor::Authenticate ([in] unsigned long scheduleId, [in] unsigned long[] tem IExecutor::Cancel ([in] unsigned long scheduleId) ``` -**描述:** +**描述:** 取消操作请求。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -98,17 +97,17 @@ IExecutor::Cancel ([in] unsigned long scheduleId) IExecutor::Delete ([in] unsigned long[] templateIdList) ``` -**描述:** +**描述:** 删除人脸特征模版。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | templateIdList | 指定要删除的模版ID列表。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -122,19 +121,19 @@ IExecutor::Delete ([in] unsigned long[] templateIdList) IExecutor::Enroll ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj ) ``` -**描述:** +**描述:** 注册人脸特征模版。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback.md)。 | +| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback_faceauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -148,17 +147,17 @@ IExecutor::Enroll ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo IExecutor::GetExecutorInfo ([out] struct ExecutorInfo executorInfo) ``` -**描述:** +**描述:** 获取执行器信息,人脸认证服务将执行器注册到用户认证框架时需要通过该接口获取对应信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| executorInfo | 执行器信息[ExecutorInfo](_executor_info.md)。 | +| executorInfo | 执行器信息[ExecutorInfo](_executor_info_faceauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -172,18 +171,18 @@ IExecutor::GetExecutorInfo ([out] struct ExecutorInfo executorInfo) IExecutor::GetTemplateInfo ([in] unsigned long templateId, [out] struct TemplateInfo templateInfo ) ``` -**描述:** +**描述:** 获取凭据模版信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | templateId | 凭据模版ID。 | -| templateInfo | 凭据模版信息[TemplateInfo](_template_info.md)。 | +| templateInfo | 凭据模版信息[TemplateInfo](_template_info_faceauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -197,19 +196,19 @@ IExecutor::GetTemplateInfo ([in] unsigned long templateId, [out] struct Template IExecutor::Identify ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj ) ``` -**描述:** +**描述:** 人脸识别。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback.md)。 | +| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback_faceauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -223,11 +222,11 @@ IExecutor::Identify ([in] unsigned long scheduleId, [in] unsigned char[] extraIn IExecutor::OnRegisterFinish ([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo ) ``` -**描述:** +**描述:** 完成执行器注册,对人脸特征模版进行对账,用于删除无效的人脸特征模板及相关信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | @@ -235,33 +234,7 @@ IExecutor::OnRegisterFinish ([in] unsigned long[] templateIdList, [in] unsigned | frameworkPublicKey | 用户认证框架的公钥,用于校验用户认证框架私钥签名的信息。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -**返回:** - -0 表示操作成功。 - -非0 表示操作失败。 - - -### OnSetData() - - -``` -IExecutor::OnSetData ([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data ) -``` - -**描述:** - -设置口令数据,口令认证驱动处理注册或认证口令请求时,如果口令数据由口令认证服务获取,需要通过该接口将口令数据传给口令认证驱动。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | -| authSubType | 口令子类型,如六位数字PIN码等。 | -| data | 口令数据。 | - -**返回:** +**返回:** 0 表示操作成功。 @@ -275,42 +248,19 @@ IExecutor::OnSetData ([in] unsigned long scheduleId, [in] unsigned long authSubT IExecutor::SendCommand ([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj ) ``` -**描述:** +**描述:** 发送人脸认证功能相关操作命令。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| commandId | 操作命令ID。 | +| commandId | 操作命令ID[CommandId](_hdf_face_auth.md#commandid)。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback.md)。 | - -**返回:** - -0 表示操作成功。 - -非0 表示操作失败。 - -### SetBufferProducer() - - -``` -IExecutor::SetBufferProducer ([in] BufferProducerSequenceable bufferProducer ) -``` - -**描述:** - -设置可用缓冲区生成器。用于传递相机预览流,开始录入前设置为有效值,结束录入后设置为空指针。 - -**参数:** - - | 名称 | 描述 | -| -------- | -------- | -| bufferProducer | 可用缓冲区生成器。 | +| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback_faceauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_pin_i_executor.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_pinauth.md similarity index 70% rename from zh-cn/device-dev/reference/hdi-apis/interface_pin_i_executor.md rename to zh-cn/device-dev/reference/hdi-apis/interface_i_executor_pinauth.md index dd911a53c9d501fcae7e23004f394a8e35ce17bf..7a180d3a62015c846efbed4501e56384c6fc844c 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_pin_i_executor.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_executor_pinauth.md @@ -1,11 +1,11 @@ # IExecutor -## **概述** +## 概述 定义执行器标准API接口。接口可用于获取执行器信息,获取凭据模版信息,注册口令,认证口令,删除口令等。 -**Since:** +**Since:** 3.2 @@ -13,30 +13,30 @@ 1.0 -**所属模块:** +**相关模块:** [HdfPinAuth](_hdf_pin_auth.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [GetTemplateInfo](#gettemplateinfo)([in] unsigned long templateId, [out] struct TemplateInfo templateInfo) | 获取凭据模版信息。 | -| [Cancel](#cancel)([in] unsigned long scheduleId) | 取消操作请求。 | -| [GetExecutorInfo](#getexecutorinfo) ([out] struct ExecutorInfo executorInfo) | 获取执行器信息,口令认证服务将执行器注册到用户认证框架时需要通过该接口获取对应信息。 | +| [GetExecutorInfo](#getexecutorinfo) ([out] struct [ExecutorInfo](_executor_info_pinauth.md) executorInfo) | 获取执行器信息,口令认证服务将执行器注册到用户认证框架时需要通过该接口获取对应信息。 | +| [GetTemplateInfo](#gettemplateinfo) ([in] unsigned long templateId, [out] struct [TemplateInfo](_template_info_pinauth.md) templateInfo) | 获取凭据模版信息。 | | [OnRegisterFinish](#onregisterfinish) ([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo) | 完成执行器注册,对口令模版信息进行对账,用于删除无效的口令模板及相关信息。 | -| [OnSetData](#onsetdata)([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data) | 设置口令数据,口令认证驱动处理注册或认证口令请求时,如果口令数据由口令认证服务获取,需要通过该接口将口令数据传给口令认证驱动。 | -| [Enroll](#enroll) ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj) | 注册口令。 | -| [Authenticate](#authenticate) ([in] unsigned long scheduleId, [in] unsigned long templateId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj) | 认证口令。 | +| [OnSetData](#onsetdata) ([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data) | 设置口令数据,口令认证驱动处理注册或认证口令请求时,如果口令数据由口令认证服务获取,需要通过该接口将口令数据传给口令认证驱动。 | +| [Enroll](#enroll) ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] [IExecutorCallback](interface_i_executor_callback_pinauth.md) callbackObj) | 注册口令。 | +| [Authenticate](#authenticate) ([in] unsigned long scheduleId, [in] unsigned long templateId, [in] unsigned char[] extraInfo, [in] [IExecutorCallback](interface_i_executor_callback_pinauth.md) callbackObj) | 认证口令。 | | [Delete](#delete) ([in] unsigned long templateId) | 删除口令。 | -| [SendCommand](#sendcommand) ([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj) | 发送口令认证功能相关操作命令。 | +| [Cancel](#cancel) ([in] unsigned long scheduleId) | 取消操作请求。 | +| [SendCommand](#sendcommand) ([in] int commandId, [in] unsigned char[] extraInfo, [in] [IExecutorCallback](interface_i_executor_callback_pinauth.md) callbackObj) | 发送口令认证功能相关操作命令。 | -## **成员函数说明** +## 成员函数说明 ### Authenticate() @@ -46,20 +46,20 @@ IExecutor::Authenticate ([in] unsigned long scheduleId, [in] unsigned long templateId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj ) ``` -**描述:** +**描述:** 认证口令。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | | templateId | 指定要认证的模版ID。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -| callbackObj | 回调对象[IExecutorCallback](interface_pin_i_executor_callback.md)。 | +| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback_pinauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -73,17 +73,17 @@ IExecutor::Authenticate ([in] unsigned long scheduleId, [in] unsigned long templ IExecutor::Cancel ([in] unsigned long scheduleId) ``` -**描述:** +**描述:** 取消操作请求。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -97,17 +97,17 @@ IExecutor::Cancel ([in] unsigned long scheduleId) IExecutor::Delete ([in] unsigned long templateId) ``` -**描述:** +**描述:** 删除口令。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | templateId | 模版ID。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -121,19 +121,19 @@ IExecutor::Delete ([in] unsigned long templateId) IExecutor::Enroll ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj ) ``` -**描述:** +**描述:** 注册口令。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | scheduleId | 调度ID,用于标识一次操作请求的调度过程。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -| callbackObj | 回调对象[IExecutorCallback](interface_pin_i_executor_callback.md)。 | +| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback_pinauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -147,17 +147,17 @@ IExecutor::Enroll ([in] unsigned long scheduleId, [in] unsigned char[] extraInfo IExecutor::GetExecutorInfo ([out] struct ExecutorInfo executorInfo) ``` -**描述:** +**描述:** 获取执行器信息,口令认证服务将执行器注册到用户认证框架时需要通过该接口获取对应信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| executorInfo | 执行器信息[ExecutorInfo](_executor_info.md)。 | +| executorInfo | 执行器信息[ExecutorInfo](_executor_info_pinauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -171,18 +171,18 @@ IExecutor::GetExecutorInfo ([out] struct ExecutorInfo executorInfo) IExecutor::GetTemplateInfo ([in] unsigned long templateId, [out] struct TemplateInfo templateInfo ) ``` -**描述:** +**描述:** 获取凭据模版信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | templateId | 凭据模版ID。 | -| templateInfo | 凭据模版信息[TemplateInfo](_template_info.md)。 | +| templateInfo | 凭据模版信息[TemplateInfo](_template_info_pinauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -196,11 +196,11 @@ IExecutor::GetTemplateInfo ([in] unsigned long templateId, [out] struct Template IExecutor::OnRegisterFinish ([in] unsigned long[] templateIdList, [in] unsigned char[] frameworkPublicKey, [in] unsigned char[] extraInfo ) ``` -**描述:** +**描述:** 完成执行器注册,对口令模版信息进行对账,用于删除无效的口令模板及相关信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | @@ -208,7 +208,7 @@ IExecutor::OnRegisterFinish ([in] unsigned long[] templateIdList, [in] unsigned | frameworkPublicKey | 用户认证框架的公钥,用于校验用户认证框架私钥签名的信息。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -222,11 +222,11 @@ IExecutor::OnRegisterFinish ([in] unsigned long[] templateIdList, [in] unsigned IExecutor::OnSetData ([in] unsigned long scheduleId, [in] unsigned long authSubType, [in] unsigned char[] data ) ``` -**描述:** +**描述:** 设置口令数据,口令认证驱动处理注册或认证口令请求时,如果口令数据由口令认证服务获取,需要通过该接口将口令数据传给口令认证驱动。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | @@ -234,7 +234,7 @@ IExecutor::OnSetData ([in] unsigned long scheduleId, [in] unsigned long authSubT | authSubType | 口令子类型,如六位数字PIN码等。 | | data | 口令数据。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -248,19 +248,19 @@ IExecutor::OnSetData ([in] unsigned long scheduleId, [in] unsigned long authSubT IExecutor::SendCommand ([in] int commandId, [in] unsigned char[] extraInfo, [in] IExecutorCallback callbackObj ) ``` -**描述:** +**描述:** 发送口令认证功能相关操作命令。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| commandId | 操作命令ID。 | +| commandId | 操作命令ID[CommandId](_hdf_pin_auth.md#commandid)。 | | extraInfo | 其他相关信息,用于支持信息扩展。 | -| callbackObj | 回调对象[IExecutorCallback](interface_pin_i_executor_callback.md)。 | +| callbackObj | 回调对象[IExecutorCallback](interface_i_executor_callback_pinauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_face_auth_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_face_auth_interface.md index d92d37b17762985a90a29d72c49aaa8c742e2c52..e474af68bdb1d3830e3846b2a0f392e79f966e15 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_face_auth_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_face_auth_interface.md @@ -1,34 +1,30 @@ # IFaceAuthInterface -## **概述** +## 概述 定义获取人脸认证驱动的执行器列表接口。 -**Since:** - +**Since:** 3.2 - **Version:** - 1.0 - -**所属模块:** +**相关模块:** [HdfFaceAuth](_hdf_face_auth.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [GetExecutorList](#getexecutorlist) ([out] IExecutor[] executorList) | 获取执行器列表,人脸认证服务进程启动进行初始化操作时通过该接口获取人脸认证驱动支持的执行器列表。 | +| [GetExecutorList](#getexecutorlist) ([out] [IExecutor](interface_i_executor_faceauth.md)[] executorList) | 获取执行器列表,人脸认证服务进程启动进行初始化操作时通过该接口获取人脸认证驱动支持的执行器列表。  | -## **成员函数说明** +## 成员函数说明 ### GetExecutorList() @@ -37,18 +33,16 @@ ``` IFaceAuthInterface::GetExecutorList ([out] IExecutor[] executorList) ``` - -**描述:** - +**描述:** 获取执行器列表,人脸认证服务进程启动进行初始化操作时通过该接口获取人脸认证驱动支持的执行器列表。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| executorList | 执行器对象列表[IExecutor](interface_i_executor.md)。 | +| executorList | 执行器对象列表[IExecutor](interface_i_executor_faceauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_geofence_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_geofence_callback.md new file mode 100644 index 0000000000000000000000000000000000000000..b2a0dcd156ea6e1a6110c5a6bda028b216ea6b19 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_geofence_callback.md @@ -0,0 +1,219 @@ +# IGeofenceCallback + + +## 概述 + +定义地理围栏模块的回调函数。 + +用户在开启地理围栏功能前,需要先注册该回调函数。当地理围栏状态发生变化时,会通过回调函数进行上报。 详情可参考[ICellfenceInterface](interface_i_cellfence_interface.md)。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [OnGeofenceAddResultCb](#ongeofenceaddresultcb) ([in] struct [GeofenceResult](_geofence_result.md)[] res) | 定义添加地理围栏结果的回调函数。 | +| [OnGeofenceRemoveResultCb](#ongeofenceremoveresultcb) ([in] struct [GeofenceResult](_geofence_result.md)[] res) | 定义删除地理围栏结果的回调函数。 | +| [OnGeofenceTransitionCb](#ongeofencetransitioncb) ([in] int geofenceId, [in] struct [GeoLocationInfo](_geo_location_info.md) location, [in] unsigned char transition, [in] long timeStamp) | 定义地理围栏状态变化的回调函数。 | +| [OnGetGeofenceSizeCb](#ongetgeofencesizecb) ([in] struct [GeofenceSize](_geofence_size.md) size) | 定义地理围栏使用信息的回调函数。 | +| [OnGeofenceRequestCellDb](#ongeofencerequestcelldb) ([in] struct [RequestCellDb](_request_cell_db.md) req) | 定义请求基站离线数据库的回调函数。 | +| [OnGetCurrentLocation](#ongetcurrentlocation) ([in] int locSource, [in] struct [GeoLocationInfo](_geo_location_info.md) location) | 定义获取设备最新位置信息的回调函数。 | +| [OnGeofenceReset](#ongeofencereset) () | 定义低功耗围栏服务复位事件通知的回调函数。 | + + +## 成员函数说明 + + +### OnGeofenceAddResultCb() + + +``` +IGeofenceCallback::OnGeofenceAddResultCb ([in] struct GeofenceResult[] res) +``` + +**描述:** + +定义添加地理围栏结果的回调函数。 + +对每个地理围栏的添加结果,通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| res | 上报地理围栏添加结果。详见[GeofenceResult](_geofence_result.md)定义。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### OnGeofenceRemoveResultCb() + + +``` +IGeofenceCallback::OnGeofenceRemoveResultCb ([in] struct GeofenceResult[] res) +``` + +**描述:** + +定义删除地理围栏结果的回调函数。 + +对每个地理围栏的删除结果,通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| res | 上报地理围栏删除结果。详见[GeofenceResult](_geofence_result.md)定义。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### OnGeofenceRequestCellDb() + + +``` +IGeofenceCallback::OnGeofenceRequestCellDb ([in] struct RequestCellDb req) +``` + +**描述:** + +定义请求基站离线数据库的回调函数。 + +设备请求基站离线数据库时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| req | 请求基站离线数据库数据结构。详见[RequestCellDb](_request_cell_db.md)定义。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### OnGeofenceReset() + + +``` +IGeofenceCallback::OnGeofenceReset () +``` + +**描述:** + +定义低功耗围栏服务复位事件通知的回调函数。 + +低功耗围栏服务发生复位时会通过该回调函数进行事件上报。 + +**返回:** + +如果回调函数调用成功,则返回0。 + +如果回调函数调用失败,则返回负值。 + + +### OnGeofenceTransitionCb() + + +``` +IGeofenceCallback::OnGeofenceTransitionCb ([in] int geofenceId, [in] struct GeoLocationInfo location, [in] unsigned char transition, [in] long timeStamp ) +``` + +**描述:** + +定义地理围栏状态变化的回调函数。 + +设备与地理围栏的状态关系发生变化时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| geofenceId | 地理围栏id号。 | +| location | 最新的位置坐标。详见[GeoLocationInfo](_geo_location_info.md)定义。 | +| transition | 地理围栏变化的状态。详见[GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition)定义。 | +| timeStamp | 时间戳。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### OnGetCurrentLocation() + + +``` +IGeofenceCallback::OnGetCurrentLocation ([in] int locSource, [in] struct GeoLocationInfo location ) +``` + +**描述:** + +定义获取设备最新位置信息的回调函数。 + +请求获取设备最新位置信息时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| locSource | 位置信息来源。详见[GeofenceLocSource](_hdi_lpfence_geofence.md#geofencelocsource)定义。 | +| location | 最新位置信息。详见[GeoLocationInfo](_geo_location_info.md)定义。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### OnGetGeofenceSizeCb() + + +``` +IGeofenceCallback::OnGetGeofenceSizeCb ([in] struct GeofenceSize size) +``` + +**描述:** + +定义地理围栏使用信息的回调函数。 + +获取地理围栏使用信息时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| size | 地理围栏使用信息。详见[GeofenceSize](_geofence_size.md)定义。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_geofence_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_geofence_interface.md new file mode 100644 index 0000000000000000000000000000000000000000..e0d8070113dd09abf0036f28c9f072b40b39fac9 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_geofence_interface.md @@ -0,0 +1,264 @@ +# IGeofenceInterface + + +## 概述 + +定义对地理围栏模块进行基本操作的接口。 + +接口包含注册回调函数,取消注册回调函数,添加圆形和多边形地理围栏,删除地理围栏,获取地理围栏状态信息,获取设备地理位置,下发基站离线数据库。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceGeofence](_hdi_lpfence_geofence.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [RegisterGeofenceCallback](#registergeofencecallback) ([in] [IGeofenceCallback](interface_i_geofence_callback.md) callbackObj) | 注册回调函数。 | +| [UnregisterGeofenceCallback](#unregistergeofencecallback) ([in] [IGeofenceCallback](interface_i_geofence_callback.md) callbackObj) | 取消注册回调函数。 | +| [AddCircleGeofences](#addcirclegeofences) ([in] struct [GeofenceCircleRequest](_geofence_circle_request.md)[] circleGeofences) | 添加圆形地理围栏。 | +| [AddPolygonGeofences](#addpolygongeofences) ([in] struct [GeofencePolygonRequest](_geofence_polygon_request.md)[] polygonGeofences) | 添加多边形地理围栏。 | +| [RemoveGeofences](#removegeofences) ([in] int[] geofenceId) | 删除地理围栏。 | +| [GetGeofenceStatus](#getgeofencestatus) ([in] int geofenceId) | 获取当前设备与一个地理围栏的状态关系。 | +| [GetGeofenceLocation](#getgeofencelocation) () | 获取最新的位置信息。 | +| [GetGeofenceSize](#getgeofencesize) () | 获取地理围栏使用信息。 | +| [SendCellOfflineDb](#sendcellofflinedb) ([in] struct [OfflineDb](_offline_db.md) dbData, [in] int cellType) | 下发基站离线数据库数据。 | + + +## 成员函数说明 + + +### AddCircleGeofences() + + +``` +IGeofenceInterface::AddCircleGeofences ([in] struct GeofenceCircleRequest[] circleGeofences) +``` + +**描述:** + +添加圆形地理围栏。 + +支持一次添加多个圆形地理围栏 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| circleGeofences | 添加圆形围栏信息。详见[GeofenceCircleRequest](_geofence_circle_request.md)。 | + +**返回:** + +如果添加成功,则返回0。 + +如果添加失败,则返回负值。 + + +### AddPolygonGeofences() + + +``` +IGeofenceInterface::AddPolygonGeofences ([in] struct GeofencePolygonRequest[] polygonGeofences) +``` + +**描述:** + +添加多边形地理围栏。 + +支持一次添加多个多边形地理围栏 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| polygonGeofences | 添加多边形围栏信息。详见[GeofencePolygonRequest](_geofence_polygon_request.md)。 | + +**返回:** + +如果添加成功,则返回0。 + +如果添加失败,则返回负值。 + + +### GetGeofenceLocation() + + +``` +IGeofenceInterface::GetGeofenceLocation () +``` + +**描述:** + +获取最新的位置信息。 + +位置信息通过回调函数上报。详见[OnGetCurrentLocation](interface_i_geofence_callback.md#ongetcurrentlocation)定义。 + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### GetGeofenceSize() + + +``` +IGeofenceInterface::GetGeofenceSize () +``` + +**描述:** + +获取地理围栏使用信息。 + +查看当前设备支持添加的地理围栏最大个数和已添加的地理围栏个数。通过回调函数上报通知,详见[OnGetGeofenceSizeCb](interface_i_geofence_callback.md#ongetgeofencesizecb)。 + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### GetGeofenceStatus() + + +``` +IGeofenceInterface::GetGeofenceStatus ([in] int geofenceId) +``` + +**描述:** + +获取当前设备与一个地理围栏的状态关系。 + +设备与地理围栏的状态关系详见[GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition)定义。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| geofenceId | 地理围栏id号。 | + +**返回:** + +返回位置关系。详见[GeofenceTransition](_hdi_lpfence_geofence.md#geofencetransition)定义。 + +如果调用失败,则返回负值。 + + +### RegisterGeofenceCallback() + + +``` +IGeofenceInterface::RegisterGeofenceCallback ([in] IGeofenceCallback callbackObj) +``` + +**描述:** + +注册回调函数。 + +用户在开启地理围栏功能前,需要先注册该回调函数。当地理围栏状态发生变化时,会通过回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要注册的回调函数,只需成功订阅一次,无需重复订阅。详见[IGeofenceCallback](interface_i_geofence_callback.md)。 | + +**返回:** + +如果注册回调函数成功,则返回0。 + +如果注册回调函数失败,则返回负值。 + + +### RemoveGeofences() + + +``` +IGeofenceInterface::RemoveGeofences ([in] int[] geofenceId) +``` + +**描述:** + +删除地理围栏。 + +支持一次删除多个地理围栏。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| geofenceId | 地理围栏id号。详见[GeofenceCircleRequest](_geofence_circle_request.md)和[GeofencePolygonRequest](_geofence_polygon_request.md)。 | + +**返回:** + +如果删除成功,则返回0。 + +如果删除失败,则返回负值。 + + +### SendCellOfflineDb() + + +``` +IGeofenceInterface::SendCellOfflineDb ([in] struct OfflineDb dbData, [in] int cellType ) +``` + +**描述:** + +下发基站离线数据库数据。 + +若请求离线数据库数据成功,则上层服务通过该接口将数据下发。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| dbData | 基站离线数据库数据。详见[OfflineDb](_offline_db.md)定义。 | +| cellType | 基站主区的移动通信技术代。详见[GeofenceCellType](_hdi_lpfence_geofence.md#geofencecelltype)定义。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### UnregisterGeofenceCallback() + + +``` +IGeofenceInterface::UnregisterGeofenceCallback ([in] IGeofenceCallback callbackObj) +``` + +**描述:** + +取消注册回调函数。 + +取消之前注册的回调函数。当不需要使用地理围栏功能,或需要更换回调函数时,需要取消注册回调函数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要取消注册的回调函数,只需成功取消订阅一次,无需重复取消订阅。详见[IGeofenceCallback](interface_i_geofence_callback.md)。 | + +**返回:** + +如果取消注册回调函数成功,则返回0。 + +如果取消注册回调函数失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_light_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_light_interface.md index 5a894832572b1c291dfe7c50bd28f2986c48683d..21a96376a1aa58ea0df708ab2c0c17e0eda3f107 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_light_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_light_interface.md @@ -1,39 +1,35 @@ # ILightInterface -## **概述** +## 概述 提供灯模块基本操作接口。 操作包括获取灯的信息、打开或关闭灯、设置灯的亮度或闪烁模式。 **Since:** - 3.1 - **Version:** - 1.0 - **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [GetLightInfo](#getlightinfo) ([out] struct [HdfLightInfo](_hdf_light_info.md)[] info) | 获取当前系统中所有类型的灯信息。 | -| [TurnOnLight](#turnonlight) ([in] int lightId, [in] struct [HdfLightEffect](_hdf_light_effect.md) effect) | 根据指定的灯类型ID打开列表中的可用灯。 | -| [TurnOnMultiLights](#turnonmultilights) ([in] int lightId, [in] struct [HdfLightColor](_hdf_light_color.md)[] colors) | 根据指定的灯类型ID打开相应灯中包含的多个子灯。 | -| [TurnOffLight](#turnofflight) ([in] int lightId) | 根据指定的灯类型ID关闭列表中的可用灯。 | +| [GetLightInfo](#getlightinfo) ([out] struct [HdfLightInfo](_hdf_light_info.md)[] info) | 获取当前系统中所有类型的灯信息。  | +| [TurnOnLight](#turnonlight) ([in] int lightId, [in] struct [HdfLightEffect](_hdf_light_effect.md) effect) | 根据指定的灯类型ID打开列表中的可用灯。  | +| [TurnOnMultiLights](#turnonmultilights) ([in] int lightId, [in] struct [HdfLightColor](_hdf_light_color.md)[] colors) | 根据指定的灯类型ID打开相应灯中包含的多个子灯。  | +| [TurnOffLight](#turnofflight) ([in] int lightId) | 根据指定的灯类型ID关闭列表中的可用灯。  | -## **成员函数说明** +## 成员函数说明 ### GetLightInfo() @@ -42,9 +38,7 @@ ``` ILightInterface::GetLightInfo ([out] struct HdfLightInfo[] info) ``` - -**描述:** - +**描述:** 获取当前系统中所有类型的灯信息。 **参数:** @@ -66,16 +60,14 @@ ILightInterface::GetLightInfo ([out] struct HdfLightInfo[] info) ``` ILightInterface::TurnOffLight ([in] int lightId) ``` - -**描述:** - +**描述:** 根据指定的灯类型ID关闭列表中的可用灯。 **参数:** | 名称 | 描述 | | -------- | -------- | -| lightId | 表示灯类型ID,详见[HdfLightId](light.md#hdflightid)。 | +| lightId | 表示灯类型ID,详见[HdfLightId](_light.md#hdflightid)。 | **返回:** @@ -90,16 +82,14 @@ ILightInterface::TurnOffLight ([in] int lightId) ``` ILightInterface::TurnOnLight ([in] int lightId, [in] struct HdfLightEffect effect ) ``` - -**描述:** - +**描述:** 根据指定的灯类型ID打开列表中的可用灯。 **参数:** | 名称 | 描述 | | -------- | -------- | -| lightId | 表示灯类型ID。详见[HdfLightId](light.md#hdflightid)。 | +| lightId | 表示灯类型ID。详见[HdfLightId](_light.md#hdflightid)。  | | effect | 表示指向灯效果的指针,如果lightbrightness字段为0时, 灯的亮度根据HCS配置的默认亮度进行设置。详见[HdfLightEffect](_hdf_light_effect.md)。 | **返回:** @@ -119,16 +109,14 @@ ILightInterface::TurnOnLight ([in] int lightId, [in] struct HdfLightEffect effec ``` ILightInterface::TurnOnMultiLights ([in] int lightId, [in] struct HdfLightColor[] colors ) ``` - -**描述:** - +**描述:** 根据指定的灯类型ID打开相应灯中包含的多个子灯。 **参数:** | 名称 | 描述 | | -------- | -------- | -| lightId | 表示灯类型ID,详见[HdfLightId](light.md#hdflightid)。 | +| lightId | 表示灯类型ID,详见[HdfLightId](_light.md#hdflightid)。  | | colors | 多个子灯对应的颜色和亮度, 详见[HdfLightColor](_hdf_light_color.md)。 | **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_callback.md index 39c11481f893e1741b5681eaf8d8be330cb2748a..23b9d193d3137895cd31e0f3a91323aea61d7938 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_callback.md @@ -1,32 +1,30 @@ # IMotionCallback -## **概述** +## 概述 定义上报手势识别数据回调函数。 手势识别用户在订阅手势识别数据时需要注册这个回调函数,只有当使能手势识别后,手势识别数据用户才会收到手势识别数据。 详情可参考[IMotionInterface](interface_i_motion_interface.md)。 **Since:** - 3.2 - **相关模块:** -[Motion](motion.md) +[Motion](_motion.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OnDataEvent](#ondataevent) ([in] struct [HdfMotionEvent](_hdf_motion_event.md) event) | 定义上报手势识别数据回调函数。 | +| [OnDataEvent](#ondataevent) ([in] struct [HdfMotionEvent](_hdf_motion_event.md) event) | 定义上报手势识别数据回调函数。  | -## **成员函数说明** +## 成员函数说明 ### OnDataEvent() @@ -35,9 +33,7 @@ ``` IMotionCallback::OnDataEvent ([in] struct HdfMotionEvent event) ``` - -**描述:** - +**描述:** 定义上报手势识别数据回调函数。 **参数:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_interface.md index 80d8001ff267ae63338d19099a0887fc3868479c..5cb456ee11675ba66ca9abdbf314673cbc7e824f 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_motion_interface.md @@ -1,7 +1,7 @@ # IMotionInterface -## **概述** +## 概述 提供Motion设备基本控制操作接口。 @@ -9,10 +9,10 @@ **相关模块:** -[Motion](motion.md) +[Motion](_motion.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -25,7 +25,7 @@ | [Unregister](#unregister) ([in] [IMotionCallback](interface_i_motion_callback.md) callbackObj) | 订阅者取消注册手势识别数据回调函数。 | -## **成员函数说明** +## 成员函数说明 ### DisableMotion() @@ -35,7 +35,7 @@ IMotionInterface::DisableMotion ([in] int motionType) ``` -**描述:** +**描述:** 去使能手势识别。 @@ -43,7 +43,13 @@ IMotionInterface::DisableMotion ([in] int motionType) | 名称 | 描述 | | -------- | -------- | -| motionType | 手势识别类型,详见[HdfMotionTypeTag](motion.md#hdfmotiontypetag)。 | +| motionType | 手势识别类型,详见[HdfMotionTypeTag](_motion.md#hdfmotiontypetag)。 | + +**返回:** + +如果操作成功,则返回0。 + +如果操作失败,则返回负值。 ### EnableMotion() @@ -53,7 +59,7 @@ IMotionInterface::DisableMotion ([in] int motionType) IMotionInterface::EnableMotion ([in] int motionType) ``` -**描述:** +**描述:** 使能手势识别。 @@ -61,7 +67,7 @@ IMotionInterface::EnableMotion ([in] int motionType) | 名称 | 描述 | | -------- | -------- | -| motionType | 手势识别类型,详见[HdfMotionTypeTag](motion.md#hdfmotiontypetag)。 | +| motionType | 手势识别类型,详见[HdfMotionTypeTag](_motion.md#hdfmotiontypetag)。 | **返回:** @@ -77,7 +83,7 @@ IMotionInterface::EnableMotion ([in] int motionType) IMotionInterface::Register ([in] IMotionCallback callbackObj) ``` -**描述:** +**描述:** 订阅者注册手势识别数据回调函数,如果注册成功,系统会将获取到的手势识别数据上报给订阅者。 @@ -101,7 +107,7 @@ IMotionInterface::Register ([in] IMotionCallback callbackObj) IMotionInterface::Unregister ([in] IMotionCallback callbackObj) ``` -**描述:** +**描述:** 订阅者取消注册手势识别数据回调函数。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_nnrt_device.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_nnrt_device.md new file mode 100644 index 0000000000000000000000000000000000000000..101de2084aba153f66cac4e7ace44577ac1c55e4 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_nnrt_device.md @@ -0,0 +1,387 @@ +# INnrtDevice + + +## 概述 + +定义了与设备相关的接口,实现设备管理和模型编译等操作。 + +当有多个设备注册时,需要保证设备名称和设备商名称的组合全局唯一。 + +**Since:** +3.2 +**Version:** +2.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [GetDeviceName](#getdevicename) ([out] String name) | 获取设备名称  | +| [GetVendorName](#getvendorname) ([out] String name) | 获取设备商名称  | +| [GetDeviceType](#getdevicetype) ([out] enum [DeviceType](_n_n_rt.md#devicetype) deviceType) | 获取设备类型  | +| [GetDeviceStatus](#getdevicestatus) ([out] enum [DeviceStatus](_n_n_rt.md#devicestatus) status) | 获取设备当前状态  | +| [GetSupportedOperation](#getsupportedoperation) ([in] struct [Model](_model.md) model, [out] boolean[] ops) | 查询设备对指定模型的算子支持程度  | +| [IsFloat16PrecisionSupported](#isfloat16precisionsupported) ([out] boolean isSupported) | 查询设备是否支持以Float16精度运算Float32的模型。  | +| [IsPerformanceModeSupported](#isperformancemodesupported) ([out] boolean isSupported) | 查询设备是否支持性能偏好设置,性能偏好的定义可以参考[PerformanceMode](_n_n_rt.md#performancemode)。  | +| [IsPrioritySupported](#isprioritysupported) ([out] boolean isSupported) | 查询设备是否支持任务优先级设置,优先级的定义可以参考[Priority](_n_n_rt.md#priority)。  | +| [IsDynamicInputSupported](#isdynamicinputsupported) ([out] boolean isSupported) | 查询设备是否支持变尺寸输入,变尺寸输入意味着同一个模型的不同次运算输入的形状可以不一样。  | +| [PrepareModel](#preparemodel) ([in] struct [Model](_model.md) model, [in] struct [ModelConfig](_model_config.md) config, [out] [IPreparedModel](interface_i_prepared_model.md) preparedModel) | 编译模型  | +| [IsModelCacheSupported](#ismodelcachesupported) ([out] boolean isSupported) | 查询是否支持模型缓存功能  | +| [PrepareModelFromModelCache](#preparemodelfrommodelcache) ([in] struct [SharedBuffer](_shared_buffer.md)[] modelCache, [in] struct [ModelConfig](_model_config.md) config, [out] [IPreparedModel](interface_i_prepared_model.md) preparedModel) | 加载模型缓存,该模型缓存是通过ExportModelCache接口导出的。  | +| [PrepareOfflineModel](#prepareofflinemodel) ([in] struct [SharedBuffer](_shared_buffer.md)[] modelCache, [in] struct [ModelConfig](_model_config.md) config, [out] [IPreparedModel](interface_i_prepared_model.md) preparedModel) | 加载离线模型文件的缓存,该离线模型是由推理框架传入NNRt并由NNRt解析得到的。  | +| [AllocateBuffer](#allocatebuffer) ([in] unsigned int length, [out] struct [SharedBuffer](_shared_buffer.md) buffer) | 申请设备共享内存,以文件描述符的形式返回,共享内存主要用于推理输入输出数据的快速传递。  | +| [ReleaseBuffer](#releasebuffer) ([in] struct [SharedBuffer](_shared_buffer.md) buffer) | 释放共享内存。  | + + +## 成员函数说明 + + +### AllocateBuffer() + + +``` +INnrtDevice::AllocateBuffer ([in] unsigned int length, [out] struct SharedBuffer buffer ) +``` +**描述:** +申请设备共享内存,以文件描述符的形式返回,共享内存主要用于推理输入输出数据的快速传递。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| length | 申请共享内存的大小,单位是字节。  | +| buffer | 共享内存的信息,包含共享内存的文件描述符和空间大小,SharedBuffer定义请查看[SharedBuffer](_shared_buffer.md)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### GetDeviceName() + + +``` +INnrtDevice::GetDeviceName ([out] String name) +``` +**描述:** +获取设备名称 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| name | 设备名称 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### GetDeviceStatus() + + +``` +INnrtDevice::GetDeviceStatus ([out] enum DeviceStatus status) +``` +**描述:** +获取设备当前状态 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| status | 设备当前状态,DeviceStatus枚举定义了可选的设备状态,详细定义请查看[DeviceStatus](_n_n_rt.md#devicestatus)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### GetDeviceType() + + +``` +INnrtDevice::GetDeviceType ([out] enum DeviceType deviceType) +``` +**描述:** +获取设备类型 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| deviceType | 设备类型,DeviceType枚举定义了可选的设备类型,详细定义请查看[DeviceType](_n_n_rt.md#devicetype)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### GetSupportedOperation() + + +``` +INnrtDevice::GetSupportedOperation ([in] struct Model model, [out] boolean[] ops ) +``` +**描述:** +查询设备对指定模型的算子支持程度 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| model | AI模型,模型结构由Model定义,详细定义请查看[Model](_model.md)。  | +| ops | 算子是否支持列表,算子支持列表的顺序与在model中的顺序要一致。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### GetVendorName() + + +``` +INnrtDevice::GetVendorName ([out] String name) +``` +**描述:** +获取设备商名称 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| name | 设备商名称 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### IsDynamicInputSupported() + + +``` +INnrtDevice::IsDynamicInputSupported ([out] boolean isSupported) +``` +**描述:** +查询设备是否支持变尺寸输入,变尺寸输入意味着同一个模型的不同次运算输入的形状可以不一样。 + +如果支持变尺寸输入,模型输入Tensor的形状上用-1标记该维度是否可变。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| isSupported | 是否支持变尺寸输入。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### IsFloat16PrecisionSupported() + + +``` +INnrtDevice::IsFloat16PrecisionSupported ([out] boolean isSupported) +``` +**描述:** +查询设备是否支持以Float16精度运算Float32的模型。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| isSupported | 是否支持Float16精度。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### IsModelCacheSupported() + + +``` +INnrtDevice::IsModelCacheSupported ([out] boolean isSupported) +``` +**描述:** +查询是否支持模型缓存功能 + +若支持,则需要实现PrepareModelFromModelCache和ExportModelCache两个接口。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| isSupported | 是否支持模型缓存。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### IsPerformanceModeSupported() + + +``` +INnrtDevice::IsPerformanceModeSupported ([out] boolean isSupported) +``` +**描述:** +查询设备是否支持性能偏好设置,性能偏好的定义可以参考[PerformanceMode](_n_n_rt.md#performancemode)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| isSupported | 是否支持性能偏好设置。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### IsPrioritySupported() + + +``` +INnrtDevice::IsPrioritySupported ([out] boolean isSupported) +``` +**描述:** +查询设备是否支持任务优先级设置,优先级的定义可以参考[Priority](_n_n_rt.md#priority)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| isSupported | 是否支持性能偏好设置。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### PrepareModel() + + +``` +INnrtDevice::PrepareModel ([in] struct Model model, [in] struct ModelConfig config, [out] IPreparedModel preparedModel ) +``` +**描述:** +编译模型 + +如果是变尺寸输入模型,则模型输入的维度信息中至少有一个是-1。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| model | 需要编译的模型,Model定义请查看[Model](_model.md)。  | +| config | 编译模型的配置,ModelConfig定义请查看[ModelConfig](_model_config.md)。  | +| preparedModel | 编译好的模型对象,用于后续的运算,IPreparedModel定义请查看[IPreparedModel](interface_i_prepared_model.md)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### PrepareModelFromModelCache() + + +``` +INnrtDevice::PrepareModelFromModelCache ([in] struct SharedBuffer[] modelCache, [in] struct ModelConfig config, [out] IPreparedModel preparedModel ) +``` +**描述:** +加载模型缓存,该模型缓存是通过ExportModelCache接口导出的。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| modelCache | 模型缓存文件的数组,数组顺序与导出时的数组顺序一致,数组元素类型请查看SharedBuffer定义[SharedBuffer](_shared_buffer.md)。  | +| config | 加载模型缓存的配置,配置参数的详细定义请参考[ModelConfig](_model_config.md)。  | +| preparedModel | 加载缓存得到的模型对象,用于后续的运算,IPreparedModel定义请查看[IPreparedModel](interface_i_prepared_model.md)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### PrepareOfflineModel() + + +``` +INnrtDevice::PrepareOfflineModel ([in] struct SharedBuffer[] modelCache, [in] struct ModelConfig config, [out] IPreparedModel preparedModel ) +``` +**描述:** +加载离线模型文件的缓存,该离线模型是由推理框架传入NNRt并由NNRt解析得到的。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| modelCache | 离线模型文件缓存的数组,元素顺序与用户传入的离线模型格式有关,元素类型请查看SharedBuffer定义[SharedBuffer](_shared_buffer.md)。  | +| config | 加载离线模型文件缓存的配置,配置参数的详细定义请参考[ModelConfig](_model_config.md)。  | +| preparedModel | 加载离线模型文件缓存得到的模型对象,用于后续的运算,IPreparedModel定义请查看[IPreparedModel](interface_i_prepared_model.md)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### ReleaseBuffer() + + +``` +INnrtDevice::ReleaseBuffer ([in] struct SharedBuffer buffer) +``` +**描述:** +释放共享内存。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| buffer | 共享内存的信息,包含共享内存的文件描述符和空间大小,SharedBuffer定义请查看[SharedBuffer](_shared_buffer.md)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_offline_stream_operator.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_offline_stream_operator.md index c70eae568751d3d73bf45d1c734b8e3b092db0e9..6fa1472fc4e7d75a108a592356025f8f9e5e2289 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_offline_stream_operator.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_offline_stream_operator.md @@ -1,7 +1,7 @@ # IOfflineStreamOperator -## **概述** +## 概述 定义Camera设备离线流操作。 @@ -9,10 +9,10 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -21,10 +21,10 @@ | -------- | -------- | | [CancelCapture](#cancelcapture) ([in] int captureId) | 取消捕获请求。 | | [ReleaseStreams](#releasestreams) ([in] int[] streamIds) | 释放离线流。 | -| [Release](#release) () | 释放所有离线流。 释放流的前置条件:
1. 所有单次捕获的Capture处理完成。
2. 所有连续捕获请求都已经被CancelCapture。 | +| [Release](#release) () | 释放所有离线流。 | -## **成员函数说明** +## 成员函数说明 ### CancelCapture() @@ -34,7 +34,7 @@ IOfflineStreamOperator::CancelCapture ([in] int captureId) ``` -**描述:** +**描述:** 取消捕获请求。 @@ -48,7 +48,7 @@ IOfflineStreamOperator::CancelCapture ([in] int captureId) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### Release() @@ -58,19 +58,21 @@ NO_ERROR 表示执行成功。 IOfflineStreamOperator::Release () ``` -**描述:** +**描述:** -释放所有离线流。 释放流的前置条件: +释放所有离线流。 -1. 所有单次捕获的Capture处理完成。 +释放流的前置条件: -2. 所有连续捕获请求都已经被CancelCapture。 +- 所有单次捕获的[Capture](interface_i_stream_operator.md#capture)处理完成。 + +- 所有连续捕获请求都已经被[CancelCapture](interface_i_stream_operator.md#cancelcapture)。 **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### ReleaseStreams() @@ -80,7 +82,7 @@ NO_ERROR 表示执行成功。 IOfflineStreamOperator::ReleaseStreams ([in] int[] streamIds) ``` -**描述:** +**描述:** 释放离线流。 @@ -94,4 +96,4 @@ IOfflineStreamOperator::ReleaseStreams ([in] int[] streamIds) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_pin_auth_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_pin_auth_interface.md index ae16e55ecdb3b44ad1329ab9a15d214e39c39a31..7d61270dbb8b13ec1e3d93525f90ea1a6c892154 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_pin_auth_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_pin_auth_interface.md @@ -1,34 +1,30 @@ # IPinAuthInterface -## **概述** +## 概述 定义获取口令认证驱动的执行器列表接口。 -**Since:** - +**Since:** 3.2 - **Version:** - 1.0 - -**所属模块:** +**相关模块:** [HdfPinAuth](_hdf_pin_auth.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [GetExecutorList](#getexecutorlist) ([out] IExecutor[] executorList) | 获取执行器列表,口令认证服务进程启动进行初始化操作时通过该接口获取口令认证驱动支持的执行器列表。 | +| [GetExecutorList](#getexecutorlist) ([out] [IExecutor](interface_i_executor_pinauth.md)[] executorList) | 获取执行器列表,口令认证服务进程启动进行初始化操作时通过该接口获取口令认证驱动支持的执行器列表。  | -## **成员函数说明** +## 成员函数说明 ### GetExecutorList() @@ -37,18 +33,16 @@ ``` IPinAuthInterface::GetExecutorList ([out] IExecutor[] executorList) ``` - -**描述:** - +**描述:** 获取执行器列表,口令认证服务进程启动进行初始化操作时通过该接口获取口令认证驱动支持的执行器列表。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| executorList | 执行器对象列表[IExecutor](interface_pin_i_executor.md)。 | +| executorList | 执行器对象列表[IExecutor](interface_i_executor_pinauth.md)。 | -**返回:** +**返回:** 0 表示操作成功。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_power_hdi_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_power_hdi_callback.md index 0aaecf4cb4a925d88ce4d78fbf2b37193886e0ad..6ba829e9e7406c154566c4314e1c0e95c5c462f4 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_power_hdi_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_power_hdi_callback.md @@ -1,33 +1,31 @@ # IPowerHdiCallback -## **概述** +## 概述 休眠/唤醒状态的回调。 -服务创建此回调对象后,可以调用IPowerInterface的接口注册回调,从而订阅休眠/唤醒状态的变化。 - -**Since:** +服务创建此回调对象后,可以调用[IPowerInterface](interface_i_power_interface.md)的接口注册回调,从而订阅休眠/唤醒状态的变化。 +**Since:** 3.1 - **相关模块:** [Power](power.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OnSuspend](#onsuspend) () | 休眠状态的回调方法。 | -| [OnWakeup](#onwakeup) () | 唤醒状态的回调方法。 | +| [OnSuspend](#onsuspend) () | 休眠状态的回调方法。  | +| [OnWakeup](#onwakeup) () | 唤醒状态的回调方法。  | -## **成员函数说明** +## 成员函数说明 ### OnSuspend() @@ -36,9 +34,7 @@ ``` IPowerHdiCallback::OnSuspend () ``` - -**描述:** - +**描述:** 休眠状态的回调方法。 当设备进入休眠状态时,将通过此方法通知给服务。 @@ -50,9 +46,7 @@ IPowerHdiCallback::OnSuspend () ``` IPowerHdiCallback::OnWakeup () ``` - -**描述:** - +**描述:** 唤醒状态的回调方法。 当设备进入唤醒状态时,将通过此方法通知给服务。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_power_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_power_interface.md index 5118655d14fb8dad970f9ac638a5d680662349cc..007d8113334a72f8ce92b74744402ffc6cde09de 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_power_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_power_interface.md @@ -1,38 +1,36 @@ # IPowerInterface -## **概述** +## 概述 休眠/唤醒操作、订阅休眠/唤醒状态、运行锁管理的接口。 服务获取此对象后,可以调用相关的接口对设备进行休眠/唤醒、订阅休眠/唤醒状态和管理运行锁。 -**Since:** - +**Since:** 3.1 - **相关模块:** [Power](power.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [RegisterCallback](#registercallback) ([in] [IPowerHdiCallback](interface_i_power_hdi_callback.md) ipowerHdiCallback) | 注册休眠/唤醒状态的回调。 | -| [StartSuspend](#startsuspend) () | 执行设备休眠操作。 | -| [StopSuspend](#stopsuspend) () | 执行设备唤醒操作。 | -| [ForceSuspend](#forcesuspend) () | 执行设备强制休眠操作。 | -| [SuspendBlock](#suspendblock) ([in] String name) | 打开运行锁,阻止休眠。 | -| [SuspendUnblock](#suspendunblock) ([in] String name) | 关闭运行锁,取消阻止休眠。 | -| [PowerDump](#powerdump) ([out] String info) | 获取电源的Dump信息。 | +| [RegisterCallback](#registercallback) ([in] [IPowerHdiCallback](interface_i_power_hdi_callback.md) ipowerHdiCallback) | 注册休眠/唤醒状态的回调。  | +| [StartSuspend](#startsuspend) () | 执行设备休眠操作。  | +| [StopSuspend](#stopsuspend) () | 执行设备唤醒操作。  | +| [ForceSuspend](#forcesuspend) () | 执行设备强制休眠操作。  | +| [SuspendBlock](#suspendblock) ([in] String name) | 打开运行锁,阻止休眠。  | +| [SuspendUnblock](#suspendunblock) ([in] String name) | 关闭运行锁,取消阻止休眠。  | +| [PowerDump](#powerdump) ([out] String info) | 获取电源的Dump信息。  | -## **成员函数说明** +## 成员函数说明 ### ForceSuspend() @@ -41,9 +39,7 @@ ``` IPowerInterface::ForceSuspend () ``` - -**描述:** - +**描述:** 执行设备强制休眠操作。 **返回:** @@ -57,9 +53,7 @@ HDF_SUCCESS 表示操作成功。 ``` IPowerInterface::PowerDump ([out] String info) ``` - -**描述:** - +**描述:** 获取电源的Dump信息。 **参数:** @@ -79,9 +73,7 @@ HDF_SUCCESS 表示操作成功。 ``` IPowerInterface::RegisterCallback ([in] IPowerHdiCallback ipowerHdiCallback) ``` - -**描述:** - +**描述:** 注册休眠/唤醒状态的回调。 **参数:** @@ -105,9 +97,7 @@ HDF_SUCCESS 表示注册成功。 ``` IPowerInterface::StartSuspend () ``` - -**描述:** - +**描述:** 执行设备休眠操作。 **返回:** @@ -121,9 +111,7 @@ HDF_SUCCESS 表示操作成功。 ``` IPowerInterface::StopSuspend () ``` - -**描述:** - +**描述:** 执行设备唤醒操作。 **返回:** @@ -137,9 +125,7 @@ HDF_SUCCESS 表示操作成功。 ``` IPowerInterface::SuspendBlock ([in] String name) ``` - -**描述:** - +**描述:** 打开运行锁,阻止休眠。 **参数:** @@ -159,9 +145,7 @@ HDF_SUCCESS 表示操作成功。 ``` IPowerInterface::SuspendUnblock ([in] String name) ``` - -**描述:** - +**描述:** 关闭运行锁,取消阻止休眠。 **参数:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_prepared_model.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_prepared_model.md new file mode 100644 index 0000000000000000000000000000000000000000..0e1be60d96a8d6f09b3154d2979b35fdc7277334 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_prepared_model.md @@ -0,0 +1,99 @@ +# IPreparedModel + + +## 概述 + +定义模型编译后的对象,包含编译后模型导出、模型推理接口。 + +**Since:** +3.2 +**Version:** +2.0 +**相关模块:** + +[NNRt](_n_n_rt.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [ExportModelCache](#exportmodelcache) ([out] struct [SharedBuffer](_shared_buffer.md)[] modelCache) | 导出模型缓存。  | +| [GetInputDimRanges](#getinputdimranges) ([out] unsigned int[][] minInputDims, [out] unsigned int[][] maxInputDims) | 获取模型输入支持的维度范围。如果模型输入为固定维度,则维度最大值与最小值相同。  | +| [Run](#run) ([in] struct [IOTensor](_i_o_tensor.md)[] inputs, [in] struct [IOTensor](_i_o_tensor.md)[] outputs, [out] int[][] outputsDims) | 推理模型  | + + +## 成员函数说明 + + +### ExportModelCache() + + +``` +IPreparedModel::ExportModelCache ([out] struct SharedBuffer[] modelCache) +``` +**描述:** +导出模型缓存。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| modelCache | 模型缓存数组,元素顺序与导出时元素顺序一致,SharedBuffer定义请查看[SharedBuffer](_shared_buffer.md)。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### GetInputDimRanges() + + +``` +IPreparedModel::GetInputDimRanges ([out] unsigned int minInputDims[][], [out] unsigned int maxInputDims[][] ) +``` +**描述:** +获取模型输入支持的维度范围。如果模型输入为固定维度,则维度最大值与最小值相同。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| minInputDims | 二维数组存放模型输入数据的最小维度值,数组第1维表示模型输入tensor的数量,第2维表示输入tensor的维度数量。  | +| maxInputDims | 二维数组存放模型输入数据的最大维度值,数组第1维表示模型输入tensor的数量,第2维表示输入tensor的维度数量。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) + + +### Run() + + +``` +IPreparedModel::Run ([in] struct IOTensor[] inputs, [in] struct IOTensor[] outputs, [out] int outputsDims[][] ) +``` +**描述:** +推理模型 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| inputs | 模型推理的输入数据,输入的顺序与模型中定义的输入顺序一致,输入数据类型参考IOTensor定义[IOTensor](_i_o_tensor.md)。  | +| outputs | 模型推理的输出数据,推理完后需要往outputs的sharedBuffer中写入输出数据,IOTensor定义请查看[IOTensor](_i_o_tensor.md)。  | +| outputsDims | 模型推理输出数据的形状,输出顺序与outputs顺序一一对应。  | +| isOutputBufferEnough | 模型推理输出数据的SharedBuffer空间是否足够,足够的话返回true,不足则返回false,输出顺序与outputs顺序一一对应。 | + +**返回:** + +返回0表示成功 + +返回非0表示失败,负数为HDF标准错误码,正数为NNRt定义的专用错误码(请查看[NNRT_ReturnCode](_n_n_rt.md#nnrt_returncode)) diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_ril.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_ril.md new file mode 100644 index 0000000000000000000000000000000000000000..29ad7f27ebf2fae5ab9891aef1cd8f7fd7995e31 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_ril.md @@ -0,0 +1,2664 @@ +# IRil + + +## 概述 + +Ril模块的请求接口。 + +请求接口包括打电话、发短信彩信、激活SIM卡、上网等。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [SetCallback](#setcallback) ([in] [IRilCallback](interface_i_ril_callback.md) rilCallback) | 设置IRil回调接口,回调函数参考[IRilCallback](interface_i_ril_callback.md)。  | +| [SetEmergencyCallList](#setemergencycalllist) ([in] int slotId, [in] int serialId, [in] struct [EmergencyInfoList](_emergency_info_list.md) emergencyInfoList) | 设置紧急呼叫号码。  | +| [GetEmergencyCallList](#getemergencycalllist) ([in] int slotId, [in] int serialId) | 获取紧急号码。  | +| [GetCallList](#getcalllist) ([in] int slotId, [in] int serialId) | 获取通话状态列表。  | +| [Dial](#dial) ([in] int slotId, [in] int serialId, [in] struct [DialInfo](_dial_info.md) dialInfo) | 拨打电话。  | +| [Reject](#reject) ([in] int slotId, [in] int serialId) | 拒接电话。  | +| [Hangup](#hangup) ([in] int slotId, [in] int serialId, [in] int callId) | 挂断电话。  | +| [Answer](#answer) ([in] int slotId, [in] int serialId) | 接听电话。  | +| [HoldCall](#holdcall) ([in] int slotId, [in] int serialId) | 保持通话。  | +| [UnHoldCall](#unholdcall) ([in] int slotId, [in] int serialId) | 取消保持通话。  | +| [SwitchCall](#switchcall) ([in] int slotId, [in] int serialId) | 切换通话。  | +| [CombineConference](#combineconference) ([in] int slotId, [in] int serialId, [in] int callType) | 合并为会议电话。  | +| [SeparateConference](#separateconference) ([in] int slotId, [in] int serialId, [in] int callId, [in] int callType) | 与会议电话分离。  | +| [GetCallWaiting](#getcallwaiting) ([in] int slotId, [in] int serialId) | 获取呼叫等待。  | +| [SetCallWaiting](#setcallwaiting) ([in] int slotId, [in] int serialId, [in] int activate) | 设置呼叫等待。  | +| [GetCallTransferInfo](#getcalltransferinfo) ([in] int slotId, [in] int serialId, [in] int reason) | 获取呼叫转移。  | +| [SetCallTransferInfo](#setcalltransferinfo) ([in] int slotId, [in] int serialId, [in] struct [CallForwardSetInfo](_call_forward_set_info.md) callForwardSetInfo) | 设置呼叫转移。  | +| [GetCallRestriction](#getcallrestriction) ([in] int slotId, [in] int serialId, [in] String fac) | 获取呼叫限制。  | +| [SetCallRestriction](#setcallrestriction) ([in] int slotId, [in] int serialId, [in] struct [CallRestrictionInfo](_call_restriction_info.md) callRestrictionInfo) | 设置呼叫限制。  | +| [GetClip](#getclip) ([in] int slotId, [in] int serialId) | 获取主叫号码显示(CLIP)。  | +| [SetClip](#setclip) ([in] int slotId, [in] int serialId, [in] int action) | 设置主叫号码显示。  | +| [GetClir](#getclir) ([in] int slotId, [in] int serialId) | 获取主叫号码显示限制(CLIR)。  | +| [SetClir](#setclir) ([in] int slotId, [in] int serialId, [in] int action) | 设置主叫号码显示限制。  | +| [SetCallPreferenceMode](#setcallpreferencemode) ([in] int slotId, [in] int serialId, [in] int mode) | 设置通话偏好模式。  | +| [GetCallPreferenceMode](#getcallpreferencemode) ([in] int slotId, [in] int serialId) | 获取通话偏好模式。  | +| [SetUssd](#setussd) ([in] int slotId, [in] int serialId, [in] String str) | 设置非结构化补充数据业务(USSD)。  | +| [GetUssd](#getussd) ([in] int slotId, [in] int serialId) | 获取Ussd业务。  | +| [SetMute](#setmute) ([in] int slotId, [in] int serialId, [in] int mute) | 设置静音。  | +| [GetMute](#getmute) ([in] int slotId, [in] int serialId) | 获取静音。  | +| [GetCallFailReason](#getcallfailreason) ([in] int slotId, [in] int serialId) | 获取通话失败原因。  | +| [CallSupplement](#callsupplement) ([in] int slotId, [in] int serialId, [in] int type) | 通话保持和恢复。  | +| [SendDtmf](#senddtmf) ([in] int slotId, [in] int serialId, [in] struct [DtmfInfo](_dtmf_info.md) dtmfInfo) | 发送双音多频(DTMF)。  | +| [StartDtmf](#startdtmf) ([in] int slotId, [in] int serialId, [in] struct [DtmfInfo](_dtmf_info.md) dtmfInfo) | 开启DTMF。  | +| [StopDtmf](#stopdtmf) ([in] int slotId, [in] int serialId, [in] struct [DtmfInfo](_dtmf_info.md) dtmfInfo) | 关闭DTMF。  | +| [SetBarringPassword](#setbarringpassword) ([in] int slotId, [in] int serialId, [in] struct [SetBarringInfo](_set_barring_info.md) setBarringInfo) | 设置呼叫限制密码。  | +| [ActivatePdpContext](#activatepdpcontext) ([in] int slotId, [in] int serialId, [in] struct [DataCallInfo](_data_call_info.md) dataCallInfo) | 激活数据业务。  | +| [DeactivatePdpContext](#deactivatepdpcontext) ([in] int slotId, [in] int serialId, [in] struct [UniInfo](_uni_info.md) uniInfo) | 断开数据业务。  | +| [GetPdpContextList](#getpdpcontextlist) ([in] int slotId, [in] int serialId, [in] struct [UniInfo](_uni_info.md) uniInfo) | 获取当前所有数据连接状态。  | +| [SetInitApnInfo](#setinitapninfo) ([in] int slotId, [in] int serialId, [in] struct [DataProfileDataInfo](_data_profile_data_info.md) dataProfileDataInfo) | 设置初始化默认网络接入技术(APN)信息。  | +| [GetLinkBandwidthInfo](#getlinkbandwidthinfo) ([in] int slotId, [in] int serialId, [in] int cid) | 获取当前链路信息。  | +| [SetLinkBandwidthReportingRule](#setlinkbandwidthreportingrule) ([in] int slotId, [in] int serialId, [in] struct [DataLinkBandwidthReportingRule](_data_link_bandwidth_reporting_rule.md) dataLinkBandwidthReportingRule) | 设置当前链路信息的上报规则。  | +| [SetDataPermitted](#setdatapermitted) ([in] int slotId, [in] int serialId, [in] int dataPermitted) | 使能SIM卡槽数据业务。  | +| [SetDataProfileInfo](#setdataprofileinfo) ([in] int slotId, [in] int serialId, [in] struct [DataProfilesInfo](_data_profiles_info.md) dataProfilesInfo) | 设置数据业务使用的PDP上下文信息。  | +| [SendDataPerformanceMode](#senddataperformancemode) ([in] int slotId, [in] int serialId, [in] struct [DataPerformanceInfo](_data_performance_info.md) dataPerformanceInfo) | 发送数据业务性能模式。  | +| [SendDataSleepMode](#senddatasleepmode) ([in] int slotId, [in] int serialId, [in] struct [DataSleepInfo](_data_sleep_info.md) dataSleepInfo) | 发送数据业务睡眠模式。  | +| [SetRadioState](#setradiostate) ([in] int slotId, [in] int serialId, [in] int fun, [in] int rst) | 设置Modem状态。  | +| [GetRadioState](#getradiostate) ([in] int slotId, [in] int serialId) | 获取Modem状态。  | +| [GetImei](#getimei) ([in] int slotId, [in] int serialId) | 获取国际移动设备识别码。  | +| [GetMeid](#getmeid) ([in] int slotId, [in] int serialId) | 获取移动设备识别码。  | +| [GetVoiceRadioTechnology](#getvoiceradiotechnology) ([in] int slotId, [in] int serialId) | 获取电路(CS)域接入技术。  | +| [GetBasebandVersion](#getbasebandversion) ([in] int slotId, [in] int serialId) | 获取基带版本。  | +| [ShutDown](#shutdown) ([in] int slotId, [in] int serialId) | 发送手机正在关机状态到Modem。  | +| [GetSimIO](#getsimio) ([in] int slotId, [in] int serialId, [in] struct [SimIoRequestInfo](_sim_io_request_info.md) simIO) | 获取SIM卡数据。  | +| [GetSimStatus](#getsimstatus) ([in] int slotId, [in] int serialId) | 获取SIM卡状态。  | +| [GetImsi](#getimsi) ([in] int slotId, [in] int serialId) | 获取SIM卡国际移动用户识别码。  | +| [GetSimLockStatus](#getsimlockstatus) ([in] int slotId, [in] int serialId, [in] struct [SimLockInfo](_sim_lock_info.md) simLockInfo) | 获取SIM卡锁状态。  | +| [SetSimLock](#setsimlock) ([in] int slotId, [in] int serialId, [in] struct [SimLockInfo](_sim_lock_info.md) simLockInfo) | 设置SIM卡锁。  | +| [ChangeSimPassword](#changesimpassword) ([in] int slotId, [in] int serialId, [in] struct [SimPasswordInfo](_sim_password_info.md) simPassword) | 修改SIM卡密码。  | +| [UnlockPin](#unlockpin) ([in] int slotId, [in] int serialId, [in] String pin) | PIN解锁。  | +| [UnlockPuk](#unlockpuk) ([in] int slotId, [in] int serialId, [in] String puk, [in] String pin) | PUK解锁。  | +| [UnlockPin2](#unlockpin2) ([in] int slotId, [in] int serialId, [in] String pin2) | PIN2解锁。  | +| [UnlockPuk2](#unlockpuk2) ([in] int slotId, [in] int serialId, [in] String puk2, [in] String pin2) | PUK2解锁。  | +| [SetActiveSim](#setactivesim) ([in] int slotId, [in] int serialId, [in] int index, [in] int enable) | 激活去激活SIM卡。  | +| [SimStkSendTerminalResponse](#simstksendterminalresponse) ([in] int slotId, [in] int serialId, [in] String strCmd) | 发送SIM卡应用开发工具箱(STK) TerminalResponse指令。  | +| [SimStkSendEnvelope](#simstksendenvelope) ([in] int slotId, [in] int serialId, [in] String strCmd) | 发送STK Envelope指令。  | +| [SimStkSendCallSetupRequestResult](#simstksendcallsetuprequestresult) ([in] int slotId, [in] int serialId, [in] int accept) | 发送STK CallSetup指令。  | +| [SimStkIsReady](#simstkisready) ([in] int slotId, [in] int serialId) | 获取STK是否Ready状态。  | +| [GetRadioProtocol](#getradioprotocol) ([in] int slotId,[in] int serialId) | 获取主副卡协议栈。  | +| [SetRadioProtocol](#setradioprotocol) ([in] int slotId,[in] int serialId,[in] struct [RadioProtocol](_radio_protocol.md) radioProtocol) | 设置主副卡协议栈。  | +| [SimOpenLogicalChannel](#simopenlogicalchannel) ([in] int slotId, [in] int serialId, [in] String appID, [in] int p2) | 打开应用协议数据单元(APDU)逻辑通道。  | +| [SimCloseLogicalChannel](#simcloselogicalchannel) ([in] int slotId, [in] int serialId, [in] int channelId) | 关闭应用协议数据单元(APDU)逻辑通道。  | +| [SimTransmitApduLogicalChannel](#simtransmitapdulogicalchannel) ([in] int slotId, [in] int serialId, [in] struct [ApduSimIORequestInfo](_apdu_sim_i_o_request_info.md) apduSimIO) | 应用协议数据单元(APDU)逻辑通道数据传输,由应用主动发起连接和关闭。  | +| [SimTransmitApduBasicChannel](#simtransmitapdubasicchannel) ([in] int slotId, [in] int serialId, [in] struct [ApduSimIORequestInfo](_apdu_sim_i_o_request_info.md) apduSimIO) | 应用协议数据单元(APDU)基础通道数据传输,默认打开的传输通道。  | +| [SimAuthentication](#simauthentication) ([in] int slotId, [in] int serialId, [in] struct [SimAuthenticationRequestInfo](_sim_authentication_request_info.md) simAuthInfo) | SIM卡鉴权。  | +| [UnlockSimLock](#unlocksimlock) ([in] int slotId, [in] int serialId, [in] int lockType, [in] String key) | 解锁SIM卡。  | +| [GetSignalStrength](#getsignalstrength) ([in] int slotId, [in] int serialId) | 获取信号强度。  | +| [GetCsRegStatus](#getcsregstatus) ([in] int slotId, [in] int serialId) | 获取电路(CS)域注册状态。  | +| [GetPsRegStatus](#getpsregstatus) ([in] int slotId, [in] int serialId) | 获取分组(PS)域注册状态。  | +| [GetOperatorInfo](#getoperatorinfo) ([in] int slotId, [in] int serialId) | 获取运营商名称信息。  | +| [GetNetworkSearchInformation](#getnetworksearchinformation) ([in] int slotId, [in] int serialId) | 获取可用网络信息。  | +| [GetNetworkSelectionMode](#getnetworkselectionmode) ([in] int slotId, [in] int serialId) | 获取选网模式。  | +| [SetNetworkSelectionMode](#setnetworkselectionmode) ([in] int slotId, [in] int serialId, [in] struct [SetNetworkModeInfo](_set_network_mode_info.md) networkModeInfo) | 设置选网模式。  | +| [GetNeighboringCellInfoList](#getneighboringcellinfolist) ([in] int slotId, [in] int serialId) | 获取相邻小区信息。  | +| [GetCurrentCellInfo](#getcurrentcellinfo) ([in] int slotId, [in] int serialId) | 获取小区信息。  | +| [SetPreferredNetwork](#setpreferrednetwork) ([in] int slotId, [in] int serialId, [in] int preferredNetworkType) | 设置首选网络类型。  | +| [GetPreferredNetwork](#getpreferrednetwork) ([in] int slotId, [in] int serialId) | 获取首选网络类型。  | +| [GetPhysicalChannelConfig](#getphysicalchannelconfig) ([in] int slotId, [in] int serialId) | 获取物理通道配置。  | +| [SetLocateUpdates](#setlocateupdates) ([in] int slotId, [in] int serialId, [in] enum [RilRegNotifyMode](_ril.md#rilregnotifymode) mode) | 设置小区位置更新通知模式。  | +| [SetNotificationFilter](#setnotificationfilter) ([in] int slotId, [in] int serialId, [in] int newFilter) | 设置Modem主动上报消息过滤器。  | +| [SetDeviceState](#setdevicestate) ([in] int slotId, [in] int serialId, [in] int deviceStateType, [in] int deviceStateOn) | 设置设备状态。  | +| [SendGsmSms](#sendgsmsms) ([in] int slotId, [in] int serialId, [in] struct [GsmSmsMessageInfo](_gsm_sms_message_info.md) gsmSmsMessageInfo) | 发送全球移动通信系统 (GSM)短信。  | +| [SendCdmaSms](#sendcdmasms) ([in] int slotId, [in] int serialId, [in] struct [SendCdmaSmsMessageInfo](_send_cdma_sms_message_info.md) cdmaSmsMessageInfo) | 发送码分多址(CDMA)短信。  | +| [AddSimMessage](#addsimmessage) ([in] int slotId, [in] int serialId, [in] struct [SmsMessageIOInfo](_sms_message_i_o_info.md) gsmSmsMessageInfo) | 写入GSM SIM卡短信。  | +| [DelSimMessage](#delsimmessage) ([in] int slotId, [in] int serialId, [in] int index) | 删除GSM SIM卡短信。  | +| [UpdateSimMessage](#updatesimmessage) ([in] int slotId, [in] int serialId, [in] struct [SmsMessageIOInfo](_sms_message_i_o_info.md) gsmSmsMessageInfo) | 更新GSM SIM卡短信。  | +| [AddCdmaSimMessage](#addcdmasimmessage) ([in] int slotId, [in] int serialId, [in] struct [SmsMessageIOInfo](_sms_message_i_o_info.md) cdmaSmsMessageInfo) | 写入CDMA SIM卡短信。  | +| [DelCdmaSimMessage](#delcdmasimmessage) ([in] int slotId, [in] int serialId, [in] int index) | 删除CDMA SIM卡短信。  | +| [UpdateCdmaSimMessage](#updatecdmasimmessage) ([in] int slotId, [in] int serialId, [in] struct [SmsMessageIOInfo](_sms_message_i_o_info.md) cdmaSmsMessageInfo) | 更新CDMA SIM卡短信。  | +| [SetSmscAddr](#setsmscaddr) ([in] int slotId, [in] int serialId, [in] struct [ServiceCenterAddress](_service_center_address.md) serviceCenterAddress) | 设置短信中心地址。  | +| [GetSmscAddr](#getsmscaddr) ([in] int slotId, [in] int serialId) | 获取短信中心地址。  | +| [SetCBConfig](#setcbconfig) ([in] int slotId, [in] int serialId, [in] struct [CBConfigInfo](_c_b_config_info.md) cellBroadcastInfo) | 激活GSM小区广播。  | +| [GetCBConfig](#getcbconfig) ([in] int slotId, [in] int serialId) | 获取GSM小区广播配置。  | +| [SetCdmaCBConfig](#setcdmacbconfig) ([in] int slotId, [in] int serialId, [in] struct [CdmaCBConfigInfoList](_cdma_c_b_config_info_list.md) cdmaCBConfigInfoList) | 激活CDMA小区广播。  | +| [GetCdmaCBConfig](#getcdmacbconfig) ([in] int slotId, [in] int serialId) | 获取CDMA小区广播配置。  | +| [SendSmsMoreMode](#sendsmsmoremode) ([in] int slotId, [in] int serialId, [in] struct [GsmSmsMessageInfo](_gsm_sms_message_info.md) gsmSmsMessageInfo) | 发送GSM长短信。  | +| [SendSmsAck](#sendsmsack) ([in] int slotId, [in] int serialId, [in] struct [ModeData](_mode_data.md) modeData) | 确认接收新短信。  | +| [SendRilAck](#sendrilack) () | 发送应答给无线接口层(RIL)。  | + + +## 成员函数说明 + + +### ActivatePdpContext() + + +``` +IRil::ActivatePdpContext ([in] int slotId, [in] int serialId, [in] struct DataCallInfo dataCallInfo ) +``` +**描述:** +激活数据业务。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dataCallInfo | 表示数据业务信息,详见[DataCallInfo](_data_call_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### AddCdmaSimMessage() + + +``` +IRil::AddCdmaSimMessage ([in] int slotId, [in] int serialId, [in] struct SmsMessageIOInfo cdmaSmsMessageInfo ) +``` +**描述:** +写入CDMA SIM卡短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| cdmaSmsMessageInfo | 表示SIM卡短信信息,详见[SmsMessageIOInfo](_sms_message_i_o_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### AddSimMessage() + + +``` +IRil::AddSimMessage ([in] int slotId, [in] int serialId, [in] struct SmsMessageIOInfo gsmSmsMessageInfo ) +``` +**描述:** +写入GSM SIM卡短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| gsmSmsMessageInfo | 表示SIM卡短信信息,详见[SmsMessageIOInfo](_sms_message_i_o_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### Answer() + + +``` +IRil::Answer ([in] int slotId, [in] int serialId ) +``` +**描述:** +接听电话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### CallSupplement() + + +``` +IRil::CallSupplement ([in] int slotId, [in] int serialId, [in] int type ) +``` +**描述:** +通话保持和恢复。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| type | 表示挂断的通话类型,0表示直接挂断,1表示挂断前台和后台,2表示挂断前台、恢复后台,3表示挂断所有通话。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### ChangeSimPassword() + + +``` +IRil::ChangeSimPassword ([in] int slotId, [in] int serialId, [in] struct SimPasswordInfo simPassword ) +``` +**描述:** +修改SIM卡密码。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| simPassword | 表示SIM卡密码信息,详见[SimPasswordInfo](_sim_password_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### CombineConference() + + +``` +IRil::CombineConference ([in] int slotId, [in] int serialId, [in] int callType ) +``` +**描述:** +合并为会议电话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| callType | 表示通话类型,当前只能为0(即语音通话)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### DeactivatePdpContext() + + +``` +IRil::DeactivatePdpContext ([in] int slotId, [in] int serialId, [in] struct UniInfo uniInfo ) +``` +**描述:** +断开数据业务。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| uniInfo | 表示通用信息,详见[UniInfo](_uni_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### DelCdmaSimMessage() + + +``` +IRil::DelCdmaSimMessage ([in] int slotId, [in] int serialId, [in] int index ) +``` +**描述:** +删除CDMA SIM卡短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| index | 表示消息索引。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### DelSimMessage() + + +``` +IRil::DelSimMessage ([in] int slotId, [in] int serialId, [in] int index ) +``` +**描述:** +删除GSM SIM卡短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| index | 表示消息索引。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### Dial() + + +``` +IRil::Dial ([in] int slotId, [in] int serialId, [in] struct DialInfo dialInfo ) +``` +**描述:** +拨打电话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dialInfo | 表示拨号信息,详见[DialInfo](_dial_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetBasebandVersion() + + +``` +IRil::GetBasebandVersion ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取基带版本。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCallFailReason() + + +``` +IRil::GetCallFailReason ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取通话失败原因。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCallList() + + +``` +IRil::GetCallList ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取通话状态列表。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCallPreferenceMode() + + +``` +IRil::GetCallPreferenceMode ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取通话偏好模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCallRestriction() + + +``` +IRil::GetCallRestriction ([in] int slotId, [in] int serialId, [in] String fac ) +``` +**描述:** +获取呼叫限制。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| fac | 表示呼叫限制操作对象。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCallTransferInfo() + + +``` +IRil::GetCallTransferInfo ([in] int slotId, [in] int serialId, [in] int reason ) +``` +**描述:** +获取呼叫转移。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| reason | 表示呼叫转移的类型,0表示无条件转移,1表示用户忙时转移,2表示无回复时转移,3表示无法接通时转移。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCallWaiting() + + +``` +IRil::GetCallWaiting ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取呼叫等待。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCBConfig() + + +``` +IRil::GetCBConfig ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取GSM小区广播配置。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCdmaCBConfig() + + +``` +IRil::GetCdmaCBConfig ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取CDMA小区广播配置。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetClip() + + +``` +IRil::GetClip ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取主叫号码显示(CLIP)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetClir() + + +``` +IRil::GetClir ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取主叫号码显示限制(CLIR)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCsRegStatus() + + +``` +IRil::GetCsRegStatus ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取电路(CS)域注册状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetCurrentCellInfo() + + +``` +IRil::GetCurrentCellInfo ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取小区信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetEmergencyCallList() + + +``` +IRil::GetEmergencyCallList ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取紧急号码。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetImei() + + +``` +IRil::GetImei ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取国际移动设备识别码。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetImsi() + + +``` +IRil::GetImsi ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取SIM卡国际移动用户识别码。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetLinkBandwidthInfo() + + +``` +IRil::GetLinkBandwidthInfo ([in] int slotId, [in] int serialId, [in] int cid ) +``` +**描述:** +获取当前链路信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| cid | PDP上下文标识符。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetMeid() + + +``` +IRil::GetMeid ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取移动设备识别码。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetMute() + + +``` +IRil::GetMute ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取静音。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetNeighboringCellInfoList() + + +``` +IRil::GetNeighboringCellInfoList ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取相邻小区信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetNetworkSearchInformation() + + +``` +IRil::GetNetworkSearchInformation ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取可用网络信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetNetworkSelectionMode() + + +``` +IRil::GetNetworkSelectionMode ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取选网模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetOperatorInfo() + + +``` +IRil::GetOperatorInfo ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取运营商名称信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetPdpContextList() + + +``` +IRil::GetPdpContextList ([in] int slotId, [in] int serialId, [in] struct UniInfo uniInfo ) +``` +**描述:** +获取当前所有数据连接状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| uniInfo | 表示通用信息,详见[UniInfo](_uni_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetPhysicalChannelConfig() + + +``` +IRil::GetPhysicalChannelConfig ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取物理通道配置。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetPreferredNetwork() + + +``` +IRil::GetPreferredNetwork ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取首选网络类型。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetPsRegStatus() + + +``` +IRil::GetPsRegStatus ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取分组(PS)域注册状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetRadioProtocol() + + +``` +IRil::GetRadioProtocol ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取主副卡协议栈。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetRadioState() + + +``` +IRil::GetRadioState ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取Modem状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetSignalStrength() + + +``` +IRil::GetSignalStrength ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取信号强度。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetSimIO() + + +``` +IRil::GetSimIO ([in] int slotId, [in] int serialId, [in] struct SimIoRequestInfo simIO ) +``` +**描述:** +获取SIM卡数据。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| [SimIoRequestInfo](_sim_io_request_info.md) | 表示SIM卡数据请求信息,详见[SimIoRequestInfo](_sim_io_request_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetSimLockStatus() + + +``` +IRil::GetSimLockStatus ([in] int slotId, [in] int serialId, [in] struct SimLockInfo simLockInfo ) +``` +**描述:** +获取SIM卡锁状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| [SimLockInfo](_sim_lock_info.md) | 表示SIM卡锁信息,详见[SimLockInfo](_sim_lock_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetSimStatus() + + +``` +IRil::GetSimStatus ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取SIM卡状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetSmscAddr() + + +``` +IRil::GetSmscAddr ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取短信中心地址。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetUssd() + + +``` +IRil::GetUssd ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取Ussd业务。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### GetVoiceRadioTechnology() + + +``` +IRil::GetVoiceRadioTechnology ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取电路(CS)域接入技术。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### Hangup() + + +``` +IRil::Hangup ([in] int slotId, [in] int serialId, [in] int callId ) +``` +**描述:** +挂断电话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| callId | 表示通话ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### HoldCall() + + +``` +IRil::HoldCall ([in] int slotId, [in] int serialId ) +``` +**描述:** +保持通话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### Reject() + + +``` +IRil::Reject ([in] int slotId, [in] int serialId ) +``` +**描述:** +拒接电话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendCdmaSms() + + +``` +IRil::SendCdmaSms ([in] int slotId, [in] int serialId, [in] struct SendCdmaSmsMessageInfo cdmaSmsMessageInfo ) +``` +**描述:** +发送码分多址(CDMA)短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| cdmaSmsMessageInfo | 表示CDMA短信信息,详见[SendCdmaSmsMessageInfo](_send_cdma_sms_message_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendDataPerformanceMode() + + +``` +IRil::SendDataPerformanceMode ([in] int slotId, [in] int serialId, [in] struct DataPerformanceInfo dataPerformanceInfo ) +``` +**描述:** +发送数据业务性能模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dataPerformanceInfo | 表示数据业务性能模式,详见[DataPerformanceInfo](_data_performance_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendDataSleepMode() + + +``` +IRil::SendDataSleepMode ([in] int slotId, [in] int serialId, [in] struct DataSleepInfo dataSleepInfo ) +``` +**描述:** +发送数据业务睡眠模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dataSleepInfo | 表示数据业务睡眠模式,详见[DataSleepInfo](_data_sleep_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendDtmf() + + +``` +IRil::SendDtmf ([in] int slotId, [in] int serialId, [in] struct DtmfInfo dtmfInfo ) +``` +**描述:** +发送双音多频(DTMF)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dtmfInfo | 表示DTMF信息,详见[DtmfInfo](_dtmf_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendGsmSms() + + +``` +IRil::SendGsmSms ([in] int slotId, [in] int serialId, [in] struct GsmSmsMessageInfo gsmSmsMessageInfo ) +``` +**描述:** +发送全球移动通信系统 (GSM)短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| gsmSmsMessageInfo | 表示GSM短信信息,详见[GsmSmsMessageInfo](_gsm_sms_message_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendRilAck() + + +``` +IRil::SendRilAck () +``` +**描述:** +发送应答给无线接口层(RIL)。 + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendSmsAck() + + +``` +IRil::SendSmsAck ([in] int slotId, [in] int serialId, [in] struct ModeData modeData ) +``` +**描述:** +确认接收新短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| modeData | 表示接收短信处理模式,详见[ModeData](_mode_data.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SendSmsMoreMode() + + +``` +IRil::SendSmsMoreMode ([in] int slotId, [in] int serialId, [in] struct GsmSmsMessageInfo gsmSmsMessageInfo ) +``` +**描述:** +发送GSM长短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| gsmSmsMessageInfo | 表示GSM短信信息,详见[GsmSmsMessageInfo](_gsm_sms_message_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SeparateConference() + + +``` +IRil::SeparateConference ([in] int slotId, [in] int serialId, [in] int callId, [in] int callType ) +``` +**描述:** +与会议电话分离。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| callId | 表示通话ID。  | +| callType | 表示通话类型,当前只能为0(即语音通话)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetActiveSim() + + +``` +IRil::SetActiveSim ([in] int slotId, [in] int serialId, [in] int index, [in] int enable ) +``` +**描述:** +激活去激活SIM卡。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| index | 表示索引值。  | +| enable | 表示激活状态,0为去激活,1为激活。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetBarringPassword() + + +``` +IRil::SetBarringPassword ([in] int slotId, [in] int serialId, [in] struct SetBarringInfo setBarringInfo ) +``` +**描述:** +设置呼叫限制密码。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| setBarringInfo | 表示设置呼叫限制密码的信息,详见[SetBarringInfo](_set_barring_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetCallback() + + +``` +IRil::SetCallback ([in] IRilCallback rilCallback) +``` +**描述:** +设置IRil回调接口,回调函数参考[IRilCallback](interface_i_ril_callback.md)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| rilCallback | 要设置的回调函数。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetCallPreferenceMode() + + +``` +IRil::SetCallPreferenceMode ([in] int slotId, [in] int serialId, [in] int mode ) +``` +**描述:** +设置通话偏好模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| mode | 表示通话偏好模式,1表示仅电路(CS)域通话,2表示电路(CS)域通话优先,3表示IP多媒体系统(IMS)通话优先,4表示仅IP多媒体系统(IMS)通话。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetCallRestriction() + + +``` +IRil::SetCallRestriction ([in] int slotId, [in] int serialId, [in] struct CallRestrictionInfo callRestrictionInfo ) +``` +**描述:** +设置呼叫限制。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| callRestrictionInfo | 表示呼叫限制信息,详见[CallRestrictionInfo](_call_restriction_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetCallTransferInfo() + + +``` +IRil::SetCallTransferInfo ([in] int slotId, [in] int serialId, [in] struct CallForwardSetInfo callForwardSetInfo ) +``` +**描述:** +设置呼叫转移。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| callForwardSetInfo | 表示呼叫转移信息,详见[CallForwardSetInfo](_call_forward_set_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetCallWaiting() + + +``` +IRil::SetCallWaiting ([in] int slotId, [in] int serialId, [in] int activate ) +``` +**描述:** +设置呼叫等待。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| activate | 表示禁止或使能呼叫等待功能,0表示禁止,1表示使能。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetCBConfig() + + +``` +IRil::SetCBConfig ([in] int slotId, [in] int serialId, [in] struct CBConfigInfo cellBroadcastInfo ) +``` +**描述:** +激活GSM小区广播。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| cellBroadcastInfo | 表示GSM小区广播配置信息,详见[CBConfigInfo](_c_b_config_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetCdmaCBConfig() + + +``` +IRil::SetCdmaCBConfig ([in] int slotId, [in] int serialId, [in] struct CdmaCBConfigInfoList cdmaCBConfigInfoList ) +``` +**描述:** +激活CDMA小区广播。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| cdmaCBConfigInfoList | 表示CDMA小区广播配置信息列表,详见[CdmaCBConfigInfoList](_cdma_c_b_config_info_list.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetClip() + + +``` +IRil::SetClip ([in] int slotId, [in] int serialId, [in] int action ) +``` +**描述:** +设置主叫号码显示。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| action | 表示禁止或使能主叫号码显示功能,0表示禁止,1表示使能。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetClir() + + +``` +IRil::SetClir ([in] int slotId, [in] int serialId, [in] int action ) +``` +**描述:** +设置主叫号码显示限制。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| action | 表示禁止或使能主叫号码显示限制功能,0表示禁止,1表示使能。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetDataPermitted() + + +``` +IRil::SetDataPermitted ([in] int slotId, [in] int serialId, [in] int dataPermitted ) +``` +**描述:** +使能SIM卡槽数据业务。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dataPermitted | 表示是否使能,0表示不使能,1表示使能。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetDataProfileInfo() + + +``` +IRil::SetDataProfileInfo ([in] int slotId, [in] int serialId, [in] struct DataProfilesInfo dataProfilesInfo ) +``` +**描述:** +设置数据业务使用的PDP上下文信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dataProfilesInfo | 表示PDP上下文信息列表,详见[DataProfilesInfo](_data_profiles_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetDeviceState() + + +``` +IRil::SetDeviceState ([in] int slotId, [in] int serialId, [in] int deviceStateType, [in] int deviceStateOn ) +``` +**描述:** +设置设备状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| deviceStateType | 表示设备状态类型,0表示省电模式,1表示充电模式,2表示低数据模式。  | +| deviceStateOn | 表示设备状态开关,0表示关闭,1表示开启。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetEmergencyCallList() + + +``` +IRil::SetEmergencyCallList ([in] int slotId, [in] int serialId, [in] struct EmergencyInfoList emergencyInfoList ) +``` +**描述:** +设置紧急呼叫号码。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| emergencyInfoList | 表示紧急号码列表,详见[EmergencyInfoList](_emergency_info_list.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetInitApnInfo() + + +``` +IRil::SetInitApnInfo ([in] int slotId, [in] int serialId, [in] struct DataProfileDataInfo dataProfileDataInfo ) +``` +**描述:** +设置初始化默认网络接入技术(APN)信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dataProfileDataInfo | 表示分组报文协议(PDP)上下文信息,详见[DataProfileDataInfo](_data_profile_data_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetLinkBandwidthReportingRule() + + +``` +IRil::SetLinkBandwidthReportingRule ([in] int slotId, [in] int serialId, [in] struct DataLinkBandwidthReportingRule dataLinkBandwidthReportingRule ) +``` +**描述:** +设置当前链路信息的上报规则。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dataLinkBandwidthReportingRule | 表示网络频率上报规则,详见[DataLinkBandwidthReportingRule](_data_link_bandwidth_reporting_rule.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetLocateUpdates() + + +``` +IRil::SetLocateUpdates ([in] int slotId, [in] int serialId, [in] enum RilRegNotifyMode mode ) +``` +**描述:** +设置小区位置更新通知模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| mode | 表示通知模式,详见[RilRegNotifyMode](_ril.md#rilregnotifymode)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetMute() + + +``` +IRil::SetMute ([in] int slotId, [in] int serialId, [in] int mute ) +``` +**描述:** +设置静音。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| mute | 表示禁止或使能静音,0表示禁止,1表示使能。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetNetworkSelectionMode() + + +``` +IRil::SetNetworkSelectionMode ([in] int slotId, [in] int serialId, [in] struct SetNetworkModeInfo networkModeInfo ) +``` +**描述:** +设置选网模式。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| networkModeInfo | 表示选网模式信息,详见[SetNetworkModeInfo](_set_network_mode_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetNotificationFilter() + + +``` +IRil::SetNotificationFilter ([in] int slotId, [in] int serialId, [in] int newFilter ) +``` +**描述:** +设置Modem主动上报消息过滤器。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| newFilter | 表示消息类型过滤器,使用二进制标志位表示不同的消息类型,0表示关闭, 1表示信号强度,2表示网络注册状态,4表示数据连接状态,8表示链路容量,16表示物理通道配置。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetPreferredNetwork() + + +``` +IRil::SetPreferredNetwork ([in] int slotId, [in] int serialId, [in] int preferredNetworkType ) +``` +**描述:** +设置首选网络类型。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| preferredNetworkType | 表示首选网络类型,详见[PreferredNetworkTypeInfo](_preferred_network_type_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetRadioProtocol() + + +``` +IRil::SetRadioProtocol ([in] int slotId, [in] int serialId, [in] struct RadioProtocol radioProtocol ) +``` +**描述:** +设置主副卡协议栈。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| radioProtocol | 表示Radio协议信息,详见[RadioProtocol](_radio_protocol.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetRadioState() + + +``` +IRil::SetRadioState ([in] int slotId, [in] int serialId, [in] int fun, [in] int rst ) +``` +**描述:** +设置Modem状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| fun | 表示功能模式,0表示最小模式,1表示online模式,4表示offline模式,其他模式由芯片自定义。  | +| rst | 表示Modem是否自动复位,0表示不复位,1表示复位。 | + +**返回:** + +0 表示执行成功 + +非零值 表示操作失败。 + + +### SetSimLock() + + +``` +IRil::SetSimLock ([in] int slotId, [in] int serialId, [in] struct SimLockInfo simLockInfo ) +``` +**描述:** +设置SIM卡锁。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| [SimLockInfo](_sim_lock_info.md) | 表示SIM卡锁信息,详见[SimLockInfo](_sim_lock_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetSmscAddr() + + +``` +IRil::SetSmscAddr ([in] int slotId, [in] int serialId, [in] struct ServiceCenterAddress serviceCenterAddress ) +``` +**描述:** +设置短信中心地址。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| serviceCenterAddress | 表示短信中心地址信息,详见[ServiceCenterAddress](_service_center_address.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SetUssd() + + +``` +IRil::SetUssd ([in] int slotId, [in] int serialId, [in] String str ) +``` +**描述:** +设置非结构化补充数据业务(USSD)。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| str | 表示USSD信息,最大长度为160个字符。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### ShutDown() + + +``` +IRil::ShutDown ([in] int slotId, [in] int serialId ) +``` +**描述:** +发送手机正在关机状态到Modem。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimAuthentication() + + +``` +IRil::SimAuthentication ([in] int slotId, [in] int serialId, [in] struct SimAuthenticationRequestInfo simAuthInfo ) +``` +**描述:** +SIM卡鉴权。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| simAuthInfo | 表示SIM卡鉴权请求信息,详见[SimAuthenticationRequestInfo](_sim_authentication_request_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimCloseLogicalChannel() + + +``` +IRil::SimCloseLogicalChannel ([in] int slotId, [in] int serialId, [in] int channelId ) +``` +**描述:** +关闭应用协议数据单元(APDU)逻辑通道。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| channelId | 表示请求关闭的逻辑通道ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimOpenLogicalChannel() + + +``` +IRil::SimOpenLogicalChannel ([in] int slotId, [in] int serialId, [in] String appID, [in] int p2 ) +``` +**描述:** +打开应用协议数据单元(APDU)逻辑通道。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| appID | 表示应用标识符。  | +| p2 | 表示AT指令码的参数2。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimStkIsReady() + + +``` +IRil::SimStkIsReady ([in] int slotId, [in] int serialId ) +``` +**描述:** +获取STK是否Ready状态。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimStkSendCallSetupRequestResult() + + +``` +IRil::SimStkSendCallSetupRequestResult ([in] int slotId, [in] int serialId, [in] int accept ) +``` +**描述:** +发送STK CallSetup指令。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| accept | 表示是否接受CallSetup请求,0为不接受,1为接受。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimStkSendEnvelope() + + +``` +IRil::SimStkSendEnvelope ([in] int slotId, [in] int serialId, [in] String strCmd ) +``` +**描述:** +发送STK Envelope指令。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| strCmd | 表示指令的字串文本。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimStkSendTerminalResponse() + + +``` +IRil::SimStkSendTerminalResponse ([in] int slotId, [in] int serialId, [in] String strCmd ) +``` +**描述:** +发送SIM卡应用开发工具箱(STK) TerminalResponse指令。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| strCmd | 表示指令的字串文本。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimTransmitApduBasicChannel() + + +``` +IRil::SimTransmitApduBasicChannel ([in] int slotId, [in] int serialId, [in] struct ApduSimIORequestInfo apduSimIO ) +``` +**描述:** +应用协议数据单元(APDU)基础通道数据传输,默认打开的传输通道。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| apduSimIO | 表示通过应用协议数据单元(APDU)传输的SIM数据请求信息,详见[ApduSimIORequestInfo](_apdu_sim_i_o_request_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SimTransmitApduLogicalChannel() + + +``` +IRil::SimTransmitApduLogicalChannel ([in] int slotId, [in] int serialId, [in] struct ApduSimIORequestInfo apduSimIO ) +``` +**描述:** +应用协议数据单元(APDU)逻辑通道数据传输,由应用主动发起连接和关闭。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| apduSimIO | 表示通过应用协议数据单元(APDU)传输的SIM数据请求信息,详见[ApduSimIORequestInfo](_apdu_sim_i_o_request_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### StartDtmf() + + +``` +IRil::StartDtmf ([in] int slotId, [in] int serialId, [in] struct DtmfInfo dtmfInfo ) +``` +**描述:** +开启DTMF。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dtmfInfo | 表示DTMF信息,详见[DtmfInfo](_dtmf_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### StopDtmf() + + +``` +IRil::StopDtmf ([in] int slotId, [in] int serialId, [in] struct DtmfInfo dtmfInfo ) +``` +**描述:** +关闭DTMF。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| dtmfInfo | 表示DTMF信息,详见[DtmfInfo](_dtmf_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### SwitchCall() + + +``` +IRil::SwitchCall ([in] int slotId, [in] int serialId ) +``` +**描述:** +切换通话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UnHoldCall() + + +``` +IRil::UnHoldCall ([in] int slotId, [in] int serialId ) +``` +**描述:** +取消保持通话。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UnlockPin() + + +``` +IRil::UnlockPin ([in] int slotId, [in] int serialId, [in] String pin ) +``` +**描述:** +PIN解锁。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| pin | 表示用于解锁的PIN码。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UnlockPin2() + + +``` +IRil::UnlockPin2 ([in] int slotId, [in] int serialId, [in] String pin2 ) +``` +**描述:** +PIN2解锁。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| pin2 | 表示用于解锁的PIN2码。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UnlockPuk() + + +``` +IRil::UnlockPuk ([in] int slotId, [in] int serialId, [in] String puk, [in] String pin ) +``` +**描述:** +PUK解锁。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| puk | 表示用于解锁的PUK码。  | +| pin | 表示用于解锁的PIN码。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UnlockPuk2() + + +``` +IRil::UnlockPuk2 ([in] int slotId, [in] int serialId, [in] String puk2, [in] String pin2 ) +``` +**描述:** +PUK2解锁。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| puk2 | 表示用于解锁的PUK2码。  | +| pin2 | 表示用于解锁的PIN2码。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UnlockSimLock() + + +``` +IRil::UnlockSimLock ([in] int slotId, [in] int serialId, [in] int lockType, [in] String key ) +``` +**描述:** +解锁SIM卡。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| lockType | 表示锁类型,参考3GPP TS 22.022 [33]。  | +| key | 表示用于解锁的密码,参考3GPP TS 22.022 [33]。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UpdateCdmaSimMessage() + + +``` +IRil::UpdateCdmaSimMessage ([in] int slotId, [in] int serialId, [in] struct SmsMessageIOInfo cdmaSmsMessageInfo ) +``` +**描述:** +更新CDMA SIM卡短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| cdmaSmsMessageInfo | 表示SIM卡短信信息,详见[SmsMessageIOInfo](_sms_message_i_o_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 + + +### UpdateSimMessage() + + +``` +IRil::UpdateSimMessage ([in] int slotId, [in] int serialId, [in] struct SmsMessageIOInfo gsmSmsMessageInfo ) +``` +**描述:** +更新GSM SIM卡短信。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| slotId | 表示卡槽ID。  | +| serialId | 表示请求的序列化ID。  | +| gsmSmsMessageInfo | 表示SIM卡短信信息,详见[SmsMessageIOInfo](_sms_message_i_o_info.md)。 | + +**返回:** + +0 表示执行成功。 + +非零值 表示操作失败。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_ril_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_ril_callback.md new file mode 100644 index 0000000000000000000000000000000000000000..ccb8c11c4f4e1c28d1dc6e5bcd09ce6cfda94d0a --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_ril_callback.md @@ -0,0 +1,2361 @@ +# IRilCallback + + +## 概述 + +Ril模块的回调接口。 + +回调接口提供打电话、发短彩信、激活SIM卡、上网等回调函数,回调函数由调用者实现。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [CallEmergencyNotice](#callemergencynotice) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [EmergencyInfoList](_emergency_info_list.md) emergencyInfoList) | 紧急呼叫号码上报。  | +| [CallStateUpdated](#callstateupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 通话状态更新上报。  | +| [CallRingbackVoiceNotice](#callringbackvoicenotice) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [RingbackVoice](_ringback_voice.md) ringbackVoice) | 通话回铃音上报。  | +| [CallSrvccStatusNotice](#callsrvccstatusnotice) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SrvccStatus](_srvcc_status.md) srvccStatus) | SRVCC(Single Radio Voice Call Continuity)状态上报。  | +| [CallUssdNotice](#callussdnotice) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [UssdNoticeInfo](_ussd_notice_info.md) ussdNoticeInfo) | USSD业务信息上报。  | +| [CallSsNotice](#callssnotice) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SsNoticeInfo](_ss_notice_info.md) ssNoticeInfo) | 补充业务信息上报。  | +| [CallRsrvccStatusNotify](#callrsrvccstatusnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | RSRVCC(Reverse Single Radio Voice Call Continuity)状态上报。  | +| [SetEmergencyCallListResponse](#setemergencycalllistresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置紧急呼叫号码列表响应。  | +| [GetEmergencyCallListResponse](#getemergencycalllistresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [EmergencyInfoList](_emergency_info_list.md) emergencyInfoList) | 查询紧急呼叫号码列表响应。  | +| [GetCallListResponse](#getcalllistresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CallInfoList](_call_info_list.md) callList) | 查询通话状态列表响应。  | +| [DialResponse](#dialresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 拨打电话响应。  | +| [HangupResponse](#hangupresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 挂断电话响应。  | +| [RejectResponse](#rejectresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 拒接电话响应。  | +| [AnswerResponse](#answerresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 接听电话响应。  | +| [HoldCallResponse](#holdcallresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 保持通话响应。  | +| [UnHoldCallResponse](#unholdcallresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 取消保持通话响应。  | +| [SwitchCallResponse](#switchcallresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 切换通话响应。  | +| [GetClipResponse](#getclipresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [GetClipResult](_get_clip_result.md) getClipResult) | 查询主叫号码显示响应。  | +| [SetClipResponse](#setclipresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置主叫号码显示响应。  | +| [CombineConferenceResponse](#combineconferenceresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 合并为会议电话响应。  | +| [SeparateConferenceResponse](#separateconferenceresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 与会议电话分离响应。  | +| [CallSupplementResponse](#callsupplementresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 挂断前台、恢复后台响应。  | +| [GetCallWaitingResponse](#getcallwaitingresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CallWaitResult](_call_wait_result.md) callWaitResult) | 查询呼叫等待响应。  | +| [SetCallWaitingResponse](#setcallwaitingresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置呼叫等待响应。  | +| [GetCallTransferInfoResponse](#getcalltransferinforesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CallForwardQueryInfoList](_call_forward_query_info_list.md) cFQueryList) | 查询呼叫转移响应。  | +| [SetCallTransferInfoResponse](#setcalltransferinforesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置呼叫转移响应。  | +| [GetCallRestrictionResponse](#getcallrestrictionresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CallRestrictionResult](_call_restriction_result.md) result) | 查询呼叫限制响应。  | +| [SetCallRestrictionResponse](#setcallrestrictionresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置呼叫限制响应。  | +| [GetClirResponse](#getclirresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [GetClirResult](_get_clir_result.md) getClirResult) | 查询主叫号码显示限制响应。  | +| [SetClirResponse](#setclirresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置主叫号码显示限制响应。  | +| [StartDtmfResponse](#startdtmfresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 开启DTMF响应。  | +| [SendDtmfResponse](#senddtmfresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 发送DTMF响应。  | +| [StopDtmfResponse](#stopdtmfresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 关闭DTMF响应。  | +| [GetCallPreferenceModeResponse](#getcallpreferencemoderesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] int mode) | 查询通话偏好模式响应。  | +| [SetCallPreferenceModeResponse](#setcallpreferencemoderesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置通话偏好模式响应。  | +| [SetUssdResponse](#setussdresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置USSD业务响应。  | +| [GetUssdResponse](#getussdresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] int cusd) | 查询USSD业务响应。  | +| [SetMuteResponse](#setmuteresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置静音响应。  | +| [GetMuteResponse](#getmuteresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] int mute) | 查询静音响应。  | +| [GetCallFailReasonResponse](#getcallfailreasonresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] int callFail) | 查询通话失败原因响应。  | +| [SetBarringPasswordResponse](#setbarringpasswordresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置呼叫限制密码响应。  | +| [PdpContextListUpdated](#pdpcontextlistupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [DataCallResultList](_data_call_result_list.md) dataCallResultList) | 数据业务建立与断开等状态变化上报。  | +| [ActivatePdpContextResponse](#activatepdpcontextresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SetupDataCallResultInfo](_setup_data_call_result_info.md) setupDataCallResultInfo) | 激活数据业务响应。  | +| [DeactivatePdpContextResponse](#deactivatepdpcontextresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 断开数据业务响应。  | +| [GetPdpContextListResponse](#getpdpcontextlistresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [DataCallResultList](_data_call_result_list.md) dataCallResultList) | 获取当前所有数据连接状态响应。  | +| [SetInitApnInfoResponse](#setinitapninforesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置初始化默认网络接入技术(APN)信息响应。  | +| [GetLinkBandwidthInfoResponse](#getlinkbandwidthinforesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [DataLinkBandwidthInfo](_data_link_bandwidth_info.md) dataLinkBandwidthInfo) | 获取当前链路信息响应。  | +| [SetLinkBandwidthReportingRuleResponse](#setlinkbandwidthreportingruleresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置当前链路信息的上报规则响应。  | +| [SetDataPermittedResponse](#setdatapermittedresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 使能SIM卡槽数据业务响应。  | +| [RadioStateUpdated](#radiostateupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] int state) | Radio状态上报。  | +| [VoiceRadioTechUpdated](#voiceradiotechupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [VoiceRadioTechnology](_voice_radio_technology.md) voiceRadioTechnology) | 语音接入技术变化上报。  | +| [ShutDownResponse](#shutdownresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | Modem收到手机正在关机响应。  | +| [SetRadioStateResponse](#setradiostateresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置Modem状态响应。  | +| [GetRadioStateResponse](#getradiostateresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo,[in] int state) | 查询Modem状态响应。  | +| [GetImeiResponse](#getimeiresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String imei) | 获取国际移动设备识别码响应。  | +| [GetMeidResponse](#getmeidresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String meid) | 获取移动设备识别码响应。  | +| [GetVoiceRadioTechnologyResponse](#getvoiceradiotechnologyresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [VoiceRadioTechnology](_voice_radio_technology.md) voiceRadioTechnology) | 获取电路域接入技术响应。  | +| [GetBasebandVersionResponse](#getbasebandversionresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String basebandVersion) | 查询基带版本响应。  | +| [SimStateUpdated](#simstateupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | SIM卡状态变化上报。  | +| [SimStkSessionEndNotify](#simstksessionendnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | STK SessionEnd指令上报。  | +| [SimStkProactiveNotify](#simstkproactivenotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String response) | STK Proactive指令上报。  | +| [SimStkAlphaNotify](#simstkalphanotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String response) | STK Alpha指令上报。  | +| [SimStkEventNotify](#simstkeventnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String response) | STK事件上报。  | +| [SimStkCallSetupNotify](#simstkcallsetupnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | STK CallSetup指令上报。  | +| [SimRefreshNotify](#simrefreshnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | SIM状态刷新上报。  | +| [SimRadioProtocolUpdated](#simradioprotocolupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [RadioProtocol](_radio_protocol.md) radioProtocol) | STK Radio协议更新上报。  | +| [GetSimIOResponse](#getsimioresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [IccIoResultInfo](_icc_io_result_info.md) result) | 获取SIM卡数据响应。  | +| [GetSimStatusResponse](#getsimstatusresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CardStatusInfo](_card_status_info.md) result) | 获取SIM卡状态响应。  | +| [GetImsiResponse](#getimsiresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String response) | 获取SIM卡IMSI响应。  | +| [GetSimLockStatusResponse](#getsimlockstatusresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] int simLockStatus) | 获取SIM卡锁状态响应。  | +| [SetSimLockResponse](#setsimlockresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [LockStatusResp](_lock_status_resp.md) lockStatus) | 设置SIM卡锁响应。  | +| [ChangeSimPasswordResponse](#changesimpasswordresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [LockStatusResp](_lock_status_resp.md) lockStatus) | 修改SIM卡密码响应。  | +| [UnlockPinResponse](#unlockpinresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [LockStatusResp](_lock_status_resp.md) lockStatus) | PIN解锁响应。  | +| [UnlockPukResponse](#unlockpukresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [LockStatusResp](_lock_status_resp.md) lockStatus) | PUK解锁响应。  | +| [UnlockPin2Response](#unlockpin2response) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [LockStatusResp](_lock_status_resp.md) lockStatus) | PIN2解锁响应。  | +| [UnlockPuk2Response](#unlockpuk2response) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [LockStatusResp](_lock_status_resp.md) lockStatus) | PUK2解锁响应。  | +| [SetActiveSimResponse](#setactivesimresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 激活去激活SIM卡响应。  | +| [SimStkSendTerminalResponseResponse](#simstksendterminalresponseresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 发送STK TerminalResponse指令响应。  | +| [SimStkSendEnvelopeResponse](#simstksendenveloperesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 发送STK Envelope指令响应。  | +| [SimStkSendCallSetupRequestResultResponse](#simstksendcallsetuprequestresultresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 发送STK CallSetup指令响应。  | +| [SimStkIsReadyResponse](#simstkisreadyresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 获取STK是否Ready状态响应。  | +| [GetRadioProtocolResponse](#getradioprotocolresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo,[in] struct [RadioProtocol](_radio_protocol.md) radioProtocol) | 获取主副卡协议栈响应。  | +| [SetRadioProtocolResponse](#setradioprotocolresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo,[in] struct [RadioProtocol](_radio_protocol.md) radioProtocol) | 设置主副卡协议栈响应。  | +| [SimOpenLogicalChannelResponse](#simopenlogicalchannelresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [OpenLogicalChannelResponse](_open_logical_channel_response.md) pOpenLogicalChannelResponse) | APDU打开逻辑通道响应。  | +| [SimCloseLogicalChannelResponse](#simcloselogicalchannelresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | APDU关闭逻辑通道响应。  | +| [SimTransmitApduLogicalChannelResponse](#simtransmitapdulogicalchannelresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [IccIoResultInfo](_icc_io_result_info.md) result) | APDU逻辑通道数据传输响应。  | +| [SimTransmitApduBasicChannelResponse](#simtransmitapdubasicchannelresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [IccIoResultInfo](_icc_io_result_info.md) result) | APDU基础通道数据传输响应。  | +| [SimAuthenticationResponse](#simauthenticationresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [IccIoResultInfo](_icc_io_result_info.md) result) | SIM卡鉴权响应。  | +| [UnlockSimLockResponse](#unlocksimlockresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [LockStatusResp](_lock_status_resp.md) lockStatus) | 解锁SIM卡响应。  | +| [NetworkCsRegStatusUpdated](#networkcsregstatusupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CsRegStatusInfo](_cs_reg_status_info.md) csRegStatusInfo) | CS域网络注册状态变化上报。  | +| [NetworkPsRegStatusUpdated](#networkpsregstatusupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [PsRegStatusInfo](_ps_reg_status_info.md) psRegStatusInfo) | PS域网络注册状态变化上报。  | +| [SignalStrengthUpdated](#signalstrengthupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [Rssi](_rssi.md) rssi) | 信号强度变化上报。  | +| [NetworkTimeZoneUpdated](#networktimezoneupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String timeZoneStr) | NITZ时区变化上报。  | +| [NetworkTimeUpdated](#networktimeupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] String timeStr) | NITZ时间更新上报。  | +| [NetworkPhyChnlCfgUpdated](#networkphychnlcfgupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [ChannelConfigInfoList](_channel_config_info_list.md) channelConfigInfoList) | 物理通道配置消息上报。  | +| [NetworkCurrentCellUpdated](#networkcurrentcellupdated) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CellListCurrentInfo](_cell_list_current_info.md) cellListCurrentInfo) | 小区信息上报。  | +| [GetSignalStrengthResponse](#getsignalstrengthresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [Rssi](_rssi.md) rssi) | 获取信号强度响应。  | +| [GetCsRegStatusResponse](#getcsregstatusresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CsRegStatusInfo](_cs_reg_status_info.md) csRegStatusInfo) | 获取语音(CS)域注册状态响应。  | +| [GetPsRegStatusResponse](#getpsregstatusresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [PsRegStatusInfo](_ps_reg_status_info.md) psRegStatusInfo) | 获取分组(PS)域注册状态响应。  | +| [GetOperatorInfoResponse](#getoperatorinforesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [OperatorInfo](_operator_info.md) psRegStatusInfo) | 获取运营商名称信息响应。  | +| [GetNetworkSearchInformationResponse](#getnetworksearchinformationresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [AvailableNetworkList](_available_network_list.md) availableNetworkList) | 获取可用网络信息响应。  | +| [GetNetworkSelectionModeResponse](#getnetworkselectionmoderesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SetNetworkModeInfo](_set_network_mode_info.md) setNetworkModeInfo) | 获取选网模式响应。  | +| [SetNetworkSelectionModeResponse](#setnetworkselectionmoderesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置选网模式响应。  | +| [GetNeighboringCellInfoListResponse](#getneighboringcellinfolistresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CellListNearbyInfo](_cell_list_nearby_info.md) cellListNearbyInfo) | 获取相邻小区信息响应。  | +| [GetCurrentCellInfoResponse](#getcurrentcellinforesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CellListCurrentInfo](_cell_list_current_info.md) cellListCurrentInfo) | 获取小区信息响应。  | +| [SetPreferredNetworkResponse](#setpreferrednetworkresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置首选网络类型响应。  | +| [GetPreferredNetworkResponse](#getpreferrednetworkresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [PreferredNetworkTypeInfo](_preferred_network_type_info.md) preferredNetworkTypeInfo) | 获取首选网络类型响应。  | +| [GetPhysicalChannelConfigResponse](#getphysicalchannelconfigresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [ChannelConfigInfoList](_channel_config_info_list.md) channelConfigInfoList) | 获取物理通道配置响应。  | +| [SetLocateUpdatesResponse](#setlocateupdatesresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 开启或关闭小区位置更新导致的网络状态通知响应。  | +| [SetNotificationFilterResponse](#setnotificationfilterresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置通知过滤器响应。  | +| [SetDeviceStateResponse](#setdevicestateresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置设备状态响应。  | +| [NewSmsNotify](#newsmsnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SmsMessageInfo](_sms_message_info.md) smsMessageInfo) | GSM新短信通知上报。  | +| [NewCdmaSmsNotify](#newcdmasmsnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo,[in] struct [SmsMessageInfo](_sms_message_info.md) smsMessageInfo) | CDMA新短信通知上报。  | +| [SmsStatusReportNotify](#smsstatusreportnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SmsMessageInfo](_sms_message_info.md) smsMessageInfo) | 新短信状态通知上报。  | +| [NewSmsStoredOnSimNotify](#newsmsstoredonsimnotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] int recordNumber, [in] int indicationType) | 收到SIM卡短信上报。  | +| [CBConfigNotify](#cbconfignotify) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CBConfigReportInfo](_c_b_config_report_info.md) cellBroadConfigReportInfo) | 小区广播配置上报。  | +| [SendGsmSmsResponse](#sendgsmsmsresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SendSmsResultInfo](_send_sms_result_info.md) sendSmsResultInfo) | 发送GSM短信响应。  | +| [SendCdmaSmsResponse](#sendcdmasmsresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SendSmsResultInfo](_send_sms_result_info.md) sendSmsResultInfo) | 发送CDMA短信响应。  | +| [AddSimMessageResponse](#addsimmessageresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 写入GSM SIM卡短信响应。  | +| [DelSimMessageResponse](#delsimmessageresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 删除GSM SIM卡短信响应。  | +| [UpdateSimMessageResponse](#updatesimmessageresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 更新GSM SIM卡短信响应。  | +| [AddCdmaSimMessageResponse](#addcdmasimmessageresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 写入CDMA SIM卡短信响应。  | +| [DelCdmaSimMessageResponse](#delcdmasimmessageresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 删除CDMA SIM卡短信响应。  | +| [UpdateCdmaSimMessageResponse](#updatecdmasimmessageresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 更新CDMA SIM卡短信响应。  | +| [SetSmscAddrResponse](#setsmscaddrresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 设置短信中心地址响应。  | +| [GetSmscAddrResponse](#getsmscaddrresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [ServiceCenterAddress](_service_center_address.md) serviceCenterAddress) | 获取短信中心地址响应。  | +| [SetCBConfigResponse](#setcbconfigresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 激活GSM小区广播响应。  | +| [GetCBConfigResponse](#getcbconfigresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CBConfigInfo](_c_b_config_info.md) cellBroadcastInfo) | 获取GSM小区广播配置响应。  | +| [SetCdmaCBConfigResponse](#setcdmacbconfigresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 激活CDMA小区广播响应。  | +| [GetCdmaCBConfigResponse](#getcdmacbconfigresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [CdmaCBConfigInfo](_cdma_c_b_config_info.md) cdmaCBConfigInfo) | 获取CDMA小区广播配置响应。  | +| [SendSmsMoreModeResponse](#sendsmsmoremoderesponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo, [in] struct [SendSmsResultInfo](_send_sms_result_info.md) sendSmsResultInfo) | 发送GSM长短信响应。  | +| [SendSmsAckResponse](#sendsmsackresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 确认接收新短信响应。  | +| [CommonErrorResponse](#commonerrorresponse) ([in] struct [RilRadioResponseInfo](_ril_radio_response_info.md) responseInfo) | 通用错误响应。  | + + +## 成员函数说明 + + +### ActivatePdpContextResponse() + + +``` +IRilCallback::ActivatePdpContextResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct SetupDataCallResultInfo setupDataCallResultInfo ) +``` +**描述:** +激活数据业务响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| setupDataCallResultInfo | 表示数据业务激活结果信息,详见[SetupDataCallResultInfo](_setup_data_call_result_info.md)。 | + + +### AddCdmaSimMessageResponse() + + +``` +IRilCallback::AddCdmaSimMessageResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +写入CDMA SIM卡短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### AddSimMessageResponse() + + +``` +IRilCallback::AddSimMessageResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +写入GSM SIM卡短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### AnswerResponse() + + +``` +IRilCallback::AnswerResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +接听电话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### CallEmergencyNotice() + + +``` +IRilCallback::CallEmergencyNotice ([in] struct RilRadioResponseInfo responseInfo, [in] struct EmergencyInfoList emergencyInfoList ) +``` +**描述:** +紧急呼叫号码上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| emergencyInfoList | 表示紧急号码列表,详见[EmergencyInfoList](_emergency_info_list.md)。 | + + +### CallRingbackVoiceNotice() + + +``` +IRilCallback::CallRingbackVoiceNotice ([in] struct RilRadioResponseInfo responseInfo, [in] struct RingbackVoice ringbackVoice ) +``` +**描述:** +通话回铃音上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| ringbackVoice | 表示回铃音信息,详见[RingbackVoice](_ringback_voice.md)。 | + + +### CallRsrvccStatusNotify() + + +``` +IRilCallback::CallRsrvccStatusNotify ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +RSRVCC(Reverse Single Radio Voice Call Continuity)状态上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### CallSrvccStatusNotice() + + +``` +IRilCallback::CallSrvccStatusNotice ([in] struct RilRadioResponseInfo responseInfo, [in] struct SrvccStatus srvccStatus ) +``` +**描述:** +SRVCC(Single Radio Voice Call Continuity)状态上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| srvccStatus | 表示SRVCC(Single Radio Voice Call Continuity)状态,详见[SrvccStatus](_srvcc_status.md)。 | + + +### CallSsNotice() + + +``` +IRilCallback::CallSsNotice ([in] struct RilRadioResponseInfo responseInfo, [in] struct SsNoticeInfo ssNoticeInfo ) +``` +**描述:** +补充业务信息上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| ssNoticeInfo | 表示补充业务信息,详见[SsNoticeInfo](_ss_notice_info.md)。 | + + +### CallStateUpdated() + + +``` +IRilCallback::CallStateUpdated ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +通话状态更新上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### CallSupplementResponse() + + +``` +IRilCallback::CallSupplementResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +挂断前台、恢复后台响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### CallUssdNotice() + + +``` +IRilCallback::CallUssdNotice ([in] struct RilRadioResponseInfo responseInfo, [in] struct UssdNoticeInfo ussdNoticeInfo ) +``` +**描述:** +USSD业务信息上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| ussdNoticeInfo | 表示USSD业务信息,详见[UssdNoticeInfo](_ussd_notice_info.md)。 | + + +### CBConfigNotify() + + +``` +IRilCallback::CBConfigNotify ([in] struct RilRadioResponseInfo responseInfo, [in] struct CBConfigReportInfo cellBroadConfigReportInfo ) +``` +**描述:** +小区广播配置上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cellBroadConfigReportInfo | 表示小区广播上报信息,详见[CBConfigReportInfo](_c_b_config_report_info.md)。 | + + +### ChangeSimPasswordResponse() + + +``` +IRilCallback::ChangeSimPasswordResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct LockStatusResp lockStatus ) +``` +**描述:** +修改SIM卡密码响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [LockStatusResp](_lock_status_resp.md) | 表示获取到的SIM卡锁状态响应,详见[LockStatusResp](_lock_status_resp.md)。 | + + +### CombineConferenceResponse() + + +``` +IRilCallback::CombineConferenceResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +合并为会议电话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### CommonErrorResponse() + + +``` +IRilCallback::CommonErrorResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +通用错误响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### DeactivatePdpContextResponse() + + +``` +IRilCallback::DeactivatePdpContextResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +断开数据业务响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### DelCdmaSimMessageResponse() + + +``` +IRilCallback::DelCdmaSimMessageResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +删除CDMA SIM卡短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### DelSimMessageResponse() + + +``` +IRilCallback::DelSimMessageResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +删除GSM SIM卡短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### DialResponse() + + +``` +IRilCallback::DialResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +拨打电话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### GetBasebandVersionResponse() + + +``` +IRilCallback::GetBasebandVersionResponse ([in] struct RilRadioResponseInfo responseInfo, [in] String basebandVersion ) +``` +**描述:** +查询基带版本响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| basebandVersion | 表示基带版本。 | + + +### GetCallFailReasonResponse() + + +``` +IRilCallback::GetCallFailReasonResponse ([in] struct RilRadioResponseInfo responseInfo, [in] int callFail ) +``` +**描述:** +查询通话失败原因响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| callFail | 表示通话失败原因。 | + + +### GetCallListResponse() + + +``` +IRilCallback::GetCallListResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CallInfoList callList ) +``` +**描述:** +查询通话状态列表响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| callList | 表示通话状态信息列表,详见[CallInfoList](_call_info_list.md)。 | + + +### GetCallPreferenceModeResponse() + + +``` +IRilCallback::GetCallPreferenceModeResponse ([in] struct RilRadioResponseInfo responseInfo, [in] int mode ) +``` +**描述:** +查询通话偏好模式响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| mode | 表示CallPreference模式。 | + + +### GetCallRestrictionResponse() + + +``` +IRilCallback::GetCallRestrictionResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CallRestrictionResult result ) +``` +**描述:** +查询呼叫限制响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| result | 表示呼叫限制结果信息,详见[CallRestrictionResult](_call_restriction_result.md)。 | + + +### GetCallTransferInfoResponse() + + +``` +IRilCallback::GetCallTransferInfoResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CallForwardQueryInfoList cFQueryList ) +``` +**描述:** +查询呼叫转移响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cFQueryList | 表示呼叫转移信息列表,详见[CallForwardQueryInfoList](_call_forward_query_info_list.md)。 | + + +### GetCallWaitingResponse() + + +``` +IRilCallback::GetCallWaitingResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CallWaitResult callWaitResult ) +``` +**描述:** +查询呼叫等待响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| callWaitResult | 表示呼叫等待结果信息,详见[CallWaitResult](_call_wait_result.md)。 | + + +### GetCBConfigResponse() + + +``` +IRilCallback::GetCBConfigResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CBConfigInfo cellBroadcastInfo ) +``` +**描述:** +获取GSM小区广播配置响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cellBroadcastInfo | 表示GSM小区广播配置信息,详见[CBConfigInfo](_c_b_config_info.md)。 | + + +### GetCdmaCBConfigResponse() + + +``` +IRilCallback::GetCdmaCBConfigResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CdmaCBConfigInfo cdmaCBConfigInfo ) +``` +**描述:** +获取CDMA小区广播配置响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cdmaCBConfigInfo | 表示CDMA小区广播配置信息,详见[CdmaCBConfigInfo](_cdma_c_b_config_info.md)。 | + + +### GetClipResponse() + + +``` +IRilCallback::GetClipResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct GetClipResult getClipResult ) +``` +**描述:** +查询主叫号码显示响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| getClipResult | 表示主叫号码显示结果信息,详见[GetClipResult](_get_clip_result.md)。 | + + +### GetClirResponse() + + +``` +IRilCallback::GetClirResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct GetClirResult getClirResult ) +``` +**描述:** +查询主叫号码显示限制响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| getClirResult | 表示主叫号码显示限制结果信息,详见[GetClirResult](_get_clir_result.md)。 | + + +### GetCsRegStatusResponse() + + +``` +IRilCallback::GetCsRegStatusResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CsRegStatusInfo csRegStatusInfo ) +``` +**描述:** +获取语音(CS)域注册状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| csRegStatusInfo | 表示CS注册状态信息,详见[CsRegStatusInfo](_cs_reg_status_info.md)。 | + + +### GetCurrentCellInfoResponse() + + +``` +IRilCallback::GetCurrentCellInfoResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CellListCurrentInfo cellListCurrentInfo ) +``` +**描述:** +获取小区信息响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cellListCurrentInfo | 表示附近的小区信息列表,详见[CellListCurrentInfo](_cell_list_current_info.md)。 | + + +### GetEmergencyCallListResponse() + + +``` +IRilCallback::GetEmergencyCallListResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct EmergencyInfoList emergencyInfoList ) +``` +**描述:** +查询紧急呼叫号码列表响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| emergencyInfoList | 表示紧急号码列表,详见[EmergencyInfoList](_emergency_info_list.md)。 | + + +### GetImeiResponse() + + +``` +IRilCallback::GetImeiResponse ([in] struct RilRadioResponseInfo responseInfo, [in] String imei ) +``` +**描述:** +获取国际移动设备识别码响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| imei | 表示IMEI。 | + + +### GetImsiResponse() + + +``` +IRilCallback::GetImsiResponse ([in] struct RilRadioResponseInfo responseInfo, [in] String response ) +``` +**描述:** +获取SIM卡IMSI响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| response | 表示获取到的IMSI文本。 | + + +### GetLinkBandwidthInfoResponse() + + +``` +IRilCallback::GetLinkBandwidthInfoResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct DataLinkBandwidthInfo dataLinkBandwidthInfo ) +``` +**描述:** +获取当前链路信息响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| dataLinkBandwidthInfo | 表示网络频率信息,详见[DataLinkBandwidthInfo](_data_link_bandwidth_info.md)。 | + + +### GetMeidResponse() + + +``` +IRilCallback::GetMeidResponse ([in] struct RilRadioResponseInfo responseInfo, [in] String meid ) +``` +**描述:** +获取移动设备识别码响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| meid | 表示MEID。 | + + +### GetMuteResponse() + + +``` +IRilCallback::GetMuteResponse ([in] struct RilRadioResponseInfo responseInfo, [in] int mute ) +``` +**描述:** +查询静音响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| mute | 表示静音状态,0表示非静音,1表示静音。 | + + +### GetNeighboringCellInfoListResponse() + + +``` +IRilCallback::GetNeighboringCellInfoListResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CellListNearbyInfo cellListNearbyInfo ) +``` +**描述:** +获取相邻小区信息响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cellListNearbyInfo | 表示附近的小区信息列表,详见[CellListNearbyInfo](_cell_list_nearby_info.md)。 | + + +### GetNetworkSearchInformationResponse() + + +``` +IRilCallback::GetNetworkSearchInformationResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct AvailableNetworkList availableNetworkList ) +``` +**描述:** +获取可用网络信息响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| availableNetworkList | 表示可用网络列表,详见[AvailableNetworkList](_available_network_list.md)。 | + + +### GetNetworkSelectionModeResponse() + + +``` +IRilCallback::GetNetworkSelectionModeResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct SetNetworkModeInfo setNetworkModeInfo ) +``` +**描述:** +获取选网模式响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| setNetworkModeInfo | 表示可选择的网络模式,详见[SetNetworkModeInfo](_set_network_mode_info.md)。 | + + +### GetOperatorInfoResponse() + + +``` +IRilCallback::GetOperatorInfoResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct OperatorInfo psRegStatusInfo ) +``` +**描述:** +获取运营商名称信息响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| psRegStatusInfo | 表示运营商信息,详见[OperatorInfo](_operator_info.md)。 | + + +### GetPdpContextListResponse() + + +``` +IRilCallback::GetPdpContextListResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct DataCallResultList dataCallResultList ) +``` +**描述:** +获取当前所有数据连接状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| dataCallResultList | 表示数据业务激活结果列表,详见[DataCallResultList](_data_call_result_list.md)。 | + + +### GetPhysicalChannelConfigResponse() + + +``` +IRilCallback::GetPhysicalChannelConfigResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct ChannelConfigInfoList channelConfigInfoList ) +``` +**描述:** +获取物理通道配置响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| channelConfigInfoList | 表示物理通道配置信息列表,详见[ChannelConfigInfoList](_channel_config_info_list.md)。 | + + +### GetPreferredNetworkResponse() + + +``` +IRilCallback::GetPreferredNetworkResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct PreferredNetworkTypeInfo preferredNetworkTypeInfo ) +``` +**描述:** +获取首选网络类型响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| preferredNetworkTypeInfo | 表示首选网络类型信息,详见[PreferredNetworkTypeInfo](_preferred_network_type_info.md)。 | + + +### GetPsRegStatusResponse() + + +``` +IRilCallback::GetPsRegStatusResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct PsRegStatusInfo psRegStatusInfo ) +``` +**描述:** +获取分组(PS)域注册状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| psRegStatusInfo | 表示PS注册状态信息,详见[PsRegStatusInfo](_ps_reg_status_info.md)。 | + + +### GetRadioProtocolResponse() + + +``` +IRilCallback::GetRadioProtocolResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct RadioProtocol radioProtocol ) +``` +**描述:** +获取主副卡协议栈响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [RadioProtocol](_radio_protocol.md) | 表示获取到的Radio协议,详见[RadioProtocol](_radio_protocol.md)。 | + + +### GetRadioStateResponse() + + +``` +IRilCallback::GetRadioStateResponse ([in] struct RilRadioResponseInfo responseInfo, [in] int state ) +``` +**描述:** +查询Modem状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### GetSignalStrengthResponse() + + +``` +IRilCallback::GetSignalStrengthResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct Rssi rssi ) +``` +**描述:** +获取信号强度响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| rssi | 表示信号强度,详见[Rssi](_rssi.md)。 | + + +### GetSimIOResponse() + + +``` +IRilCallback::GetSimIOResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct IccIoResultInfo result ) +``` +**描述:** +获取SIM卡数据响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| result | 表示SIM卡IO响应结果信息,详见[IccIoResultInfo](_icc_io_result_info.md)。 | + + +### GetSimLockStatusResponse() + + +``` +IRilCallback::GetSimLockStatusResponse ([in] struct RilRadioResponseInfo responseInfo, [in] int simLockStatus ) +``` +**描述:** +获取SIM卡锁状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| simLockStatus | 表示SIM卡锁状态,详见**simLockStatus**。 | + + +### GetSimStatusResponse() + + +``` +IRilCallback::GetSimStatusResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct CardStatusInfo result ) +``` +**描述:** +获取SIM卡状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [CardStatusInfo](_card_status_info.md) | 表示卡状态信息,详见[CardStatusInfo](_card_status_info.md)。 | + + +### GetSmscAddrResponse() + + +``` +IRilCallback::GetSmscAddrResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct ServiceCenterAddress serviceCenterAddress ) +``` +**描述:** +获取短信中心地址响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | +| serviceCenterAddress | 表示短信中心地址信息,详见[ServiceCenterAddress](_service_center_address.md)。  | + + +### GetUssdResponse() + + +``` +IRilCallback::GetUssdResponse ([in] struct RilRadioResponseInfo responseInfo, [in] int cusd ) +``` +**描述:** +查询USSD业务响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cusd | 表示USSD业务信息。 | + + +### GetVoiceRadioTechnologyResponse() + + +``` +IRilCallback::GetVoiceRadioTechnologyResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct VoiceRadioTechnology voiceRadioTechnology ) +``` +**描述:** +获取电路域接入技术响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [VoiceRadioTechnology](_voice_radio_technology.md) | 表示语音接入技术,详见[VoiceRadioTechnology](_voice_radio_technology.md)。 | + + +### HangupResponse() + + +``` +IRilCallback::HangupResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +挂断电话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### HoldCallResponse() + + +``` +IRilCallback::HoldCallResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +保持通话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### NetworkCsRegStatusUpdated() + + +``` +IRilCallback::NetworkCsRegStatusUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct CsRegStatusInfo csRegStatusInfo ) +``` +**描述:** +CS域网络注册状态变化上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| csRegStatusInfo | 表示CS注册状态信息,详见[CsRegStatusInfo](_cs_reg_status_info.md)。 | + + +### NetworkCurrentCellUpdated() + + +``` +IRilCallback::NetworkCurrentCellUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct CellListCurrentInfo cellListCurrentInfo ) +``` +**描述:** +小区信息上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| cellListCurrentInfo | 表示当前小区信息,详见[CellListCurrentInfo](_cell_list_current_info.md)。 | + + +### NetworkPhyChnlCfgUpdated() + + +``` +IRilCallback::NetworkPhyChnlCfgUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct ChannelConfigInfoList channelConfigInfoList ) +``` +**描述:** +物理通道配置消息上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| channelConfigInfoList | 表示通道配置信息列表,详见[ChannelConfigInfoList](_channel_config_info_list.md)。 | + + +### NetworkPsRegStatusUpdated() + + +``` +IRilCallback::NetworkPsRegStatusUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct PsRegStatusInfo psRegStatusInfo ) +``` +**描述:** +PS域网络注册状态变化上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| psRegStatusInfo | 表示PS注册状态信息,详见[PsRegStatusInfo](_ps_reg_status_info.md)。 | + + +### NetworkTimeUpdated() + + +``` +IRilCallback::NetworkTimeUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] String timeStr ) +``` +**描述:** +NITZ时间更新上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| timeStr | 表示时间。 | + + +### NetworkTimeZoneUpdated() + + +``` +IRilCallback::NetworkTimeZoneUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] String timeZoneStr ) +``` +**描述:** +NITZ时区变化上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| timeZoneStr | 表示时区。 | + + +### NewCdmaSmsNotify() + + +``` +IRilCallback::NewCdmaSmsNotify ([in] struct RilRadioResponseInfo responseInfo, [in] struct SmsMessageInfo smsMessageInfo ) +``` +**描述:** +CDMA新短信通知上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| smsMessageInfo | 表示上报短信信息,详见[SmsMessageInfo](_sms_message_info.md)。 | + + +### NewSmsNotify() + + +``` +IRilCallback::NewSmsNotify ([in] struct RilRadioResponseInfo responseInfo, [in] struct SmsMessageInfo smsMessageInfo ) +``` +**描述:** +GSM新短信通知上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| smsMessageInfo | 表示上报短信信息,详见[SmsMessageInfo](_sms_message_info.md)。 | + + +### NewSmsStoredOnSimNotify() + + +``` +IRilCallback::NewSmsStoredOnSimNotify ([in] struct RilRadioResponseInfo responseInfo, [in] int recordNumber, [in] int indicationType ) +``` +**描述:** +收到SIM卡短信上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| recordNumber | 表示SIM卡短信数量。  | +| indicationType | 表示响应类型,详见**HRilNotiType**。 | + + +### PdpContextListUpdated() + + +``` +IRilCallback::PdpContextListUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct DataCallResultList dataCallResultList ) +``` +**描述:** +数据业务建立与断开等状态变化上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| dataCallResultList | 表示数据业务激活结果列表,详见[DataCallResultList](_data_call_result_list.md)。 | + + +### RadioStateUpdated() + + +``` +IRilCallback::RadioStateUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] int state ) +``` +**描述:** +Radio状态上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| state | 表示Radio状态,0表示OFF,1表示ON。 | + + +### RejectResponse() + + +``` +IRilCallback::RejectResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +拒接电话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SendCdmaSmsResponse() + + +``` +IRilCallback::SendCdmaSmsResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct SendSmsResultInfo sendSmsResultInfo ) +``` +**描述:** +发送CDMA短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| sendSmsResultInfo | 表示发送短信响应信息,详见[SendSmsResultInfo](_send_sms_result_info.md)。 | + + +### SendDtmfResponse() + + +``` +IRilCallback::SendDtmfResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +发送DTMF响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SendGsmSmsResponse() + + +``` +IRilCallback::SendGsmSmsResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct SendSmsResultInfo sendSmsResultInfo ) +``` +**描述:** +发送GSM短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| sendSmsResultInfo | 表示发送短信响应信息,详见[SendSmsResultInfo](_send_sms_result_info.md)。 | + + +### SendSmsAckResponse() + + +``` +IRilCallback::SendSmsAckResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +确认接收新短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SendSmsMoreModeResponse() + + +``` +IRilCallback::SendSmsMoreModeResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct SendSmsResultInfo sendSmsResultInfo ) +``` +**描述:** +发送GSM长短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| sendSmsResultInfo | 表示发送短信响应信息,详见[SendSmsResultInfo](_send_sms_result_info.md)。 | + + +### SeparateConferenceResponse() + + +``` +IRilCallback::SeparateConferenceResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +与会议电话分离响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetActiveSimResponse() + + +``` +IRilCallback::SetActiveSimResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +激活去激活SIM卡响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetBarringPasswordResponse() + + +``` +IRilCallback::SetBarringPasswordResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置呼叫限制密码响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetCallPreferenceModeResponse() + + +``` +IRilCallback::SetCallPreferenceModeResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置通话偏好模式响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetCallRestrictionResponse() + + +``` +IRilCallback::SetCallRestrictionResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置呼叫限制响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetCallTransferInfoResponse() + + +``` +IRilCallback::SetCallTransferInfoResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置呼叫转移响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetCallWaitingResponse() + + +``` +IRilCallback::SetCallWaitingResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置呼叫等待响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetCBConfigResponse() + + +``` +IRilCallback::SetCBConfigResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +激活GSM小区广播响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetCdmaCBConfigResponse() + + +``` +IRilCallback::SetCdmaCBConfigResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +激活CDMA小区广播响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetClipResponse() + + +``` +IRilCallback::SetClipResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置主叫号码显示响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetClirResponse() + + +``` +IRilCallback::SetClirResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置主叫号码显示限制响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetDataPermittedResponse() + + +``` +IRilCallback::SetDataPermittedResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +使能SIM卡槽数据业务响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetDeviceStateResponse() + + +``` +IRilCallback::SetDeviceStateResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置设备状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetEmergencyCallListResponse() + + +``` +IRilCallback::SetEmergencyCallListResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置紧急呼叫号码列表响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetInitApnInfoResponse() + + +``` +IRilCallback::SetInitApnInfoResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置初始化默认网络接入技术(APN)信息响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetLinkBandwidthReportingRuleResponse() + + +``` +IRilCallback::SetLinkBandwidthReportingRuleResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置当前链路信息的上报规则响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetLocateUpdatesResponse() + + +``` +IRilCallback::SetLocateUpdatesResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +开启或关闭小区位置更新导致的网络状态通知响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetMuteResponse() + + +``` +IRilCallback::SetMuteResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置静音响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetNetworkSelectionModeResponse() + + +``` +IRilCallback::SetNetworkSelectionModeResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置选网模式响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetNotificationFilterResponse() + + +``` +IRilCallback::SetNotificationFilterResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置通知过滤器响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetPreferredNetworkResponse() + + +``` +IRilCallback::SetPreferredNetworkResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置首选网络类型响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetRadioProtocolResponse() + + +``` +IRilCallback::SetRadioProtocolResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct RadioProtocol radioProtocol ) +``` +**描述:** +设置主副卡协议栈响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [RadioProtocol](_radio_protocol.md) | 表示获取到的响应Radio协议,详见[RadioProtocol](_radio_protocol.md)。 | + + +### SetRadioStateResponse() + + +``` +IRilCallback::SetRadioStateResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置Modem状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetSimLockResponse() + + +``` +IRilCallback::SetSimLockResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct LockStatusResp lockStatus ) +``` +**描述:** +设置SIM卡锁响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [LockStatusResp](_lock_status_resp.md) | 表示获取到的SIM卡锁状态响应,详见[LockStatusResp](_lock_status_resp.md)。 | + + +### SetSmscAddrResponse() + + +``` +IRilCallback::SetSmscAddrResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置短信中心地址响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SetUssdResponse() + + +``` +IRilCallback::SetUssdResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +设置USSD业务响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### ShutDownResponse() + + +``` +IRilCallback::ShutDownResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +Modem收到手机正在关机响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SignalStrengthUpdated() + + +``` +IRilCallback::SignalStrengthUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct Rssi rssi ) +``` +**描述:** +信号强度变化上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| rssi | 表示信号强度,详见[Rssi](_rssi.md)。 | + + +### SimAuthenticationResponse() + + +``` +IRilCallback::SimAuthenticationResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct IccIoResultInfo result ) +``` +**描述:** +SIM卡鉴权响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| result | 表示SIM卡鉴权的结果信息,详见[IccIoResultInfo](_icc_io_result_info.md)。 | + + +### SimCloseLogicalChannelResponse() + + +``` +IRilCallback::SimCloseLogicalChannelResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +APDU关闭逻辑通道响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimOpenLogicalChannelResponse() + + +``` +IRilCallback::SimOpenLogicalChannelResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct OpenLogicalChannelResponse pOpenLogicalChannelResponse ) +``` +**描述:** +APDU打开逻辑通道响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [OpenLogicalChannelResponse](_open_logical_channel_response.md) | 表示打开逻辑通道的响应信息,详见[OpenLogicalChannelResponse](_open_logical_channel_response.md)。 | + + +### SimRadioProtocolUpdated() + + +``` +IRilCallback::SimRadioProtocolUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct RadioProtocol radioProtocol ) +``` +**描述:** +STK Radio协议更新上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimRefreshNotify() + + +``` +IRilCallback::SimRefreshNotify ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +SIM状态刷新上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStateUpdated() + + +``` +IRilCallback::SimStateUpdated ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +SIM卡状态变化上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkAlphaNotify() + + +``` +IRilCallback::SimStkAlphaNotify ([in] struct RilRadioResponseInfo responseInfo, [in] String response ) +``` +**描述:** +STK Alpha指令上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkCallSetupNotify() + + +``` +IRilCallback::SimStkCallSetupNotify ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +STK CallSetup指令上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkEventNotify() + + +``` +IRilCallback::SimStkEventNotify ([in] struct RilRadioResponseInfo responseInfo, [in] String response ) +``` +**描述:** +STK事件上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkIsReadyResponse() + + +``` +IRilCallback::SimStkIsReadyResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +获取STK是否Ready状态响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkProactiveNotify() + + +``` +IRilCallback::SimStkProactiveNotify ([in] struct RilRadioResponseInfo responseInfo, [in] String response ) +``` +**描述:** +STK Proactive指令上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkSendCallSetupRequestResultResponse() + + +``` +IRilCallback::SimStkSendCallSetupRequestResultResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +发送STK CallSetup指令响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkSendEnvelopeResponse() + + +``` +IRilCallback::SimStkSendEnvelopeResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +发送STK Envelope指令响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkSendTerminalResponseResponse() + + +``` +IRilCallback::SimStkSendTerminalResponseResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +发送STK TerminalResponse指令响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimStkSessionEndNotify() + + +``` +IRilCallback::SimStkSessionEndNotify ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +STK SessionEnd指令上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SimTransmitApduBasicChannelResponse() + + +``` +IRilCallback::SimTransmitApduBasicChannelResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct IccIoResultInfo result ) +``` +**描述:** +APDU基础通道数据传输响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| result | 表示数据传输结果信息,详见[IccIoResultInfo](_icc_io_result_info.md)。 | + + +### SimTransmitApduLogicalChannelResponse() + + +``` +IRilCallback::SimTransmitApduLogicalChannelResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct IccIoResultInfo result ) +``` +**描述:** +APDU逻辑通道数据传输响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| result | 表示数据传输结果信息,详见[IccIoResultInfo](_icc_io_result_info.md)。 | + + +### SmsStatusReportNotify() + + +``` +IRilCallback::SmsStatusReportNotify ([in] struct RilRadioResponseInfo responseInfo, [in] struct SmsMessageInfo smsMessageInfo ) +``` +**描述:** +新短信状态通知上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| smsMessageInfo | 表示上报短信信息,详见[SmsMessageInfo](_sms_message_info.md)。 | + + +### StartDtmfResponse() + + +``` +IRilCallback::StartDtmfResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +开启DTMF响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### StopDtmfResponse() + + +``` +IRilCallback::StopDtmfResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +关闭DTMF响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### SwitchCallResponse() + + +``` +IRilCallback::SwitchCallResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +切换通话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### UnHoldCallResponse() + + +``` +IRilCallback::UnHoldCallResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +取消保持通话响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### UnlockPin2Response() + + +``` +IRilCallback::UnlockPin2Response ([in] struct RilRadioResponseInfo responseInfo, [in] struct LockStatusResp lockStatus ) +``` +**描述:** +PIN2解锁响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [LockStatusResp](_lock_status_resp.md) | 表示获取到的SIM卡锁状态响应,详见[LockStatusResp](_lock_status_resp.md)。 | + + +### UnlockPinResponse() + + +``` +IRilCallback::UnlockPinResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct LockStatusResp lockStatus ) +``` +**描述:** +PIN解锁响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [LockStatusResp](_lock_status_resp.md) | 表示获取到的SIM卡锁状态响应,详见[LockStatusResp](_lock_status_resp.md)。 | + + +### UnlockPuk2Response() + + +``` +IRilCallback::UnlockPuk2Response ([in] struct RilRadioResponseInfo responseInfo, [in] struct LockStatusResp lockStatus ) +``` +**描述:** +PUK2解锁响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [LockStatusResp](_lock_status_resp.md) | 表示获取到的SIM卡锁状态响应,详见[LockStatusResp](_lock_status_resp.md)。 | + + +### UnlockPukResponse() + + +``` +IRilCallback::UnlockPukResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct LockStatusResp lockStatus ) +``` +**描述:** +PUK解锁响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [LockStatusResp](_lock_status_resp.md) | 表示获取到的SIM卡锁状态响应,详见[LockStatusResp](_lock_status_resp.md)。 | + + +### UnlockSimLockResponse() + + +``` +IRilCallback::UnlockSimLockResponse ([in] struct RilRadioResponseInfo responseInfo, [in] struct LockStatusResp lockStatus ) +``` +**描述:** +解锁SIM卡响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| [LockStatusResp](_lock_status_resp.md) | 表示获取到的SIM卡锁状态响应,详见[LockStatusResp](_lock_status_resp.md)。 | + + +### UpdateCdmaSimMessageResponse() + + +``` +IRilCallback::UpdateCdmaSimMessageResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +更新CDMA SIM卡短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### UpdateSimMessageResponse() + + +``` +IRilCallback::UpdateSimMessageResponse ([in] struct RilRadioResponseInfo responseInfo) +``` +**描述:** +更新GSM SIM卡短信响应。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。 | + + +### VoiceRadioTechUpdated() + + +``` +IRilCallback::VoiceRadioTechUpdated ([in] struct RilRadioResponseInfo responseInfo, [in] struct VoiceRadioTechnology voiceRadioTechnology ) +``` +**描述:** +语音接入技术变化上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| responseInfo | 表示通用响应信息,例如卡槽ID,请求序列ID等,详见[RilRadioResponseInfo](_ril_radio_response_info.md)。  | +| voiceRadioTechnology | 表示变化后的电路域接入技术,详见[VoiceRadioTechnology](_voice_radio_technology.md)。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_callback.md index 56699b4b547f0a277e721dc1a186a6f1da74bae3..6d107432c9a55ff86b9cf50fb099a1f758dc726e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_callback.md @@ -1,7 +1,7 @@ # ISensorCallback -## **概述** +## 概述 定义用于上报传感器数据的回调函数。 @@ -9,10 +9,10 @@ **相关模块:** -[Sensor](sensor.md) +[Sensor](_sensor.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -22,7 +22,7 @@ | [OnDataEvent](#ondataevent) ([in] struct [HdfSensorEvents](_hdf_sensor_events.md) event) | 定义上报传感器数据的功能。 | -## **成员函数说明** +## 成员函数说明 ### OnDataEvent() @@ -32,7 +32,7 @@ ISensorCallback::OnDataEvent ([in] struct HdfSensorEvents event) ``` -**描述:** +**描述:** 定义上报传感器数据的功能。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_interface.md index be4ea74d8120858005132020f305985b2f322c06..01de9779e32921a0daef0814d5181c809fc1be15 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_sensor_interface.md @@ -1,43 +1,39 @@ # ISensorInterface -## **概述** +## 概述 提供Sensor设备基本控制操作接口。 操作包括获取传感器设备信息、订阅/取消订阅传感器数据、使能/去使能传感器、设置传感器模式、设置传感器精度、量程等可选配置接口定义。 -**Since:** - +**Since:** 2.2 - **Version:** - 1.0 - **相关模块:** -[Sensor](sensor.md) +[Sensor](_sensor.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [GetAllSensorInfo](#getallsensorinfo) ([out] struct [HdfSensorInformation](_hdf_sensor_information.md)[] info) | 获取当前系统中所有类型的传感器信息。 | -| [Enable](#enable) ([in] int sensorId) | 根据传感器设备类型标识使能传感器信息列表里存在的设备,只有数据订阅者使能传感器后,才能获取订阅的传感器数据。 | -| [Disable](#disable) ([in] int sensorId) | 根据传感器设备类型标识去使能传感器信息列表里存在的设备。 | -| [SetBatch](#setbatch) ([in] int sensorId,[in] long samplingInterval, [in] long reportInterval) | 设置指定传感器的数据上报模式,不同的工作模式,上报数据的方式不同。 | -| [SetMode](#setmode) ([in] int sensorId, [in] int mode) | 设置指定传感器数据上报模式。 | -| [SetOption](#setoption) ([in] int sensorId, [in] unsigned int option) | 设置指定传感器量程、精度等可选配置。 | -| [Register](#register) ([in] int groupId, [in] [ISensorCallback](interface_i_sensor_callback.md) callbackObj) | 订阅者注册传感器数据回调函数,系统会将获取到的传感器数据上报给订阅者。 | -| [Unregister](#unregister) ([in] int groupId, [in] [ISensorCallback](interface_i_sensor_callback.md) callbackObj) | 订阅者取消注册传感器数据回调函数。 | +| [GetAllSensorInfo](#getallsensorinfo) ([out] struct [HdfSensorInformation](_hdf_sensor_information.md)[] info) | 获取当前系统中所有类型的传感器信息。  | +| [Enable](#enable) ([in] int sensorId) | 根据传感器设备类型标识使能传感器信息列表里存在的设备,只有数据订阅者使能传感器后,才能获取订阅的传感器数据。  | +| [Disable](#disable) ([in] int sensorId) | 根据传感器设备类型标识去使能传感器信息列表里存在的设备。  | +| [SetBatch](#setbatch) ([in] int sensorId,[in] long samplingInterval, [in] long reportInterval) | 设置指定传感器的数据上报模式,不同的工作模式,上报数据的方式不同。  | +| [SetMode](#setmode) ([in] int sensorId, [in] int mode) | 设置指定传感器数据上报模式。  | +| [SetOption](#setoption) ([in] int sensorId, [in] unsigned int option) | 设置指定传感器量程、精度等可选配置。  | +| [Register](#register) ([in] int groupId, [in] [ISensorCallback](interface_i_sensor_callback.md) callbackObj) | 订阅者注册传感器数据回调函数,系统会将获取到的传感器数据上报给订阅者。  | +| [Unregister](#unregister) ([in] int groupId, [in] [ISensorCallback](interface_i_sensor_callback.md) callbackObj) | 订阅者取消注册传感器数据回调函数。  | -## **成员函数说明** +## 成员函数说明 ### Disable() @@ -46,16 +42,14 @@ ``` ISensorInterface::Disable ([in] int sensorId) ``` - -**描述:** - +**描述:** 根据传感器设备类型标识去使能传感器信息列表里存在的设备。 **参数:** | 名称 | 描述 | | -------- | -------- | -| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](sensor.md#hdfsensortypetag)。 | +| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](_sensor.md#hdfsensortypetag)。 | **返回:** @@ -70,16 +64,14 @@ ISensorInterface::Disable ([in] int sensorId) ``` ISensorInterface::Enable ([in] int sensorId) ``` - -**描述:** - +**描述:** 根据传感器设备类型标识使能传感器信息列表里存在的设备,只有数据订阅者使能传感器后,才能获取订阅的传感器数据。 **参数:** | 名称 | 描述 | | -------- | -------- | -| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](sensor.md#hdfsensortypetag)。 | +| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](_sensor.md#hdfsensortypetag)。 | **返回:** @@ -94,9 +86,7 @@ ISensorInterface::Enable ([in] int sensorId) ``` ISensorInterface::GetAllSensorInfo ([out] struct HdfSensorInformation[] info) ``` - -**描述:** - +**描述:** 获取当前系统中所有类型的传感器信息。 **参数:** @@ -118,16 +108,14 @@ ISensorInterface::GetAllSensorInfo ([out] struct HdfSensorInformation[] info) ``` ISensorInterface::Register ([in] int groupId, [in] ISensorCallback callbackObj ) ``` - -**描述:** - +**描述:** 订阅者注册传感器数据回调函数,系统会将获取到的传感器数据上报给订阅者。 **参数:** | 名称 | 描述 | | -------- | -------- | -| groupId | 传感器组ID。 groupId枚举值范围为128-160,表示已订阅医疗传感器服务,只需成功订阅一次,无需重复订阅。 groupId枚举值范围不在128-160之间,这意味着传统传感器已订阅,只需成功订阅一次,无需重复订阅。 | +| groupId | 传感器组ID。 groupId枚举值范围为128-160,表示已订阅医疗传感器服务,只需成功订阅一次,无需重复订阅。 groupId枚举值范围不在128-160之间,这意味着传统传感器已订阅,只需成功订阅一次,无需重复订阅。  | | callbackObj | 要注册的回调函数,详见[ISensorCallback](interface_i_sensor_callback.md)。 | **返回:** @@ -143,17 +131,15 @@ ISensorInterface::Register ([in] int groupId, [in] ISensorCallback callbackObj ) ``` ISensorInterface::SetBatch ([in] int sensorId, [in] long samplingInterval, [in] long reportInterval ) ``` - -**描述:** - +**描述:** 设置指定传感器的数据上报模式,不同的工作模式,上报数据的方式不同。 **参数:** | 名称 | 描述 | | -------- | -------- | -| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](sensor.md#hdfsensortypetag)。 | -| samplingInterval | 设置指定传感器的数据采样间隔,单位纳秒。 | +| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](_sensor.md#hdfsensortypetag)。  | +| samplingInterval | 设置指定传感器的数据采样间隔,单位纳秒。  | | reportInterval | 表示传感器数据上报间隔,单位纳秒。 | **返回:** @@ -169,17 +155,15 @@ ISensorInterface::SetBatch ([in] int sensorId, [in] long samplingInterval, [in] ``` ISensorInterface::SetMode ([in] int sensorId, [in] int mode ) ``` - -**描述:** - +**描述:** 设置指定传感器数据上报模式。 **参数:** | 名称 | 描述 | | -------- | -------- | -| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](sensor.md#hdfsensortypetag)。 | -| mode | 传感器的数据上报模式,详见[HdfSensorModeType](sensor.md#hdfsensormodetype)。 | +| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](_sensor.md#hdfsensortypetag)。  | +| mode | 传感器的数据上报模式,详见[HdfSensorModeType](_sensor.md#hdfsensormodetype)。 | **返回:** @@ -194,16 +178,14 @@ ISensorInterface::SetMode ([in] int sensorId, [in] int mode ) ``` ISensorInterface::SetOption ([in] int sensorId, [in] unsigned int option ) ``` - -**描述:** - +**描述:** 设置指定传感器量程、精度等可选配置。 **参数:** | 名称 | 描述 | | -------- | -------- | -| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](sensor.md#hdfsensortypetag)。 | +| sensorId | 唯一标识一个传感器设备类型,详见[HdfSensorTypeTag](_sensor.md#hdfsensortypetag)。  | | option | 表示要设置的选项,如测量范围和精度。 | **返回:** @@ -219,16 +201,14 @@ ISensorInterface::SetOption ([in] int sensorId, [in] unsigned int option ) ``` ISensorInterface::Unregister ([in] int groupId, [in] ISensorCallback callbackObj ) ``` - -**描述:** - +**描述:** 订阅者取消注册传感器数据回调函数。 **参数:** | 名称 | 描述 | | -------- | -------- | -| groupId | 传感器组ID。 groupId枚举值范围为128-160,表示已订阅医疗传感器服务。只需成功取消订阅一次,无需重复取消订阅。 groupId枚举值范围不在128-160之间,这意味着传统传感器已订阅。并且成功取消订阅。 | +| groupId | 传感器组ID。 groupId枚举值范围为128-160,表示已订阅医疗传感器服务。只需成功取消订阅一次,无需重复取消订阅。 groupId枚举值范围不在128-160之间,这意味着传统传感器已订阅。并且成功取消订阅。  | | callbackObj | 要取消注册的回调函数,详见[ISensorCallback](interface_i_sensor_callback.md)。 | **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator.md index 98a762eceb7b11e0c574191f4586aa767a95ede1..c2ca391257f8fe96da9fab131bed68cf2ba4d3bc 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator.md @@ -1,30 +1,30 @@ # IStreamOperator -## **概述** +## 概述 定义Camera设备流操作。 对Camera设备执行流的创建、配置与添加参数、属性获取、句柄绑定与解除、图像捕获与取消、流的转换以及流释放操作。 -流是指从底层设备输出,经本模块内部各环节处理,最终传递到上层服务或者应用的一组数据序列。 本模块支持的流的类型有预览流,录像流,拍照流等,更多类型可查看[StreamIntent](camera.md#streamintent)。 +流是指从底层设备输出,经本模块内部各环节处理,最终传递到上层服务或者应用的一组数据序列。本模块支持的流的类型有预览流,录像流,拍照流等,更多类型可查看[StreamIntent](_camera.md#streamintent)。 **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [IsStreamsSupported](#isstreamssupported) ([in] enum [OperationMode](camera.md#operationmode) mode, [in] unsigned char[] modeSetting, [in] struct [StreamInfo](_stream_info.md)[] infos, [out] enum [StreamSupportType](camera.md#streamsupporttype) type) | 查询是否支持添加参数对应的流。 | +| [IsStreamsSupported](#isstreamssupported) ([in] enum [OperationMode](_camera.md#operationmode) mode, [in] unsigned char[] modeSetting, [in] struct [StreamInfo](_stream_info.md)[] infos, [out] enum [StreamSupportType](_camera.md#streamsupporttype) type) | 查询是否支持添加参数对应的流。 | | [CreateStreams](#createstreams) ([in] struct [StreamInfo](_stream_info.md)[] streamInfos) | 创建流。 | | [ReleaseStreams](#releasestreams) ([in] int[] streamIds) | 释放流。 | -| [CommitStreams](#commitstreams) ([in] enum [OperationMode](camera.md#operationmode) mode, [in] unsigned char[] modeSetting) | 配置流。 | +| [CommitStreams](#commitstreams) ([in] enum [OperationMode](_camera.md#operationmode) mode, [in] unsigned char[] modeSetting) | 配置流。 | | [GetStreamAttributes](#getstreamattributes) ([out] struct [StreamAttribute](_stream_attribute.md)[] attributes) | 获取流的属性。通过该接口获取的流属性可能会和[CreateStreams](#createstreams)输入的流信息存在差异。 | | [AttachBufferQueue](#attachbufferqueue) ([in] int streamId, [in] BufferProducerSequenceable bufferProducer) | 绑定生产者句柄和指定流。 | | [DetachBufferQueue](#detachbufferqueue) ([in] int streamId) | 解除生产者句柄和指定流的绑定关系。 | @@ -33,7 +33,7 @@ | [ChangeToOfflineStream](#changetoofflinestream) ([in] int[] streamIds, [in] [IStreamOperatorCallback](interface_i_stream_operator_callback.md) callbackObj, [out] [IOfflineStreamOperator](interface_i_offline_stream_operator.md) offlineOperator) | 将指定流转换成离线流。 | -## **成员函数说明** +## 成员函数说明 ### AttachBufferQueue() @@ -43,7 +43,7 @@ IStreamOperator::AttachBufferQueue ([in] int streamId, [in] BufferProducerSequenceable bufferProducer ) ``` -**描述:** +**描述:** 绑定生产者句柄和指定流。 @@ -60,7 +60,7 @@ IStreamOperator::AttachBufferQueue ([in] int streamId, [in] BufferProducerSequen NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -74,7 +74,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::CancelCapture ([in] int captureId) ``` -**描述:** +**描述:** 取消连续捕获。捕获结束时,会调用[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)来通知调用者捕获的帧计数等信息。 @@ -88,7 +88,7 @@ IStreamOperator::CancelCapture ([in] int captureId) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -102,7 +102,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::Capture ([in] int captureId, [in] struct CaptureInfo info, [in] boolean isStreaming ) ``` -**描述:** +**描述:** 捕获图像。 @@ -112,7 +112,7 @@ IStreamOperator::Capture ([in] int captureId, [in] struct CaptureInfo info, [in] - 单次捕获即触发之后只捕获一帧图像数据,用于单次拍照场景。捕获启动时,会调用[OnCaptureStarted](interface_i_stream_operator_callback.md#oncapturestarted)来通知调用者捕获已经启动。 -- 连续捕获需调用[CancelCapture](#cancelcapture)来停止捕获。捕获结束时,会调用[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)来通知调用者捕获的帧计数等信息。 [CaptureInfo](_capture_info.md)的[enableShutterCallback_](_capture_info.md#enableshuttercallback)使能OnFrameShutter,使能后每次捕获触发OnFrameShutter。 对于多个流同时捕获的场景,本模块内部保证同时上报多路流捕获数据。 +- 连续捕获需调用[CancelCapture](#cancelcapture)来停止捕获。捕获结束时,会调用[OnCaptureEnded](interface_i_stream_operator_callback.md#oncaptureended)来通知调用者捕获的帧计数等信息。 [CaptureInfo](_capture_info.md)的enableShutterCallback_使能[OnFrameShutter](interface_i_stream_operator_callback.md#onframeshutter),使能后每次捕获触发[OnFrameShutter](interface_i_stream_operator_callback.md#onframeshutter)。 对于多个流同时捕获的场景,本模块内部保证同时上报多路流捕获数据。 **参数:** @@ -126,7 +126,7 @@ IStreamOperator::Capture ([in] int captureId, [in] struct CaptureInfo info, [in] NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -140,7 +140,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::ChangeToOfflineStream ([in] int[] streamIds, [in] IStreamOperatorCallback callbackObj, [out] IOfflineStreamOperator offlineOperator ) ``` -**描述:** +**描述:** 将指定流转换成离线流。 @@ -158,7 +158,7 @@ IStreamOperator::ChangeToOfflineStream ([in] int[] streamIds, [in] IStreamOperat NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### CommitStreams() @@ -168,7 +168,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::CommitStreams ([in] enum OperationMode mode, [in] unsigned char[] modeSetting ) ``` -**描述:** +**描述:** 配置流。 @@ -178,14 +178,14 @@ IStreamOperator::CommitStreams ([in] enum OperationMode mode, [in] unsigned char | 名称 | 描述 | | -------- | -------- | -| mode | 流运行的模式,支持的模式定义在[OperationMode](camera.md#operationmode)。 | +| mode | 流运行的模式,支持的模式定义在[OperationMode](_camera.md#operationmode)。 | | modeSetting | 流的配置参数,包括帧率,ZOOM等信息。ZOOM:变焦 | **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### CreateStreams() @@ -195,7 +195,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::CreateStreams ([in] struct StreamInfo[] streamInfos) ``` -**描述:** +**描述:** 创建流。 @@ -205,13 +205,13 @@ IStreamOperator::CreateStreams ([in] struct StreamInfo[] streamInfos) | 名称 | 描述 | | -------- | -------- | -| streamInfos | 流信息列表,流信息定义在[StreamInfo](_stream_info.md)。输入的流信息可能会被修改,需通过[GetStreamAttributes](#getstreamattributes)获取最新的流属性。 | +| streamInfos | 流信息列表,流信息定义在[StreamInfo](_stream_info.md)。输入的流信息可能会被修改,需通过 [GetStreamAttributes](#getstreamattributes)获取最新的流属性。 | **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### DetachBufferQueue() @@ -221,7 +221,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::DetachBufferQueue ([in] int streamId) ``` -**描述:** +**描述:** 解除生产者句柄和指定流的绑定关系。 @@ -235,7 +235,7 @@ IStreamOperator::DetachBufferQueue ([in] int streamId) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 **参见:** @@ -249,7 +249,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::GetStreamAttributes ([out] struct StreamAttribute[] attributes) ``` -**描述:** +**描述:** 获取流的属性。通过该接口获取的流属性可能会和[CreateStreams](#createstreams)输入的流信息存在差异。 @@ -263,7 +263,7 @@ IStreamOperator::GetStreamAttributes ([out] struct StreamAttribute[] attributes) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### IsStreamsSupported() @@ -273,7 +273,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::IsStreamsSupported ([in] enum OperationMode mode, [in] unsigned char[] modeSetting, [in] struct StreamInfo[] infos, [out] enum StreamSupportType type ) ``` -**描述:** +**描述:** 查询是否支持添加参数对应的流。 @@ -289,16 +289,16 @@ IStreamOperator::IsStreamsSupported ([in] enum OperationMode mode, [in] unsigned | 名称 | 描述 | | -------- | -------- | -| mode | 流的使用模式,支持的模式参考[OperationMode](camera.md#operationmode)。 | +| mode | 流的使用模式,支持的模式参考[OperationMode](_camera.md#operationmode)。 | | modeSetting | 流的配置,包括帧率,3A等配置信息。3A:自动曝光 (AE)、自动聚焦 (AF)、自动白平衡 (AWB) | | infos | 流的配置信息,具体参考[StreamInfo](_stream_info.md)。 | -| type | 对动态配置流的支持类型,支持类型定义在[StreamSupportType](camera.md#streamsupporttype)。 | +| type | 对动态配置流的支持类型,支持类型定义在[StreamSupportType](_camera.md#streamsupporttype)。 | **返回:** NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 ### ReleaseStreams() @@ -308,7 +308,7 @@ NO_ERROR 表示执行成功。 IStreamOperator::ReleaseStreams ([in] int[] streamIds) ``` -**描述:** +**描述:** 释放流。 @@ -322,4 +322,4 @@ IStreamOperator::ReleaseStreams ([in] int[] streamIds) NO_ERROR 表示执行成功。 -其他值表示执行失败,具体错误码查看[CamRetCode](camera.md#camretcode)。 +其他值表示执行失败,具体错误码查看[CamRetCode](_camera.md#camretcode)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator_callback.md index 0c1293b76174281509b427abc30d78bd51b17b55..928651bf44b18c0c3f097243e262d011f7ddb247 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_stream_operator_callback.md @@ -1,7 +1,7 @@ # IStreamOperatorCallback -## **概述** +## 概述 定义Camera设备流回调操作。 @@ -9,10 +9,10 @@ **相关模块:** -[Camera](camera.md) +[Camera](_camera.md) -## **汇总** +## 汇总 ### Public 成员函数 @@ -25,7 +25,7 @@ | [OnFrameShutter](#onframeshutter) ([in] int captureId, [in] int[] streamIds, [in] unsigned long timestamp) | 帧捕获回调。 | -## **成员函数说明** +## 成员函数说明 ### OnCaptureEnded() @@ -35,7 +35,7 @@ IStreamOperatorCallback::OnCaptureEnded ([in] int captureId, [in] struct CaptureEndedInfo[] infos ) ``` -**描述:** +**描述:** 捕获结束回调,在捕获结束时调用。 @@ -58,7 +58,7 @@ IStreamOperatorCallback::OnCaptureEnded ([in] int captureId, [in] struct Capture IStreamOperatorCallback::OnCaptureError ([in] int captureId, [in] struct CaptureErrorInfo[] infos ) ``` -**描述:** +**描述:** 捕获错误回调,在捕获过程中发生错误时调用。 @@ -77,7 +77,7 @@ IStreamOperatorCallback::OnCaptureError ([in] int captureId, [in] struct Capture IStreamOperatorCallback::OnCaptureStarted ([in] int captureId, [in] int[] streamIds ) ``` -**描述:** +**描述:** 捕获开始回调,在捕获开始时调用。 @@ -100,11 +100,11 @@ IStreamOperatorCallback::OnCaptureStarted ([in] int captureId, [in] int[] stream IStreamOperatorCallback::OnFrameShutter ([in] int captureId, [in] int[] streamIds, [in] unsigned long timestamp ) ``` -**描述:** +**描述:** 帧捕获回调。 -通过**Capture**的输入参数[CaptureInfo](_capture_info.md)的enableShutterCallback_使能该回调, 使能后每次捕获均会触发此回调。 +通过[Capture](interface_i_stream_operator.md#capture)的输入参数[CaptureInfo](_capture_info.md)的enableShutterCallback_使能该回调, 使能后每次捕获均会触发此回调。 **参数:** @@ -116,4 +116,4 @@ IStreamOperatorCallback::OnFrameShutter ([in] int captureId, [in] int[] streamId **参见:** -Capture +[Capture](interface_i_stream_operator.md#capture) diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_callback.md index 96d23ab5bea3795d727408cd8be19ef490f957b7..51a04d18de365fffe51f0af530b454bb0508bd03 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_callback.md @@ -1,32 +1,30 @@ # IThermalCallback -## **概述** +## 概述 订阅设备发热状态的回调。 服务创建此回调对象后,可以调用[IThermalInterface](interface_i_thermal_interface.md)的接口注册回调,从而订阅设备发热状态的变化。 **Since:** - 3.1 - **相关模块:** [Thermal](thermal.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OnThermalDataEvent](#onthermaldataevent) ([in] struct [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) event) | 设备发热状态变化的回调方法。 | +| [OnThermalDataEvent](#onthermaldataevent) ([in] struct [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) event) | 设备发热状态变化的回调方法。  | -## **成员函数说明** +## 成员函数说明 ### OnThermalDataEvent() @@ -35,9 +33,7 @@ ``` IThermalCallback::OnThermalDataEvent ([in] struct HdfThermalCallbackInfo event) ``` - -**描述:** - +**描述:** 设备发热状态变化的回调方法。 当设备发热状态发生变化时,将通过此方法的参数返回给服务。 @@ -46,7 +42,7 @@ IThermalCallback::OnThermalDataEvent ([in] struct HdfThermalCallbackInfo event) | 名称 | 描述 | | -------- | -------- | -| event | 设备发热信息,包括器件类型、器件温度。 | +| event | 输入参数,设备发热信息,包括器件类型、器件温度。  | **参见:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_interface.md index d911533f458425c6c0e5afe889500d55de599b07..46263dadf08b992893b004161362dbdb19617f9a 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_thermal_interface.md @@ -1,37 +1,35 @@ # IThermalInterface -## **概述** +## 概述 设备温度管理、控制及订阅接口。 服务获取此对象后,可以调用相关的接口管理、控制和订阅设备温度。 -**Since:** - +**Since:** 3.1 - **相关模块:** [Thermal](thermal.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [SetCpuFreq](#setcpufreq) ([in] int freq) | 设置CPU频率。 | -| [SetGpuFreq](#setgpufreq) ([in] int freq) | 设置GPU频率。 | -| [SetBatteryCurrent](#setbatterycurrent) ([in] int current) | 设置充电电流。 | -| [GetThermalZoneInfo](#getthermalzoneinfo) ([out] struct [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) event) | 获取设备发热的信息。 | -| [Register](#register) ([in] [IThermalCallback](interface_i_thermal_callback.md) callbackObj) | 注册设备发热状态的回调。 | -| [Unregister](#unregister) () | 取消注册设备发热状态的回调。 | +| [SetCpuFreq](#setcpufreq) ([in] int freq) | 设置CPU频率。  | +| [SetGpuFreq](#setgpufreq) ([in] int freq) | 设置GPU频率。  | +| [SetBatteryCurrent](#setbatterycurrent) ([in] int current) | 设置充电电流。  | +| [GetThermalZoneInfo](#getthermalzoneinfo) ([out] struct [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) event) | 获取设备发热的信息。  | +| [Register](#register) ([in] [IThermalCallback](interface_i_thermal_callback.md) callbackObj) | 注册设备发热状态的回调。  | +| [Unregister](#unregister) () | 取消注册设备发热状态的回调。  | -## **成员函数说明** +## 成员函数说明 ### GetThermalZoneInfo() @@ -40,9 +38,7 @@ ``` IThermalInterface::GetThermalZoneInfo ([out] struct HdfThermalCallbackInfo event) ``` - -**描述:** - +**描述:** 获取设备发热的信息。 **参数:** @@ -66,9 +62,7 @@ HDF_SUCCESS 表示获取成功。 ``` IThermalInterface::Register ([in] IThermalCallback callbackObj) ``` - -**描述:** - +**描述:** 注册设备发热状态的回调。 **参数:** @@ -92,9 +86,7 @@ HDF_SUCCESS 表示注册成功。 ``` IThermalInterface::SetBatteryCurrent ([in] int current) ``` - -**描述:** - +**描述:** 设置充电电流。 **参数:** @@ -114,9 +106,7 @@ HDF_SUCCESS 表示设置成功 ``` IThermalInterface::SetCpuFreq ([in] int freq) ``` - -**描述:** - +**描述:** 设置CPU频率。 **参数:** @@ -136,9 +126,7 @@ HDF_SUCCESS 表示设置成功。 ``` IThermalInterface::SetGpuFreq ([in] int freq) ``` - -**描述:** - +**描述:** 设置GPU频率。 **参数:** @@ -158,9 +146,7 @@ HDF_SUCCESS 表示设置成功。 ``` IThermalInterface::Unregister () ``` - -**描述:** - +**描述:** 取消注册设备发热状态的回调。 **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_usb_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_usb_interface.md index 214049b2314770756eb8da433404716a06de8503..4275d101c485a3e600e6a8f9b299db6b9eeb3c6e 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_usb_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_usb_interface.md @@ -1,7 +1,7 @@ # IUsbInterface -## **概述** +## 概述 定义USB驱动基本的操作功能。 @@ -9,53 +9,53 @@ **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OpenDevice](#opendevice) ([in] struct [UsbDev](_usb_dev.md) dev) | 打开设备,建立连接。 | -| [CloseDevice](#closedevice) ([in] struct [UsbDev](_usb_dev.md) dev) | 关闭设备,释放与设备相关的所有系统资源。 | -| [GetDeviceDescriptor](#getdevicedescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char[] descriptor) | 获取设备描述符,设备描述符提供了关于设备、设备的配置以及任何设备所归属的类的信息。 | -| [GetStringDescriptor](#getstringdescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char descId, [out] unsigned char[] descriptor) | 根据设备的字符串ID获取字符串描述符,字符串描述符是提供一些设备接口相关的描述性信息,比如厂商的名字、产品序列号等。 | -| [GetConfigDescriptor](#getconfigdescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char descId, [out] unsigned char[] descriptor) | 根据设备的配置ID获取配置描述符,配置描述符包含有关配置及其接口、备用设置及其终结点的信息。 | -| [GetRawDescriptor](#getrawdescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char[] descriptor) | 获取USB设备的原始描述符。 | -| [GetFileDescriptor](#getfiledescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [out] int fd) | 获取USB设备的文件描述符。 | -| [SetConfig](#setconfig) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char configIndex) | 设置USB设备当前的配置信息,USB设备被主机配置过后,主机可以使用设备提供的所有功能。 | -| [GetConfig](#getconfig) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char configIndex) | 获取USB设备当前的配置信息。 | -| [ClaimInterface](#claiminterface) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char interfaceid, [in] unsigned char force) | 打开USB设备的接口并声明独占,必须在数据传输前执行。 | -| [ReleaseInterface](#releaseinterface) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char interfaceid) | 在停止数据传输后关闭占用的USB设备接口,并释放相关资源。 | -| [SetInterface](#setinterface) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char interfaceid, [in] unsigned char altIndex) | 设置USB设备指定接口的备选设置,用于在具有相同ID但不同备用设置的两个接口之间进行选择。 | -| [BulkTransferRead](#bulktransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [out] unsigned char[] data) | 在USB设备指定端点方向为读取时,执行批量数据读取。 | -| [BulkTransferWrite](#bulktransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [in] unsigned char[] data) | 在USB设备指定端点方向为写入时,执行批量数据写入。 | -| [ControlTransferRead](#controltransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbCtrlTransfer](_usb_ctrl_transfer.md) ctrl, [out] unsigned char[] data) | 在传输状态为读取并且控制端点是端点零时,对USB设备执行控制传输。 | -| [ControlTransferWrite](#controltransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbCtrlTransfer](_usb_ctrl_transfer.md) ctrl, [in] unsigned char[] data) | 在传输状态为写入并且控制端点是端点零时,对USB设备执行控制传输。 | -| [InterruptTransferRead](#interrupttransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [out] unsigned char[] data) | 在USB设备指定端点方向为数据读取时执行中断数据读取。 | -| [InterruptTransferWrite](#interrupttransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [in] unsigned char[] data) | 在USB设备指定端点方向为写入时执行中断数据写入。 | -| [IsoTransferRead](#isotransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [out] unsigned char[] data) | 在USB设备指定端点方向为读取时执行等时数据读取。 | -| [IsoTransferWrite](#isotransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [in] unsigned char[] data) | 在USB设备指定端点方向为写入时执行等时数据写入。 | -| [RequestQueue](#requestqueue) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] unsigned char[] clientData, [in] unsigned char[] buffer) | 在USB设备指定端点上进行异步数据发送或者接收请求,数据传输方向由端点方向决定。 | -| [RequestWait](#requestwait) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char[] clientData, [out] unsigned char[] buffer, [in] int timeout) | 等待RequestQueue异步请求的操作结果。 | -| [RequestCancel](#requestcancel) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe) | 取消待处理的数据请求。 | -| [GetCurrentFunctions](#getcurrentfunctions) ([out] int funcs) | 获取USB设备当前的功能(按位域表示)。 | -| [SetCurrentFunctions](#setcurrentfunctions) ([in] int funcs) | 设置USB设备当前的功能(按位域表示)。 | -| [SetPortRole](#setportrole) ([in] int portId, [in] int powerRole, [in] int dataRole) | 设置USB设备端口的角色。 | -| [QueryPort](#queryport) ([out] int portId, [out] int powerRole, [out] int dataRole, [out] int mode) | 查询USB设备端口的当前设置信息。 | -| [BindUsbdSubscriber](#bindusbdsubscriber) ([in] [IUsbdSubscriber](interface_i_usbd_subscriber.md) subscriber) | 绑定订阅者。 | -| [UnbindUsbdSubscriber](#unbindusbdsubscriber) ([in] [IUsbdSubscriber](interface_i_usbd_subscriber.md) subscriber) | 解绑订阅者。 | -| [RegBulkCallback](#regbulkcallback) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) cb) | 注册批量传输异步回调函数。 | -| [UnRegBulkCallback](#unregbulkcallback) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe) | 注销批量传输异步回调函数。 | -| [BulkRead](#bulkread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] Ashmem ashmem) | 批量传输异步读数据。 | -| [BulkWrite](#bulkwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] Ashmem ashmem) | 批量传输异步写数据。 | -| [BulkCancel](#bulkcancel) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe) | 批量传输异步取消接口,用于取消当前接口的异步批量读写操作。 | - - -## **成员函数说明** +| [OpenDevice](#opendevice) ([in] struct [UsbDev](_usb_dev.md) dev) | 打开设备,建立连接。  | +| [CloseDevice](#closedevice) ([in] struct [UsbDev](_usb_dev.md) dev) | 关闭设备,释放与设备相关的所有系统资源。  | +| [GetDeviceDescriptor](#getdevicedescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char[] descriptor) | 获取设备描述符,设备描述符提供了关于设备、设备的配置以及任何设备所归属的类的信息。  | +| [GetStringDescriptor](#getstringdescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char descId, [out] unsigned char[] descriptor) | 根据设备的字符串ID获取字符串描述符,字符串描述符是提供一些设备接口相关的描述性信息,比如厂商的名字、产品序列号等。  | +| [GetConfigDescriptor](#getconfigdescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char descId, [out] unsigned char[] descriptor) | 根据设备的配置ID获取配置描述符,配置描述符包含有关配置及其接口、备用设置及其终结点的信息。  | +| [GetRawDescriptor](#getrawdescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char[] descriptor) | 获取USB设备的原始描述符。  | +| [GetFileDescriptor](#getfiledescriptor) ([in] struct [UsbDev](_usb_dev.md) dev, [out] int fd) | 获取USB设备的文件描述符。  | +| [SetConfig](#setconfig) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char configIndex) | 设置USB设备当前的配置信息,USB设备被主机配置过后,主机可以使用设备提供的所有功能。  | +| [GetConfig](#getconfig) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char configIndex) | 获取USB设备当前的配置信息。  | +| [ClaimInterface](#claiminterface) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char interfaceid, [in] unsigned char force) | 打开USB设备的接口并声明独占,必须在数据传输前执行。  | +| [ReleaseInterface](#releaseinterface) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char interfaceid) | 在停止数据传输后关闭占用的USB设备接口,并释放相关资源。  | +| [SetInterface](#setinterface) ([in] struct [UsbDev](_usb_dev.md) dev, [in] unsigned char interfaceid, [in] unsigned char altIndex) | 设置USB设备指定接口的备选设置,用于在具有相同ID但不同备用设置的两个接口之间进行选择。  | +| [BulkTransferRead](#bulktransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [out] unsigned char[] data) | 在USB设备指定端点方向为读取时,执行批量数据读取。  | +| [BulkTransferWrite](#bulktransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [in] unsigned char[] data) | 在USB设备指定端点方向为写入时,执行批量数据写入。  | +| [ControlTransferRead](#controltransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbCtrlTransfer](_usb_ctrl_transfer.md) ctrl, [out] unsigned char[] data) | 在传输状态为读取并且控制端点是端点零时,对USB设备执行控制传输。  | +| [ControlTransferWrite](#controltransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbCtrlTransfer](_usb_ctrl_transfer.md) ctrl, [in] unsigned char[] data) | 在传输状态为写入并且控制端点是端点零时,对USB设备执行控制传输。  | +| [InterruptTransferRead](#interrupttransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [out] unsigned char[] data) | 在USB设备指定端点方向为数据读取时执行中断数据读取。  | +| [InterruptTransferWrite](#interrupttransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [in] unsigned char[] data) | 在USB设备指定端点方向为写入时执行中断数据写入。  | +| [IsoTransferRead](#isotransferread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [out] unsigned char[] data) | 在USB设备指定端点方向为读取时执行等时数据读取。  | +| [IsoTransferWrite](#isotransferwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] int timeout, [in] unsigned char[] data) | 在USB设备指定端点方向为写入时执行等时数据写入。  | +| [RequestQueue](#requestqueue) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] unsigned char[] clientData, [in] unsigned char[] buffer) | 在USB设备指定端点上进行异步数据发送或者接收请求,数据传输方向由端点方向决定。  | +| [RequestWait](#requestwait) ([in] struct [UsbDev](_usb_dev.md) dev, [out] unsigned char[] clientData, [out] unsigned char[] buffer, [in] int timeout) | 等待RequestQueue异步请求的操作结果。  | +| [RequestCancel](#requestcancel) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe) | 取消待处理的数据请求。  | +| [GetCurrentFunctions](#getcurrentfunctions) ([out] int funcs) | 获取USB设备当前的功能(按位域表示)。  | +| [SetCurrentFunctions](#setcurrentfunctions) ([in] int funcs) | 设置USB设备当前的功能(按位域表示)。  | +| [SetPortRole](#setportrole) ([in] int portId, [in] int powerRole, [in] int dataRole) | 设置USB设备端口的角色。  | +| [QueryPort](#queryport) ([out] int portId, [out] int powerRole, [out] int dataRole, [out] int mode) | 查询USB设备端口的当前设置信息。  | +| [BindUsbdSubscriber](#bindusbdsubscriber) ([in] [IUsbdSubscriber](interface_i_usbd_subscriber.md) subscriber) | 绑定订阅者。  | +| [UnbindUsbdSubscriber](#unbindusbdsubscriber) ([in] [IUsbdSubscriber](interface_i_usbd_subscriber.md) subscriber) | 解绑订阅者。  | +| [RegBulkCallback](#regbulkcallback) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] [IUsbdBulkCallback](interface_i_usbd_bulk_callback.md) cb) | 注册批量传输异步回调函数。  | +| [UnRegBulkCallback](#unregbulkcallback) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe) | 注销批量传输异步回调函数。  | +| [BulkRead](#bulkread) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] Ashmem ashmem) | 批量传输异步读数据。  | +| [BulkWrite](#bulkwrite) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe, [in] Ashmem ashmem) | 批量传输异步写数据。  | +| [BulkCancel](#bulkcancel) ([in] struct [UsbDev](_usb_dev.md) dev, [in] struct [UsbPipe](_usb_pipe.md) pipe) | 批量传输异步取消接口,用于取消当前接口的异步批量读写操作。  | + + +## 成员函数说明 ### BindUsbdSubscriber() @@ -64,9 +64,7 @@ ``` IUsbInterface::BindUsbdSubscriber ([in] IUsbdSubscriber subscriber) ``` - -**描述:** - +**描述:** 绑定订阅者。 **参数:** @@ -88,16 +86,14 @@ IUsbInterface::BindUsbdSubscriber ([in] IUsbdSubscriber subscriber) ``` IUsbInterface::BulkCancel ([in] struct UsbDev dev, [in] struct UsbPipe pipe ) ``` - -**描述:** - +**描述:** 批量传输异步取消接口,用于取消当前接口的异步批量读写操作。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | **返回:** @@ -113,17 +109,15 @@ IUsbInterface::BulkCancel ([in] struct UsbDev dev, [in] struct UsbPipe pipe ) ``` IUsbInterface::BulkRead ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] Ashmem ashmem ) ``` - -**描述:** - +**描述:** 批量传输异步读数据。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | | ashmem | 共享内存,用于存放读取的数据。 | **返回:** @@ -139,18 +133,16 @@ IUsbInterface::BulkRead ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] ``` IUsbInterface::BulkTransferRead ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [out] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在USB设备指定端点方向为读取时,执行批量数据读取。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | -| timeout | 超时时间。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | +| timeout | 超时时间。  | | data | 读取的数据。 | **返回:** @@ -166,18 +158,16 @@ IUsbInterface::BulkTransferRead ([in] struct UsbDev dev, [in] struct UsbPipe pip ``` IUsbInterface::BulkTransferWrite ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在USB设备指定端点方向为写入时,执行批量数据写入。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | -| timeout | 超时时间。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | +| timeout | 超时时间。  | | data | 写入的数据。 | **返回:** @@ -193,17 +183,15 @@ IUsbInterface::BulkTransferWrite ([in] struct UsbDev dev, [in] struct UsbPipe pi ``` IUsbInterface::BulkWrite ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] Ashmem ashmem ) ``` - -**描述:** - +**描述:** 批量传输异步写数据。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | | ashmem | 为共享内存,用于存放需要写入的数据。 | **返回:** @@ -219,17 +207,15 @@ IUsbInterface::BulkWrite ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] ``` IUsbInterface::ClaimInterface ([in] struct UsbDev dev, [in] unsigned char interfaceid, [in] unsigned char force ) ``` - -**描述:** - +**描述:** 打开USB设备的接口并声明独占,必须在数据传输前执行。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| interfaceid | USB设备接口ID。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| interfaceid | USB设备接口ID。  | | force | 是否强制,1表示强制,0表示不强制。 | **返回:** @@ -245,9 +231,7 @@ IUsbInterface::ClaimInterface ([in] struct UsbDev dev, [in] unsigned char interf ``` IUsbInterface::CloseDevice ([in] struct UsbDev dev) ``` - -**描述:** - +**描述:** 关闭设备,释放与设备相关的所有系统资源。 **参数:** @@ -269,17 +253,15 @@ IUsbInterface::CloseDevice ([in] struct UsbDev dev) ``` IUsbInterface::ControlTransferRead ([in] struct UsbDev dev, [in] struct UsbCtrlTransfer ctrl, [out] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在传输状态为读取并且控制端点是端点零时,对USB设备执行控制传输。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| ctrl | USB设备控制数据,详见[UsbCtrlTransfer](_usb_ctrl_transfer.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| ctrl | USB设备控制数据,详见[UsbCtrlTransfer](_usb_ctrl_transfer.md)。  | | data | 读取的数据。 | **返回:** @@ -295,17 +277,15 @@ IUsbInterface::ControlTransferRead ([in] struct UsbDev dev, [in] struct UsbCtrlT ``` IUsbInterface::ControlTransferWrite ([in] struct UsbDev dev, [in] struct UsbCtrlTransfer ctrl, [in] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在传输状态为写入并且控制端点是端点零时,对USB设备执行控制传输。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| ctrl | USB设备控制数据,详见[UsbCtrlTransfer](_usb_ctrl_transfer.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| ctrl | USB设备控制数据,详见[UsbCtrlTransfer](_usb_ctrl_transfer.md)。  | | data | 写入的数据。 | **返回:** @@ -321,16 +301,14 @@ IUsbInterface::ControlTransferWrite ([in] struct UsbDev dev, [in] struct UsbCtrl ``` IUsbInterface::GetConfig ([in] struct UsbDev dev, [out] unsigned char configIndex ) ``` - -**描述:** - +**描述:** 获取USB设备当前的配置信息。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | configIndex | USB设备配置信息的字符串描述符索引值(数字字符串)。 | **返回:** @@ -346,17 +324,15 @@ IUsbInterface::GetConfig ([in] struct UsbDev dev, [out] unsigned char configInde ``` IUsbInterface::GetConfigDescriptor ([in] struct UsbDev dev, [in] unsigned char descId, [out] unsigned char[] descriptor ) ``` - -**描述:** - +**描述:** 根据设备的配置ID获取配置描述符,配置描述符包含有关配置及其接口、备用设置及其终结点的信息。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| descId | USB设备的配置ID。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| descId | USB设备的配置ID。  | | descriptor | 获取USB设备配置信息。 | **返回:** @@ -372,9 +348,7 @@ IUsbInterface::GetConfigDescriptor ([in] struct UsbDev dev, [in] unsigned char d ``` IUsbInterface::GetCurrentFunctions ([out] int funcs) ``` - -**描述:** - +**描述:** 获取USB设备当前的功能(按位域表示)。 **参数:** @@ -396,16 +370,14 @@ IUsbInterface::GetCurrentFunctions ([out] int funcs) ``` IUsbInterface::GetDeviceDescriptor ([in] struct UsbDev dev, [out] unsigned char[] descriptor ) ``` - -**描述:** - +**描述:** 获取设备描述符,设备描述符提供了关于设备、设备的配置以及任何设备所归属的类的信息。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | descriptor | USB设备的描述符信息。 | **返回:** @@ -421,16 +393,14 @@ IUsbInterface::GetDeviceDescriptor ([in] struct UsbDev dev, [out] unsigned char[ ``` IUsbInterface::GetFileDescriptor ([in] struct UsbDev dev, [out] int fd ) ``` - -**描述:** - +**描述:** 获取USB设备的文件描述符。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | fd | USB设备的文件描述符。 | **返回:** @@ -446,16 +416,14 @@ IUsbInterface::GetFileDescriptor ([in] struct UsbDev dev, [out] int fd ) ``` IUsbInterface::GetRawDescriptor ([in] struct UsbDev dev, [out] unsigned char[] descriptor ) ``` - -**描述:** - +**描述:** 获取USB设备的原始描述符。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | descriptor | USB设备的原始描述符。 | **返回:** @@ -471,17 +439,15 @@ IUsbInterface::GetRawDescriptor ([in] struct UsbDev dev, [out] unsigned char[] d ``` IUsbInterface::GetStringDescriptor ([in] struct UsbDev dev, [in] unsigned char descId, [out] unsigned char[] descriptor ) ``` - -**描述:** - +**描述:** 根据设备的字符串ID获取字符串描述符,字符串描述符是提供一些设备接口相关的描述性信息,比如厂商的名字、产品序列号等。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| descId | USB设备的描述符ID。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| descId | USB设备的描述符ID。  | | descriptor | 获取USB设备的字符串描述符。 | **返回:** @@ -497,18 +463,16 @@ IUsbInterface::GetStringDescriptor ([in] struct UsbDev dev, [in] unsigned char d ``` IUsbInterface::InterruptTransferRead ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [out] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在USB设备指定端点方向为数据读取时执行中断数据读取。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | -| timeout | 超时时间。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | +| timeout | 超时时间。  | | data | 读取的数据。 | **返回:** @@ -524,18 +488,16 @@ IUsbInterface::InterruptTransferRead ([in] struct UsbDev dev, [in] struct UsbPip ``` IUsbInterface::InterruptTransferWrite ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在USB设备指定端点方向为写入时执行中断数据写入。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | -| timeout | 超时时间。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | +| timeout | 超时时间。  | | data | 写入的数据。 | **返回:** @@ -551,18 +513,16 @@ IUsbInterface::InterruptTransferWrite ([in] struct UsbDev dev, [in] struct UsbPi ``` IUsbInterface::IsoTransferRead ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [out] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在USB设备指定端点方向为读取时执行等时数据读取。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | -| timeout | 超时时间。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | +| timeout | 超时时间。  | | data | 读取的数据。 | **返回:** @@ -578,18 +538,16 @@ IUsbInterface::IsoTransferRead ([in] struct UsbDev dev, [in] struct UsbPipe pipe ``` IUsbInterface::IsoTransferWrite ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] int timeout, [in] unsigned char[] data ) ``` - -**描述:** - +**描述:** 在USB设备指定端点方向为写入时执行等时数据写入。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | -| timeout | 超时时间。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | +| timeout | 超时时间。  | | data | 写入的数据。 | **返回:** @@ -605,9 +563,7 @@ IUsbInterface::IsoTransferWrite ([in] struct UsbDev dev, [in] struct UsbPipe pip ``` IUsbInterface::OpenDevice ([in] struct UsbDev dev) ``` - -**描述:** - +**描述:** 打开设备,建立连接。 **参数:** @@ -629,18 +585,16 @@ IUsbInterface::OpenDevice ([in] struct UsbDev dev) ``` IUsbInterface::QueryPort ([out] int portId, [out] int powerRole, [out] int dataRole, [out] int mode ) ``` - -**描述:** - +**描述:** 查询USB设备端口的当前设置信息。 **参数:** | 名称 | 描述 | | -------- | -------- | -| portId | USB设备端口ID。 | -| powerRole | USB设备电源角色。 | -| dataRole | USB设备数据角色。 | +| portId | USB设备端口ID。  | +| powerRole | USB设备电源角色。  | +| dataRole | USB设备数据角色。  | | mode | USB设备模式。 | **返回:** @@ -656,17 +610,15 @@ IUsbInterface::QueryPort ([out] int portId, [out] int powerRole, [out] int dataR ``` IUsbInterface::RegBulkCallback ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] IUsbdBulkCallback cb ) ``` - -**描述:** - +**描述:** 注册批量传输异步回调函数。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | | cb | 回调函数对象,详见[IUsbdBulkCallback](interface_i_usbd_bulk_callback.md)。 | **返回:** @@ -682,16 +634,14 @@ IUsbInterface::RegBulkCallback ([in] struct UsbDev dev, [in] struct UsbPipe pipe ``` IUsbInterface::ReleaseInterface ([in] struct UsbDev dev, [in] unsigned char interfaceid ) ``` - -**描述:** - +**描述:** 在停止数据传输后关闭占用的USB设备接口,并释放相关资源。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | interfaceid | USB设备接口ID。 | **返回:** @@ -707,16 +657,14 @@ IUsbInterface::ReleaseInterface ([in] struct UsbDev dev, [in] unsigned char inte ``` IUsbInterface::RequestCancel ([in] struct UsbDev dev, [in] struct UsbPipe pipe ) ``` - -**描述:** - +**描述:** 取消待处理的数据请求。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | **返回:** @@ -732,18 +680,16 @@ IUsbInterface::RequestCancel ([in] struct UsbDev dev, [in] struct UsbPipe pipe ) ``` IUsbInterface::RequestQueue ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [in] unsigned char[] clientData, [in] unsigned char[] buffer ) ``` - -**描述:** - +**描述:** 在USB设备指定端点上进行异步数据发送或者接收请求,数据传输方向由端点方向决定。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | -| clientData | 用户数据。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。  | +| clientData | 用户数据。  | | buffer | 传输的数据。 | **返回:** @@ -759,18 +705,16 @@ IUsbInterface::RequestQueue ([in] struct UsbDev dev, [in] struct UsbPipe pipe, [ ``` IUsbInterface::RequestWait ([in] struct UsbDev dev, [out] unsigned char[] clientData, [out] unsigned char[] buffer, [in] int timeout ) ``` - -**描述:** - +**描述:** 等待RequestQueue异步请求的操作结果。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| clientData | 用户数据。 | -| buffer | 传输的数据。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| clientData | 用户数据。  | +| buffer | 传输的数据。  | | timeout | 超时时间。 | **返回:** @@ -786,16 +730,14 @@ IUsbInterface::RequestWait ([in] struct UsbDev dev, [out] unsigned char[] client ``` IUsbInterface::SetConfig ([in] struct UsbDev dev, [in] unsigned char configIndex ) ``` - -**描述:** - +**描述:** 设置USB设备当前的配置信息,USB设备被主机配置过后,主机可以使用设备提供的所有功能。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | configIndex | USB设备配置信息的字符串描述符索引值(数字字符串)。 | **返回:** @@ -811,9 +753,7 @@ IUsbInterface::SetConfig ([in] struct UsbDev dev, [in] unsigned char configIndex ``` IUsbInterface::SetCurrentFunctions ([in] int funcs) ``` - -**描述:** - +**描述:** 设置USB设备当前的功能(按位域表示)。 **参数:** @@ -835,17 +775,15 @@ IUsbInterface::SetCurrentFunctions ([in] int funcs) ``` IUsbInterface::SetInterface ([in] struct UsbDev dev, [in] unsigned char interfaceid, [in] unsigned char altIndex ) ``` - -**描述:** - +**描述:** 设置USB设备指定接口的备选设置,用于在具有相同ID但不同备用设置的两个接口之间进行选择。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | -| interfaceid | USB设备接口ID。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | +| interfaceid | USB设备接口ID。  | | altIndex | USB设备接口的备用设置信息。 | **返回:** @@ -861,17 +799,15 @@ IUsbInterface::SetInterface ([in] struct UsbDev dev, [in] unsigned char interfac ``` IUsbInterface::SetPortRole ([in] int portId, [in] int powerRole, [in] int dataRole ) ``` - -**描述:** - +**描述:** 设置USB设备端口的角色。 **参数:** | 名称 | 描述 | | -------- | -------- | -| portId | USB设备端口ID。 | -| powerRole | 电源角色的值。 | +| portId | USB设备端口ID。  | +| powerRole | 电源角色的值。  | | dataRole | 数据角色的值。 | **返回:** @@ -887,9 +823,7 @@ IUsbInterface::SetPortRole ([in] int portId, [in] int powerRole, [in] int dataRo ``` IUsbInterface::UnbindUsbdSubscriber ([in] IUsbdSubscriber subscriber) ``` - -**描述:** - +**描述:** 解绑订阅者。 **参数:** @@ -911,16 +845,14 @@ IUsbInterface::UnbindUsbdSubscriber ([in] IUsbdSubscriber subscriber) ``` IUsbInterface::UnRegBulkCallback ([in] struct UsbDev dev, [in] struct UsbPipe pipe ) ``` - -**描述:** - +**描述:** 注销批量传输异步回调函数。 **参数:** | 名称 | 描述 | | -------- | -------- | -| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。 | +| dev | USB设备地址信息,详见[UsbDev](_usb_dev.md)。  | | pipe | USB设备管道信息,详见[UsbPipe](_usb_pipe.md)。 | **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_bulk_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_bulk_callback.md index e533f6c6902b02b964b700fc67d532c4434145c4..ed2ac7c2b420bf73af78b9e13e3ad2f70b986b47 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_bulk_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_bulk_callback.md @@ -1,37 +1,33 @@ # IUsbdBulkCallback -## **概述** +## 概述 USB驱动的回调函数。 当USB驱动进行批量传输异步读/写数据时调用回调函数,处理对应的结果。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [OnBulkWriteCallback](#onbulkwritecallback) ([in] int status, [in] int actLength) | 批量写数据的回调函数。 | -| [OnBulkReadCallback](#onbulkreadcallback) ([in] int status, [in] int actLength) | 批量读数据的回调函数。 | +| [OnBulkWriteCallback](#onbulkwritecallback) ([in] int status, [in] int actLength) | 批量写数据的回调函数。  | +| [OnBulkReadCallback](#onbulkreadcallback) ([in] int status, [in] int actLength) | 批量读数据的回调函数。  | -## **成员函数说明** +## 成员函数说明 ### OnBulkReadCallback() @@ -40,16 +36,14 @@ USB驱动的回调函数。 ``` IUsbdBulkCallback::OnBulkReadCallback ([in] int status, [in] int actLength ) ``` - -**描述:** - +**描述:** 批量读数据的回调函数。 **参数:** | 名称 | 描述 | | -------- | -------- | -| status | 完成状态。 | +| status | 完成状态。  | | actLength | 读数据时实际接收的数据长度。 | **返回:** @@ -65,16 +59,14 @@ IUsbdBulkCallback::OnBulkReadCallback ([in] int status, [in] int actLength ) ``` IUsbdBulkCallback::OnBulkWriteCallback ([in] int status, [in] int actLength ) ``` - -**描述:** - +**描述:** 批量写数据的回调函数。 **参数:** | 名称 | 描述 | | -------- | -------- | -| status | 完成状态。 | +| status | 完成状态。  | | actLength | 写数据时实际发送的数据长度。 | **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_subscriber.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_subscriber.md index bcd7aef290c7cda9b8f80c06b3e51d98bf43140a..44d4dc94976fc9b79b0199698765c2f803600ad5 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_subscriber.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_usbd_subscriber.md @@ -1,7 +1,7 @@ # IUsbdSubscriber -## **概述** +## 概述 定义USB驱动的订阅类相关函数。 @@ -9,21 +9,21 @@ **相关模块:** -[USB](usb.md) +[USB](_u_s_b.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [DeviceEvent](#deviceevent) ([in] struct [USBDeviceInfo](_u_s_b_device_info.md) info) | 设备状态改变事件。 | -| [PortChangedEvent](#portchangedevent) ([in] struct [PortInfo](_port_info.md) info) | 端口改变事件。 | +| [DeviceEvent](#deviceevent) ([in] struct [USBDeviceInfo](_u_s_b_device_info.md) info) | 设备状态改变事件。  | +| [PortChangedEvent](#portchangedevent) ([in] struct [PortInfo](_port_info.md) info) | 端口改变事件。  | -## **成员函数说明** +## 成员函数说明 ### DeviceEvent() @@ -32,9 +32,7 @@ ``` IUsbdSubscriber::DeviceEvent ([in] struct USBDeviceInfo info) ``` - -**描述:** - +**描述:** 设备状态改变事件。 **参数:** @@ -56,9 +54,7 @@ IUsbdSubscriber::DeviceEvent ([in] struct USBDeviceInfo info) ``` IUsbdSubscriber::PortChangedEvent ([in] struct PortInfo info) ``` - -**描述:** - +**描述:** 端口改变事件。 **参数:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_user_auth_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_user_auth_interface.md index d6309d369b6fc7b664bc41c488f4a06ece3d08af..a843ba4b656f1c7adaa5ba03e415923aab1b48c4 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_user_auth_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_user_auth_interface.md @@ -1,54 +1,50 @@ # IUserAuthInterface -## **概述** +## 概述 声明用户认证驱动的API接口。 -**Since:** - +**Since:** 3.2 - -**Version:** - +**Version:** 1.0 - -**所属模块:** +**相关模块:** [HdfUserAuth](_hdf_user_auth.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [Init](#init)() | 初始化用户认证驱动缓存信息,用于用户认证框架进程启动时初始化信息。 | -| [AddExecutor](#addexecutor)([in] struct ExecutorRegisterInfo info, [out] unsigned long index, [out] unsigned char[] publicKey, [out] unsigned long[] templateIds) | 添加认证执行器来获取认证能力,用于各认证基础服务如口令认证服务等将认证能力对接到用户认证框架。 | -| [DeleteExecutor](#deleteexecutor)([in] unsigned long index) | 删除执行器,用于清理失效的执行器信息。 | -| [OpenSession](#opensession)([in] int userId, [out] unsigned char[] challenge) | 开启一个认证凭据管理会话,用于在请求管理用户认证凭据前获取有效挑战值。 | -| [CloseSession](#closesession)([in] int userId) | 关闭认证凭据管理会话,完成用户认证凭据管理请求处理后,调用该接口使原挑战值失效。 | -| [BeginEnrollment](#beginenrollment)([in] int userId, [in] unsigned char[] authToken, [in] struct EnrollParam param, [out] struct ScheduleInfo info) | 开始注册用户认证凭据。当注册凭据类型为口令且该用户已经注册了口令凭据时,将会更新口令凭据。 | -| [UpdateEnrollmentResult](#updateenrollmentresult)([in] int userId, [in] unsigned char[] scheduleResult, [out] unsigned long credentialId, [out] struct CredentialInfo oldInfo) | 更新用户凭据注册结果,完成凭据注册。 | -| [CancelEnrollment](#cancelenrollment)([in] int userId) | 取消注册请求。 | -| [DeleteCredential](#deletecredential)([in] int userId, [in] unsigned long credentialId, [in] unsigned char[] authToken, [out] struct CredentialInfo info) | 删除用户凭据信息。 | -| [GetCredential](#getcredential)([in] int userId, [in] enum AuthType authType, [out] struct CredentialInfo[] infos) | 查询用户凭据信息。 | -| [GetUserInfo](#getuserinfo) ([in] int userId, [out] unsigned long secureUid, [out] enum PinSubType pinSubType, [out] struct EnrolledInfo[] infos) | 查询用户认证相关信息。 | -| [DeleteUser](#deleteuser)([in] int userId, [in] unsigned char[] authToken, [out] struct CredentialInfo[] deletedInfos) | 删除用户口令认证凭据,在用户IAM系统内删除该用户,该请求由用户触发。 | -| [EnforceDeleteUser](#enforcedeleteuser)([in] int userId, [out] struct CredentialInfo[] deletedInfos) | 强制删除用户,该请求由系统内管理用户的模块触发。 | -| [BeginAuthentication](#beginauthentication)([in] unsigned long contextId, [in] struct AuthSolution param, [out] struct ScheduleInfo[] scheduleInfos) | 开始认证用户,并生成认证方案。 | -| [UpdateAuthenticationResult](#updateauthenticationresult)([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct AuthResultInfo info) | 更新认证结果,评估认证方案的认证结果。 | -| [CancelAuthentication](#cancelauthentication)([in] unsigned long contextId) | 取消用户认证请求。 | -| [BeginIdentification](#beginidentification)([in] unsigned long contextId, [in] enum AuthType authType, [in] unsigned char[] challenge, [in] unsigned int executorSensorHint, [out] struct ScheduleInfo scheduleInfo) | 开始用户身份识别,并生成识别方案。 | -| [UpdateIdentificationResult](#updateidentificationresult)([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct IdentifyResultInfo info) | 更新用户身份识别结果,生成身份识别方案的结果。 | -| [CancelIdentification](#cancelidentification)([in] unsigned long contextId) | 取消用户身份识别请求。 | -| [GetAuthTrustLevel](#getauthtrustlevel)([in] GetUserInfoint userId, [in] enum AuthType authType, [out] unsigned int authTrustLevel) | 获取当前认证类型的认证结果可信等级。 | -| [GetValidSolution](#getvalidsolution)([in] int userId, [in] enum AuthType[] authTypes, [in] unsigned int authTrustLevel, [out] enum AuthType[] validTypes) | 获取指定认证结果可信等级下有效的认证方式。 | - - -## **成员函数说明** +| [Init](#init) () | 初始化用户认证驱动缓存信息,用于用户认证框架进程启动时初始化信息。  | +| [AddExecutor](#addexecutor) ([in] struct [ExecutorRegisterInfo](_executor_register_info.md) info, [out] unsigned long index, [out] unsigned char[] publicKey, [out] unsigned long[] templateIds) | 添加认证执行器来获取认证能力,用于各认证基础服务如口令认证服务等将认证能力对接到用户认证框架。  | +| [DeleteExecutor](#deleteexecutor) ([in] unsigned long index) | 删除执行器,用于清理失效的执行器信息。  | +| [OpenSession](#opensession) ([in] int userId, [out] unsigned char[] challenge) | 开启一个认证凭据管理会话,用于在请求管理用户认证凭据前获取有效挑战值。  | +| [CloseSession](#closesession) ([in] int userId) | 关闭认证凭据管理会话,完成用户认证凭据管理请求处理后,调用该接口使原挑战值失效。  | +| [BeginEnrollment](#beginenrollment) ([in] int userId, [in] unsigned char[] authToken, [in] struct [EnrollParam](_enroll_param.md) param, [out] struct [ScheduleInfo](_schedule_info.md) info) | 开始注册用户认证凭据。当注册凭据类型为口令且该用户已经注册了口令凭据时,将会更新口令凭据。  | +| [UpdateEnrollmentResult](#updateenrollmentresult) ([in] int userId, [in] unsigned char[] scheduleResult, [out] struct [EnrollResultInfo](_enroll_result_info.md) info) | 更新用户凭据注册结果,完成凭据注册。  | +| [CancelEnrollment](#cancelenrollment) ([in] int userId) | 取消注册请求。  | +| [DeleteCredential](#deletecredential) ([in] int userId, [in] unsigned long credentialId, [in] unsigned char[] authToken, [out] struct [CredentialInfo](_credential_info.md) info) | 删除用户凭据信息。  | +| [GetCredential](#getcredential) ([in] int userId, [in] enum [AuthType](_hdf_user_auth.md#authtype) authType, [out] struct [CredentialInfo](_credential_info.md)[] infos) | 查询用户凭据信息。  | +| [GetUserInfo](#getuserinfo) ([in] int userId, [out] unsigned long secureUid, [out] enum [PinSubType](_hdf_user_auth.md#pinsubtype) pinSubType, [out] struct [EnrolledInfo](_enrolled_info.md)[] infos) | 查询用户认证相关信息。  | +| [DeleteUser](#deleteuser) ([in] int userId, [in] unsigned char[] authToken, [out] struct [CredentialInfo](_credential_info.md)[] deletedInfos) | 删除用户口令认证凭据,在用户IAM系统内删除该用户,该请求由用户触发。  | +| [EnforceDeleteUser](#enforcedeleteuser) ([in] int userId, [out] struct [CredentialInfo](_credential_info.md)[] deletedInfos) | 强制删除用户,该请求由系统内管理用户的模块触发。  | +| [BeginAuthentication](#beginauthentication) ([in] unsigned long contextId, [in] struct [AuthSolution](_auth_solution.md) param, [out] struct [ScheduleInfo](_schedule_info.md)[] scheduleInfos) | 开始认证用户,并生成认证方案。  | +| [UpdateAuthenticationResult](#updateauthenticationresult) ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct [AuthResultInfo](_auth_result_info.md) info) | 更新认证结果,评估认证方案的认证结果。  | +| [CancelAuthentication](#cancelauthentication) ([in] unsigned long contextId) | 取消用户认证请求。  | +| [BeginIdentification](#beginidentification) ([in] unsigned long contextId, [in] enum [AuthType](_hdf_user_auth.md#authtype) authType, [in] unsigned char[] challenge, [in] unsigned int executorSensorHint, [out] struct [ScheduleInfo](_schedule_info.md) scheduleInfo) | 开始用户身份识别,并生成识别方案。  | +| [UpdateIdentificationResult](#updateidentificationresult) ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct [IdentifyResultInfo](_identify_result_info.md) info) | 更新用户身份识别结果,生成身份识别方案的结果。  | +| [CancelIdentification](#cancelidentification) ([in] unsigned long contextId) | 取消用户身份识别请求。  | +| [GetAuthTrustLevel](#getauthtrustlevel) ([in] int userId, [in] enum [AuthType](_hdf_user_auth.md#authtype) authType, [out] unsigned int authTrustLevel) | 获取当前认证类型的认证结果可信等级。  | +| [GetValidSolution](#getvalidsolution) ([in] int userId, [in] enum [AuthType](_hdf_user_auth.md#authtype)[] authTypes, [in] unsigned int authTrustLevel, [out] enum [AuthType](_hdf_user_auth.md#authtype)[] validTypes) | 获取指定认证结果可信等级下有效的认证方式。  | + + +## 成员函数说明 ### AddExecutor() @@ -57,21 +53,19 @@ ``` IUserAuthInterface::AddExecutor ([in] struct ExecutorRegisterInfo info, [out] unsigned long index, [out] unsigned char[] publicKey, [out] unsigned long[] templateIds ) ``` - -**描述:** - +**描述:** 添加认证执行器来获取认证能力,用于各认证基础服务如口令认证服务等将认证能力对接到用户认证框架。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| info | 执行器注册信息[ExecutorRegisterInfo](_executor_register_info.md)。 | -| index | 用户认证框架的执行器索引。 | -| publicKey | 用户认证框架公钥。 | +| info | 执行器注册信息[ExecutorRegisterInfo](_executor_register_info.md)。  | +| index | 用户认证框架的执行器索引。  | +| publicKey | 用户认证框架公钥。  | | templateIds | 该执行器已注册的模版ID列表。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -84,20 +78,18 @@ IUserAuthInterface::AddExecutor ([in] struct ExecutorRegisterInfo info, [out] un ``` IUserAuthInterface::BeginAuthentication ([in] unsigned long contextId, [in] struct AuthSolution param, [out] struct ScheduleInfo[] scheduleInfos ) ``` - -**描述:** - +**描述:** 开始认证用户,并生成认证方案。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| contextId | 上下文索引。 | -| param | 认证方案[AuthSolution](_auth_solution.md)。 | +| contextId | 上下文索引。  | +| param | 认证方案[AuthSolution](_auth_solution.md)。  | | scheduleInfos | 调度信息[ScheduleInfo](_schedule_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -110,21 +102,19 @@ IUserAuthInterface::BeginAuthentication ([in] unsigned long contextId, [in] stru ``` IUserAuthInterface::BeginEnrollment ([in] int userId, [in] unsigned char[] authToken, [in] struct EnrollParam param, [out] struct ScheduleInfo info ) ``` - -**描述:** - +**描述:** 开始注册用户认证凭据。当注册凭据类型为口令且该用户已经注册了口令凭据时,将会更新口令凭据。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| authToken | 用户口令认证令牌。 | -| param | 注册凭据参数[EnrollParam](_enroll_param.md)。 | +| userId | 用户ID。  | +| authToken | 用户口令认证令牌。  | +| param | 注册凭据参数[EnrollParam](_enroll_param.md)。  | | info | 调度信息[ScheduleInfo](_schedule_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -135,24 +125,22 @@ IUserAuthInterface::BeginEnrollment ([in] int userId, [in] unsigned char[] authT ``` -IUserAuthInterface::BeginIdentification([in] unsigned long contextId, [in] enum AuthType authType, [in] unsigned char[] challenge, [in] unsigned int executorSensorHint, [out] struct ScheduleInfo scheduleInfo) +IUserAuthInterface::BeginIdentification ([in] unsigned long contextId, [in] enum AuthType authType, [in] unsigned char[] challenge, [in] unsigned int executorSensorHint, [out] struct ScheduleInfo scheduleInfo ) ``` - -**描述:** - +**描述:** 开始用户身份识别,并生成识别方案。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| contextId | 上下文索引。 | -| authType | 用户身份识别类型[AuthType](_hdf_user_auth.md#authtype)。 | -| challenge | 随机挑战值,用于生成用户身份识别令牌,防止重放。 | -| executorSensorHint | 执行器传感器提示,用于找到对应认证方式的传感器。 | +| contextId | 上下文索引。  | +| authType | 用户身份识别类型AuthType}。  | +| challenge | 随机挑战值,用于生成用户身份识别令牌,防止重放。  | +| executorSensorHint | 执行器传感器提示,用于找到对应认证方式的传感器。  | | scheduleInfo | 调度信息[ScheduleInfo](_schedule_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -165,18 +153,16 @@ IUserAuthInterface::BeginIdentification([in] unsigned long contextId, [in] enum ``` IUserAuthInterface::CancelAuthentication ([in] unsigned long contextId) ``` - -**描述:** - +**描述:** 取消用户认证请求。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | contextId | 上下文索引。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -189,18 +175,16 @@ IUserAuthInterface::CancelAuthentication ([in] unsigned long contextId) ``` IUserAuthInterface::CancelEnrollment ([in] int userId) ``` - -**描述:** - +**描述:** 取消注册请求。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | userId | 用户ID。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -213,18 +197,16 @@ IUserAuthInterface::CancelEnrollment ([in] int userId) ``` IUserAuthInterface::CancelIdentification ([in] unsigned long contextId) ``` - -**描述:** - +**描述:** 取消用户身份识别请求。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | contextId | 上下文索引。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -237,18 +219,16 @@ IUserAuthInterface::CancelIdentification ([in] unsigned long contextId) ``` IUserAuthInterface::CloseSession ([in] int userId) ``` - -**描述:** - +**描述:** 关闭认证凭据管理会话,完成用户认证凭据管理请求处理后,调用该接口使原挑战值失效。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | userId | 用户ID。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -261,21 +241,19 @@ IUserAuthInterface::CloseSession ([in] int userId) ``` IUserAuthInterface::DeleteCredential ([in] int userId, [in] unsigned long credentialId, [in] unsigned char[] authToken, [out] struct CredentialInfo info ) ``` - -**描述:** - +**描述:** 删除用户凭据信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| credentialId | 凭据ID。 | -| authToken | 用户口令认证令牌。 | +| userId | 用户ID。  | +| credentialId | 凭据ID。  | +| authToken | 用户口令认证令牌。  | | info | 删除的凭据信息[CredentialInfo](_credential_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -288,18 +266,16 @@ IUserAuthInterface::DeleteCredential ([in] int userId, [in] unsigned long creden ``` IUserAuthInterface::DeleteExecutor ([in] unsigned long index) ``` - -**描述:** - +**描述:** 删除执行器,用于清理失效的执行器信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | | index | 用户认证框架的执行器索引。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -312,20 +288,18 @@ IUserAuthInterface::DeleteExecutor ([in] unsigned long index) ``` IUserAuthInterface::DeleteUser ([in] int userId, [in] unsigned char[] authToken, [out] struct CredentialInfo[] deletedInfos ) ``` - -**描述:** - +**描述:** 删除用户口令认证凭据,在用户IAM系统内删除该用户,该请求由用户触发。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| authToken | 用户口令认证令牌。 | +| userId | 用户ID。  | +| authToken | 用户口令认证令牌。  | | deletedInfos | 删除的凭据信息[CredentialInfo](_credential_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -338,19 +312,17 @@ IUserAuthInterface::DeleteUser ([in] int userId, [in] unsigned char[] authToken, ``` IUserAuthInterface::EnforceDeleteUser ([in] int userId, [out] struct CredentialInfo[] deletedInfos ) ``` - -**描述:** - +**描述:** 强制删除用户,该请求由系统内管理用户的模块触发。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | +| userId | 用户ID。  | | deletedInfos | 删除的凭据信息[CredentialInfo](_credential_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -363,20 +335,18 @@ IUserAuthInterface::EnforceDeleteUser ([in] int userId, [out] struct CredentialI ``` IUserAuthInterface::GetAuthTrustLevel ([in] int userId, [in] enum AuthType authType, [out] unsigned int authTrustLevel ) ``` - -**描述:** - +**描述:** 获取当前认证类型的认证结果可信等级。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| authType | 认证类型[AuthType](_hdf_user_auth.md#authtype)。 | +| userId | 用户ID。  | +| authType | 认证类型[AuthType](_hdf_user_auth.md#authtype)。  | | authTrustLevel | 认证结果可信等级。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -389,20 +359,18 @@ IUserAuthInterface::GetAuthTrustLevel ([in] int userId, [in] enum AuthType authT ``` IUserAuthInterface::GetCredential ([in] int userId, [in] enum AuthType authType, [out] struct CredentialInfo[] infos ) ``` - -**描述:** - +**描述:** 查询用户凭据信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| authType | 凭据类型[AuthType](_hdf_user_auth.md#authtype)。 | +| userId | 用户ID。  | +| authType | 凭据类型[AuthType](_hdf_user_auth.md#authtype)。  | | infos | 凭据信息[CredentialInfo](_credential_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -413,23 +381,21 @@ IUserAuthInterface::GetCredential ([in] int userId, [in] enum AuthType authType, ``` -IUserAuthInterface::GetUserInfo([in] int userId, [out] unsigned long secureUid, [out] enum PinSubType pinSubType, [out] struct EnrolledInfo[] infos) +IUserAuthInterface::GetUserInfo ([in] int userId, [out] unsigned long secureUid, [out] enum PinSubType pinSubType, [out] struct EnrolledInfo[] infos ) ``` - -**描述:** - +**描述:** 查询用户认证相关信息。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| secureUid | 安全用户ID。 | -| pinSubType | 口令认证子类型[PinSubType](_hdf_user_auth.md#pinsubtype)。 | +| userId | 用户ID。  | +| secureUid | 安全用户ID。  | +| pinSubType | 口令认证子类型[PinSubType](_hdf_user_auth.md#pinsubtype)。  | | infos | 注册信息[EnrolledInfo](_enrolled_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -442,21 +408,19 @@ IUserAuthInterface::GetUserInfo([in] int userId, [out] unsigned long secureUid, ``` IUserAuthInterface::GetValidSolution ([in] int userId, [in] enum AuthType[] authTypes, [in] unsigned int authTrustLevel, [out] enum AuthType[] validTypes ) ``` - -**描述:** - +**描述:** 获取指定认证结果可信等级下有效的认证方式。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| authTypes | 用于筛选的认证方式列表[AuthType](_hdf_user_auth.md#authtype)。 | -| authTrustLevel | 认证结果可信等级。 | +| userId | 用户ID。  | +| authTypes | 用于筛选的认证方式列表[AuthType](_hdf_user_auth.md#authtype)。  | +| authTrustLevel | 认证结果可信等级。  | | validTypes | 有效的认证方式列表[AuthType](_hdf_user_auth.md#authtype)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -469,12 +433,10 @@ IUserAuthInterface::GetValidSolution ([in] int userId, [in] enum AuthType[] auth ``` IUserAuthInterface::Init () ``` - -**描述:** - +**描述:** 初始化用户认证驱动缓存信息,用于用户认证框架进程启动时初始化信息。 -**返回:** +**返回:** 0 表示操作成功。 @@ -487,19 +449,17 @@ IUserAuthInterface::Init () ``` IUserAuthInterface::OpenSession ([in] int userId, [out] unsigned char[] challenge ) ``` - -**描述:** - +**描述:** 开启一个认证凭据管理会话,用于在请求管理用户认证凭据前获取有效挑战值。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | +| userId | 用户ID。  | | challenge | 随机挑战值,用于生成用户身份认证令牌。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -512,20 +472,18 @@ IUserAuthInterface::OpenSession ([in] int userId, [out] unsigned char[] challeng ``` IUserAuthInterface::UpdateAuthenticationResult ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct AuthResultInfo info ) ``` - -**描述:** - +**描述:** 更新认证结果,评估认证方案的认证结果。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| contextId | 上下文索引。 | -| scheduleResult | 执行器签发的认证结果。 | +| contextId | 上下文索引。  | +| scheduleResult | 执行器签发的认证结果。  | | info | 认证结果信息[AuthResultInfo](_auth_result_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -536,22 +494,20 @@ IUserAuthInterface::UpdateAuthenticationResult ([in] unsigned long contextId, [i ``` -IUserAuthInterface::UpdateEnrollmentResult([in] int userId, [in] unsigned char[] scheduleResult, [out] struct EnrollResultInfo info) +IUserAuthInterface::UpdateEnrollmentResult ([in] int userId, [in] unsigned char[] scheduleResult, [out] struct EnrollResultInfo info ) ``` - -**描述:** - +**描述:** 更新用户凭据注册结果,完成凭据注册。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| userId | 用户ID。 | -| scheduleResult | 执行器签发的注册结果。 | -| oldInfo | 录入结果信息[EnrollResultInfo](_enroll_resultinfo.md)。 | +| userId | 用户ID。  | +| scheduleResult | 执行器签发的注册结果。  | +| info | 录入结果信息[EnrollResultInfo](_enroll_result_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 @@ -564,20 +520,18 @@ IUserAuthInterface::UpdateEnrollmentResult([in] int userId, [in] unsigned char[] ``` IUserAuthInterface::UpdateIdentificationResult ([in] unsigned long contextId, [in] unsigned char[] scheduleResult, [out] struct IdentifyResultInfo info ) ``` - -**描述:** - +**描述:** 更新用户身份识别结果,生成身份识别方案的结果。 -**参数:** +**参数:** | 名称 | 描述 | | -------- | -------- | -| contextId | 上下文索引。 | -| scheduleResult | 执行器签发的用户身份识别结果。 | +| contextId | 上下文索引。  | +| scheduleResult | 执行器签发的用户身份识别结果。  | | info | 用户身份识别结果[IdentifyResultInfo](_identify_result_info.md)。 | -**返回:** +**返回:** 0 表示操作成功。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_vibrator_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_vibrator_interface.md index f0e739cef3f20c790d87d3462e5e245689530ba8..6361bbffbd0784dc7bc7eea50c3c53dc3f4c9ba8 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_vibrator_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_vibrator_interface.md @@ -1,40 +1,36 @@ # IVibratorInterface -## **概述** +## 概述 Vibrator模块向上层服务提供统一的接口。 上层服务开发人员可根据Vibrator模块提供的统一接口,用于控制马达执行单次或周期性振动。 **Since:** - 3.2 - **Version:** - 1.1 - **相关模块:** -[Vibrator](vibrator.md) +[Vibrator](_vibrator.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [StartOnce](#startonce) ([in] unsigned int duration) | 控制马达以执行给定持续时间的单次振动。 | -| [Start](#start) ([in] String effectType) | 控制马达以预置效果执行周期性振动。 | -| [Stop](#stop) ([in] enum [HdfVibratorMode](vibrator.md#hdfvibratormode) mode) | 停止马达振动。 | -| [GetVibratorInfo](#getvibratorinfo) ([out] struct [HdfVibratorInfo](_hdf_vibrator_info.md)[] vibratorInfo) | 获取有关系统中支持设置振幅和频率的所有马达信息。 | -| [EnableVibratorModulation](#enablevibratormodulation) ([in] unsigned int duration, [in] int intensity, [in] int frequency) | 根据传入的振动效果启动马达。 | +| [StartOnce](#startonce) ([in] unsigned int duration) | 控制马达以执行给定持续时间的单次振动。  | +| [Start](#start) ([in] String effectType) | 控制马达以预置效果执行周期性振动。  | +| [Stop](#stop) ([in] enum [HdfVibratorMode](_vibrator.md#hdfvibratormode) mode) | 停止马达振动。  | +| [GetVibratorInfo](#getvibratorinfo) ([out] struct [HdfVibratorInfo](_hdf_vibrator_info.md)[] vibratorInfo) | 获取有关系统中支持设置振幅和频率的所有马达信息。  | +| [EnableVibratorModulation](#enablevibratormodulation) ([in] unsigned int duration, [in] int intensity, [in] int frequency) | 根据传入的振动效果启动马达。  | -## **成员函数说明** +## 成员函数说明 ### EnableVibratorModulation() @@ -43,17 +39,15 @@ Vibrator模块向上层服务提供统一的接口。 ``` IVibratorInterface::EnableVibratorModulation ([in] unsigned int duration, [in] int intensity, [in] int frequency ) ``` - -**描述:** - +**描述:** 根据传入的振动效果启动马达。 **参数:** | 名称 | 描述 | | -------- | -------- | -| duration | 表示马达振动的持续时间,以毫秒为单位。 | -| intensity | 表示振动周期内的马达振幅。 | +| duration | 表示马达振动的持续时间,以毫秒为单位。  | +| intensity | 表示振动周期内的马达振幅。  | | frequency | 表示振动周期内的马达频率。 | **返回:** @@ -73,9 +67,7 @@ IVibratorInterface::EnableVibratorModulation ([in] unsigned int duration, [in] i ``` IVibratorInterface::GetVibratorInfo ([out] struct HdfVibratorInfo[] vibratorInfo) ``` - -**描述:** - +**描述:** 获取有关系统中支持设置振幅和频率的所有马达信息。 **参数:** @@ -97,9 +89,7 @@ IVibratorInterface::GetVibratorInfo ([out] struct HdfVibratorInfo[] vibratorInfo ``` IVibratorInterface::Start ([in] String effectType) ``` - -**描述:** - +**描述:** 控制马达以预置效果执行周期性振动。 单次振动与周期振动相互排斥。在执行周期性振动之前,需退出单次振动。 @@ -123,9 +113,7 @@ IVibratorInterface::Start ([in] String effectType) ``` IVibratorInterface::StartOnce ([in] unsigned int duration) ``` - -**描述:** - +**描述:** 控制马达以执行给定持续时间的单次振动。 单次振动与周期振动相互排斥。在执行单次振动之前,需退出周期性振动。 @@ -149,9 +137,7 @@ IVibratorInterface::StartOnce ([in] unsigned int duration) ``` IVibratorInterface::Stop ([in] enum HdfVibratorMode mode) ``` - -**描述:** - +**描述:** 停止马达振动。 马达启动前,必须在任何模式下停止振动。此功能用在振动过程之后。 @@ -160,7 +146,7 @@ IVibratorInterface::Stop ([in] enum HdfVibratorMode mode) | 名称 | 描述 | | -------- | -------- | -| mode | 表示振动模式,可以是单次或周期性的,详见[HdfVibratorMode](vibrator.md#hdfvibratormode)。 | +| mode | 表示振动模式,可以是单次或周期性的,详见[HdfVibratorMode](_vibrator.md#hdfvibratormode)。 | **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_wififence_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_wififence_callback.md new file mode 100644 index 0000000000000000000000000000000000000000..0011c7fb3ce46fb0b0d6135e7d22bcb9b335b3f5 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_wififence_callback.md @@ -0,0 +1,109 @@ +# IWififenceCallback + + +## 概述 + +定义Wi-Fi围栏模块的回调函数。 + +用户在开启Wi-Fi围栏功能前,需要先注册该回调函数。当Wi-Fi围栏状态发生变化时,会通过回调函数进行上报。 详情可参考[ICellfenceInterface](interface_i_cellfence_interface.md)。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceWififence](_hdi_lpfence_wififence.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [OnWififenceChanged](#onwififencechanged) ([in] int wififenceId, [in] int transition, [in] long timeStamp) | 定义Wi-Fi围栏状态变化的回调函数。 | +| [OnGetWififenceSizeCb](#ongetwififencesizecb) ([in] struct [WififenceSize](_wififence_size.md) size) | 定义Wi-Fi围栏使用信息的回调函数。 | +| [OnWififenceReset](#onwififencereset) () | 定义低功耗围栏服务复位事件通知的回调函数。 | + + +## 成员函数说明 + + +### OnGetWififenceSizeCb() + + +``` +IWififenceCallback::OnGetWififenceSizeCb ([in] struct WififenceSize size) +``` + +**描述:** + +定义Wi-Fi围栏使用信息的回调函数。 + +获取Wi-Fi围栏使用信息时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| size | 基站围栏使用信息。详见[WififenceSize](_wififence_size.md)定义。 | + +**返回:** + +如果回调函数上报数据成功,则返回0。 + +如果回调函数上报数据失败,则返回负值。 + + +### OnWififenceChanged() + + +``` +IWififenceCallback::OnWififenceChanged ([in] int wififenceId, [in] int transition, [in] long timeStamp ) +``` + +**描述:** + +定义Wi-Fi围栏状态变化的回调函数。 + +设备与Wi-Fi围栏的状态关系发生变化时,会通过该回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| wififenceId | Wi-Fi围栏ID号。 | +| transition | Wi-Fi围栏变化的状态。详见[WififenceTransition](_hdi_lpfence_wififence.md#wififencetransition)定义。 | +| timeStamp | 时间戳。 | + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### OnWififenceReset() + + +``` +IWififenceCallback::OnWififenceReset () +``` + +**描述:** + +定义低功耗围栏服务复位事件通知的回调函数。 + +低功耗围栏服务发生复位时会通过该回调函数进行事件上报。 + +**返回:** + +如果回调函数调用成功,则返回0。 + +如果回调函数调用失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_wififence_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_wififence_interface.md new file mode 100644 index 0000000000000000000000000000000000000000..06e1782ab74bb8510e51d2e2531f0f49ebcd5d5d --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_wififence_interface.md @@ -0,0 +1,188 @@ +# IWififenceInterface + + +## 概述 + +定义对Wi-Fi围栏模块进行基本操作的接口。 + +接口包含注册回调函数,取消注册回调函数,添加Wi-Fi围栏,删除Wi-Fi围栏,获取Wi-Fi围栏状态,获取Wi-Fi围栏使用信息的功能。 + +**Since:** + +4.0 + +**Since:** + +4.0 + +**相关模块:** + +[HdiLpfenceWififence](_hdi_lpfence_wififence.md) + + +## 汇总 + + +### Public 成员函数 + + | 名称 | 描述 | +| -------- | -------- | +| [RegisterWififenceCallback](#registerwififencecallback) ([in] [IWififenceCallback](interface_i_wififence_callback.md) callbackObj) | 注册回调函数。 | +| [UnregisterWififenceCallback](#unregisterwififencecallback) ([in] [IWififenceCallback](interface_i_wififence_callback.md) callbackObj) | 取消注册回调函数。 | +| [AddWififences](#addwififences) ([in] struct [WififenceRequest](_wififence_request.md)[] wififence) | 添加Wi-Fi围栏。 | +| [RemoveWififences](#removewififences) ([in] int[] wififenceId) | 删除Wi-Fi围栏。 | +| [GetWififenceStatus](#getwififencestatus) ([in] int wififenceId) | 获取设备与一个Wi-Fi围栏的状态关系。 | +| [GetWififenceSize](#getwififencesize) () | 获取Wi-Fi围栏使用信息 | + + +## 成员函数说明 + + +### AddWififences() + + +``` +IWififenceInterface::AddWififences ([in] struct WififenceRequest[] wififence) +``` + +**描述:** + +添加Wi-Fi围栏。 + +支持一次添加多个Wi-Fi围栏,一个Wi-Fi围栏包含多组MAC地址信息。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| wififence | 添加的Wi-Fi围栏信息。详见[WififenceRequest](_wififence_request.md)。 | + +**返回:** + +如果添加成功,则返回0。 + +如果添加失败,则返回负值。 + + +### GetWififenceSize() + + +``` +IWififenceInterface::GetWififenceSize () +``` + +**描述:** + +获取Wi-Fi围栏使用信息 + +查看当前设备支持添加的Wi-Fi围栏最大个数和已添加的Wi-Fi围栏个数。通过回调函数上报通知,详见[OnGetWififenceSizeCb](interface_i_wififence_callback.md#ongetwififencesizecb)。 + +**返回:** + +如果调用成功,则返回0。 + +如果调用失败,则返回负值。 + + +### GetWififenceStatus() + + +``` +IWififenceInterface::GetWififenceStatus ([in] int wififenceId) +``` + +**描述:** + +获取设备与一个Wi-Fi围栏的状态关系。 + +设备与Wi-Fi围栏的状态关系详见[WififenceTransition](_hdi_lpfence_wififence.md#wififencetransition)定义。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| wififenceId | Wi-Fi围栏ID号。 | + +**返回:** + +返回位置关系。详见[WififenceTransition](_hdi_lpfence_wififence.md#wififencetransition)定义。 + +如果调用失败,则返回负值。 + + +### RegisterWififenceCallback() + + +``` +IWififenceInterface::RegisterWififenceCallback ([in] IWififenceCallback callbackObj) +``` + +**描述:** + +注册回调函数。 + +用户在开启Wi-Fi围栏功能前,需要先注册该回调函数。当Wi-Fi围栏状态发生变化时,会通过回调函数进行上报。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要注册的回调函数,只需成功订阅一次,无需重复订阅。详见[IWififenceCallback](interface_i_wififence_callback.md)。 | + +**返回:** + +如果注册回调函数成功,则返回0。 + +如果注册回调函数失败,则返回负值。 + + +### RemoveWififences() + + +``` +IWififenceInterface::RemoveWififences ([in] int[] wififenceId) +``` + +**描述:** + +删除Wi-Fi围栏。 + +支持一次删除多个Wi-Fi围栏。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| wififenceId | Wi-Fi围栏ID号。详见[WififenceRequest](_wififence_request.md)。 | + +**返回:** + +如果删除成功,则返回0。 + +如果删除失败,则返回负值。 + + +### UnregisterWififenceCallback() + + +``` +IWififenceInterface::UnregisterWififenceCallback ([in] IWififenceCallback callbackObj) +``` + +**描述:** + +取消注册回调函数。 + +取消之前注册的回调函数。当不需要使用Wi-Fi围栏功能,或需要更换回调函数时,需要取消注册回调函数。 + +**参数:** + + | 名称 | 描述 | +| -------- | -------- | +| callbackObj | 要取消注册的回调函数,只需成功取消订阅一次,无需重复取消订阅。详见[IWififenceCallback](interface_i_wififence_callback.md)。 | + +**返回:** + +如果取消注册回调函数成功,则返回0。 + +如果取消注册回调函数失败,则返回负值。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_callback.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_callback.md index 3fe5e85f25ae6014d60ece20c979fe605223f74c..b7cff83fae25993d1498f8ef546bb6a97a99f4f3 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_callback.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_callback.md @@ -1,38 +1,34 @@ # IWlanCallback -## **概述** +## 概述 定义WLAN模块的回调函数。 当WLAN模块发生重启,扫描热点结束,收到Netlink消息后,调用回调函数,处理对应的结果信息。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [ResetDriverResult](#resetdriverresult) ([in] unsigned int event, [in] int code, [in] String ifName) | 重启WLAN驱动的结果处理回调方法。 | -| [ScanResult](#scanresult) ([in] unsigned int event, [in] struct [HdfWifiScanResult](_hdf_wifi_scan_result.md) scanResult, [in] String ifName) | 扫描结果的回调方法。 | -| [WifiNetlinkMessage](#wifinetlinkmessage) ([in] unsigned char[] recvMsg) | Netlink消息的回调方法。 | +| [ResetDriverResult](#resetdriverresult) ([in] unsigned int event, [in] int code, [in] String ifName) | 重启WLAN驱动的结果处理回调方法。  | +| [ScanResult](#scanresult) ([in] unsigned int event, [in] struct [HdfWifiScanResult](_hdf_wifi_scan_result.md) scanResult, [in] String ifName) | 扫描结果的回调方法。  | +| [WifiNetlinkMessage](#wifinetlinkmessage) ([in] unsigned char[] recvMsg) | Netlink消息的回调方法。  | -## **成员函数说明** +## 成员函数说明 ### ResetDriverResult() @@ -41,9 +37,7 @@ ``` IWlanCallback::ResetDriverResult ([in] unsigned int event, [in] int code, [in] String ifName ) ``` - -**描述:** - +**描述:** 重启WLAN驱动的结果处理回调方法。 当重启WLAN驱动后,调用此接口处理驱动重启后的返回结果。 @@ -52,8 +46,8 @@ IWlanCallback::ResetDriverResult ([in] unsigned int event, [in] int code, [in] S | 名称 | 描述 | | -------- | -------- | -| event | 重启驱动的事件ID。 | -| code | 重启驱动后返回的结果数据。 | +| event | 重启驱动的事件ID。  | +| code | 重启驱动后返回的结果数据。  | | ifName | 网卡名称。 | @@ -63,9 +57,7 @@ IWlanCallback::ResetDriverResult ([in] unsigned int event, [in] int code, [in] S ``` IWlanCallback::ScanResult ([in] unsigned int event, [in] struct HdfWifiScanResult scanResult, [in] String ifName ) ``` - -**描述:** - +**描述:** 扫描结果的回调方法。 当扫描结束后,将通过此方法处理返回的扫描结果数据。 @@ -74,8 +66,8 @@ IWlanCallback::ScanResult ([in] unsigned int event, [in] struct HdfWifiScanResul | 名称 | 描述 | | -------- | -------- | -| event | 扫描结果的事件ID。 | -| scanResult | 扫描结果数据。 | +| event | 扫描结果的事件ID。  | +| scanResult | 扫描结果数据。  | | ifName | 网卡名称。 | @@ -85,9 +77,7 @@ IWlanCallback::ScanResult ([in] unsigned int event, [in] struct HdfWifiScanResul ``` IWlanCallback::WifiNetlinkMessage ([in] unsigned char[] recvMsg) ``` - -**描述:** - +**描述:** Netlink消息的回调方法。 当收到Netlink消息后,将通过此方法处理收到的消息。 diff --git a/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_interface.md b/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_interface.md index 33df7f747fb979dce5515f83a1de25e930e4a3fd..a3b4733d4fd02ef6166ab558447b10ada14e2e2b 100644 --- a/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_interface.md +++ b/zh-cn/device-dev/reference/hdi-apis/interface_i_wlan_interface.md @@ -1,65 +1,61 @@ # IWlanInterface -## **概述** +## 概述 WLAN模块向上层WLAN服务提供了统一接口。 上层服务调用相关的接口,可以建立/关闭WLAN热点,扫描/关联/去关联WLAN热点,设置国家码,管理网络设备等。 **Since:** - 3.2 - **Version:** - 1.0 - **相关模块:** -[WLAN](wlan.md) +[WLAN](_w_l_a_n.md) -## **汇总** +## 汇总 ### Public 成员函数 | 名称 | 描述 | | -------- | -------- | -| [Start](#start) () | 创建HAL和驱动之间的通道及获取驱动网卡信息,该函数调用在创建IWiFi实体后进行。 | -| [Stop](#stop) () | 销毁HAL和驱动之间的通道,该函数调用在销毁IWiFi实体前进行。 | -| [CreateFeature](#createfeature) ([in] int type, [out] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature) | 根据输入类型创建对应的feature对象。 | -| [DestroyFeature](#destroyfeature) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature) | 销毁feature对象。 | -| [GetAsscociatedStas](#getasscociatedstas) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] struct [HdfStaInfo](_hdf_sta_info.md)[] staInfo, [out] unsigned int num) | 获取与AP连接的所有STA的信息(目前只包含MAC地址)。 | -| [GetChipId](#getchipid) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] unsigned char chipId) | 获得当前驱动的芯片ID。 | -| [GetDeviceMacAddress](#getdevicemacaddress) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] unsigned char[] mac, [in] unsigned char len) | 获取设备的MAC地址。 | -| [GetFeatureByIfName](#getfeaturebyifname) ([in] String ifName, [out] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature) | 通过网卡名称获取对应的feature对象。 | -| [GetFeatureType](#getfeaturetype) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] int featureType) | 获取feature对象的类型。 | -| [GetFreqsWithBand](#getfreqswithband) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] struct [HdfWifiInfo](_hdf_wifi_info.md) wifiInfo, [out] int[] freq) | 获取指定频段(2.4G或者5G)下支持的频率。 | -| [GetIfNamesByChipId](#getifnamesbychipid) ([in] unsigned char chipId, [out] String ifName, [out] unsigned int num) | 通过芯片ID获得当前芯片所有的网卡名称。 | -| [GetNetworkIfaceName](#getnetworkifacename) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] String ifName) | 根据feature对象获取网卡名称。 | -| [GetSupportCombo](#getsupportcombo) ([out] unsigned long combo) | 获取多网卡共存情况。 | -| [GetSupportFeature](#getsupportfeature) ([out] unsigned char[] supType) | 获取该设备支持的WLAN特性(不考虑当前的使用状态)。 | -| [RegisterEventCallback](#registereventcallback) ([in] [IWlanCallback](interface_i_wlan_callback.md) cbFunc, [in] String ifName) | 注册IWiFi的回调函数,监听异步事件。 | -| [UnregisterEventCallback](#unregistereventcallback) ([in] [IWlanCallback](interface_i_wlan_callback.md) cbFunc, [in] String ifName) | 去注册IWiFi的回调函数。 | -| [ResetDriver](#resetdriver) ([in] unsigned char chipId, [in] String ifName) | 重启指定芯片ID的WLAN驱动程序。 | -| [SetCountryCode](#setcountrycode) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] String code, [in] unsigned int len) | 设置国家码(表示AP射频所在的国家,规定了AP射频特性,包括AP的发送功率、支持的信道等。其目的是为了使AP的射频特性符合不同国家或区域的法律法规要求)。 | -| [SetMacAddress](#setmacaddress) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] unsigned char[] mac) | 根据传入参数设置对应网卡的MAC地址。 | -| [SetScanningMacAddress](#setscanningmacaddress) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] unsigned char[] scanMac) | 设置扫描单个MAC地址。 | -| [SetTxPower](#settxpower) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] int power) | 设置发射功率。 | -| [GetNetDevInfo](#getnetdevinfo) ([out] struct [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) netDeviceInfoResult) | 获取网络设备信息(设备索引、网卡名字、MAC等信息)。 | -| [StartScan](#startscan) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] struct [HdfWifiScan](_hdf_wifi_scan.md) scan) | 启动扫描。 | -| [GetPowerMode](#getpowermode) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] unsigned char mode) | 获取正在使用的功率模式。 | -| [SetPowerMode](#setpowermode) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] unsigned char mode) | 设置功率模式。 | -| [StartChannelMeas](#startchannelmeas) ([in] String ifName, [in] struct [MeasChannelParam](_meas_channel_param.md) measChannelParam) | 启动信道测量。 | -| [GetChannelMeasResult](#getchannelmeasresult) ([in] String ifName, [out] struct [MeasChannelResult](_meas_channel_result.md) measChannelResult) | 获取信道测量结果。 | -| [SetProjectionScreenParam](#setprojectionscreenparam) ([in] String ifName, [in] struct [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) param) | 设置投屏参数。 | -| [WifiSendCmdIoctl](#wifisendcmdioctl) ([in] String ifName, [in] int cmdId, [in] byte[] paramBuf) | 向驱动发送IO控制命令。 | -| [GetStaInfo](#getstainfo) ([in] String ifName, [out] struct [WifiStationInfo](_wifi_station_info.md) info, [in] unsigned char[] mac) | 获取指定网卡的STA的信息。 | - - -## **成员函数说明** +| [Start](#start) () | 创建HAL和驱动之间的通道及获取驱动网卡信息,该函数调用在创建IWiFi实体后进行。  | +| [Stop](#stop) () | 销毁HAL和驱动之间的通道,该函数调用在销毁IWiFi实体前进行。  | +| [CreateFeature](#createfeature) ([in] int type, [out] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature) | 根据输入类型创建对应的feature对象。  | +| [DestroyFeature](#destroyfeature) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature) | 销毁feature对象。  | +| [GetAsscociatedStas](#getasscociatedstas) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] struct [HdfStaInfo](_hdf_sta_info.md)[] staInfo, [out] unsigned int num) | 获取与AP连接的所有STA的信息(目前只包含MAC地址)。  | +| [GetChipId](#getchipid) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] unsigned char chipId) | 获得当前驱动的芯片ID。  | +| [GetDeviceMacAddress](#getdevicemacaddress) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] unsigned char[] mac, [in] unsigned char len) | 获取设备的MAC地址。  | +| [GetFeatureByIfName](#getfeaturebyifname) ([in] String ifName, [out] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature) | 通过网卡名称获取对应的feature对象。  | +| [GetFeatureType](#getfeaturetype) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] int featureType) | 获取feature对象的类型。  | +| [GetFreqsWithBand](#getfreqswithband) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] struct [HdfWifiInfo](_hdf_wifi_info.md) wifiInfo, [out] int[] freq) | 获取指定频段(2.4G或者5G)下支持的频率。  | +| [GetIfNamesByChipId](#getifnamesbychipid) ([in] unsigned char chipId, [out] String ifName, [out] unsigned int num) | 通过芯片ID获得当前芯片所有的网卡名称。  | +| [GetNetworkIfaceName](#getnetworkifacename) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] String ifName) | 根据feature对象获取网卡名称。  | +| [GetSupportCombo](#getsupportcombo) ([out] unsigned long combo) | 获取多网卡共存情况。  | +| [GetSupportFeature](#getsupportfeature) ([out] unsigned char[] supType) | 获取该设备支持的WLAN特性(不考虑当前的使用状态)。  | +| [RegisterEventCallback](#registereventcallback) ([in] [IWlanCallback](interface_i_wlan_callback.md) cbFunc, [in] String ifName) | 注册IWiFi的回调函数,监听异步事件。  | +| [UnregisterEventCallback](#unregistereventcallback) ([in] [IWlanCallback](interface_i_wlan_callback.md) cbFunc, [in] String ifName) | 去注册IWiFi的回调函数。  | +| [ResetDriver](#resetdriver) ([in] unsigned char chipId, [in] String ifName) | 重启指定芯片ID的WLAN驱动程序。  | +| [SetCountryCode](#setcountrycode) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] String code, [in] unsigned int len) | 设置国家码(表示AP射频所在的国家,规定了AP射频特性,包括AP的发送功率、支持的信道等。其目的是为了使AP的射频特性符合不同国家或区域的法律法规要求)。  | +| [SetMacAddress](#setmacaddress) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] unsigned char[] mac) | 根据传入参数设置对应网卡的MAC地址。  | +| [SetScanningMacAddress](#setscanningmacaddress) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] unsigned char[] scanMac) | 设置扫描单个MAC地址。  | +| [SetTxPower](#settxpower) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] int power) | 设置发射功率。  | +| [GetNetDevInfo](#getnetdevinfo) ([out] struct [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) netDeviceInfoResult) | 获取网络设备信息(设备索引、网卡名字、MAC等信息)。  | +| [StartScan](#startscan) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] struct [HdfWifiScan](_hdf_wifi_scan.md) scan) | 启动扫描。  | +| [GetPowerMode](#getpowermode) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [out] unsigned char mode) | 获取正在使用的功率模式。  | +| [SetPowerMode](#setpowermode) ([in] struct [HdfFeatureInfo](_hdf_feature_info.md) ifeature, [in] unsigned char mode) | 设置功率模式。  | +| [StartChannelMeas](#startchannelmeas) ([in] String ifName, [in] struct [MeasChannelParam](_meas_channel_param.md) measChannelParam) | 启动信道测量。  | +| [GetChannelMeasResult](#getchannelmeasresult) ([in] String ifName, [out] struct [MeasChannelResult](_meas_channel_result.md) measChannelResult) | 获取信道测量结果。  | +| [SetProjectionScreenParam](#setprojectionscreenparam) ([in] String ifName, [in] struct [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) param) | 设置投屏参数。  | +| [WifiSendCmdIoctl](#wifisendcmdioctl) ([in] String ifName, [in] int cmdId, [in] byte[] paramBuf) | 向驱动发送IO控制命令。  | +| [GetStaInfo](#getstainfo) ([in] String ifName, [out] struct [WifiStationInfo](_wifi_station_info.md) info, [in] unsigned char[] mac) | 获取指定网卡的STA的信息。  | + + +## 成员函数说明 ### CreateFeature() @@ -68,16 +64,14 @@ WLAN模块向上层WLAN服务提供了统一接口。 ``` IWlanInterface::CreateFeature ([in] int type, [out] struct HdfFeatureInfo ifeature ) ``` - -**描述:** - +**描述:** 根据输入类型创建对应的feature对象。 **参数:** | 名称 | 描述 | | -------- | -------- | -| type | 创建的feature类型。 | +| type | 创建的feature类型。  | | ifeature | 获取创建的feature对象。 | **返回:** @@ -93,9 +87,7 @@ IWlanInterface::CreateFeature ([in] int type, [out] struct HdfFeatureInfo ifeatu ``` IWlanInterface::DestroyFeature ([in] struct HdfFeatureInfo ifeature) ``` - -**描述:** - +**描述:** 销毁feature对象。 **参数:** @@ -117,17 +109,15 @@ IWlanInterface::DestroyFeature ([in] struct HdfFeatureInfo ifeature) ``` IWlanInterface::GetAsscociatedStas ([in] struct HdfFeatureInfo ifeature, [out] struct HdfStaInfo[] staInfo, [out] unsigned int num ) ``` - -**描述:** - +**描述:** 获取与AP连接的所有STA的信息(目前只包含MAC地址)。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | -| staInfo | 保存与AP连接的STA的基本信息。 | +| ifeature | feature对象。  | +| staInfo | 保存与AP连接的STA的基本信息。  | | num | 实际连接的STA的个数。 | **返回:** @@ -143,16 +133,14 @@ IWlanInterface::GetAsscociatedStas ([in] struct HdfFeatureInfo ifeature, [out] s ``` IWlanInterface::GetChannelMeasResult ([in] String ifName, [out] struct MeasChannelResult measChannelResult ) ``` - -**描述:** - +**描述:** 获取信道测量结果。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifName | 网卡名称。 | +| ifName | 网卡名称。  | | measChannelResult | 信道测量结果(信道号、信道负载、信道噪声)。 | **返回:** @@ -168,16 +156,14 @@ IWlanInterface::GetChannelMeasResult ([in] String ifName, [out] struct MeasChann ``` IWlanInterface::GetChipId ([in] struct HdfFeatureInfo ifeature, [out] unsigned char chipId ) ``` - -**描述:** - +**描述:** 获得当前驱动的芯片ID。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | chipId | 获得的芯片ID。 | **返回:** @@ -193,17 +179,15 @@ IWlanInterface::GetChipId ([in] struct HdfFeatureInfo ifeature, [out] unsigned c ``` IWlanInterface::GetDeviceMacAddress ([in] struct HdfFeatureInfo ifeature, [out] unsigned char[] mac, [in] unsigned char len ) ``` - -**描述:** - +**描述:** 获取设备的MAC地址。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | -| mac | 获得的MAC地址。 | +| ifeature | feature对象。  | +| mac | 获得的MAC地址。  | | len | mac数组的长度。 | **返回:** @@ -219,16 +203,14 @@ IWlanInterface::GetDeviceMacAddress ([in] struct HdfFeatureInfo ifeature, [out] ``` IWlanInterface::GetFeatureByIfName ([in] String ifName, [out] struct HdfFeatureInfo ifeature ) ``` - -**描述:** - +**描述:** 通过网卡名称获取对应的feature对象。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifName | 网卡名称。 | +| ifName | 网卡名称。  | | ifeature | 获取该网卡的feature对象。 | **返回:** @@ -244,16 +226,14 @@ IWlanInterface::GetFeatureByIfName ([in] String ifName, [out] struct HdfFeatureI ``` IWlanInterface::GetFeatureType ([in] struct HdfFeatureInfo ifeature, [out] int featureType ) ``` - -**描述:** - +**描述:** 获取feature对象的类型。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | featureType | feature对象的类型。 | **返回:** @@ -269,17 +249,15 @@ IWlanInterface::GetFeatureType ([in] struct HdfFeatureInfo ifeature, [out] int f ``` IWlanInterface::GetFreqsWithBand ([in] struct HdfFeatureInfo ifeature, [in] struct HdfWifiInfo wifiInfo, [out] int[] freq ) ``` - -**描述:** - +**描述:** 获取指定频段(2.4G或者5G)下支持的频率。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | -| wifiInfo | 频段信息。 | +| ifeature | feature对象。  | +| wifiInfo | 频段信息。  | | freq | 保存支持的频率。 | **返回:** @@ -295,17 +273,15 @@ IWlanInterface::GetFreqsWithBand ([in] struct HdfFeatureInfo ifeature, [in] stru ``` IWlanInterface::GetIfNamesByChipId ([in] unsigned char chipId, [out] String ifName, [out] unsigned int num ) ``` - -**描述:** - +**描述:** 通过芯片ID获得当前芯片所有的网卡名称。 **参数:** | 名称 | 描述 | | -------- | -------- | -| chipId | 需要获取网卡名称的芯片ID。 | -| ifNames | 网卡名称。 | +| chipId | 需要获取网卡名称的芯片ID。  | +| ifNames | 网卡名称。  | | num | 网卡的数量。 | **返回:** @@ -321,9 +297,7 @@ IWlanInterface::GetIfNamesByChipId ([in] unsigned char chipId, [out] String ifNa ``` IWlanInterface::GetNetDevInfo ([out] struct HdfNetDeviceInfoResult netDeviceInfoResult) ``` - -**描述:** - +**描述:** 获取网络设备信息(设备索引、网卡名字、MAC等信息)。 **参数:** @@ -345,16 +319,14 @@ IWlanInterface::GetNetDevInfo ([out] struct HdfNetDeviceInfoResult netDeviceInfo ``` IWlanInterface::GetNetworkIfaceName ([in] struct HdfFeatureInfo ifeature, [out] String ifName ) ``` - -**描述:** - +**描述:** 根据feature对象获取网卡名称。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | ifName | 网卡名称。 | **返回:** @@ -370,16 +342,14 @@ IWlanInterface::GetNetworkIfaceName ([in] struct HdfFeatureInfo ifeature, [out] ``` IWlanInterface::GetPowerMode ([in] struct HdfFeatureInfo ifeature, [out] unsigned char mode ) ``` - -**描述:** - +**描述:** 获取正在使用的功率模式。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | mode | 功率模式,包括睡眠模式(待机状态运行)、一般模式(正常额定功率运行)、穿墙模式(最大功率运行,提高信号强度和覆盖面积)。 | **返回:** @@ -395,17 +365,15 @@ IWlanInterface::GetPowerMode ([in] struct HdfFeatureInfo ifeature, [out] unsigne ``` IWlanInterface::GetStaInfo ([in] String ifName, [out] struct WifiStationInfo info, [in] unsigned char[] mac ) ``` - -**描述:** - +**描述:** 获取指定网卡的STA的信息。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifName | 网卡名称。 | -| info | 获取的STA的信息,详情请参考[WifiStationInfo](_wifi_station_info.md)。 | +| ifName | 网卡名称。  | +| info | 获取的STA的信息,详情请参考[WifiStationInfo](_wifi_station_info.md)。  | | mac | STA的MAC地址。 | **返回:** @@ -421,9 +389,7 @@ IWlanInterface::GetStaInfo ([in] String ifName, [out] struct WifiStationInfo inf ``` IWlanInterface::GetSupportCombo ([out] unsigned long combo) ``` - -**描述:** - +**描述:** 获取多网卡共存情况。 **参数:** @@ -445,9 +411,7 @@ IWlanInterface::GetSupportCombo ([out] unsigned long combo) ``` IWlanInterface::GetSupportFeature ([out] unsigned char[] supType) ``` - -**描述:** - +**描述:** 获取该设备支持的WLAN特性(不考虑当前的使用状态)。 **参数:** @@ -469,16 +433,14 @@ IWlanInterface::GetSupportFeature ([out] unsigned char[] supType) ``` IWlanInterface::RegisterEventCallback ([in] IWlanCallback cbFunc, [in] String ifName ) ``` - -**描述:** - +**描述:** 注册IWiFi的回调函数,监听异步事件。 **参数:** | 名称 | 描述 | | -------- | -------- | -| cbFunc | 注册的回调函数。 | +| cbFunc | 注册的回调函数。  | | ifName | 网卡名称。 | **返回:** @@ -494,16 +456,14 @@ IWlanInterface::RegisterEventCallback ([in] IWlanCallback cbFunc, [in] String if ``` IWlanInterface::ResetDriver ([in] unsigned char chipId, [in] String ifName ) ``` - -**描述:** - +**描述:** 重启指定芯片ID的WLAN驱动程序。 **参数:** | 名称 | 描述 | | -------- | -------- | -| chipId | 需要进行重启驱动的芯片ID。 | +| chipId | 需要进行重启驱动的芯片ID。  | | ifName | 网卡名称。 | **返回:** @@ -519,17 +479,15 @@ IWlanInterface::ResetDriver ([in] unsigned char chipId, [in] String ifName ) ``` IWlanInterface::SetCountryCode ([in] struct HdfFeatureInfo ifeature, [in] String code, [in] unsigned int len ) ``` - -**描述:** - +**描述:** 设置国家码(表示AP射频所在的国家,规定了AP射频特性,包括AP的发送功率、支持的信道等。其目的是为了使AP的射频特性符合不同国家或区域的法律法规要求)。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | -| code | 设置的国家码。 | +| ifeature | feature对象。  | +| code | 设置的国家码。  | | len | 国家码长度。 | **返回:** @@ -545,16 +503,14 @@ IWlanInterface::SetCountryCode ([in] struct HdfFeatureInfo ifeature, [in] String ``` IWlanInterface::SetMacAddress ([in] struct HdfFeatureInfo ifeature, [in] unsigned char[] mac ) ``` - -**描述:** - +**描述:** 根据传入参数设置对应网卡的MAC地址。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | mac | 设置的MAC地址。 | **返回:** @@ -570,17 +526,15 @@ IWlanInterface::SetMacAddress ([in] struct HdfFeatureInfo ifeature, [in] unsigne ``` IWlanInterface::SetPowerMode ([in] struct HdfFeatureInfo ifeature, [in] unsigned char mode ) ``` - -**描述:** - +**描述:** 设置功率模式。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | -| mode | 功率模式,包括睡眠模式(待机状态运行)、一般模式(正常额定功率运行)、穿墙模式(最大功率运行,提高信号强度和覆盖面积)。 | +| ifeature | feature对象。  | +| mode | 功率模式,包括睡眠模式(待机状态运行)、一般模式(正常额定功率运行)、穿墙模式(最大功率运行,提高信号强度和覆盖面积)。 | **返回:** @@ -595,16 +549,14 @@ IWlanInterface::SetPowerMode ([in] struct HdfFeatureInfo ifeature, [in] unsigned ``` IWlanInterface::SetProjectionScreenParam ([in] String ifName, [in] struct ProjectionScreenCmdParam param ) ``` - -**描述:** - +**描述:** 设置投屏参数。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifName | 网卡名称。 | +| ifName | 网卡名称。  | | param | 投屏参数。 | **返回:** @@ -620,16 +572,14 @@ IWlanInterface::SetProjectionScreenParam ([in] String ifName, [in] struct Projec ``` IWlanInterface::SetScanningMacAddress ([in] struct HdfFeatureInfo ifeature, [in] unsigned char[] scanMac ) ``` - -**描述:** - +**描述:** 设置扫描单个MAC地址。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | scanMac | 设置STA扫描的MAC地址。 | **返回:** @@ -645,16 +595,14 @@ IWlanInterface::SetScanningMacAddress ([in] struct HdfFeatureInfo ifeature, [in] ``` IWlanInterface::SetTxPower ([in] struct HdfFeatureInfo ifeature, [in] int power ) ``` - -**描述:** - +**描述:** 设置发射功率。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | power | 设置的发射功率。 | **返回:** @@ -670,9 +618,7 @@ IWlanInterface::SetTxPower ([in] struct HdfFeatureInfo ifeature, [in] int power ``` IWlanInterface::Start () ``` - -**描述:** - +**描述:** 创建HAL和驱动之间的通道及获取驱动网卡信息,该函数调用在创建IWiFi实体后进行。 **返回:** @@ -688,16 +634,14 @@ IWlanInterface::Start () ``` IWlanInterface::StartChannelMeas ([in] String ifName, [in] struct MeasChannelParam measChannelParam ) ``` - -**描述:** - +**描述:** 启动信道测量。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifName | 网卡名称。 | +| ifName | 网卡名称。  | | measChannelParam | 信道测量参数(信道号、测量时间)。 | **返回:** @@ -713,16 +657,14 @@ IWlanInterface::StartChannelMeas ([in] String ifName, [in] struct MeasChannelPar ``` IWlanInterface::StartScan ([in] struct HdfFeatureInfo ifeature, [in] struct HdfWifiScan scan ) ``` - -**描述:** - +**描述:** 启动扫描。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifeature | feature对象。 | +| ifeature | feature对象。  | | scan | 扫描参数。 | **返回:** @@ -738,9 +680,7 @@ IWlanInterface::StartScan ([in] struct HdfFeatureInfo ifeature, [in] struct HdfW ``` IWlanInterface::Stop () ``` - -**描述:** - +**描述:** 销毁HAL和驱动之间的通道,该函数调用在销毁IWiFi实体前进行。 **返回:** @@ -756,16 +696,14 @@ IWlanInterface::Stop () ``` IWlanInterface::UnregisterEventCallback ([in] IWlanCallback cbFunc, [in] String ifName ) ``` - -**描述:** - +**描述:** 去注册IWiFi的回调函数。 **参数:** | 名称 | 描述 | | -------- | -------- | -| cbFunc | 去注册的回调函数。 | +| cbFunc | 去注册的回调函数。  | | ifName | 网卡名称。 | **返回:** @@ -781,17 +719,15 @@ IWlanInterface::UnregisterEventCallback ([in] IWlanCallback cbFunc, [in] String ``` IWlanInterface::WifiSendCmdIoctl ([in] String ifName, [in] int cmdId, [in] byte[] paramBuf ) ``` - -**描述:** - +**描述:** 向驱动发送IO控制命令。 **参数:** | 名称 | 描述 | | -------- | -------- | -| ifName | 网卡名称。 | -| cmdId | 命令ID。 | +| ifName | 网卡名称。  | +| cmdId | 命令ID。  | | paramBuf | 命令内容。 | **返回:** diff --git a/zh-cn/device-dev/reference/hdi-apis/pin__auth_2_i_executor_callback_8idl.md b/zh-cn/device-dev/reference/hdi-apis/pin__auth_2_i_executor_callback_8idl.md deleted file mode 100644 index a8a0b816d93ea68433e534748afc275f544773b6..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/pin__auth_2_i_executor_callback_8idl.md +++ /dev/null @@ -1,35 +0,0 @@ -# IExecutorCallback.idl - - -## **概述** - -定义异步API接口回调,用于返回异步接口的请求处理结果和获取信息。使用细节见[IExecutor](interface_pin_i_executor.md)。 - -**Since:** - -3.2 - -**Version:** - -1.0 - -**所属模块:** - -[HdfPinAuth](_hdf_pin_auth.md) - - -## **汇总** - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [IExecutorCallback](interface_pin_i_executor_callback.md) | 定义异步API接口回调,用于返回异步接口的请求处理结果和信息。使用细节见[IExecutor](interface_pin_i_executor.md)。 | - - -### 关键字 - - | 名称 | 描述 | -| -------- | -------- | -| package ohos.hdi.pin_auth.v1_0 | 口令认证接口的包路径 | diff --git a/zh-cn/device-dev/reference/hdi-apis/power.md b/zh-cn/device-dev/reference/hdi-apis/power.md index 4383da36d209e4552fbf70c1e62d023c3c4adcd3..8d377936210920a92b884262d77f0b3b80e8d9aa 100644 --- a/zh-cn/device-dev/reference/hdi-apis/power.md +++ b/zh-cn/device-dev/reference/hdi-apis/power.md @@ -1,22 +1,22 @@ # Power -## **概述** +## 概述 -提供休眠/唤醒操作、订阅休眠/唤醒状态、运行锁管理的接口。 +提供休眠/唤醒操作、订阅休眠/唤醒状态和运行锁管理的接口。 电源模块为电源服务提供的休眠/唤醒操作、订阅休眠/唤醒状态和运行锁管理的接口。 服务获取此模块的对象或代理后,可以调用相关的接口对设备进行休眠/唤醒、订阅休眠/唤醒状态和管理运行锁。 -**Since**: +**Since:** 3.1 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 @@ -32,15 +32,15 @@ | 名称 | 描述 | | -------- | -------- | -| [IPowerHdiCallback](interface_i_power_hdi_callback.md) | 休眠/唤醒状态的回调。 | -| [IPowerInterface](interface_i_power_interface.md) | 休眠/唤醒操作、订阅休眠/唤醒状态、运行锁管理的接口。 | +| [IPowerHdiCallback](interface_i_power_hdi_callback.md) | interface
休眠/唤醒状态的回调。 | +| [IPowerInterface](interface_i_power_interface.md) | interface
休眠/唤醒操作、订阅休眠/唤醒状态、运行锁管理的接口。 | ### 枚举 | 名称 | 描述 | | -------- | -------- | -| [PowerHdfCmd](#powerhdfcmd) {   CMD_REGISTER_CALLBCK = 0, CMD_START_SUSPEND, CMD_STOP_SUSPEND, CMD_FORCE_SUSPEND,   CMD_SUSPEND_BLOCK, CMD_SUSPEND_UNBLOCK, CMD_DUMP } | 枚举电源命令的参数。 | +| [PowerHdfCmd](#powerhdfcmd) { CMD_REGISTER_CALLBCK = 0, CMD_START_SUSPEND, CMD_STOP_SUSPEND, CMD_FORCE_SUSPEND,   CMD_SUSPEND_BLOCK, CMD_SUSPEND_UNBLOCK, CMD_DUMP } | 枚举电源命令的参数。 | | [PowerHdfCallbackCmd](#powerhdfcallbackcmd) { CMD_ON_SUSPEND = 0, CMD_ON_WAKEUP } | 枚举电源状态回调的参数。 | | [PowerHdfState](#powerhdfstate) { AWAKE = 0, INACTIVE, SLEEP } | 枚举电源的状态。 | @@ -52,7 +52,7 @@ | package ohos.hdi.power.v1_0 | 电源模块接口的包路径。 | -## **枚举类型说明** +## 枚举类型说明 ### PowerHdfCallbackCmd @@ -62,7 +62,7 @@ enum PowerHdfCallbackCmd ``` -**描述:** +**描述:** 枚举电源状态回调的参数。 @@ -79,7 +79,7 @@ enum PowerHdfCallbackCmd enum PowerHdfCmd ``` -**描述:** +**描述:** 枚举电源命令的参数。 @@ -101,7 +101,7 @@ enum PowerHdfCmd enum PowerHdfState ``` -**描述:** +**描述:** 枚举电源的状态。 diff --git a/zh-cn/device-dev/reference/hdi-apis/thermal.md b/zh-cn/device-dev/reference/hdi-apis/thermal.md index 72a5d3edf656d93a1cb5587840d022fc181f7e3d..baee01f86678c4fed89c47de392d408768630975 100644 --- a/zh-cn/device-dev/reference/hdi-apis/thermal.md +++ b/zh-cn/device-dev/reference/hdi-apis/thermal.md @@ -1,22 +1,22 @@ # Thermal -## **概述** +## 概述 提供设备温度管理、控制及订阅接口。 -热模块为热服务提供的设备温度管理、控制及订阅接口。服务获取此模块的对象或代理后,可以调用相关的接口管理、控制和订阅设备温度。 +热模块为热服务提供的设备温度管理、控制及订阅接口。 服务获取此模块的对象或代理后,可以调用相关的接口管理、控制和订阅设备温度。 -**Since**: +**Since:** 3.1 -**Version**: +**Version:** 1.0 -## **汇总** +## 汇总 ### 文件 @@ -32,10 +32,10 @@ | 名称 | 描述 | | -------- | -------- | -| [IThermalCallback](interface_i_thermal_callback.md) | 订阅设备发热状态的回调。 | -| [IThermalInterface](interface_i_thermal_interface.md) | 设备温度管理、控制及订阅接口。 | -| [ThermalZoneInfo](_thermal_zone_info.md) | 设备发热的信息。 | -| [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) | 设备发热的信息列表。 | +| [IThermalCallback](interface_i_thermal_callback.md) | interface
订阅设备发热状态的回调。 | +| [IThermalInterface](interface_i_thermal_interface.md) | interface
设备温度管理、控制及订阅接口。 | +| [ThermalZoneInfo](_thermal_zone_info.md) | struct
设备发热的信息。 | +| [HdfThermalCallbackInfo](_hdf_thermal_callback_info.md) | struct
设备发热的信息列表。 | ### 关键字 diff --git a/zh-cn/device-dev/reference/hdi-apis/union_audio_scene_descriptor_1_1_scene_desc.md b/zh-cn/device-dev/reference/hdi-apis/union_audio_scene_descriptor_1_1_scene_desc.md deleted file mode 100644 index f9291a99bb1b489827b8e47ed1a33301215de8df..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/union_audio_scene_descriptor_1_1_scene_desc.md +++ /dev/null @@ -1,21 +0,0 @@ -# AudioSceneDescriptor::SceneDesc - - -## **概述** - -音频场景描述。 - -**相关模块:** - -[Audio](_audio.md) - - -## **汇总** - - -### Public 属性 - - | 名称 | 描述 | -| -------- | -------- | -| [id](_audio.md#id) | 音频场景的ID。 | -| [desc](_audio.md#desc-35) | 以字符串命名的音频场景。 | diff --git a/zh-cn/device-dev/reference/hdi-apis/union_color_value.md b/zh-cn/device-dev/reference/hdi-apis/union_color_value.md index 49a63ccebf1a51b82141b05378791a5aa7030268..7026a44c27a85910708164c5eadd0f67aadc93fb 100644 --- a/zh-cn/device-dev/reference/hdi-apis/union_color_value.md +++ b/zh-cn/device-dev/reference/hdi-apis/union_color_value.md @@ -1,29 +1,33 @@ # ColorValue -## **概述** +## 概述 定义灯的颜色模式。 参数包括RGB模式和WRGB模式。 +**Since:** +3.2 +**Version:** +1.0 **相关模块:** -[Light](light.md) +[Light](_light.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [wrgbColor](#wrgbcolor) | WRGB模式 | -| [rgbColor](#rgbcolor) | RGB模式 | +| [wrgbColor](#wrgbcolor) | struct [WRGBColor](_w_r_g_b_color.md)
WRGB模式, 详见[WRGBColor](_w_r_g_b_color.md)。  | +| [rgbColor](#rgbcolor) | struct [RGBColor](_r_g_b_color.md)
RGB模式, 详见[RGBColor](_r_g_b_color.md)。  | -## **类成员变量说明** +## 类成员变量说明 ### rgbColor @@ -32,9 +36,7 @@ ``` struct RGBColor ColorValue::rgbColor ``` - -**描述:** - +**描述:** RGB模式, 详见[RGBColor](_r_g_b_color.md)。 @@ -44,7 +46,5 @@ RGB模式, 详见[RGBColor](_r_g_b_color.md)。 ``` struct WRGBColor ColorValue::wrgbColor ``` - -**描述:** - +**描述:** WRGB模式, 详见[WRGBColor](_w_r_g_b_color.md)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/union_current_service_cell_paras.md b/zh-cn/device-dev/reference/hdi-apis/union_current_service_cell_paras.md new file mode 100644 index 0000000000000000000000000000000000000000..7553024ab053073bf6d10fe69bb52c72acafea2e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/union_current_service_cell_paras.md @@ -0,0 +1,88 @@ +# CurrentServiceCellParas + + +## 概述 + +当前蜂窝数据信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [gsm](#gsm) | struct [CellRatGsm](_cell_rat_gsm.md)
Gsm蜂窝信息  | +| [lte](#lte) | struct [CellRatLte](_cell_rat_lte.md)
LTE蜂窝信息  | +| [wcdma](#wcdma) | struct [CellRatWcdma](_cell_rat_wcdma.md)
WCDMA蜂窝信息  | +| [cdma](#cdma) | struct [CellRatCdma](_cell_rat_cdma.md)
CDMA蜂窝信息  | +| [tdscdma](#tdscdma) | struct [CellRatTdscdma](_cell_rat_tdscdma.md)
TDSCDMA蜂窝信息  | +| [nr](#nr) | struct [CellRatNr](_cell_rat_nr.md)
NR蜂窝信息  | + + +## 类成员变量说明 + + +### cdma + + +``` +struct CellRatCdma CurrentServiceCellParas::cdma +``` +**描述:** +CDMA蜂窝信息 + + +### gsm + + +``` +struct CellRatGsm CurrentServiceCellParas::gsm +``` +**描述:** +Gsm蜂窝信息 + + +### lte + + +``` +struct CellRatLte CurrentServiceCellParas::lte +``` +**描述:** +LTE蜂窝信息 + + +### nr + + +``` +struct CellRatNr CurrentServiceCellParas::nr +``` +**描述:** +NR蜂窝信息 + + +### tdscdma + + +``` +struct CellRatTdscdma CurrentServiceCellParas::tdscdma +``` +**描述:** +TDSCDMA蜂窝信息 + + +### wcdma + + +``` +struct CellRatWcdma CurrentServiceCellParas::wcdma +``` +**描述:** +WCDMA蜂窝信息 diff --git a/zh-cn/device-dev/reference/hdi-apis/union_port_cap.md b/zh-cn/device-dev/reference/hdi-apis/union_port_cap.md index 015901e57a6474e086908bec3f88c427c14db67e..650d631d0fd697093aed64ba1a44c72cb081bbc7 100644 --- a/zh-cn/device-dev/reference/hdi-apis/union_port_cap.md +++ b/zh-cn/device-dev/reference/hdi-apis/union_port_cap.md @@ -1,27 +1,27 @@ # PortCap -## **概述** +## 概述 定义音视频编解码能力。 **相关模块:** -[Codec](codec.md) +[Codec](_codec.md) -## **汇总** +## 汇总 ### Public 属性 | 名称 | 描述 | | -------- | -------- | -| [video](#video) | 视频编解码能力 | -| [audio](#audio) | 音频编解码能力 | +| [video](#video) | [VideoPortCap](_video_port_cap.md)
视频编解码能力。  | +| [audio](#audio) | [AudioPortCap](_audio_port_cap.md)
音频编解码能力。  | -## **类成员变量说明** +## 类成员变量说明 ### audio @@ -30,9 +30,7 @@ ``` AudioPortCap PortCap::audio ``` - -**描述:** - +**描述:** 音频编解码能力。 @@ -42,7 +40,5 @@ AudioPortCap PortCap::audio ``` VideoPortCap PortCap::video ``` - -**描述:** - +**描述:** 视频编解码能力。 diff --git a/zh-cn/device-dev/reference/hdi-apis/union_scene_desc.md b/zh-cn/device-dev/reference/hdi-apis/union_scene_desc.md new file mode 100644 index 0000000000000000000000000000000000000000..cbb45e95f4d94f2bf6c6c12ad6c10e8862c8c19e --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/union_scene_desc.md @@ -0,0 +1,37 @@ +# SceneDesc + + +## 概述 + +音频场景描述。 + +**Since:** +3.2 +**Version:** +1.0 +**相关模块:** + +[Audio](_audio.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [id](#id) | unsigned int
音频场景的ID,详情参考[AudioCategory](_audio.md#audiocategory)。  | + + +## 类成员变量说明 + + +### id + + +``` +unsigned int SceneDesc::id +``` +**描述:** +音频场景的ID,详情参考[AudioCategory](_audio.md#audiocategory)。 diff --git a/zh-cn/device-dev/reference/hdi-apis/union_service_cell_paras.md b/zh-cn/device-dev/reference/hdi-apis/union_service_cell_paras.md new file mode 100644 index 0000000000000000000000000000000000000000..710534c68405c4ebc1c1a715c756133fec9c1066 --- /dev/null +++ b/zh-cn/device-dev/reference/hdi-apis/union_service_cell_paras.md @@ -0,0 +1,88 @@ +# ServiceCellParas + + +## 概述 + +多种网络模式的小区信息。 + +**相关模块:** + +[Ril](_ril.md) + + +## 汇总 + + +### Public 属性 + + | 名称 | 描述 | +| -------- | -------- | +| [gsm](#gsm) | struct [CellListRatGsm](_cell_list_rat_gsm.md)
GSM小区信息,具体查看[CellListRatGsm](_cell_list_rat_gsm.md) | +| [lte](#lte) | struct [CellListRatLte](_cell_list_rat_lte.md)
LTE小区信息,具体查看[CellListRatLte](_cell_list_rat_lte.md) | +| [wcdma](#wcdma) | struct [CellListRatWcdma](_cell_list_rat_wcdma.md)
WCDMA小区信息,具体查看[CellListRatWcdma](_cell_list_rat_wcdma.md) | +| [cdma](#cdma) | struct [CellListRatCdma](_cell_list_rat_cdma.md)
CDMA小区信息,具体查看[CellListRatCdma](_cell_list_rat_cdma.md) | +| [tdscdma](#tdscdma) | struct [CellListRatTdscdma](_cell_list_rat_tdscdma.md)
TDSCDMA小区信息,具体查看[CellListRatTdscdma](_cell_list_rat_tdscdma.md) | +| [nr](#nr) | struct [CellListRatNr](_cell_list_rat_nr.md)
NR小区信息,具体查看[CellListRatNr](_cell_list_rat_nr.md) | + + +## 类成员变量说明 + + +### cdma + + +``` +struct CellListRatCdma ServiceCellParas::cdma +``` +**描述:** +CDMA小区信息,具体查看[CellListRatCdma](_cell_list_rat_cdma.md) + + +### gsm + + +``` +struct CellListRatGsm ServiceCellParas::gsm +``` +**描述:** +GSM小区信息,具体查看[CellListRatGsm](_cell_list_rat_gsm.md) + + +### lte + + +``` +struct CellListRatLte ServiceCellParas::lte +``` +**描述:** +LTE小区信息,具体查看[CellListRatLte](_cell_list_rat_lte.md) + + +### nr + + +``` +struct CellListRatNr ServiceCellParas::nr +``` +**描述:** +NR小区信息,具体查看[CellListRatNr](_cell_list_rat_nr.md) + + +### tdscdma + + +``` +struct CellListRatTdscdma ServiceCellParas::tdscdma +``` +**描述:** +TDSCDMA小区信息,具体查看[CellListRatTdscdma](_cell_list_rat_tdscdma.md) + + +### wcdma + + +``` +struct CellListRatWcdma ServiceCellParas::wcdma +``` +**描述:** +WCDMA小区信息,具体查看[CellListRatWcdma](_cell_list_rat_wcdma.md) diff --git a/zh-cn/device-dev/reference/hdi-apis/wlan.md b/zh-cn/device-dev/reference/hdi-apis/wlan.md deleted file mode 100644 index b2bba7253d37b14588ca2b44988dd6a0612e6800..0000000000000000000000000000000000000000 --- a/zh-cn/device-dev/reference/hdi-apis/wlan.md +++ /dev/null @@ -1,55 +0,0 @@ -# WLAN - - -## **概述** - -WLAN模块向上层WLAN服务提供了统一接口。 - -上层WLAN服务开发人员可根据WLAN模块提供的向上统一接口获取如下能力:建立/关闭WLAN热点,扫描/关联WLAN热点,WLAN平台芯片管理,网络数据缓冲的申请、释放、移动等操作,网络设备管理,电源管理等。 - -**Since**: - -3.2 - -**Version**: - -1.0 - - -## **汇总** - - -### 文件 - - | 名称 | 描述 | -| -------- | -------- | -| [IWlanCallback.idl](_i_wlan_callback_8idl.md) | WLAN模块为WLAN服务提供的重启驱动、扫描结果、Netlink消息处理的回调。 | -| [IWlanInterface.idl](_i_wlan_interface_8idl.md) | 建立/关闭WLAN热点,扫描/关联/去关联WLAN热点,设置国家码,管理网络设备等操作的接口。 | -| [WlanTypes.idl](_wlan_types_8idl.md) | WLAN模块相关的数据类型。 | - - -### 类 - - | 名称 | 描述 | -| -------- | -------- | -| [IWlanCallback](interface_i_wlan_callback.md) | 定义WLAN模块的回调函数。 | -| [IWlanInterface](interface_i_wlan_interface.md) | WLAN模块向上层WLAN服务提供了统一接口。 | -| [HdfFeatureInfo](_hdf_feature_info.md) | feature对象信息。 | -| [HdfStaInfo](_hdf_sta_info.md) | STA的信息。 | -| [HdfWifiDriverScanSsid](_hdf_wifi_driver_scan_ssid.md) | WiFi扫描参数SSID信息。 | -| [HdfWifiScan](_hdf_wifi_scan.md) | WiFi扫描参数。 | -| [HdfNetDeviceInfo](_hdf_net_device_info.md) | 网络设备信息。 | -| [HdfNetDeviceInfoResult](_hdf_net_device_info_result.md) | 网络设备信息集合。 | -| [HdfWifiScanResult](_hdf_wifi_scan_result.md) | WiFi扫描结果。 | -| [HdfWifiInfo](_hdf_wifi_info.md) | WiFi频段信息。 | -| [MeasChannelParam](_meas_channel_param.md) | 信道测量参数。 | -| [MeasChannelResult](_meas_channel_result.md) | 信道测量结果。 | -| [ProjectionScreenCmdParam](_projection_screen_cmd_param.md) | 投屏参数。 | -| [WifiStationInfo](_wifi_station_info.md) | STA的信息。 | - - -### 关键字 - - | 名称 | 描述 | -| -------- | -------- | -| package ohos.hdi.wlan.v1_0 | WLAN模块接口的包路径。 | diff --git a/zh-cn/device-dev/subsystems/subsys-boot-init-seccomp.md b/zh-cn/device-dev/subsystems/subsys-boot-init-seccomp.md index d64a6a6eb431a15d0529fac5b3298d4b9c9e6098..f022097e0ef18ea91e814507ccf6f043f32db379 100644 --- a/zh-cn/device-dev/subsystems/subsys-boot-init-seccomp.md +++ b/zh-cn/device-dev/subsystems/subsys-boot-init-seccomp.md @@ -376,12 +376,18 @@ swapon;all ./build.sh --product-name 产品文件 --ccache --target-cpu arm64 --build-target 目标文件 ``` -5. 若第4步ELF文件依赖libc++.so,则通过执行命令将arm64位的libc++.so复制到out目录下。 +5. 若此前未进行全量编译,且第4步依赖的动态库未在//out文件夹下,则通过执行以下命令将业务依赖的相关动态库复制到//out目录下。以下为参考操作,若还依赖其它动态库,请自行复制。 ```shell - ./build.sh --product-name 产品名称 --ccache --build-target musl-libcxx.so --target-cpu arm64 + # 先进入代码根目录 + cd /root/to/OpenHarmonyCode + # 在out/产品名称/lib.unstripped/下创建aarch64-linux-ohos文件夹存放依赖的动态库 + mkdir out/产品名称/lib.unstripped/aarch64-linux-ohos + # 复制相关动态库到out目录下 + cp prebuilts/clang/ohos/${host_platform_dir}/llvm/lib/clang/${clang_version}/lib/aarch64-linux-ohos/*.so out/产品名称/lib.unstripped/aarch64-linux-ohos/ + cp prebuilts/clang/ohos/${host_platform_dir}/${clang_version}/llvm/lib/aarch64-linux-ohos/*.so out/产品名称/lib.unstripped/aarch64-linux-ohos/ ``` -6. 修改collect_elf_syscall.py脚本文件,将objdump与readelf工具的路径从空修改为工具在linux环境下的绝对路径。工具路径存放在//prebuilts文件夹下。 +6. 修改collect_elf_syscall.py脚本文件,将objdump与readelf工具的路径从空修改为工具在linux环境下的绝对路径。脚本文件存放在base/startup/init/services/modules/seccomp/scripts/tools/下。objdump与readelf工具存放在//prebuilts文件夹内部。 ```python #modified the path of objdump and readelf path def get_obj_dump_path(): @@ -396,8 +402,6 @@ swapon;all 7. 使用脚本解析生成对应的策略文件xxx.seccomp.policy - 脚本collect_elf_syscall.py在//base/startup/init/services/modules/seccomp/scripts/tools/路径下 - **表7** collect_elf_syscall.py的参数说明 | 参数 | 说明 | | --- | --- | diff --git a/zh-cn/device-dev/subsystems/subsys-build-all.md b/zh-cn/device-dev/subsystems/subsys-build-all.md index b6bddb7fb95fef31be91e2c937ec6692e78eb1bc..3da6fa6c5cc7feefdbdcb7d52160f418310629a1 100644 --- a/zh-cn/device-dev/subsystems/subsys-build-all.md +++ b/zh-cn/device-dev/subsystems/subsys-build-all.md @@ -105,6 +105,7 @@ OpenHarmony编译子系统是以GN和Ninja构建为基座,对构建和配置 - [子系统配置规则](subsys-build-subsystem.md#子系统配置规则) - [部件配置规则](subsys-build-component.md#部件配置规则) - [模块配置规则](subsys-build-module.md#模块配置规则) +- [Rust模块配置规则](subsys-build-rust-compilation.md#Rust模块配置规则) - [芯片解决方案配置规则](subsys-build-chip_solution.md#芯片解决方案配置规则) - [特性配置规则](subsys-build-feature.md#特性配置规则) - [系统能力配置规则](subsys-build-syscap.md#如何按需配置部件的系统能力) diff --git a/zh-cn/device-dev/subsystems/subsys-build-cargo2gn-guide.md b/zh-cn/device-dev/subsystems/subsys-build-cargo2gn-guide.md index 1bd28164b41007f94187a2ab7459bfd79aeec40b..3071cb6508db35dc7185e7bbaa5434bbeae90670 100644 --- a/zh-cn/device-dev/subsystems/subsys-build-cargo2gn-guide.md +++ b/zh-cn/device-dev/subsystems/subsys-build-cargo2gn-guide.md @@ -12,7 +12,7 @@ rust三方库使用cargo编译,配置为Cargo.toml。集成到OpenHarmony上 2. 创建配置文件cargo2gn.json,可以参考如下配置。 - ``` + ```json { "copy-out": true, "run": true, @@ -24,7 +24,7 @@ rust三方库使用cargo编译,配置为Cargo.toml。集成到OpenHarmony上 3. 执行以下命令进行转换。 ``` - python /mnt/xxx/openharmony/build/scripts/cargo2gn.py --config cargo2gn.json + python3 /mnt/xxx/openharmony/build/scripts/cargo2gn.py --config cargo2gn.json ``` 转换结果 @@ -83,7 +83,7 @@ rust三方库使用cargo编译,配置为Cargo.toml。集成到OpenHarmony上 ``` 2. 把所有需要转换的rust三方库添加到rust目录下的Cargo.toml的[workspace]里,如下所示。 - ``` + ```toml [workspace] members = [ "aho-corasick", diff --git a/zh-cn/device-dev/subsystems/subsys-build-rust-compilation.md b/zh-cn/device-dev/subsystems/subsys-build-rust-compilation.md index 1fc2e56d6d6f306e3ce279b4e1fc460afd3ee577..ab5bbfc1008c2f2bea1d16a12849f9e29663f63a 100644 --- a/zh-cn/device-dev/subsystems/subsys-build-rust-compilation.md +++ b/zh-cn/device-dev/subsystems/subsys-build-rust-compilation.md @@ -12,7 +12,7 @@ OpenHarmony为了集成C/C++代码和提升编译速度,使用了GN + Ninja的 | ----- | ------------------------------------------------------------ | | Cargo | Cargo是Rust官方使用的构建工具,允许Rust项目声明其各种依赖项,并确保您始终获得可重复的构建。 | | crate | crate是一个独立的可编译单元。 | -| lints | lints 是指出常见编程错误、错误、样式错误和可疑结构的工具。可以对程序进行更加广泛的错误分析。 | +| Lint | Lint是指出常见编程错误、错误、样式错误和可疑结构的工具。可以对程序进行更加广泛的错误分析。 | @@ -100,6 +100,9 @@ OpenHarmony提供了用于Rust代码编译构建的各类型GN模板,可以用 ![test_rlib_crate](./figures/test_rlib_crate.png) ### 配置三方库示例 + +rust三方库的BUILD.gn文件可通过cargo2gn工具自动生成。参见:[Cargo2gn工具操作指导](subsys-build-cargo2gn-guide.md) + 该示例用于测试包含预编译文件build.rs的三方静态库rlib文件的编译,使用了模板ohos_rust_executable和ohos_rust_cargo_crate。操作步骤如下: 1. 创建build/rust/tests/test_rlib_cargo_crate/crate/src/lib.rs,如下所示: @@ -301,26 +304,27 @@ OpenHarmony提供了用于Rust代码编译构建的各类型GN模板,可以用 在build/rust/tests目录下有Rust各类型模块的配置实例可供参考: | 用例目录 | 测试功能 | | -------------------------------------------- | ------------------------------------------------------------ | -| build/rust/tests/test_bin_crate | 测试ohos_rust_executable的host和target编译链接及运行 | -| build/rust/tests/test_static_link | 测试ohos_rust_executable对libstd.rlib进行静态链接 | -| build/rust/tests/test_dylib_crate | 测试ohos_rust_executable对ohos_rust_shared_library的编译依赖和运行 | -| build/rust/tests/test_rlib_crate | 测试ohos_rust_executable对ohos_rust_static_library的编译依赖和运行 | -| build/rust/tests/test_proc_macro_crate | 测试ohos_rust_executable对ohos_rust_proc_macro的编译依赖和运行,对不同类型都有用例覆盖 | -| build/rust/tests/test_cdylib_crate | 测试ohos_rust_executable对ohos_rust_shared_ffi的编译依赖和运行 | -| build/rust/tests/test_staticlib_crate | 测试ohos_rust_executable对ohos_rust_static_ffi的编译依赖和运行 | -| build/rust/tests/test_rust_ut | 测试ohos_rust_unittest,用例代码与特性代码在同一个文件中 | -| build/rust/tests/test_rust_st | 测试ohos_rust_systemtest,用例代码在独立的test目录中 | -| build/rust/tests/test_bin_cargo_crate | 测试ohos_cargo_crate对拥有build.rs预编译的可执行文件编译链接和运行,适用于rust三方crate编译依赖 | -| build/rust/tests/test_rlib_cargo_crate | 测试ohos_cargo_crate对拥有build.rs预编译的静态库文件编译链接和运行,适用于rust三方crate编译依赖 | -| build/rust/tests/test_proc_macro_cargo_crate | 测试ohos_cargo_crate对拥有build.rs预编译的过程宏编译链接和运行,适用于rust三方crate编译依赖 | +| build/rust/tests/test_bin_crate | 用ohos_rust_executable模板在host平台编译可执行文件,在target平台上运行可执行文件。 | +| build/rust/tests/test_static_link | 测试可执行文件对标准库的静态链接。 | +| build/rust/tests/test_dylib_crate | 测试对动态库的编译和动态链接功能 | +| build/rust/tests/test_rlib_crate | 测试对静态库的编译和静态链接功能 | +| build/rust/tests/test_proc_macro_crate | 测试对Rust过程宏的编译和链接功能。提供对不同类型的宏的测试用例。 | +| build/rust/tests/test_cdylib_crate | 测试将Rust代码编译成C/C++动态库。 | +| build/rust/tests/test_staticlib_crate | 测试将Rust代码编译成C/C++静态库。 | +| build/rust/tests/test_rust_ut | 测试Rust代码单元测试模板功能(ability)。 | +| build/rust/tests/test_rust_st | 测试Rust代码系统测试模板功能(ability)。 | +| build/rust/tests/test_bin_cargo_crate | 测试Rust三方可执行文件的编译和运行。三方源码中包含build.rs。 | +| build/rust/tests/test_rlib_cargo_crate | 测试Rust三方静态库的编译和静态链接。三方源码中包含build.rs。 | +| build/rust/tests/test_proc_macro_cargo_crate | 测试Rust三方过程宏的编译和链接。三方源码中包含build.rs。 | ## 参考 ### 特性点实例 #### Rust源码依赖调用C/C++库 -OpenHarmony上C/C++模块动态库默认用.z.so后缀,但是Rust的编译命令通过-l链接时,默认只会链接.so后缀的动态库。因此如果要依赖一个C/C++动态库编译模块,需要在该动态库的GN构建文件中添加output_externsion = "so"的声明,这样编译得到的动态库将会以".so"作为后缀,而不是".z.so"。 +OpenHarmony上C/C++模块动态库默认用.z.so后缀,但是Rust的编译命令通过-l链接时,默认只会链接.so后缀的动态库。因此如果要依赖一个C/C++动态库编译模块,需要在该动态库的GN构建文件中添加output_extension = "so"的声明,这样编译得到的动态库将会以".so"作为后缀,而不是".z.so"。 在Rust源码中如果直接链接动态库,后缀也需要使用".so",这时使用动态库的中间名,不需要添加lib前缀。例如Rust源码中链接libhilog.so: + ```rust #[link(name = "hilog")] ``` @@ -335,10 +339,11 @@ executable("foo") { }] } ``` -### lints规则 -OpenHarmony框架支持rustc lints和clippy lints两种lints,每种lints划为三个等级的标准:"openharmony"、"vendor"和"none",严格程度按照"openharmony" -> "vendor" -> "none"逐级递减。 -配置Rust模块时可以通过rustc_lints和clippy_lints来指定使用lints的等级。 +### Lint规则 +OpenHarmony框架支持rustc lints和clippy lints两种Lint,每种Lint划为三个等级的标准:"openharmony"、"vendor"和"none",严格程度按照"openharmony" -> "vendor" -> "none"逐级递减。 +配置Rust模块时可以通过rustc_lints和clippy_lints来指定使用Lint的等级。 模块中没有配置rustc_lints或者clippy_lints时会根据模块所在路径来匹配lints等级。不同路径下的Rust代码的语法规范会有不同程度地约束,因此用户在OpenHarmony配置Rust代码编译模块时还应关注模块所在路径。 + #### rustc lints和clippy lints的各等级标志 | **lints类型** | **模块属性** | **lints等级** | **lints等级标志** | **lints内容** | | ------------- | ------------ | ------------- | ----------------- | ------------------------------------------------------------ | @@ -358,3 +363,5 @@ OpenHarmony框架支持rustc lints和clippy lints两种lints,每种lints划为 | device | vendor | | others | openharmony | +### [交互工具使用指导](subsys-build-bindgen-cxx-guide.md) +### [Cargo2gn工具操作指导](subsys-build-cargo2gn-guide.md) diff --git a/zh-cn/device-dev/subsystems/subsys-dfx-hitracemeter.md b/zh-cn/device-dev/subsystems/subsys-dfx-hitracemeter.md index 58a4e82fea85f151a2101dd586adec0c520bed21..f8ccc1315303b939369d570fa967b89a0a9d2430 100644 --- a/zh-cn/device-dev/subsystems/subsys-dfx-hitracemeter.md +++ b/zh-cn/device-dev/subsystems/subsys-dfx-hitracemeter.md @@ -279,6 +279,7 @@ HiTraceMeter提供了可执行的二进制程序hitrace,设备刷openharmony | --trace_begin | 启动抓trace | | --trace_dump | 将数据输出到指定位置(默认控制台) | | --trace_finish | 停止抓trace,并将数据输出到指定位置(默认控制台) | +| --trace_finish_nodump | 停止抓trace,不输出trace信息 | | -l,--list_categories | 输出手机能支持的trace模块 | | --overwrite | 当缓冲区满的时候,将丢弃最新的信息。(默认丢弃最老的日志) | | -o filename,--output filename | 指定输出的目标文件名称 | diff --git a/zh-cn/device-dev/website.md b/zh-cn/device-dev/website.md index 5b7c3554ee4351f78c857c4c638c178b63955917..43302278d8057df1ec7c15b1f64d0ff373662520 100644 --- a/zh-cn/device-dev/website.md +++ b/zh-cn/device-dev/website.md @@ -562,258 +562,227 @@ - [移植常见问题](faqs/faqs-porting.md) - [启动恢复常见问题](faqs/faqs-startup.md) - [系统应用常见问题](faqs/faqs-system-applications.md) - - HDI接口参考 + - HDI接口参考 - 模块 - [Audio](reference/hdi-apis/_audio.md) - [Battery](reference/hdi-apis/battery.md) - - [Camera](reference/hdi-apis/camera.md) - - [Codec](reference/hdi-apis/codec.md) + - [Camera](reference/hdi-apis/_camera.md) + - [Codec](reference/hdi-apis/_codec.md) - [Display](reference/hdi-apis/_display.md) - [HdfFaceAuth](reference/hdi-apis/_hdf_face_auth.md) - [HdfPinAuth](reference/hdi-apis/_hdf_pin_auth.md) - [HdfUserAuth](reference/hdi-apis/_hdf_user_auth.md) - - [HdiActivityRecognition](reference/hdi-apis/activity_recognition.md) - - [Input](reference/hdi-apis/input.md) - - [Light](reference/hdi-apis/light.md) - - [Motion](reference/hdi-apis/motion.md) + - [HdiActivityRecognition](reference/hdi-apis/_hdi_activity_recognition.md) + - [HdiLpfenceCellbatching](reference/hdi-apis/_hdi_lpfence_cellbatching.md) + - [HdiLpfenceCellfence](reference/hdi-apis/_hdi_lpfence_cellfence.md) + - [HdiLpfenceGeofence](reference/hdi-apis/_hdi_lpfence_geofence.md) + - [HdiLpfenceWififence](reference/hdi-apis/_hdi_lpfence_wififence.md) + - [Input](reference/hdi-apis/_input.md) + - [Light](reference/hdi-apis/_light.md) + - [Motion](reference/hdi-apis/_motion.md) + - [NNRt](reference/hdi-apis/_n_n_rt.md) - [Power](reference/hdi-apis/power.md) - - [Sensor](reference/hdi-apis/sensor.md) + - [Ril](reference/hdi-apis/_ril.md) + - [Sensor](reference/hdi-apis/_sensor.md) - [Thermal](reference/hdi-apis/thermal.md) - - [USB](reference/hdi-apis/usb.md) - - [Vibrator](reference/hdi-apis/vibrator.md) - - [WLAN](reference/hdi-apis/wlan.md) - - 头文件和结构体 - - 头文件 - - [audio_adapter.h](reference/hdi-apis/audio__adapter_8h.md) - - [audio_attribute.h](reference/hdi-apis/audio__attribute_8h.md) - - [audio_capture.h](reference/hdi-apis/audio__capture_8h.md) - - [audio_control.h](reference/hdi-apis/audio__control_8h.md) - - [audio_manager.h](reference/hdi-apis/audio__manager_8h.md) - - [audio_render.h](reference/hdi-apis/audio__render_8h.md) - - [audio_scene.h](reference/hdi-apis/audio__scene_8h.md) - - [audio_types.h](reference/hdi-apis/audio__types_8h.md) - - [audio_volume.h](reference/hdi-apis/audio__volume_8h.md) - - [codec_callback_if.h](reference/hdi-apis/codec_callback_if_h.md) - - [codec_common_type.h](reference/hdi-apis/codec_common_type_h.md) - - [codec_component_if.h](reference/hdi-apis/codec_component_if_h.md) - - [codec_component_manager.h](reference/hdi-apis/codec__component__manager_h.md) - - [codec_component_type.h](reference/hdi-apis/codec__component__type_h.md) + - [USB](reference/hdi-apis/_u_s_b.md) + - [Vibrator](reference/hdi-apis/_vibrator.md) + - [WLAN](reference/hdi-apis/_w_l_a_n.md) + - 头文件 + - Audio模块头文件 + - [AudioTypes.idl](reference/hdi-apis/_audio_types_8idl.md) + - [IAudioAdapter.idl](reference/hdi-apis/_i_audio_adapter_8idl.md) + - [IAudioCallback.idl](reference/hdi-apis/_i_audio_callback_8idl.md) + - [IAudioCapture.idl](reference/hdi-apis/_i_audio_capture_8idl.md) + - [IAudioManager.idl](reference/hdi-apis/_i_audio_manager_8idl.md) + - [IAudioRender.idl](reference/hdi-apis/_i_audio_render_8idl.md) + - Battery模块相关头文件 + - [IBatteryCallback.idl](reference/hdi-apis/_i_battery_callback_8idl.md) + - [IBatteryInterface.idl](reference/hdi-apis/_i_battery_interface_8idl.md) + - [Types.idl](reference/hdi-apis/_battery_types_8idl.md) + - Camera模块头文件 + - [ICameraDevice.idl](reference/hdi-apis/_i_camera_device_8idl.md) + - [ICameraDeviceCallback.idl](reference/hdi-apis/_i_camera_device_callback_8idl.md) + - [ICameraHost.idl](reference/hdi-apis/_i_camera_host_8idl.md) + - [ICameraHostCallback.idl](reference/hdi-apis/_i_camera_host_callback_8idl.md) + - [IOfflineStreamOperator.idl](reference/hdi-apis/_i_offline_stream_operator_8idl.md) + - [IStreamOperator.idl](reference/hdi-apis/_i_stream_operator_8idl.md) + - [IStreamOperatorCallback.idl](reference/hdi-apis/_i_stream_operator_callback_8idl.md) + - [Types.idl](reference/hdi-apis/_types_8idl.md) + - Codec模块头文件 + - [codec_callback_if.h](reference/hdi-apis/codec__callback__if_8h.md) + - [codec_common_type.h](reference/hdi-apis/codec__common__type_8h.md) + - [codec_component_if.h](reference/hdi-apis/codec__component__if_8h.md) + - [codec_component_manager.h](reference/hdi-apis/codec__component__manager_8h.md) + - [codec_component_type.h](reference/hdi-apis/codec__component__type_8h.md) + - Display模块头文件 - [display_device.h](reference/hdi-apis/display__device_8h.md) - [display_gfx.h](reference/hdi-apis/display__gfx_8h.md) - [display_gralloc.h](reference/hdi-apis/display__gralloc_8h.md) - [display_layer.h](reference/hdi-apis/display__layer_8h.md) - [display_type.h](reference/hdi-apis/display__type_8h.md) - [display_vgu.h](reference/hdi-apis/display__vgu_8h.md) - - [input_controller.h](reference/hdi-apis/input__controller_8h.md) - - [input_manager.h](reference/hdi-apis/input__manager_8h.md) - - [input_reporter.h](reference/hdi-apis/input__reporter_8h.md) - - [input_type.h](reference/hdi-apis/input__type_8h.md) - - [ActivityRecognitionTypes.idl](reference/hdi-apis/activity_recognition_types_idl.md) - - [Types.idl](reference/hdi-apis/battery_types_idl.md) - - [IExecutor.idl](reference/hdi-apis/face__auth_2_i_executor_8idl.md) - - [IExecutorCallback.idl](reference/hdi-apis/face__auth_2_i_executor_callback_8idl.md) + - HdfFaceAuth模块头文件 - [FaceAuthTypes.idl](reference/hdi-apis/_face_auth_types_8idl.md) - - [PinAuthTypes.idl](reference/hdi-apis/_pin_auth_types_8idl.md) - - [IExecutor.idl](reference/hdi-apis/pin__auth_2_i_executor_8idl.md) - - [IExecutorCallback.idl](reference/hdi-apis/pin__auth_2_i_executor_callback_8idl.md) + - [IExecutor.idl](reference/hdi-apis/_i_executor_8idl_faceauth.md) + - [IExecutorCallback.idl](reference/hdi-apis/_i_executor_callback_8idl_faceauth.md) - [IFaceAuthInterface.idl](reference/hdi-apis/_i_face_auth_interface_8idl.md) + - HdfPinAuth模块头文件 + - [IExecutor.idl](reference/hdi-apis/_i_executor_8idl_pinauth.md) + - [IExecutorCallback.idl](reference/hdi-apis/_i_executor_callback_8idl_pinauth.md) - [IPinAuthInterface.idl](reference/hdi-apis/_i_pin_auth_interface_8idl.md) + - HdfUserAuth模块头文件 - [IUserAuthInterface.idl](reference/hdi-apis/_i_user_auth_interface_8idl.md) - [UserAuthTypes.idl](reference/hdi-apis/_user_auth_types_8idl.md) + - HdiActivityRecognition模块头文件 + - [ActivityRecognitionTypes.idl](reference/hdi-apis/_activity_recognition_types_8idl.md) - [IActivityChangedCallback.idl](reference/hdi-apis/_i_activity_changed_callback_8idl.md) - [IActivityInterface.idl](reference/hdi-apis/_i_activity_interface_8idl.md) - - [IBatteryCallback.idl](reference/hdi-apis/_i_battery_callback_8idl.md) - - [IBatteryInterface.idl](reference/hdi-apis/_i_battery_interface_8idl.md) - - [ICameraDevice.idl](reference/hdi-apis/_i_camera_device_8idl.md) - - [ICameraDeviceCallback.idl](reference/hdi-apis/_i_camera_device_callback_8idl.md) - - [ICameraHostCallback.idl](reference/hdi-apis/_i_camera_host_callback_8idl.md) - - [ICameraHost.idl](reference/hdi-apis/_i_camera_host_8idl.md) + - HdiLpfenceCellbatching模块头文件 + - [CellbatchingTypes.idl](reference/hdi-apis/_cellbatching_types_8idl.md) + - [ICellbatchingCallback.idl](reference/hdi-apis/_i_cellbatching_callback_8idl.md) + - [ICellbatchingInterface.idl](reference/hdi-apis/_i_cellbatching_interface_8idl.md) + - HdiLpfenceCellfence模块头文件 + - [CellfenceTypes.idl](reference/hdi-apis/_cellfence_types_8idl.md) + - [ICellfenceCallback.idl](reference/hdi-apis/_i_cellfence_callback_8idl.md) + - [ICellfenceInterface.idl](reference/hdi-apis/_i_cellfence_interface_8idl.md) + - HdiLpfenceGeofence模块头文件 + - [GeofenceTypes.idl](reference/hdi-apis/_geofence_types_8idl.md) + - [IGeofenceCallback.idl](reference/hdi-apis/_i_geofence_callback_8idl.md) + - [IGeofenceIntf.idl](reference/hdi-apis/_i_geofence_intf_8idl.md) + - HdiLpfenceWififence模块头文件 + - [IWififenceCallback.idl](reference/hdi-apis/_i_wififence_callback_8idl.md) + - [IWififenceInterface.idl](reference/hdi-apis/_i_wififence_interface_8idl.md) + - [WififenceTypes.idl](reference/hdi-apis/_wififence_types_8idl.md) + - Input模块头文件 + - [input_controller.h](reference/hdi-apis/input__controller_8h.md) + - [input_manager.h](reference/hdi-apis/input__manager_8h.md) + - [input_reporter.h](reference/hdi-apis/input__reporter_8h.md) + - [input_type.h](reference/hdi-apis/input__type_8h.md) + - Light模块头文件 - [ILightInterface.idl](reference/hdi-apis/_i_light_interface_8idl.md) + - [LightTypes.idl](reference/hdi-apis/_light_types_8idl.md) + - Motion模块头文件 - [IMotionCallback.idl](reference/hdi-apis/_i_motion_callback_8idl.md) - [IMotionInterface.idl](reference/hdi-apis/_i_motion_interface_8idl.md) - - [IOfflineStreamOperator.idl](reference/hdi-apis/_i_offline_stream_operator_8idl.md) + - [MotionTypes.idl](reference/hdi-apis/_motion_types_8idl.md) + - NNRt模块头文件 + - [INnrtDevice.idl](reference/hdi-apis/_i_nnrt_device_8idl.md) + - [IPreparedModel.idl](reference/hdi-apis/_i_prepared_model_8idl.md) + - [ModelTypes.idl](reference/hdi-apis/_model_types_8idl.md) + - [NnrtTypes.idl](reference/hdi-apis/_nnrt_types_8idl.md) + - [NodeAttrTypes.idl](reference/hdi-apis/_node_attr_types_8idl.md) + - Power模块头文件 - [IPowerHdiCallback.idl](reference/hdi-apis/_i_power_hdi_callback_8idl.md) - [IPowerInterface.idl](reference/hdi-apis/_i_power_interface_8idl.md) + - [PowerTypes.idl](reference/hdi-apis/_power_types_8idl.md) + - Ril模块头文件 + - [IRil.idl](reference/hdi-apis/_i_ril_8idl.md) + - [IRilCallback.idl](reference/hdi-apis/_i_ril_callback_8idl.md) + - [Types.idl](reference/hdi-apis/_ril_types_8idl.md) + - Sensor模块头文件 - [ISensorCallback.idl](reference/hdi-apis/_i_sensor_callback_8idl.md) - [ISensorInterface.idl](reference/hdi-apis/_i_sensor_interface_8idl.md) - - [IStreamOperator.idl](reference/hdi-apis/_i_stream_operator_8idl.md) - - [IStreamOperatorCallback.idl](reference/hdi-apis/_i_stream_operator_callback_8idl.md) + - [SensorTypes.idl](reference/hdi-apis/_sensor_types_8idl.md) + - Thermal模块头文件 - [IThermalCallback.idl](reference/hdi-apis/_i_thermal_callback_8idl.md) - [IThermalInterface.idl](reference/hdi-apis/_i_thermal_interface_8idl.md) + - [ThermalTypes.idl](reference/hdi-apis/_thermal_types_8idl.md) + - USB模块头文件 - [IUsbdBulkCallback.idl](reference/hdi-apis/_i_usbd_bulk_callback_8idl.md) - - [IUsbInterface.idl](reference/hdi-apis/_i_usb_interface_8idl.md) - [IUsbdSubscriber.idl](reference/hdi-apis/_i_usbd_subscriber_8idl.md) + - [IUsbInterface.idl](reference/hdi-apis/_i_usb_interface_8idl.md) + - [UsbTypes.idl](reference/hdi-apis/_usb_types_8idl.md) + - Vibrator模块头文件 - [IVibratorInterface.idl](reference/hdi-apis/_i_vibrator_interface_8idl.md) + - [VibratorTypes.idl](reference/hdi-apis/_vibrator_types_8idl.md) + - WLAN模块头文件 - [IWlanCallback.idl](reference/hdi-apis/_i_wlan_callback_8idl.md) - [IWlanInterface.idl](reference/hdi-apis/_i_wlan_interface_8idl.md) - - [LightTypes.idl](reference/hdi-apis/_light_types_8idl.md) - - [MotionTypes.idl](reference/hdi-apis/_motion_types_8idl.md) - - [PowerTypes.idl](reference/hdi-apis/_power_types_8idl.md) - - [SensorTypes.idl](reference/hdi-apis/_sensor_types_8idl.md) - - [ThermalTypes.idl](reference/hdi-apis/_thermal_types_8idl.md) - - [Types.idl](reference/hdi-apis/camera_2v1__0_2_types_8idl.md) - - [UsbTypes.idl](reference/hdi-apis/_usb_types_8idl.md) - - [VibratorTypes.idl](reference/hdi-apis/_vibrator_types_8idl.md) - [WlanTypes.idl](reference/hdi-apis/_wlan_types_8idl.md) - - 结构体 - - [YUVDescInfo](reference/hdi-apis/_yun_desc_info_.md) - - [ExtDataHandle](reference/hdi-apis/_ext_data_handle.md) - - [ActRecognitionEvent](reference/hdi-apis/_act_recognition_event.md) - - [AllocInfo](reference/hdi-apis/_alloc_info.md) - - [Alignment](reference/hdi-apis/_alignment.md) - - [AudioAdapter](reference/hdi-apis/_audio_adapter.md) + - 结构体 + - Audio模块结构体 - [AudioAdapterDescriptor](reference/hdi-apis/_audio_adapter_descriptor.md) - - [AudioAttribute](reference/hdi-apis/_audio_attribute.md) - - [AudioCapture](reference/hdi-apis/_audio_capture.md) - - [AudioControl](reference/hdi-apis/_audio_control.md) - [AudioDevExtInfo](reference/hdi-apis/_audio_dev_ext_info.md) - [AudioDeviceDescriptor](reference/hdi-apis/_audio_device_descriptor.md) - - [AudioManager](reference/hdi-apis/_audio_manager.md) + - [AudioDeviceStatus](reference/hdi-apis/_audio_device_status.md) + - [AudioEvent](reference/hdi-apis/_audio_event.md) + - [AudioInfo](reference/hdi-apis/_audio_info.md) - [AudioMixExtInfo](reference/hdi-apis/_audio_mix_ext_info.md) - - [AudioMmapBufferDescriptor](reference/hdi-apis/_audio_mmap_buffer_descriptor.md) + - [AudioMmapBufferDescripter](reference/hdi-apis/_audio_mmap_buffer_descripter.md) - [AudioPort](reference/hdi-apis/_audio_port.md) - - [AudioPortCap](reference/hdi-apis/audio_portcap.md) - [AudioPortCapability](reference/hdi-apis/_audio_port_capability.md) - - [AudioRender](reference/hdi-apis/_audio_render.md) - [AudioRoute](reference/hdi-apis/_audio_route.md) - [AudioRouteNode](reference/hdi-apis/_audio_route_node.md) - [AudioSampleAttributes](reference/hdi-apis/_audio_sample_attributes.md) - - [AudioScene](reference/hdi-apis/_audio_scene.md) - [AudioSceneDescriptor](reference/hdi-apis/_audio_scene_descriptor.md) - - [AudioSceneDescriptor::SceneDesc](reference/hdi-apis/union_audio_scene_descriptor_1_1_scene_desc.md) - [AudioSessionExtInfo](reference/hdi-apis/_audio_session_ext_info.md) - [AudioSubPortCapability](reference/hdi-apis/_audio_sub_port_capability.md) - [AudioTimeStamp](reference/hdi-apis/_audio_time_stamp.md) - - [AudioVolume](reference/hdi-apis/_audio_volume.md) - - [AuthResultInfo](reference/hdi-apis/_auth_result_info.md) - - [AuthSolution](reference/hdi-apis/_auth_solution.md) - - [BufferData](reference/hdi-apis/_buffer_data.md) + - [IAudioAdapter](reference/hdi-apis/interface_i_audio_adapter.md) + - [IAudioCallback](reference/hdi-apis/interface_i_audio_callback.md) + - [IAudioCapture](reference/hdi-apis/interface_i_audio_capture.md) + - [IAudioManager](reference/hdi-apis/interface_i_audio_manager.md) + - [IAudioRender](reference/hdi-apis/interface_i_audio_render.md) + - [SceneDesc](reference/hdi-apis/union_scene_desc.md) + - Battery模块结构体 - [BatteryInfo](reference/hdi-apis/_battery_info.md) + - [IBatteryCallback](reference/hdi-apis/interface_i_battery_callback.md) + - [IBatteryInterface](reference/hdi-apis/interface_i_battery_interface.md) + - Camera模块结构体 - [CaptureEndedInfo](reference/hdi-apis/_capture_ended_info.md) - [CaptureErrorInfo](reference/hdi-apis/_capture_error_info.md) - [CaptureInfo](reference/hdi-apis/_capture_info.md) + - [ICameraDevice](reference/hdi-apis/interface_i_camera_device.md) + - [ICameraDeviceCallback](reference/hdi-apis/interface_i_camera_device_callback.md) + - [ICameraHost](reference/hdi-apis/interface_i_camera_host.md) + - [ICameraHostCallback](reference/hdi-apis/interface_i_camera_host_callback.md) + - [IOfflineStreamOperator](reference/hdi-apis/interface_i_offline_stream_operator.md) + - [IStreamOperator](reference/hdi-apis/interface_i_stream_operator.md) + - [IStreamOperatorCallback](reference/hdi-apis/interface_i_stream_operator_callback.md) + - [StreamAttribute](reference/hdi-apis/_stream_attribute.md) + - [StreamInfo](reference/hdi-apis/_stream_info.md) + - Codec模块结构体 + - [Alignment](reference/hdi-apis/_alignment.md) + - [AudioPortCap](reference/hdi-apis/_audio_port_cap.md) - [CodecCallbackType](reference/hdi-apis/_codec_callback_type.md) - [CodecCompCapability](reference/hdi-apis/_codec_comp_capability.md) - [CodecComponentManager](reference/hdi-apis/_codec_component_manager.md) - [CodecComponentType](reference/hdi-apis/_codec_component_type.md) - - [ColorValue](reference/hdi-apis/union_color_value.md) - [CompVerInfo](reference/hdi-apis/_comp_ver_info.md) - - [CredentialInfo](reference/hdi-apis/_credential_info.md) + - [EventInfo](reference/hdi-apis/_event_info.md) + - [GetBufferHandleUsageParams](reference/hdi-apis/_get_buffer_handle_usage_params.md) + - [OmxCodecBuffer](reference/hdi-apis/_omx_codec_buffer.md) + - [PortCap](reference/hdi-apis/union_port_cap.md) + - [RangeValue](reference/hdi-apis/_range_value.md) + - [Rect](reference/hdi-apis/_rect.md) + - [SupportBufferType](reference/hdi-apis/_support_buffer_type.md) + - [UseBufferType](reference/hdi-apis/_use_buffer_type.md) + - [VideoPortCap](reference/hdi-apis/_video_port_cap.md) + - Display模块结构体 + - [AllocInfo](reference/hdi-apis/_alloc_info.md) + - [BufferData](reference/hdi-apis/_buffer_data.md) - [DeviceFuncs](reference/hdi-apis/_device_funcs.md) - [DisplayCapability](reference/hdi-apis/_display_capability.md) - [DisplayInfo](reference/hdi-apis/_display_info.md) - [DisplayModeInfo](reference/hdi-apis/_display_mode_info.md) - - [EnrolledInfo](reference/hdi-apis/_enrolled_info.md) - - [EnrollParam](reference/hdi-apis/_enroll_param.md) - - [EnrollResultInfo](reference/hdi-apis/_enroll_resultinfo.md) - - [EventInfo](reference/hdi-apis/_event_info.md) - - [ExecutorInfo](reference/hdi-apis/_executor_info.md) - - [ExecutorInfo](reference/hdi-apis/_user_executor_info.md) - - [ExecutorRegisterInfo](reference/hdi-apis/_executor_register_info.md) - - [ExecutorSendMsg](reference/hdi-apis/_executor_send_msg.md) - - [GetBufferHandleUsageParams](reference/hdi-apis/_get_buffer_handle_usage_params.md) + - [ExtDataHandle](reference/hdi-apis/_ex_data_handle.md) - [GfxFuncs](reference/hdi-apis/_gfx_funcs.md) - [GfxOpt](reference/hdi-apis/_gfx_opt.md) - [GrallocFuncs](reference/hdi-apis/_gralloc_funcs.md) - - [HdfFeatureInfo](reference/hdi-apis/_hdf_feature_info.md) - - [HdfLightColor](reference/hdi-apis/_hdf_light_color.md) - - [HdfLightEffect](reference/hdi-apis/_hdf_light_effect.md) - - [HdfLightFlashEffect](reference/hdi-apis/_hdf_light_flash_effect.md) - - [HdfLightInfo](reference/hdi-apis/_hdf_light_info.md) - - [HdfMotionEvent](reference/hdi-apis/_hdf_motion_event.md) - - [HdfNetDeviceInfo](reference/hdi-apis/_hdf_net_device_info.md) - - [HdfNetDeviceInfoResult](reference/hdi-apis/_hdf_net_device_info_result.md) - - [HdfSensorEvents](reference/hdi-apis/_hdf_sensor_events.md) - - [HdfSensorInformation](reference/hdi-apis/_hdf_sensor_information.md) - - [HdfStaInfo](reference/hdi-apis/_hdf_sta_info.md) - - [HdfThermalCallbackInfo](reference/hdi-apis/_hdf_thermal_callback_info.md) - - [HdfVibratorInfo](reference/hdi-apis/_hdf_vibrator_info.md) - - [HdfWifiDriverScanSsid](reference/hdi-apis/_hdf_wifi_driver_scan_ssid.md) - - [HdfWifiInfo](reference/hdi-apis/_hdf_wifi_info.md) - - [HdfWifiScan](reference/hdi-apis/_hdf_wifi_scan.md) - - [HdfWifiScanResult](reference/hdi-apis/_hdf_wifi_scan_result.md) - [HDRCapability](reference/hdi-apis/_h_d_r_capability.md) - [HDRMetaData](reference/hdi-apis/_h_d_r_meta_data.md) - - [IActivityChangedCallback](reference/hdi-apis/interface_i_activity_changed_callback.md) - - [IActivityInterface](reference/hdi-apis/interface_i_activity_interface.md) - - [IBatteryCallback](reference/hdi-apis/interface_i_battery_callback.md) - - [IBatteryInterface](reference/hdi-apis/interface_i_battery_interface.md) - - [ICameraDevice](reference/hdi-apis/interface_i_camera_device.md) - - [ICameraDeviceCallback](reference/hdi-apis/interface_i_camera_device_callback.md) - - [ICameraHost](reference/hdi-apis/interface_i_camera_host.md) - - [ICameraHostCallback](reference/hdi-apis/interface_i_camera_host_callback.md) - [ICircle](reference/hdi-apis/_i_circle.md) - - [IdentifyResultInfo](reference/hdi-apis/_identify_result_info.md) - - [IExecutor](reference/hdi-apis/interface_i_executor.md) - - [IExecutor](reference/hdi-apis/interface_pin_i_executor.md) - - [IExecutorCallback](reference/hdi-apis/interface_i_executor_callback.md) - - [IExecutorCallback](reference/hdi-apis/interface_pin_i_executor_callback.md) - - [IFaceAuthInterface](reference/hdi-apis/interface_i_face_auth_interface.md) - [ILine](reference/hdi-apis/_i_line.md) - - [IInputInterface](reference/hdi-apis/_i_input_interface.md) - - [ILightInterface](reference/hdi-apis/interface_i_light_interface.md) - - [IMotionCallback](reference/hdi-apis/interface_i_motion_callback.md) - - [IMotionInterface](reference/hdi-apis/interface_i_motion_interface.md) - - [InputController](reference/hdi-apis/_input_controller.md) - - [InputDevAbility](reference/hdi-apis/_input_dev_ability.md) - - [InputDevAttr](reference/hdi-apis/_input_dev_attr.md) - - [InputDevDesc](reference/hdi-apis/_input_dev_desc.md) - - [InputDeviceInfo](reference/hdi-apis/_input_device_info.md) - - [InputDevIdentify](reference/hdi-apis/_input_dev_identify.md) - - [InputDimensionInfo](reference/hdi-apis/_input_dimension_info.md) - - [InputEventCb](reference/hdi-apis/_input_event_cb.md) - - [InputEventPackage](reference/hdi-apis/_input_event_package.md) - - [IPowerHdiCallback](reference/hdi-apis/interface_i_power_hdi_callback.md) - - [InputExtraCmd](reference/hdi-apis/_input_extra_cmd.md) - - [InputHostCb](reference/hdi-apis/_input_host_cb.md) - - [InputHotPlugEvent](reference/hdi-apis/_input_hot_plug_event.md) - - [InputManager](reference/hdi-apis/_input_manager.md) - - [InputReporter](reference/hdi-apis/_input_reporter.md) - - [IOfflineStreamOperator](reference/hdi-apis/interface_i_offline_stream_operator.md) - - [IPinAuthInterface](reference/hdi-apis/interface_i_pin_auth_interface.md) - - [IPowerInterface](reference/hdi-apis/interface_i_power_interface.md) - [IRect](reference/hdi-apis/_i_rect.md) - - [ISensorCallback](reference/hdi-apis/interface_i_sensor_callback.md) - - [ISensorInterface](reference/hdi-apis/interface_i_sensor_interface.md) - - [IStreamOperator](reference/hdi-apis/interface_i_stream_operator.md) - - [IStreamOperatorCallback](reference/hdi-apis/interface_i_stream_operator_callback.md) - [ISurface](reference/hdi-apis/_i_surface.md) - - [IThermalCallback](reference/hdi-apis/interface_i_thermal_callback.md) - - [IThermalInterface](reference/hdi-apis/interface_i_thermal_interface.md) - - [IUsbdBulkCallback](reference/hdi-apis/interface_i_usbd_bulk_callback.md) - - [IUsbdSubscriber](reference/hdi-apis/interface_i_usbd_subscriber.md) - - [IUsbInterface](reference/hdi-apis/interface_i_usb_interface.md) - - [IUserAuthInterface](reference/hdi-apis/interface_i_user_auth_interface.md) - - [IVibratorInterface](reference/hdi-apis/interface_i_vibrator_interface.md) - - [IWlanCallback](reference/hdi-apis/interface_i_wlan_callback.md) - - [IWlanInterface](reference/hdi-apis/interface_i_wlan_interface.md) - [LayerAlpha](reference/hdi-apis/_layer_alpha.md) - [LayerBuffer](reference/hdi-apis/_layer_buffer.md) - [LayerFuncs](reference/hdi-apis/_layer_funcs.md) - [LayerInfo](reference/hdi-apis/_layer_info.md) - - [MeasChannelParam](reference/hdi-apis/_meas_channel_param.md) - - [MeasChannelResult](reference/hdi-apis/_meas_channel_result.md) - - [OmxCodecBuffer](reference/hdi-apis/_omx_codec_buffer.md) - - [PortCap](reference/hdi-apis/union_port_cap.md) - - [PortInfo](reference/hdi-apis/_port_info.md) - [PresentTimestamp](reference/hdi-apis/_present_timestamp.md) - [PropertyObject](reference/hdi-apis/_property_object.md) - - [ProjectionScreenCmdParam](reference/hdi-apis/_projection_screen_cmd_param.md) - - [RangeValue](reference/hdi-apis/_range_value.md) - - [Rect](reference/hdi-apis/_rect.md) - [Rectangle](reference/hdi-apis/_rectangle.md) - - [RGBColor](reference/hdi-apis/_r_g_b_color.md) - - [ScheduleInfo](reference/hdi-apis/_schedule_info.md) - - [StreamAttribute](reference/hdi-apis/_stream_attribute.md) - - [StreamInfo](reference/hdi-apis/_stream_info.md) - - [SupportBufferType](reference/hdi-apis/_support_buffer_type.md) - - [TemplateInfo](reference/hdi-apis/_template_info.md) - - [ThermalZoneInfo](reference/hdi-apis/_thermal_zone_info.md) - - [UsbCtrlTransfer](reference/hdi-apis/_usb_ctrl_transfer.md) - - [UsbDev](reference/hdi-apis/_usb_dev.md) - - [USBDeviceInfo](reference/hdi-apis/_u_s_b_device_info.md) - - [UsbPipe](reference/hdi-apis/_usb_pipe.md) - - [UseBufferType](reference/hdi-apis/_use_buffer_type.md) - [VerifyAllocInfo](reference/hdi-apis/_verify_alloc_info.md) - [VGUBuffer](reference/hdi-apis/_v_g_u_buffer.md) - [VGUColorStop](reference/hdi-apis/_v_g_u_color_stop.md) @@ -834,9 +803,285 @@ - [VGUSolid](reference/hdi-apis/_v_g_u_solid.md) - [VGUStrokeAttr](reference/hdi-apis/_v_g_u_stroke_attr.md) - [VGUSurface](reference/hdi-apis/_v_g_u_surface.md) - - [VideoPortCap](reference/hdi-apis/_video_port_cap.md) + - [YUVDescInfo](reference/hdi-apis/_yuv_desc_info.md) + - HdfFaceAuth模块结构体 + - [ExecutorInfo](reference/hdi-apis/_executor_info_faceauth.md) + - [IExecutor](reference/hdi-apis/interface_i_executor_faceauth.md) + - [IExecutorCallback](reference/hdi-apis/interface_i_executor_callback_faceauth.md) + - [IFaceAuthInterface](reference/hdi-apis/interface_i_face_auth_interface.md) + - [TemplateInfo](reference/hdi-apis/_template_info_faceauth.md) + - HdfPinAuth模块结构体 + - [ExecutorInfo](reference/hdi-apis/_executor_info_pinauth.md) + - [IExecutor](reference/hdi-apis/interface_i_executor_pinauth.md) + - [IExecutorCallback](reference/hdi-apis/interface_i_executor_callback_pinauth.md) + - [IPinAuthInterface](reference/hdi-apis/interface_i_pin_auth_interface.md) + - [TemplateInfo](reference/hdi-apis/_template_info_pinauth.md) + - HdfUserAuth模块结构体 + - [AuthResultInfo](reference/hdi-apis/_auth_result_info.md) + - [AuthSolution](reference/hdi-apis/_auth_solution.md) + - [CredentialInfo](reference/hdi-apis/_credential_info.md) + - [EnrolledInfo](reference/hdi-apis/_enrolled_info.md) + - [EnrollParam](reference/hdi-apis/_enroll_param.md) + - [EnrollResultInfo](reference/hdi-apis/_enroll_result_info.md) + - [ExecutorInfo](reference/hdi-apis/_executor_info_userauth.md) + - [ExecutorRegisterInfo](reference/hdi-apis/_executor_register_info.md) + - [ExecutorSendMsg](reference/hdi-apis/_executor_send_msg.md) + - [IdentifyResultInfo](reference/hdi-apis/_identify_result_info.md) + - [IUserAuthInterface](reference/hdi-apis/interface_i_user_auth_interface.md) + - [ScheduleInfo](reference/hdi-apis/_schedule_info.md) + - HdiActivityRecognition模块结构体 + - [ActRecognitionEvent](reference/hdi-apis/_act_recognition_event.md) + - [IActivityChangedCallback](reference/hdi-apis/interface_i_activity_changed_callback.md) + - [IActivityInterface](reference/hdi-apis/interface_i_activity_interface.md) + - HdiLpfenceCellbatching模块结构体 + - [CellbatchingRequest](reference/hdi-apis/_cellbatching_request.md) + - [CellTrajectoryData](reference/hdi-apis/_cell_trajectory_data.md) + - [ICellbatchingCallback](reference/hdi-apis/interface_i_cellbatching_callback.md) + - [ICellbatchingInterface](reference/hdi-apis/interface_i_cellbatching_interface.md) + - HdiLpfenceCellfence模块结构体 + - [CellfenceInfo](reference/hdi-apis/_cellfence_info.md) + - [CellfenceRequest](reference/hdi-apis/_cellfence_request.md) + - [CellfenceSize](reference/hdi-apis/_cellfence_size.md) + - [CellfenceStatus](reference/hdi-apis/_cellfence_status.md) + - [ICellfenceCallback](reference/hdi-apis/interface_i_cellfence_callback.md) + - [ICellfenceInterface](reference/hdi-apis/interface_i_cellfence_interface.md) + - HdiLpfenceGeofence模块结构体 + - [CurrentCell](reference/hdi-apis/_current_cell.md) + - [GeofenceCellInfo](reference/hdi-apis/_geofence_cell_info.md) + - [GeofenceCircleRequest](reference/hdi-apis/_geofence_circle_request.md) + - [GeofencePolygonRequest](reference/hdi-apis/_geofence_polygon_request.md) + - [GeofenceResult](reference/hdi-apis/_geofence_result.md) + - [GeofenceSize](reference/hdi-apis/_geofence_size.md) + - [GeoLocationInfo](reference/hdi-apis/_geo_location_info.md) + - [IGeofenceCallback](reference/hdi-apis/interface_i_geofence_callback.md) + - [IGeofenceInterface](reference/hdi-apis/interface_i_geofence_interface.md) + - [NeighborCell](reference/hdi-apis/_neighbor_cell.md) + - [OfflineDb](reference/hdi-apis/_offline_db.md) + - [Point](reference/hdi-apis/_point.md) + - [RequestCellDb](reference/hdi-apis/_request_cell_db.md) + - HdiLpfenceWififence模块结构体 + - [IWififenceCallback](reference/hdi-apis/interface_i_wififence_callback.md) + - [IWififenceInterface](reference/hdi-apis/interface_i_wififence_interface.md) + - [WififenceRequest](reference/hdi-apis/_wififence_request.md) + - [WififenceSize](reference/hdi-apis/_wififence_size.md) + - Input模块结构体 + - [IInputInterface](reference/hdi-apis/_i_input_interface.md) + - [InputController](reference/hdi-apis/_input_controller.md) + - [InputDevAbility](reference/hdi-apis/_input_dev_ability.md) + - [InputDevAttr](reference/hdi-apis/_input_dev_attr.md) + - [InputDevDesc](reference/hdi-apis/_input_dev_desc.md) + - [InputDeviceInfo](reference/hdi-apis/_input_device_info.md) + - [InputDevIdentify](reference/hdi-apis/_input_dev_identify.md) + - [InputDimensionInfo](reference/hdi-apis/_input_dimension_info.md) + - [InputEventCb](reference/hdi-apis/_input_event_cb.md) + - [InputEventPackage](reference/hdi-apis/_input_event_package.md) + - [InputExtraCmd](reference/hdi-apis/_input_extra_cmd.md) + - [InputHostCb](reference/hdi-apis/_input_host_cb.md) + - [InputHotPlugEvent](reference/hdi-apis/_input_hot_plug_event.md) + - [InputManager](reference/hdi-apis/_input_manager.md) + - [InputReporter](reference/hdi-apis/_input_reporter.md) + - Light模块结构体 + - [ColorValue](reference/hdi-apis/union_color_value.md) + - [HdfLightColor](reference/hdi-apis/_hdf_light_color.md) + - [HdfLightEffect](reference/hdi-apis/_hdf_light_effect.md) + - [HdfLightFlashEffect](reference/hdi-apis/_hdf_light_flash_effect.md) + - [HdfLightInfo](reference/hdi-apis/_hdf_light_info.md) + - [ILightInterface](reference/hdi-apis/interface_i_light_interface.md) + - [RGBColor](reference/hdi-apis/_r_g_b_color.md) + - [WRGBColor](reference/hdi-apis/_w_r_g_b_color.md) + - Motion模块结构体 + - [HdfMotionEvent](reference/hdi-apis/_hdf_motion_event.md) + - [IMotionCallback](reference/hdi-apis/interface_i_motion_callback.md) + - [IMotionInterface](reference/hdi-apis/interface_i_motion_interface.md) + - NNRt模块结构体 + - [Activation](reference/hdi-apis/_activation.md) + - [AddFusion](reference/hdi-apis/_add_fusion.md) + - [ArgMaxFusion](reference/hdi-apis/_arg_max_fusion.md) + - [AvgPoolFusion](reference/hdi-apis/_avg_pool_fusion.md) + - [BatchToSpaceND](reference/hdi-apis/_batch_to_space_n_d.md) + - [BiasAdd](reference/hdi-apis/_bias_add.md) + - [Cast](reference/hdi-apis/_cast.md) + - [Concat](reference/hdi-apis/_concat.md) + - [Conv2DFusion](reference/hdi-apis/_conv2_d_fusion.md) + - [Conv2dTransposeFusion](reference/hdi-apis/_conv2d_transpose_fusion.md) + - [DivFusion](reference/hdi-apis/_div_fusion.md) + - [Eltwise](reference/hdi-apis/_eltwise.md) + - [ExpandDims](reference/hdi-apis/_expand_dims.md) + - [Fill](reference/hdi-apis/_fill.md) + - [FullConnection](reference/hdi-apis/_full_connection.md) + - [FusedBatchNorm](reference/hdi-apis/_fused_batch_norm.md) + - [Gather](reference/hdi-apis/_gather.md) + - [INnrtDevice](reference/hdi-apis/interface_i_nnrt_device.md) + - [IOTensor](reference/hdi-apis/_i_o_tensor.md) + - [IPreparedModel](reference/hdi-apis/interface_i_prepared_model.md) + - [LayerNormFusion](reference/hdi-apis/_layer_norm_fusion.md) + - [LessEqual](reference/hdi-apis/_less_equal.md) + - [MatMulFusion](reference/hdi-apis/_mat_mul_fusion.md) + - [Maximum](reference/hdi-apis/_maximum.md) + - [MaxPoolFusion](reference/hdi-apis/_max_pool_fusion.md) + - [Model](reference/hdi-apis/_model.md) + - [ModelConfig](reference/hdi-apis/_model_config.md) + - [MulFusion](reference/hdi-apis/_mul_fusion.md) + - [Node](reference/hdi-apis/_node.md) + - [OneHot](reference/hdi-apis/_one_hot.md) + - [PadFusion](reference/hdi-apis/_pad_fusion.md) + - [PowFusion](reference/hdi-apis/_pow_fusion.md) + - [PReLUFusion](reference/hdi-apis/_p_re_l_u_fusion.md) + - [QuantDTypeCast](reference/hdi-apis/_quant_d_type_cast.md) + - [QuantParam](reference/hdi-apis/_quant_param.md) + - [ReduceFusion](reference/hdi-apis/_reduce_fusion.md) + - [Reshape](reference/hdi-apis/_reshape.md) + - [Resize](reference/hdi-apis/_resize.md) + - [Rsqrt](reference/hdi-apis/_rsqrt.md) + - [ScaleFusion](reference/hdi-apis/_scale_fusion.md) + - [Shape](reference/hdi-apis/_shape.md) + - [SharedBuffer](reference/hdi-apis/_shared_buffer.md) + - [SliceFusion](reference/hdi-apis/_slice_fusion.md) + - [Softmax](reference/hdi-apis/_softmax.md) + - [SpaceToBatchND](reference/hdi-apis/_space_to_batch_n_d.md) + - [Split](reference/hdi-apis/_split.md) + - [Sqrt](reference/hdi-apis/_sqrt.md) + - [SquaredDifference](reference/hdi-apis/_squared_difference.md) + - [Squeeze](reference/hdi-apis/_squeeze.md) + - [Stack](reference/hdi-apis/_stack.md) + - [StridedSlice](reference/hdi-apis/_strided_slice.md) + - [SubFusion](reference/hdi-apis/_sub_fusion.md) + - [SubGraph](reference/hdi-apis/_sub_graph.md) + - [Tensor](reference/hdi-apis/_tensor.md) + - [TileFusion](reference/hdi-apis/_tile_fusion.md) + - [TopKFusion](reference/hdi-apis/_top_k_fusion.md) + - [Transpose](reference/hdi-apis/_transpose.md) + - [Unsqueeze](reference/hdi-apis/_unsqueeze.md) + - Power模块结构体 + - [IPowerHdiCallback](reference/hdi-apis/interface_i_power_hdi_callback.md) + - [IPowerInterface](reference/hdi-apis/interface_i_power_interface.md) + - Ril模块结构体 + - [ApduSimIORequestInfo](reference/hdi-apis/_apdu_sim_i_o_request_info.md) + - [AvailableNetworkInfo](reference/hdi-apis/_available_network_info.md) + - [AvailableNetworkList](reference/hdi-apis/_available_network_list.md) + - [CallForwardQueryInfoList](reference/hdi-apis/_call_forward_query_info_list.md) + - [CallForwardQueryResult](reference/hdi-apis/_call_forward_query_result.md) + - [CallForwardSetInfo](reference/hdi-apis/_call_forward_set_info.md) + - [CallInfo](reference/hdi-apis/_call_info.md) + - [CallInfoList](reference/hdi-apis/_call_info_list.md) + - [CallRestrictionInfo](reference/hdi-apis/_call_restriction_info.md) + - [CallRestrictionResult](reference/hdi-apis/_call_restriction_result.md) + - [CallWaitResult](reference/hdi-apis/_call_wait_result.md) + - [CardStatusInfo](reference/hdi-apis/_card_status_info.md) + - [CBConfigInfo](reference/hdi-apis/_c_b_config_info.md) + - [CBConfigReportInfo](reference/hdi-apis/_c_b_config_report_info.md) + - [CdmaCBConfigInfo](reference/hdi-apis/_cdma_c_b_config_info.md) + - [CdmaCBConfigInfoList](reference/hdi-apis/_cdma_c_b_config_info_list.md) + - [CdmaRssi](reference/hdi-apis/_cdma_rssi.md) + - [CellListCurrentInfo](reference/hdi-apis/_cell_list_current_info.md) + - [CellListNearbyInfo](reference/hdi-apis/_cell_list_nearby_info.md) + - [CellListRatCdma](reference/hdi-apis/_cell_list_rat_cdma.md) + - [CellListRatGsm](reference/hdi-apis/_cell_list_rat_gsm.md) + - [CellListRatLte](reference/hdi-apis/_cell_list_rat_lte.md) + - [CellListRatNr](reference/hdi-apis/_cell_list_rat_nr.md) + - [CellListRatTdscdma](reference/hdi-apis/_cell_list_rat_tdscdma.md) + - [CellListRatWcdma](reference/hdi-apis/_cell_list_rat_wcdma.md) + - [CellNearbyInfo](reference/hdi-apis/_cell_nearby_info.md) + - [CellRatCdma](reference/hdi-apis/_cell_rat_cdma.md) + - [CellRatGsm](reference/hdi-apis/_cell_rat_gsm.md) + - [CellRatLte](reference/hdi-apis/_cell_rat_lte.md) + - [CellRatNr](reference/hdi-apis/_cell_rat_nr.md) + - [CellRatTdscdma](reference/hdi-apis/_cell_rat_tdscdma.md) + - [CellRatWcdma](reference/hdi-apis/_cell_rat_wcdma.md) + - [ChannelConfigInfoList](reference/hdi-apis/_channel_config_info_list.md) + - [CsRegStatusInfo](reference/hdi-apis/_cs_reg_status_info.md) + - [CurrentCellInfo](reference/hdi-apis/_current_cell_info.md) + - [CurrentServiceCellParas](reference/hdi-apis/union_current_service_cell_paras.md) + - [DataCallInfo](reference/hdi-apis/_data_call_info.md) + - [DataCallResultList](reference/hdi-apis/_data_call_result_list.md) + - [DataLinkBandwidthInfo](reference/hdi-apis/_data_link_bandwidth_info.md) + - [DataLinkBandwidthReportingRule](reference/hdi-apis/_data_link_bandwidth_reporting_rule.md) + - [DataPerformanceInfo](reference/hdi-apis/_data_performance_info.md) + - [DataProfileDataInfo](reference/hdi-apis/_data_profile_data_info.md) + - [DataProfilesInfo](reference/hdi-apis/_data_profiles_info.md) + - [DataSleepInfo](reference/hdi-apis/_data_sleep_info.md) + - [DialInfo](reference/hdi-apis/_dial_info.md) + - [DtmfInfo](reference/hdi-apis/_dtmf_info.md) + - [EmergencyCall](reference/hdi-apis/_emergency_call.md) + - [EmergencyInfoList](reference/hdi-apis/_emergency_info_list.md) + - [GetClipResult](reference/hdi-apis/_get_clip_result.md) + - [GetClirResult](reference/hdi-apis/_get_clir_result.md) + - [GsmRssi](reference/hdi-apis/_gsm_rssi.md) + - [GsmSmsMessageInfo](reference/hdi-apis/_gsm_sms_message_info.md) + - [IccIoResultInfo](reference/hdi-apis/_icc_io_result_info.md) + - [IRil](reference/hdi-apis/interface_i_ril.md) + - [IRilCallback](reference/hdi-apis/interface_i_ril_callback.md) + - [LockStatusResp](reference/hdi-apis/_lock_status_resp.md) + - [LteRssi](reference/hdi-apis/_lte_rssi.md) + - [ModeData](reference/hdi-apis/_mode_data.md) + - [NrRssi](reference/hdi-apis/_nr_rssi.md) + - [OpenLogicalChannelResponse](reference/hdi-apis/_open_logical_channel_response.md) + - [OperatorInfo](reference/hdi-apis/_operator_info.md) + - [PhysicalChannelConfig](reference/hdi-apis/_physical_channel_config.md) + - [PreferredNetworkTypeInfo](reference/hdi-apis/_preferred_network_type_info.md) + - [PsRegStatusInfo](reference/hdi-apis/_ps_reg_status_info.md) + - [RadioProtocol](reference/hdi-apis/_radio_protocol.md) + - [RilRadioResponseInfo](reference/hdi-apis/_ril_radio_response_info.md) + - [RingbackVoice](reference/hdi-apis/_ringback_voice.md) + - [Rssi](reference/hdi-apis/_rssi.md) + - [SendCdmaSmsMessageInfo](reference/hdi-apis/_send_cdma_sms_message_info.md) + - [SendSmsResultInfo](reference/hdi-apis/_send_sms_result_info.md) + - [ServiceCellParas](reference/hdi-apis/union_service_cell_paras.md) + - [ServiceCenterAddress](reference/hdi-apis/_service_center_address.md) + - [SetBarringInfo](reference/hdi-apis/_set_barring_info.md) + - [SetNetworkModeInfo](reference/hdi-apis/_set_network_mode_info.md) + - [SetupDataCallResultInfo](reference/hdi-apis/_setup_data_call_result_info.md) + - [SimAuthenticationRequestInfo](reference/hdi-apis/_sim_authentication_request_info.md) + - [SimIoRequestInfo](reference/hdi-apis/_sim_io_request_info.md) + - [SimLockInfo](reference/hdi-apis/_sim_lock_info.md) + - [SimPasswordInfo](reference/hdi-apis/_sim_password_info.md) + - [SimPinInputTimes](reference/hdi-apis/_sim_pin_input_times.md) + - [SmsMessageInfo](reference/hdi-apis/_sms_message_info.md) + - [SmsMessageIOInfo](reference/hdi-apis/_sms_message_i_o_info.md) + - [SrvccStatus](reference/hdi-apis/_srvcc_status.md) + - [SsNoticeInfo](reference/hdi-apis/_ss_notice_info.md) + - [TdScdmaRssi](reference/hdi-apis/_td_scdma_rssi.md) + - [UniInfo](reference/hdi-apis/_uni_info.md) + - [UssdNoticeInfo](reference/hdi-apis/_ussd_notice_info.md) + - [VoiceRadioTechnology](reference/hdi-apis/_voice_radio_technology.md) + - [WcdmaRssi](reference/hdi-apis/_wcdma_rssi.md) + - Sensor模块结构体 + - [HdfSensorEvents](reference/hdi-apis/_hdf_sensor_events.md) + - [HdfSensorInformation](reference/hdi-apis/_hdf_sensor_information.md) + - [ISensorCallback](reference/hdi-apis/interface_i_sensor_callback.md) + - [ISensorInterface](reference/hdi-apis/interface_i_sensor_interface.md) + - Thermal模块结构体 + - [HdfThermalCallbackInfo](reference/hdi-apis/_hdf_thermal_callback_info.md) + - [IThermalCallback](reference/hdi-apis/interface_i_thermal_callback.md) + - [IThermalInterface](reference/hdi-apis/interface_i_thermal_interface.md) + - [ThermalZoneInfo](reference/hdi-apis/_thermal_zone_info.md) + - USB模块结构体 + - [IUsbdBulkCallback](reference/hdi-apis/interface_i_usbd_bulk_callback.md) + - [IUsbdSubscriber](reference/hdi-apis/interface_i_usbd_subscriber.md) + - [IUsbInterface](reference/hdi-apis/interface_i_usb_interface.md) + - [PortInfo](reference/hdi-apis/_port_info.md) + - [UsbCtrlTransfer](reference/hdi-apis/_usb_ctrl_transfer.md) + - [UsbDev](reference/hdi-apis/_usb_dev.md) + - [USBDeviceInfo](reference/hdi-apis/_u_s_b_device_info.md) + - [UsbPipe](reference/hdi-apis/_usb_pipe.md) + - Vibrator模块结构体 + - [HdfVibratorInfo](reference/hdi-apis/_hdf_vibrator_info.md) + - [IVibratorInterface](reference/hdi-apis/interface_i_vibrator_interface.md) + - WLAN模块结构体 + - [HdfFeatureInfo](reference/hdi-apis/_hdf_feature_info.md) + - [HdfNetDeviceInfo](reference/hdi-apis/_hdf_net_device_info.md) + - [HdfNetDeviceInfoResult](reference/hdi-apis/_hdf_net_device_info_result.md) + - [HdfStaInfo](reference/hdi-apis/_hdf_sta_info.md) + - [HdfWifiDriverScanSsid](reference/hdi-apis/_hdf_wifi_driver_scan_ssid.md) + - [HdfWifiInfo](reference/hdi-apis/_hdf_wifi_info.md) + - [HdfWifiScan](reference/hdi-apis/_hdf_wifi_scan.md) + - [HdfWifiScanResult](reference/hdi-apis/_hdf_wifi_scan_result.md) + - [IWlanCallback](reference/hdi-apis/interface_i_wlan_callback.md) + - [IWlanInterface](reference/hdi-apis/interface_i_wlan_interface.md) + - [MeasChannelParam](reference/hdi-apis/_meas_channel_param.md) + - [MeasChannelResult](reference/hdi-apis/_meas_channel_result.md) + - [ProjectionScreenCmdParam](reference/hdi-apis/_projection_screen_cmd_param.md) - [WifiStationInfo](reference/hdi-apis/_wifi_station_info.md) - - [WRGBColor](reference/hdi-apis/_w_r_g_b_color.md) - CMSIS API参考 - [CMSIS](reference/kernel/cmsis/_c_m_s_i_s-_r_t_o_s.md) - 结构体 diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_4.0.7.3/changelog-arkcompiler.md b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.7.3/changelog-arkcompiler.md new file mode 100644 index 0000000000000000000000000000000000000000..13b9b4c46da8bc46df2fea3a9417f08c43e7eaef --- /dev/null +++ b/zh-cn/release-notes/changelogs/OpenHarmony_4.0.7.3/changelog-arkcompiler.md @@ -0,0 +1,164 @@ +# 语言编译运行时子系统ChangeLog +## cl.arkcompiler.1 LLVM新增告警及已有告警增强 + +**变更影响** + +OpenHarmony NDK默认不开启-Werror选项,对于已经开启-Werror选项的开发者,建议基于告警检查提示修改错误业务代码或屏蔽 + + **关键的编译检查规则变更** + +| 新增检查选项 | 作用 | 修改建议 | +| --- | --- | --- | +| Wunused-but-set-variable | 当代码中有未使用的变量时(包含++操作符)提出告警 | 定义变量时添加"maybe_unused"属性或者使用宏区分 | +| Wdeprecated-non-prototype | 当代码中存在没有原型的函数时提出告警 | 添加函数原型并明确参数 | +| Wunqualified-std-cast-call | 当代码中错误使用std::move等时提出告警 | 明确移动语义的使用场景并检查代码 | +| Wdeprecated-builtins | 当代码中使用了废弃的内置函数时提出告警 | 替换使用新版函数 | +| Warray-parameter | 当函数参数中包含数组并且重复定义了不一致的形式时提出告警 | 确认函数参数的一致性 | +| Wbitwise-instead-of-logical | 当在布尔运算中使用按位或时提出告警 | 更新代码在布尔运算中使用逻辑或 | +| Wint-conversion | 当代码中出现int变量转换为指针时提出告警 | 更新代码替换使用新的实现方式 | +| Wdeprecated-declarations | 当代码中使用了废弃的定义(包含函数和变量等)时提出告警 | 更新代码替换使用新的实现方式 | +| Wnull-pointer-subtraction | 当代码中出现空指针减法时提出告警 | 更新代码避免空指针参与减法运算 | +| Wunused-but-set-parameter | 当函数中出现未使用的参数时提出告警 | 更新代码去掉未使用的参数 | +| Warray-bounds | 当代码中出现对数组的越界访问时提出告警 | 检查代码并修改越界访问 | +| Wdeprecated-pragma | 当代码中使用了废弃的宏时提出告警 | 更新代码避免使用废弃的宏 | +| Wreserved-identifier | 当代码中使用了"__"开头的变量时提出告警 | 检查代码避免"__"开头的变量被外部使用 | + + **适配指导** + +1. 对于用户代码中存在的LLVM-12未检测出来的问题,需要用户检查并更新代码。 +2. LLVM更新废弃了一些旧的实现,需要用户代码适配并更新代码。 +3. 开发者评估暂时规避的告警,可采用-Wno-xxx选项规避该error。 + +问题代码实例 + +``` +void Heap::Resume(TriggerGCType gcType) +{ + if (mode_ != HeapMode::SPAWN && + activeSemiSpace_->AdjustCapacity(inactiveSemiSpace_->GetAllocatedSizeSinceGC())) { + // if activeSpace capacity changes, oldSpace maximumCapacity should change, too. + size_t multiple = 2; + // oldSpaceMaxLimit被赋值了但未被使用 + size_t oldSpaceMaxLimit = 0; + if (activeSemiSpace_->GetInitialCapacity() >= inactiveSemiSpace_->GetInitialCapacity()) { + size_t delta = activeSemiSpace_->GetInitialCapacity() - inactiveSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() - delta * multiple; + } else { + size_t delta = inactiveSemiSpace_->GetInitialCapacity() - activeSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() + delta * multiple; + } + inactiveSemiSpace_->SetInitialCapacity(activeSemiSpace_->GetInitialCapacity()); + } + // irrelated code ... +} +``` + +oldSpaceMaxLimit变量并未使用,编译器提出告警 + +``` +../../arkcompiler/ets_runtime/ecmascript/mem/heap.cpp:247:16: error: variable 'oldSpaceMaxLimit' set but not used [-Werror,-Wunused-but-set-variable] + size_t oldSpaceMaxLimit = 0; +``` + +添加属性后解决 + +``` +void Heap::Resume(TriggerGCType gcType) +{ + if (mode_ != HeapMode::SPAWN && + activeSemiSpace_->AdjustCapacity(inactiveSemiSpace_->GetAllocatedSizeSinceGC())) { + // if activeSpace capacity changes, oldSpace maximumCapacity should change, too. + size_t multiple = 2; + // 添加maybe_unused属性,声明不一定使用变量oldSpaceMaxLimit + [[maybe_unused]] size_t oldSpaceMaxLimit = 0; + if (activeSemiSpace_->GetInitialCapacity() >= inactiveSemiSpace_->GetInitialCapacity()) { + size_t delta = activeSemiSpace_->GetInitialCapacity() - inactiveSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() - delta * multiple; + } else { + size_t delta = inactiveSemiSpace_->GetInitialCapacity() - activeSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() + delta * multiple; + } + inactiveSemiSpace_->SetInitialCapacity(activeSemiSpace_->GetInitialCapacity()); + } + // irrelated code ... +} +``` + +## cl.arkcompiler.2 LLVM解析格式差异 + + **变更影响** + +对于业务依赖version-script或-gcc-toolchain选项的开发者,在沿用LLVM12配置文件或选项时,可能会解析失败 + + **关键的编译规则变更** + +1. 新版本中修改了符号的表示,现在连续的">"会被编译器表示为">>",这个在旧版本中会被表示为"> >",错误使用将导致符号不被解析匹配 +2. 废弃-xx选项,如-gcc-toolchain选项,改用--gcc-toolchain选项(该选项在clang3.4以后的版本已表示会弃用,LLVM15上正式废弃) + + **适配指导** + +version-script使用方法可以参考 + +适配实例 + +对于代码中出现连续两个“>”(忽略中间空格数量),在version-script中(由于 mangling差异)会被分别解析为如下"> >"与">>"两种情况,在15中我们需要使用">>" + +原始配置文件 + +``` +{ + global: + extern "C++" { + "google::protobuf::TextFormat::ParseFromString(std::__cxx11::basic_string, std::allocator > const&, google::protobuf::Message*)"; + // LLVM12 "> >"可以被解析,但">>"不行 + "google::protobuf::TextFormat::PrintToString(google::protobuf::Message const&, std::__cxx11::basic_string, std::allocator >*)"; + }; + local: + *; +} +``` + +修改后的配置文件 + +``` +{ + global: + extern "C++" { + "google::protobuf::TextFormat::ParseFromString(std::__cxx11::basic_string, std::allocator> const&, google::protobuf::Message*)"; + // LLVM15 只会解析">>" + "google::protobuf::TextFormat::PrintToString(google::protobuf::Message const&, std::__cxx11::basic_string, std::allocator>*)"; + }; + local: + *; +} +``` + +## cl.arkcompiler.3 LLVM emu-tls变更 + + **变更影响** + +对于LLVM12/LLVM15工具链混用的开发者(禁止行为),会产生libc++.so emu-tls符号无法找到的问题 + + **关键的库依赖变更** + +LLVM15中将emu-tls符号从目标二进制抽取到了libc++.so中,即__emutls_get_address的属性从内部符号变为外部可见的符号(libc++.so中会包含该符号),可能会导致编译出来的动态库依赖libc++.so。 + + **适配指导** + +该符号同时也在libclang_rt.builtin.a中,如果不希望依赖libc++.so可以静态链接libclang_rt.builtin.a库。 + +## cl.arkcompiler.4 LLVM官方release note + + **变更影响** + +新增特性及内部接口变更(如LLVM内部的IR,编译器前端修改),详见官方变更文档 + + **关键变更文档** + +https://releases.llvm.org/13.0.0/docs/ReleaseNotes.html +https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html +https://releases.llvm.org/15.0.0/docs/ReleaseNotes.html + + **适配指导** + +详细修改信息以及适配指导见官方文档