diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 21ad360b0075b96d9e2d898de7b3d453a4eb83c9..0ed2e6f197cffce33600823716ab446334f327ed 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -142,7 +142,9 @@ declare namespace wifi { *
This method adds one configuration at a time. After this configuration is added, * your device will determine whether to connect to the hotspot. * + * @param config - candidate config. * @return Returns {@code networkId} if the configuration is added; returns {@code -1} otherwise. + * * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO @@ -156,13 +158,15 @@ declare namespace wifi { * *
This method removes one configuration at a time.
*
+ * @param networkId - Network ID which will be removed.
+ * @return Returns {@code true} if the candidate hotspot configuration is removed, returns {@code false} otherwise.
+ *
* @since 9
- * @throws {TypedError | Error} when failed to remove the hotspot configuration.
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.SET_WIFI_INFO
*/
- function removeCandidateConfig(networkId: number): Promise You can obtain only the Wi-Fi configurations you created on your own application.
*
* @return Returns the list of all existing Wi-Fi configurations you created on your application.
+ *
* @since 9
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
@@ -182,13 +187,15 @@ declare namespace wifi {
*
* This method connect to a configuration at a time.
*
- * @param {number} networkId - Network ID which will be connected.
- * @throws {TypedError | Error} when failed connect to the hotspot configuration
+ * @param networkId - Network ID which will be connected.
+ * Returns {@code true} if the operation is successful, returns {@code false} otherwise. The connect result
+ * will be indicated by the call back function of wifi connection change.
+ *
* @since 9
* @syscap SystemCapability.Communication.WiFi.STA
* @permission ohos.permission.SET_WIFI_INFO
*/
- function connectToCandidateConfig(networkId: number): void;
+ function connectToCandidateConfig(networkId: number): boolean;
/**
* Connects to Wi-Fi network.
@@ -1070,8 +1077,13 @@ declare namespace wifi {
/* @systemapi */
staticIp: IpConfig;
- /** EAP config info */
- /* @systemapi */
+ /**
+ * EAP config info.
+ *
+ * @since 9
+ * @systemapi
+ * @syscap SystemCapability.Communication.WiFi.STA
+ */
eapConfig: WifiEapConfig;
}
@@ -1149,13 +1161,28 @@ declare namespace wifi {
/** Channel width */
channelWidth: number;
- /** Center frequency */
+ /**
+ * Center frequency 0.
+ *
+ * @since 9
+ * @syscap SystemCapability.Communication.WiFi.STA
+ */
centerFrequency0: number;
- /** Center frequency */
+ /**
+ * Center frequency 1.
+ *
+ * @since 9
+ * @syscap SystemCapability.Communication.WiFi.STA
+ */
centerFrequency1: number;
- /** Information elements */
+ /**
+ * Information elements.
+ *
+ * @since 9
+ * @syscap SystemCapability.Communication.WiFi.STA
+ */
infoElems: Array