提交 a0b278db 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 18d11e0d
...@@ -8,8 +8,6 @@ The **DataStorage** module provides applications with data processing capability ...@@ -8,8 +8,6 @@ The **DataStorage** module provides applications with data processing capability
> - The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> >
> - The APIs of this module are no longer maintained since API version 9. You are advised to use [@ohos.data.preferences](js-apis-data-preferences.md). > - The APIs of this module are no longer maintained since API version 9. You are advised to use [@ohos.data.preferences](js-apis-data-preferences.md).
>
> - The APIs of this module can be used only in the FA model.
## Modules to Import ## Modules to Import
...@@ -188,7 +186,7 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete ...@@ -188,7 +186,7 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------------------- | | -------- | ------------------------- | ---- | -------------------------- |
| path | string | Yes | Path of the target file.| | path | string | Yes | Path of the target file.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. |
**Example** **Example**
...@@ -230,7 +228,7 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete ...@@ -230,7 +228,7 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
| Type | Description | | Type | Description |
| ------------------- | ------------------------------- | | ------------------- | ------------------------------- |
| Promise&lt;void&gt; | Promise that returns no value. | | Promise&lt;void&gt; | Promise that returns no value.|
**Example** **Example**
...@@ -295,7 +293,7 @@ Removes the singleton **Storage** instance of a file from the cache. The removed ...@@ -295,7 +293,7 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------------------- | | -------- | ------------------------- | ---- | -------------------------- |
| path | string | Yes | Path of the target file.| | path | string | Yes | Path of the target file.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. |
**Example** **Example**
...@@ -337,7 +335,7 @@ Removes the singleton **Storage** instance of a file from the cache. The removed ...@@ -337,7 +335,7 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
| Type | Description | | Type | Description |
| ------------------- | ------------------------------- | | ------------------- | ------------------------------- |
| Promise&lt;void&gt; | Promise that returns no value. | | Promise&lt;void&gt; | Promise that returns no value.|
**Example** **Example**
...@@ -490,7 +488,7 @@ Obtains the **Storage** instance corresponding to the specified file, writes dat ...@@ -490,7 +488,7 @@ Obtains the **Storage** instance corresponding to the specified file, writes dat
| -------- | ------------------------- | ---- | ----------------------------------------- | | -------- | ------------------------- | ---- | ----------------------------------------- |
| key | string | Yes | Key of the data. It cannot be empty. | | key | string | Yes | Key of the data. It cannot be empty. |
| value | [ValueType](#valuetype) | Yes | New value to store. It can be a number, string, or Boolean value.| | value | [ValueType](#valuetype) | Yes | New value to store. It can be a number, string, or Boolean value.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. |
**Example** **Example**
...@@ -524,7 +522,7 @@ Obtains the **Storage** instance corresponding to the specified file, writes dat ...@@ -524,7 +522,7 @@ Obtains the **Storage** instance corresponding to the specified file, writes dat
| Type | Description | | Type | Description |
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise that returns no value. | | Promise&lt;void&gt; | Promise that returns no value.|
**Example** **Example**
...@@ -672,7 +670,7 @@ Deletes data with the specified key from this storage object. This API uses an a ...@@ -672,7 +670,7 @@ Deletes data with the specified key from this storage object. This API uses an a
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------- | | -------- | ------------------------- | ---- | ------------------------------- |
| key | string | Yes | Key of the data. It cannot be empty.| | key | string | Yes | Key of the data. It cannot be empty.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. |
**Example** **Example**
...@@ -705,7 +703,7 @@ Deletes data with the specified key from this storage object. This API uses a pr ...@@ -705,7 +703,7 @@ Deletes data with the specified key from this storage object. This API uses a pr
| Type | Description | | Type | Description |
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise that returns no value. | | Promise&lt;void&gt; | Promise that returns no value.|
**Example** **Example**
...@@ -746,7 +744,7 @@ Saves the modification of this object to the **Storage** instance and synchroniz ...@@ -746,7 +744,7 @@ Saves the modification of this object to the **Storage** instance and synchroniz
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value.|
**Example** **Example**
...@@ -773,7 +771,7 @@ Saves the modification of this object to the **Storage** instance and synchroniz ...@@ -773,7 +771,7 @@ Saves the modification of this object to the **Storage** instance and synchroniz
| Type | Description | | Type | Description |
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise that returns no value. | | Promise&lt;void&gt; | Promise that returns no value.|
**Example** **Example**
...@@ -814,7 +812,7 @@ Clears this **Storage** object. This API uses an asynchronous callback to return ...@@ -814,7 +812,7 @@ Clears this **Storage** object. This API uses an asynchronous callback to return
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback that returns no value.|
**Example** **Example**
...@@ -840,7 +838,7 @@ Clears this **Storage** object. This API uses a promise to return the result. ...@@ -840,7 +838,7 @@ Clears this **Storage** object. This API uses a promise to return the result.
**Return value** **Return value**
| Type | Description | | Type | Description |
| ------------------- | --------------------------- | | ------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise that returns no value. | | Promise&lt;void&gt; | Promise that returns no value.|
**Example** **Example**
......
# WLAN Extension Interface # @ohos.wifiManagerExt (WLAN Extension)
This **wifiext** module provides WLAN extension interfaces for non-universal products. This **wifiext** module provides WLAN extension interfaces for non-universal products.
> **NOTE** > **NOTE**
> >
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The APIs described in this document are used only for non-universal products, such as routers. > - The APIs described in this document are used only for non-universal products, such as routers.
## Modules to Import ## Modules to Import
...@@ -14,9 +14,9 @@ The APIs described in this document are used only for non-universal products, su ...@@ -14,9 +14,9 @@ The APIs described in this document are used only for non-universal products, su
import wifiManagerExt from '@ohos.wifiManagerExt'; import wifiManagerExt from '@ohos.wifiManagerExt';
``` ```
## wifiext.enableHotspot ## wifiext.enableHotspot<sup>9+</sup>
enableHotspot(): boolean; enableHotspot(): void;
Enables the WLAN hotspot. Enables the WLAN hotspot.
...@@ -24,16 +24,17 @@ Enables the WLAN hotspot. ...@@ -24,16 +24,17 @@ Enables the WLAN hotspot.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension **System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value** **Error codes**
| **Type**| **Description**| For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.disableHotspot ## wifiext.disableHotspot<sup>9+</sup>
disableHotspot(): boolean; disableHotspot(): void;
Disables the WLAN hotspot. Disables the WLAN hotspot.
...@@ -41,18 +42,19 @@ Disables the WLAN hotspot. ...@@ -41,18 +42,19 @@ Disables the WLAN hotspot.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension **System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value** **Error codes**
| **Type**| **Description**| For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.getSupportedPowerModel ## wifiext.getSupportedPowerMode<sup>9+</sup>
getSupportedPowerModel(): Promise&lt;Array&lt;PowerModel&gt;&gt; getSupportedPowerMode(): Promise&lt;Array&lt;PowerMode&gt;&gt;
Obtains the supported power models. This API uses a promise to return the result. Obtains the supported power modes. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO **Required permissions**: ohos.permission.GET_WIFI_INFO
...@@ -60,14 +62,21 @@ Obtains the supported power models. This API uses a promise to return the result ...@@ -60,14 +62,21 @@ Obtains the supported power models. This API uses a promise to return the result
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;Array&lt;[PowerModel](#powermodel)&gt;&gt; | Promise used to return the power models obtained.| | Promise&lt;Array&lt;[PowerMode](#powermode)&gt;&gt; | Promise used to return the power modes obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
## PowerModel | **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
Enumerates the power models. ## PowerMode
Enumerates the power modes.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension **System capability**: SystemCapability.Communication.WiFi.AP.Extension
...@@ -78,11 +87,11 @@ Enumerates the power models. ...@@ -78,11 +87,11 @@ Enumerates the power models.
| THROUGH_WALL | 2 | Through_wall| | THROUGH_WALL | 2 | Through_wall|
## wifiext.getSupportedPowerModel ## wifiext.getSupportedPowerMode<sup>9+</sup>
getSupportedPowerModel(callback: AsyncCallback&lt;Array&lt;PowerModel&gt;&gt;): void getSupportedPowerMode(callback: AsyncCallback&lt;Array&lt;PowerMode&gt;&gt;): void
Obtains the supported power models. This API uses an asynchronous callback to return the result. Obtains the supported power modes. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO **Required permissions**: ohos.permission.GET_WIFI_INFO
...@@ -90,16 +99,23 @@ Obtains the supported power models. This API uses an asynchronous callback to re ...@@ -90,16 +99,23 @@ Obtains the supported power models. This API uses an asynchronous callback to re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;Array&lt;[PowerModel](#powermodel)&gt;&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is 0 and **data** is the power models obtained. If **err** is not **0**, an error has occurred.| | callback | AsyncCallback&lt;Array&lt;[PowerMode](#powermode)&gt;&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power modes obtained. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.getPowerModel ## wifiext.getPowerMode<sup>9+</sup>
getPowerModel(): Promise&lt;PowerModel&gt; getPowerMode(): Promise&lt;PowerMode&gt;
Obtains the power model. This API uses a promise to return the result. Obtains the power mode. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO **Required permissions**: ohos.permission.GET_WIFI_INFO
...@@ -107,16 +123,23 @@ Obtains the power model. This API uses a promise to return the result. ...@@ -107,16 +123,23 @@ Obtains the power model. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[PowerModel](#powermodel)&gt; | Promise used to return the power model obtained.| | Promise&lt;[PowerMode](#powermode)&gt; | Promise used to return the power modes obtained.|
**Error codes**
## wifiext.getPowerModel For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
getPowerModel(callback: AsyncCallback&lt;PowerModel&gt;): void | **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
Obtains the power model. This API uses an asynchronous callback to return the result. ## wifiext.getPowerMode<sup>9+</sup>
getPowerMode(callback: AsyncCallback&lt;PowerMode&gt;): void
Obtains the power mode. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO **Required permissions**: ohos.permission.GET_WIFI_INFO
...@@ -124,16 +147,23 @@ Obtains the power model. This API uses an asynchronous callback to return the re ...@@ -124,16 +147,23 @@ Obtains the power model. This API uses an asynchronous callback to return the re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[PowerModel](#powermodel)&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power model obtained. If **err** is not **0**, an error has occurred.| | callback | AsyncCallback&lt;[PowerMode](#powermode)&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power mode obtained. If **err** is not **0**, an error has occurred.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
## wifiext.setPowerModel | **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
setPowerModel(model: PowerModel) : boolean; ## wifiext.setPowerMode<sup>9+</sup>
Sets the power model. setPowerMode(model: PowerMode) : boolean;
Sets the power mode.
**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT **Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
...@@ -141,12 +171,14 @@ setPowerModel(model: PowerModel) : boolean; ...@@ -141,12 +171,14 @@ setPowerModel(model: PowerModel) : boolean;
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| model | [PowerModel](#powermodel) | Yes| Power model to set.| | model | [PowerMode](#powermode) | Yes| Power mode to set.|
**Return value** **Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **Type**| **Description**|
| -------- | -------- | | -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.| | 2701000 | Operation failed.|
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
- [NFC Error Codes](errorcode-nfc.md) - [NFC Error Codes](errorcode-nfc.md)
- [RPC Error Codes](errorcode-rpc.md) - [RPC Error Codes](errorcode-rpc.md)
- [Bluetooth Error Codes](errorcode-bluetoothManager.md) - [Bluetooth Error Codes](errorcode-bluetoothManager.md)
- [Wi-Fi Error Codes](errorcode-wifi.md)
- Basic Features - Basic Features
- [Accessibility Error Codes](errorcode-accessibility.md) - [Accessibility Error Codes](errorcode-accessibility.md)
- [FaultLogger Error Codes](errorcode-faultlogger.md) - [FaultLogger Error Codes](errorcode-faultlogger.md)
......
# Wi-Fi Error Codes
## 2401000 STA Internal Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs an operation related to the station (STA).
**Possible Causes**
1. Communication between the Wi-Fi service and the STA failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the Wi-Fi function again.
2. If the error persists, restart the device.
## 2501000 STA Internal Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a STA-related operation.
**Possible Causes**
1. Communication between the Wi-Fi service and the STA failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the Wi-Fi function again.
2. If the error persists, restart the device.
## 2501001 STA Disabled
**Error Message**
Wifi is closed.
**Description**
The Wi-Fi STA function is disabled.
**Possible Causes**
The Wi-Fi function is disabled.
**Solution**
Enable the Wi-Fi function.
## 2601000 Hotspot Module Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a hotspot-related operation.
**Possible Causes**
1. Communication between the Wi-Fi service and the hotspot failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the hotspot again.
2. If the error persists, restart the device.
## 2701000 AP Extension Module Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a hotspot-related operation.
**Possible Causes**
1. Communication between the Wi-Fi service and the hotspot failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the hotspot again.
2. If the error persists, restart the device.
## 2801000 P2P Module Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a P2P-related operation.
**Possible Causes**
1. Communication with the Wi-Fi service failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the Wi-Fi function again.
2. If the error persists, restart the device.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册