diff --git a/CODEOWNERS b/CODEOWNERS index 9b36e3beb739abd5f7bd294dfb149297e93c0651..9ffdaf23ba7351b7dd5e18b54559e424f4a2b80a 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -317,6 +317,7 @@ zh-cn/application-dev/reference/apis/js-apis-system-parameter.md @qinxiaowang zh-cn/application-dev/reference/apis/js-apis-thermal.md @qinxiaowang zh-cn/application-dev/reference/apis/js-apis-update.md @HelloCrease zh-cn/application-dev/reference/apis/js-apis-usb.md @ge-yafang +zh-cn/application-dev/reference/apis/js-apis-colorSpaceManager.mdd @ge-yafang zh-cn/application-dev/reference/apis/js-apis-vibrator.md @HelloCrease zh-cn/application-dev/reference/apis/js-apis-appAccount.md @zengyawen zh-cn/application-dev/reference/apis/js-apis-distributed-account.md @zengyawen diff --git a/en/application-dev/database/database-distributedobject-guidelines.md b/en/application-dev/database/database-distributedobject-guidelines.md index 8cc0a8aca0a6b8f6fad3f1a03f452e8ea9d3eb97..ec77d5330b57751e36b3ba2d96b57028c340dd36 100644 --- a/en/application-dev/database/database-distributedobject-guidelines.md +++ b/en/application-dev/database/database-distributedobject-guidelines.md @@ -4,7 +4,7 @@ The **distributedDataObject** module provides APIs to implement data collaboration of the same application across multiple devices. In addition, the devices that form a Super Device can listen for object status and data changes with each other. -For example, when the data of the a distributed data object is added, deleted, or modified for application A on device 1, application A on device 2 can obtain the updated data. In addition, device 2 can listen for data changes and online/offline of the data objects on device 1. +For example, when the data of a distributed data object is added, deleted, or modified for application A on device 1, application A on device 2 can obtain the updated data. In addition, device 2 can listen for data changes and online/offline of the data objects on device 1. ## Available APIs @@ -18,7 +18,7 @@ Call **createDistributedObject()** to create a distributed data object instance. **Table 1** API for creating a distributed data object instance | Package| API| Description| | -------- | -------- | -------- | -| ohos.data.distributedDataObject| createDistributedObject(source: object): DistributedObject | Creates a distributed data object instance for data operations.
- **source**: attributes of the **distributedObject** set.
- **DistributedObject**: returns the distributed object created.| +| ohos.data.distributedDataObject| createDistributedObject(source: object): DistributedObject | Creates a distributed data object instance for data operations.
- **source**: attributes of the distributed data object to set.
- **DistributedObject**: returns the distributed data object created. | ### Generating a Session ID @@ -29,14 +29,14 @@ Call **genSessionId()** to generate a session ID randomly. The generated session | -------- | -------- | -------- | | ohos.data.distributedDataObject| genSessionId(): string | Generates a session ID, which can be used as the session ID of a distributed data object.| -### Setting a SessionID for a Distributed Data Object +### Setting a Session ID for a Distributed Data Object Call **setSessionId()** to set a session ID for a distributed data object. The session ID is a unique identifier for one collaboration across devices. The distributed data objects to be synchronized must be associated with the same session ID. **Table 3** API for setting a session ID | Class| API| Description| | -------- | -------- | -------- | -| DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for a distributed data object.
**sessionId**: session ID of a distributed object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.| +| DistributedDataObject | setSessionId(sessionId?: string): boolean | Sets a session ID for a distributed data object.
**sessionId**: session ID of a distributed data object in a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty. | ### Observing Data Changes @@ -47,7 +47,7 @@ Call **on()** to subscribe to data changes of a distributed data object. When th | Class| API| Description| | -------- | -------- | -------- | | DistributedDataObject| on(type: 'change', callback: Callback<{ sessionId: string, fields: Array<string> }>): void | Subscribes to data changes.| -| DistributedDataObject| off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes. **Callback**: specifies the data changes to unsubscribe from. If this parameter is not specified, all data changes of this distributed data object will be unsubscribed from.| +| DistributedDataObject| off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void | Unsubscribes from data changes.
**Callback**: callback to unregister. If this parameter is not specified, all data changes of this distributed data object will be unsubscribed from. | ### Observing Online or Offline Status @@ -59,7 +59,7 @@ Call **on()** to subscribe to status changes of a distributed data object. The s | DistributedDataObject| on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }>): void | Subscribes to the status changes of a distributed data object.| | DistributedDataObject| off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }>): void | Unsubscribes from status changes of a distributed data object.| -### Saving a Distributed Data Object and Revoking the Data Saving Operation +### Saving or Deleting a Distributed Data Object Call **save()** to save a distributed data object. When the application is active, the saved data will not be released. When the application exits and restarts, the data saved on the device will be restored. @@ -71,11 +71,12 @@ The saved data will be released in the following cases: - The application has been uninstalled. - Data is successfully restored. -**Table 6** APIs for saving a distributed data object and revoking the saving operation +**Table 6** APIs for saving and deleting a distributed data object + | Class| API| Description| | -------- | -------- | -------- | | DistributedDataObject | save(deviceId: string): Promise<SaveSuccessResponse> | Saves a distributed data object.| -| DistributedDataObject| revokeSave(): Promise<RevokeSaveSuccessResponse> | Revokes the data saving operation.| +| DistributedDataObject| revokeSave(): Promise<RevokeSaveSuccessResponse> | Deletes a distributed data object. | ## How to Develop @@ -89,12 +90,10 @@ The following example shows how to implement distributed data object synchroniza 2. Apply for the permission. - Add the required permission (FA model) in the **config.json** file. + Add the permissions required (FA model) to the **config.json** file. The sample code is as follows: - The sample code is as follows: - - ```json - { + ```json + { "module": { "reqPermissions": [ { @@ -103,30 +102,27 @@ The following example shows how to implement distributed data object synchroniza ] } } - ``` - + ``` For the apps based on the stage model, see [Declaring Permissions](../security/accesstoken-guidelines.md#stage-model). - + This permission must also be granted by the user when the application is started for the first time. The sample code is as follows: - - ```json + + ```js import featureAbility from '@ohos.ability.featureAbility'; - - function grantPermission() { - console.info('grantPermission'); - let context = featureAbility.getContext(); - context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, function (result) { - console.info(`result.requestCode=${result.requestCode}`) - - }) - console.info('end grantPermission'); - } - - grantPermission(); - ``` - + + function grantPermission() { + console.info('grantPermission'); + let context = featureAbility.getContext(); + context.requestPermissionsFromUser(['ohos.permission.DISTRIBUTED_DATASYNC'], 666, function (result) { + console.info(`result.requestCode=${result.requestCode}`) + + }) + console.info('end grantPermission'); + } + + grantPermission(); + ``` - 3. Obtain a distributed data object instance. The sample code is as follows: @@ -142,12 +138,10 @@ The following example shows how to implement distributed data object synchroniza var sessionId = distributedObject.genSessionId(); ``` -4. Add the distributed data object instance to the synchronization network. +4. Add the distributed data object instance to a network for data synchronization. The data objects in the synchronization network include the local and remote objects. - The data objects in the synchronization network include the local and remote objects. - The sample code is as follows: - + ```js // Local object var local_object = distributedObject.createDistributedObject({ @@ -167,16 +161,16 @@ The following example shows how to implement distributed data object synchroniza parent: undefined, list: undefined }); - // After learning that the device goes online, the remote object synchronizes data. That is, name changes to jack and age to 18. + // After learning that the local device goes online, the remote object synchronizes data. That is, name changes to jack and age to 18. remote_object.setSessionId(sessionId); ``` 5. Observe the data changes of the distributed data object. You can subscribe to data changes of the remote object. When the data in the remote object changes, a callback will be called to return the data changes. - + The sample code is as follows: - + ```js function changeCallback(sessionId, changeData) { console.info("change" + sessionId); @@ -185,13 +179,13 @@ The following example shows how to implement distributed data object synchroniza changeData.forEach(element => { console.info("changed !" + element + " " + local_object[element]); }); - } + } } // To refresh the page in changeCallback, correctly bind (this) to the changeCallback. local_object.on("change", this.changeCallback.bind(this)); ``` - + 6. Modify attributes of the distributed data object. The object attributes support basic data types (such as number, Boolean, and string) and complex data types (array and nested basic types). @@ -250,7 +244,7 @@ The following example shows how to implement distributed data object synchroniza local_object.on("status", this.statusCallback); ``` -10. Save a distributed data object and revoke the data saving operation. +10. Save a distributed data object and delete it. ```js // Save a distributed data object. @@ -261,7 +255,7 @@ The following example shows how to implement distributed data object synchroniza }, (result) => { console.info("save local failed."); }); - // Revoke the data saving operation. + // Delete a distributed data object.. g_object.revokeSave().then((result) => { console.info("revokeSave success."); }, (result) => { @@ -271,7 +265,7 @@ The following example shows how to implement distributed data object synchroniza 11. Unsubscribe from the status changes of the distributed data object. - You can specify the callback to unregister. If you do not specify the callback, this API unregisters all status change callbacks of this distributed data object. + You can specify the callback to unregister. If you do not specify the callback, all status change callbacks of this distributed data object will be unregistered. The sample code is as follows: @@ -282,9 +276,7 @@ The following example shows how to implement distributed data object synchroniza local_object.off("status"); ``` -12. Remove a distributed data object from the synchronization network. - - Data changes on the local object will not be synchronized to the removed distributed data object. +12. Remove a distributed data object from the synchronization network. Data changes on the local object will not be synchronized to the removed distributed data object. The sample code is as follows: diff --git a/en/application-dev/reference/apis/js-apis-wifi.md b/en/application-dev/reference/apis/js-apis-wifi.md index eccade788a2d19a81b1512ae206dbdfba449b95d..ae5ab4c9b924e6b72457a9bbadec1cfd26ef5e6b 100644 --- a/en/application-dev/reference/apis/js-apis-wifi.md +++ b/en/application-dev/reference/apis/js-apis-wifi.md @@ -16,13 +16,15 @@ import wifi from '@ohos.wifi'; enableWifi(): boolean Enables WLAN. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -33,13 +35,15 @@ This is a system API. disableWifi(): boolean Disables WLAN. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -56,6 +60,7 @@ Checks whether WLAN is enabled. **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if WLAN is enabled; returns **false** otherwise.| @@ -72,6 +77,7 @@ Starts a scan for WLAN. **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -88,6 +94,7 @@ Obtains the scan result. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | Promise< Array<[WifiScanInfo](#wifiscaninfo)> > | Promise used to return the detected hotspots.| @@ -104,6 +111,7 @@ Obtains the scan result. This API uses an asynchronous callback to return the re **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the detected hotspots. Otherwise, **err** is a non-zero value and **data** is empty.| @@ -157,6 +165,7 @@ Represents WLAN hotspot information. **System capability**: SystemCapability.Communication.WiFi.STA + | **Name**| **Type**| **Readable/Writable**| **Description**| | -------- | -------- | -------- | -------- | | ssid | string | Read only| Service set identifier (SSID) of the hotspot, in UTF-8 format.| @@ -167,8 +176,8 @@ Represents WLAN hotspot information. | band | number | Read only| Frequency band of the WLAN access point (AP).| | frequency | number | Read only| Frequency of the WLAN AP.| | channelWidth | number | Read only| Channel width of the WLAN AP.| -| centerFrequency09+ | number | Read only| Center frequency.| -| centerFrequency19+ | number | Read only| Center frequency.| +| centerFrequency09+ | number | Read only| Center frequency of the hotspot.| +| centerFrequency19+ | number | Read only| Center frequency of the hotspot. If the hotspot uses two non-overlapping WLAN channels, two center frequencies, namely **centerFrequency0** and **centerFrequency1**, are returned.| | infoElems9+ | Array<[WifiInfoElem](#wifiinfoelem9)> | Read only| Information elements.| | timestamp | number | Read only| Timestamp.| @@ -179,6 +188,7 @@ Enumerates the WLAN security types. **System capability**: SystemCapability.Communication.WiFi.Core + | **Name**| **Default Value**| **Description**| | -------- | -------- | -------- | | WIFI_SEC_TYPE_INVALID | 0 | Invalid security type.| @@ -197,8 +207,11 @@ Enumerates the WLAN security types. Represents a WLAN information element. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.STA + | **Name**| **Type**| **Readable/Writable**| **Description**| | -------- | -------- | -------- | -------- | | eid | number | Read only| ID of the information element.| @@ -211,6 +224,7 @@ Enumerates the WLAN channel widths. **System capability**: SystemCapability.Communication.WiFi.STA + | **Name**| **Default Value**| **Description**| | -------- | -------- | -------- | | WIDTH_20MHZ | 0 | 20 MHz.| @@ -232,6 +246,7 @@ Obtains the scan result. This API returns the result synchronously. **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | |  Array<[WifiScanInfo](#wifiscaninfo)> | Scan result obtained.| @@ -242,18 +257,21 @@ Obtains the scan result. This API returns the result synchronously. addDeviceConfig(config: WifiDeviceConfig): Promise<number> Adds network configuration. This API uses a promise to return the result. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.| **Return value** + | **Type**| **Description**| | -------- | -------- | | Promise<number> | Promise used to return the WLAN configuration ID. If **-1** is returned, the operation has failed.| @@ -264,6 +282,7 @@ Represents the WLAN configuration. **System capability**: SystemCapability.Communication.WiFi.STA + | **Name**| **Type**| **Readable/Writable**| **Description**| | -------- | -------- | -------- | -------- | | ssid | string | Read only| SSID of the hotspot, in UTF-8 format.| @@ -271,22 +290,25 @@ Represents the WLAN configuration. | preSharedKey | string | Read only| PSK of the hotspot.| | isHiddenSsid | boolean | Read only| Whether the network is hidden.| | securityType | [WifiSecurityType](#wifisecuritytype) | Read only| Security type.| -| creatorUid | number | Read only| User ID, which is available only to system applications.| -| disableReason | number | Read only| Reason for disabling WLAN. This parameter is available only to system applications.| -| netId | number | Read only| Allocated network ID, which is available only to system applications.| -| randomMacType | number | Read only| Random MAC type, which is available only to system applications.| -| randomMacAddr | string | Read only| Random MAC address, which is available only for system applications.| -| ipType | [IpType](#iptype7) | Read only| IP address type, which is available only to system applications.| -| staticIp | [IpConfig](#ipconfig7) | Read only| Static IP address configuration, which is available only to system applications.| -| eapConfig9+ | [WifiEapConfig](#wifieapconfig9) | Read only| EAP configuration, which is available only to system applications.| +| creatorUid | number | Read only| ID of the creator.
**System API**: This is a system API.| +| disableReason | number | Read only| Reason for disabling WLAN.
**System API**: This is a system API.| +| netId | number | Read only| Network ID.
**System API**: This is a system API.| +| randomMacType | number | Read only| Random MAC type.
**System API**: This is a system API.| +| randomMacAddr | string | Read only| Random MAC address.
**System API**: This is a system API.| +| ipType | [IpType](#iptype7) | Read only| IP address type.
**System API**: This is a system API.| +| staticIp | [IpConfig](#ipconfig7) | Read only| Static IP address configuration.
**System API**: This is a system API.| +| eapConfig9+ | [WifiEapConfig](#wifieapconfig9) | Read only| EAP configuration.
**System API**: This is a system API.| ## IpType7+ Enumerate the IP address types. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.STA + | Name| Default Value| Description| | -------- | -------- | -------- | | STATIC | 0 | Static IP address.| @@ -298,6 +320,8 @@ Enumerate the IP address types. Represents IP configuration information. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.STA | **Name**| **Type**| **Readable/Writable**| **Description**| @@ -312,6 +336,8 @@ Represents IP configuration information. Represents EAP configuration information. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.STA | **Name**| **Type**| **Readable/Writable**| **Description**| @@ -335,6 +361,8 @@ Represents EAP configuration information. Enumerates the EAP authentication methods. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.STA | Name| Default Value| Description| @@ -354,6 +382,8 @@ Enumerates the EAP authentication methods. Enumerates the Phase 2 authentication methods. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.STA | Name| Default Value| Description| @@ -373,13 +403,15 @@ Enumerates the Phase 2 authentication methods. addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void Adds network configuration. This API uses an asynchronous callback to return the result. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.| @@ -397,11 +429,13 @@ Adds the configuration of an untrusted network. This API uses a promise to retur **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.| **Return value** + | **Type**| **Description**| | -------- | -------- | | Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.| @@ -418,6 +452,7 @@ Adds the configuration of an untrusted network. This API uses an asynchronous ca **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.| @@ -435,11 +470,13 @@ Removes the configuration of an untrusted network. This API uses a promise to re **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.| **Return value** + | **Type**| **Description**| | -------- | -------- | | Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.| @@ -456,6 +493,7 @@ Removes the configuration of an untrusted network. This API uses an asynchronous **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.| @@ -473,11 +511,13 @@ Adds the configuration of a candidate network. This API uses a promise to return **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.| **Return value** + | **Type**| **Description**| | -------- | -------- | | Promise<number> | Promise used to return the network configuration ID.| @@ -494,6 +534,7 @@ Adds the configuration of a candidate network. This API uses an asynchronous cal **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.| @@ -511,11 +552,13 @@ Removes the configuration of a candidate network. This API uses a promise to ret **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | networkId | number | Yes| ID of the network configuration to remove.| **Return value** + | **Type**| **Description**| | -------- | -------- | | Promise<void> | Promise used to return the result.| @@ -532,6 +575,7 @@ Removes the configuration of a candidate network. This API uses an asynchronous **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | networkId | number | Yes| ID of the network configuration to remove.| @@ -549,6 +593,7 @@ Obtains candidate network configuration. **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | |  Array<[WifiDeviceConfig](#wifideviceconfig)> | Candidate network configuration obtained.| @@ -556,7 +601,7 @@ Obtains candidate network configuration. ## wifi.connectToCandidateConfig9+ -connectToCandidateConfig(networkId: number): boolean +connectToCandidateConfig(networkId: number): void Connects to a candidate network. @@ -565,33 +610,32 @@ Connects to a candidate network. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | networkId | number | Yes| ID of the candidate network configuration.| -**Return value** - | **Type**| **Description**| - | -------- | -------- | - | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| - ## wifi.connectToNetwork connectToNetwork(networkId: number): boolean Connects to the specified network. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | networkId | number | Yes| Network configuration ID.| **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -602,20 +646,22 @@ This is a system API. connectToDevice(config: WifiDeviceConfig): boolean Connects to the specified network. -This is a system API. -**Required permissions**: - ohos.permission.SET_WIFI_INFO, ohos.permission.SET_WIFI_CONFIG, and ohos.permissio.MANAGE_WIFI_CONNECTION (available only to system applications) +**System API**: This is a system API. + +**Required permissions**: ohos.permission.SET_WIFI_INFO, ohos.permission.SET_WIFI_CONFIG, and ohos.permissio.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration.| **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -625,16 +671,17 @@ This is a system API. disconnect(): boolean -Disconnects from the specified network. -This is a system API. +Disconnects the network. -**Required permissions**: - ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) +**System API**: This is a system API. + +**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -651,12 +698,14 @@ Obtains the WLAN signal level. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | rssi | number | Yes| RSSI of the hotspot, in dBm.| | band | number | Yes| Frequency band of the WLAN AP.| **Return value** + | **Type**| **Description**| | -------- | -------- | | number | Signal level obtained. The value range is [0, 4].| @@ -673,6 +722,7 @@ Obtains WLAN connection information. This API uses a promise to return the resul **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | Type| Description| | -------- | -------- | | Promise<[WifiLinkedInfo](#wifilinkedinfo)> | Promise used to return the WLAN connection information obtained.| @@ -689,6 +739,7 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiLinkedInfo](#wifilinkedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the WLAN connection information obtained. If **err** is not **0**, an error has occurred.| @@ -723,19 +774,19 @@ Represents the WLAN connection information. | -------- | -------- | -------- | -------- | | ssid | string | Read only| SSID of the hotspot, in UTF-8 format.| | bssid | string | Read only| BSSID of the hotspot.| -| networkId | number | Read only| Network configuration ID, which is available only to system applications.| +| networkId | number | Read only| Network configuration ID.
**System API**: This is a system API.| | rssi | number | Read only| RSSI of the hotspot, in dBm.| | band | number | Read only| Frequency band of the WLAN AP.| | linkSpeed | number | Read only| Speed of the WLAN AP.| | frequency | number | Read only| Frequency of the WLAN AP.| | isHidden | boolean | Read only| Whether to hide the WLAN AP.| | isRestricted | boolean | Read only| Whether to restrict data volume at the WLAN AP.| -| chload | number | Read only| Channel load. A larger value indicates a higher load. This parameter is only available to system applications.| -| snr | number | Read only| Signal-to-noise ratio (SNR), which is available only to system applications.| +| chload | number | Read only| Channel load. A larger value indicates a higher load.
**System API**: This is a system API.| +| snr | number | Read only| Signal-to-noise ratio (SNR).
**System API**: This is a system API.| | macType9+ | number | Read only| MAC address type.| | macAddress | string | Read only| MAC address of the device.| | ipAddress | number | Read only| IP address of the device that sets up the WLAN connection.| -| suppState | [SuppState](#suppstate) | Read only| Supplicant state, which is available only to system applications.| +| suppState | [SuppState](#suppstate) | Read only| Supplicant state.
**System API**: This is a system API.| | connState | [ConnState](#connstate) | Read only| WLAN connection state.| @@ -761,6 +812,8 @@ Enumerates the WLAN connection states. Enumerates the supplicant states. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.STA | Name| Default Value| Description| @@ -790,6 +843,7 @@ Checks whether the WLAN is connected. **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.| @@ -800,13 +854,15 @@ Checks whether the WLAN is connected. getSupportedFeatures(): number Obtains the features supported by this device. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_INFO **System capability**: SystemCapability.Communication.WiFi.Core **Return value** + | **Type**| **Description**| | -------- | -------- | | number | Feature value. | @@ -839,11 +895,13 @@ Checks whether the device supports the specified WLAN feature. **Parameters** + | **Name**| **Type**| Mandatory| **Description**| | -------- | -------- | -------- | -------- | | featureId | number | Yes| Feature ID.| **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the feature is supported; returns **false** otherwise.| @@ -854,13 +912,15 @@ Checks whether the device supports the specified WLAN feature. getDeviceMacAddress(): string[] Obtains the device MAC address. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | string[] | MAC address obtained.| @@ -877,6 +937,7 @@ Obtains IP information. **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | [IpInfo](#ipinfo7) | IP information obtained.| @@ -910,6 +971,7 @@ Obtains the country code. **System capability**: SystemCapability.Communication.WiFi.Core **Return value** + | **Type**| **Description**| | -------- | -------- | | string | Country code obtained.| @@ -920,13 +982,15 @@ Obtains the country code. reassociate(): boolean Re-associates with the network. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -937,13 +1001,15 @@ This is a system API. reconnect(): boolean Reconnects to the network. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -954,13 +1020,15 @@ This is a system API. getDeviceConfigs():  Array<[WifiDeviceConfig](#wifideviceconfig)> Obtains network configuration. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.GET_WIFI_CONFIG **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | |  Array<[WifiDeviceConfig](#wifideviceconfig)> | Array of network configuration obtained.| @@ -968,24 +1036,27 @@ This is a system API. ## wifi.updateNetwork7+ -updateNetwork(config: WifiDeviceConfig): boolean +updateNetwork(config: WifiDeviceConfig): number Updates network configuration. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#wifideviceconfig) | Yes| New WLAN configuration.| **Return value** + | **Type**| **Description**| | -------- | -------- | - | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| + | number | ID of the updated network configuration. The value **-1** indicates that the operation has failed.| ## wifi.disableNetwork7+ @@ -993,18 +1064,21 @@ This is a system API. disableNetwork(netId: number): boolean Disables network configuration. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | netId | number | Yes| ID of the network configuration to disable.| **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1015,13 +1089,15 @@ This is a system API. removeAllNetwork(): boolean Removes the configuration of all networks. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1032,18 +1108,21 @@ This is a system API. removeDevice(id: number): boolean Removes the specified network configuration. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | id | number | Yes| ID of the network configuration to remove.| **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1054,13 +1133,15 @@ This is a system API. enableHotspot(): boolean Enables this hotspot. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.AP.Core **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1071,13 +1152,15 @@ This is a system API. disableHotspot(): boolean Disables this hotspot. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.AP.Core **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1088,13 +1171,15 @@ This is a system API. isHotspotDualBandSupported(): boolean Checks whether the hotspot supports dual band. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.AP.Core **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the feature is supported; returns **false** otherwise.| @@ -1105,13 +1190,15 @@ This is a system API. isHotspotActive(): boolean Checks whether this hotspot is active. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_INFO **System capability**: SystemCapability.Communication.WiFi.AP.Core **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the hotspot is active; returns **false** otherwise.| @@ -1122,18 +1209,21 @@ This is a system API. setHotspotConfig(config: HotspotConfig): boolean Sets hotspot configuration. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG **System capability**: SystemCapability.Communication.WiFi.AP.Core **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | config | [HotspotConfig](#hotspotconfig7) | Yes| Hotspot configuration to set.| **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1143,6 +1233,8 @@ This is a system API. Represents the hotspot configuration. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.AP.Core | **Name**| **Type**| **Readable/Writable**| **Description**| @@ -1159,13 +1251,15 @@ Represents the hotspot configuration. getHotspotConfig(): HotspotConfig obtains hotspot configuration. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG **System capability**: SystemCapability.Communication.WiFi.AP.Core **Return value** + | **Type**| **Description**| | -------- | -------- | | [HotspotConfig](#hotspotconfig7) | Hotspot configuration obtained.| @@ -1176,13 +1270,15 @@ This is a system API. getStations():  Array<[StationInfo](#stationinfo7)> Obtains information about the connected stations. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.AP.Core **Return value** + | **Type**| **Description**| | -------- | -------- | |  Array<[StationInfo](#stationinfo7)> | Connected stations obtained.| @@ -1192,6 +1288,8 @@ This is a system API. Represents the station information. +**System API**: This is a system API. + **System capability**: SystemCapability.Communication.WiFi.AP.Core | **Name**| **Type**| **Readable/Writable**| **Description**| @@ -1212,6 +1310,7 @@ Obtains P2P link information. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Promise used to return the P2P link information obtained.| @@ -1254,6 +1353,7 @@ Obtains P2P link information. This API uses an asynchronous callback to return t **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the P2P link information. If **err** is not **0**, an error has occurred.| @@ -1270,6 +1370,7 @@ Obtains the current P2P group information. This API uses a promise to return the **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Promise used to return the group information obtained.| @@ -1286,6 +1387,7 @@ Obtains the current P2P group information. This API uses an asynchronous callbac **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.| @@ -1302,6 +1404,7 @@ Obtains the peer device list in the P2P connection. This API uses a promise to r **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | Promise<[WifiP2pDevice[]](#wifip2pdevice8)> | Promise used to return the peer device list.| @@ -1318,6 +1421,7 @@ Obtains the peer device list in the P2P connection. This API uses an asynchronou **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the peer device list obtained. If **err** is not **0**, an error has occurred.| @@ -1364,6 +1468,7 @@ Obtains the local device information in the P2P connection. This API uses a prom **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | Promise<[WifiP2pDevice](#wifip2pdevice8)> | Promise used to return the local device information obtained.| @@ -1380,6 +1485,7 @@ Obtains the local device information in the P2P connection. This API uses an asy **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pDevice](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the local device information obtained. If **err** is not **0**, an error has occurred.| @@ -1402,6 +1508,7 @@ Creates a P2P group. | config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Group configuration.| **Return value** + | Type| Description| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1446,6 +1553,7 @@ Removes this P2P group. **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1463,11 +1571,13 @@ Sets up a P2P connection. **Parameters** + | **Name**| **Type**| Mandatory| **Description**| | -------- | -------- | -------- | -------- | | config | [WifiP2PConfig](#wifip2pconfig8) | Yes| P2P group configuration.| **Return value** + | Type| Description| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1551,6 +1661,7 @@ Cancels this P2P connection. **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1567,6 +1678,7 @@ Starts to discover devices. **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1583,6 +1695,7 @@ Stops discovering devices. **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1594,17 +1707,21 @@ deletePersistentGroup(netId: number): boolean Deletes a persistent group. -**Required permissions**: ohos.permission.GET_WIFI_INFO +**System API**: This is a system API. + +**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| Mandatory| **Description**| | -------- | -------- | -------- | -------- | | netId | number | Yes| ID of the group to delete.| **Return value** + | Type| Description| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1615,13 +1732,15 @@ Deletes a persistent group. getP2pGroups(): Promise<Array<WifiP2pGroupInfo>> Obtains information about all P2P groups. This API uses a promise to return the result. -This is a system API. + +**System API**: This is a system API. **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION **System capability**: SystemCapability.Communication.WiFi.P2P **Return value** + | Type| Description| | -------- | -------- | | Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> > | Promise used to return the group information obtained.| @@ -1652,11 +1771,14 @@ getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void Obtains information about all P2P groups. This API uses an asynchronous callback to return the result. +**System API**: This is a system API. + **Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | callback | AsyncCallback< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.| @@ -1667,19 +1789,21 @@ Obtains information about all P2P groups. This API uses an asynchronous callback setDeviceName(devName: string): boolean Sets the device name. -This is a system API. -**Required permissions**: - ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) +**System API**: This is a system API. + +**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications) **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | devName | string | Yes| Device name to set.| **Return value** + | **Type**| **Description**| | -------- | -------- | | boolean | Returns **true** if the operation is successful; returns **false** otherwise.| @@ -1696,6 +1820,7 @@ Registers the WLAN state change events. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **wifiStateChange**.| @@ -1722,6 +1847,7 @@ Unregisters the WLAN state change events. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **wifiStateChange**.| @@ -1755,6 +1881,7 @@ Registers the WLAN connection state change events. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **wifiConnectionChange**.| @@ -1779,6 +1906,7 @@ Unregisters the WLAN connection state change events. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **wifiConnectionChange**.| @@ -1796,6 +1924,7 @@ Registers the WLAN scan state change events. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **wifiScanStateChange**.| @@ -1838,6 +1967,7 @@ Registers the RSSI change events. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **wifiRssiChange**.| @@ -1855,6 +1985,7 @@ Unregisters the RSSI change events. **System capability**: SystemCapability.Communication.WiFi.STA **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **wifiRssiChange**.| @@ -1872,6 +2003,7 @@ Registers the hotspot state change events. **System capability**: SystemCapability.Communication.WiFi.AP.Core **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **hotspotStateChange**.| @@ -1898,6 +2030,7 @@ Unregisters the hotspot state change events. **System capability**: SystemCapability.Communication.WiFi.AP.Core **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **hotspotStateChange**.| @@ -1915,6 +2048,7 @@ Registers the P2P state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pStateChange**.| @@ -1941,6 +2075,7 @@ Unregisters the P2P state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pStateChange**.| @@ -1958,6 +2093,7 @@ Registers the P2P connection state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pConnectionChange**.| @@ -1975,6 +2111,7 @@ Unregisters the P2P connection state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pConnectionChange**.| @@ -1992,6 +2129,7 @@ Registers the P2P device state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pDeviceChange**.| @@ -2009,6 +2147,7 @@ Unregisters the P2P device state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pDeviceChange**.| @@ -2026,6 +2165,7 @@ Registers the P2P peer device state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.| @@ -2043,6 +2183,7 @@ Unregisters the P2P peer device state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.| @@ -2060,6 +2201,7 @@ Registers the P2P persistent group state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.| @@ -2077,6 +2219,7 @@ Unregisters the P2P persistent group state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.| @@ -2094,6 +2237,7 @@ Registers the P2P device discovery state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pDiscoveryChange**.| @@ -2118,6 +2262,7 @@ Unregisters the P2P device discovery state change events. **System capability**: SystemCapability.Communication.WiFi.P2P **Parameters** + | **Name**| **Type**| **Mandatory**| **Description**| | -------- | -------- | -------- | -------- | | type | string | Yes| Event type. The value is **p2pDiscoveryChange**.| diff --git a/en/application-dev/reference/arkui-js/js-components-common-animation.md b/en/application-dev/reference/arkui-js/js-components-common-animation.md index 24676a73232a85ae609e6ea07b403bdd78961bb4..72969d608a86f4ce8fdf8ad2eb95431e18b93528 100644 --- a/en/application-dev/reference/arkui-js/js-components-common-animation.md +++ b/en/application-dev/reference/arkui-js/js-components-common-animation.md @@ -6,20 +6,20 @@ Components support dynamic rotation, translation, and scaling effects. These eff > > The initial APIs of this component are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. -| Name | Type | Default Value | Description | -| ------------------------- | ------------------------------------------------------------ | ------------------------------------- | ------------------------------------------------------------ | -| transform-origin | string6+ \| \ \| \ string6+ \| \ \| \ | center center | Origin position of the transformed element. The unit can be px or a percentage (relative to the animation target component). If only one value is specified, the other one is **50%**. The available values for the first string are **left**, **center**, and **right**. The available values for the second string are **top**, **center**, and **bottom**.
Example:
transform-origin: 200px 30%
transform-origin: 100px topt
ransform-origin: center center | -| transform | string | - | Translation, rotation, and scaling attributes.
For details, see **transform**. | -| animation6+ | string | 0s ease 0s 1 normal none running none | Animation attributes in the format of **duration \| timing-function \| delay \| iteration-count \| direction \| fill-mode \| play-state \| name**. The order of the parameters is not specified, but the **duration** and **delay** parameters are parsed based on where they are placed. | -| animation-name | string | - | @keyframes rule. For details, see **@keyframes**. | -| animation-delay | \