diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 90cbbfa9dcf78eb6caca97b66c76b257f27a60c4..54818887de5821b170d07ca425b0503b367177be 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -624,10 +624,25 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.STA * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function getLinkedInfo(): Promise; + + /** + * Obtain connection information about the Wi-Fi connection. If does't have the permission of ohos.permission.GET_WIFI_PEERS_MAC, return random bssid. + * @permission ohos.permission.GET_WIFI_INFO + * @returns { Promise } Returns Wi-Fi linked information. + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wi-Fi STA disabled. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function getLinkedInfoReturnsPromise(): Promise; /** * Obtain multiple Wi-Fi connection information when Wi-Fi linked in MLO(Muti-Link Operation) state. @@ -657,6 +672,7 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.STA * @since 9 */ + /** * Obtain connection information about the Wi-Fi connection. * @permission ohos.permission.GET_WIFI_INFO @@ -669,11 +685,33 @@ declare namespace wifiManager { * @throws {BusinessError} 2501001 - Wi-Fi STA disabled. * @syscap SystemCapability.Communication.WiFi.STA * @crossplatform - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function getLinkedInfo(callback: AsyncCallback): void; + /** + * Obtain connection information about the Wi-Fi connection. + * @permission ohos.permission.GET_WIFI_INFO + * @param { AsyncCallback } callback - Indicates callback of function. + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wi-Fi STA disabled. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @since 20 + * @arkts 1.2 + */ + function getLinkedInfoWithCallback(callback: AsyncCallback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload getLinkedInfo { getLinkedInfoReturnsPromise, getLinkedInfoWithCallback }; + /** * Obtain connection information about the Wi-Fi connection.this apireturns the result syncchronously. * If does't have the permission of ohos.permission.GET_WIFI_PEERS_MAC, return random bssid. @@ -1605,11 +1643,29 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.STA * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function on(type: 'wifiStateChange', callback: Callback): void; + /** + * Subscribe Wi-Fi status change events. + * When the service exits, call off(type: 'wifiStateChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiStateChange' } type - event name. + * @param { Callback } callback - the callback of on, 0: inactive, 1: active, 2: activating, 3: de-activating + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function onWifiStateChange(type: 'wifiStateChange', callback: Callback): void; + /** * Unsubscribe Wi-Fi status change events. * @@ -1641,11 +1697,30 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.STA * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function off(type: 'wifiStateChange', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi status change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiStateChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function offWifiStateChange(type: 'wifiStateChange', callback?: Callback): void; + /** * Subscribe Wi-Fi connection change events. * When the service exits, call off(type: 'wifiConnectionChange', callback?: Callback<number>) to unregister the callback registered. @@ -1675,11 +1750,29 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.STA * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function on(type: 'wifiConnectionChange', callback: Callback): void; + /** + * Subscribe Wi-Fi connection change events. + * When the service exits, call off(type: 'wifiConnectionChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiConnectionChange' } type - event name. + * @param { Callback } callback - the callback of on, 0: disconnected, 1: connected + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function onWifiConnectionChange(type: 'wifiConnectionChange', callback: Callback): void; + /** * Unsubscribe Wi-Fi connection change events. * All callback functions will be deregistered If there is no specific callback parameter.

@@ -1709,11 +1802,29 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.STA * @crossplatform * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function off(type: 'wifiConnectionChange', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi connection change events. + * All callback functions will be deregistered If there is no specific callback parameter.

+ * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiConnectionChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function offWifiConnectionChange(type: 'wifiConnectionChange', callback?: Callback): void; + /** * Subscribe Wi-Fi scan status change events. * When the service exits, call off(type: 'wifiScanStateChange', callback?: Callback<number>) to unregister the callback registered. @@ -1742,11 +1853,28 @@ declare namespace wifiManager { * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function on(type: 'wifiScanStateChange', callback: Callback): void; + /** + * Subscribe Wi-Fi scan status change events. + * When the service exits, call off(type: 'wifiScanStateChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiScanStateChange' } type - event name. + * @param { Callback } callback - the callback of on, 0: scan fail, 1: scan success + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function onWifiScanStateChange(type: 'wifiScanStateChange', callback: Callback): void; + /** * Unsubscribe Wi-Fi scan status change events. * All callback functions will be deregistered If there is no specific callback parameter.

@@ -1775,11 +1903,28 @@ declare namespace wifiManager { * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @atomicservice - * @since arkts {'1.1':'12', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ function off(type: 'wifiScanStateChange', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi scan status change events. + * All callback functions will be deregistered If there is no specific callback parameter.

+ * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiScanStateChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function offWifiScanStateChange(type: 'wifiScanStateChange', callback?: Callback): void; + /** * Subscribe Wi-Fi rssi change events. * When the service exits, call off(type: 'wifiRssiChange', callback?: Callback<number>) to unregister the callback registered. @@ -1792,11 +1937,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'wifiRssiChange', callback: Callback): void; + /** + * Subscribe Wi-Fi rssi change events. + * When the service exits, call off(type: 'wifiRssiChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiRssiChange' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @since 20 + * @arkts 1.2 + */ + function onWifiRssiChange(type: 'wifiRssiChange', callback: Callback): void; + /** * Unsubscribe Wi-Fi rssi change events. * All callback functions will be deregistered If there is no specific callback parameter.

@@ -1809,11 +1970,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'wifiRssiChange', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi rssi change events. + * All callback functions will be deregistered If there is no specific callback parameter.

+ * @permission ohos.permission.GET_WIFI_INFO + * @param { 'wifiRssiChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @since 20 + * @arkts 1.2 + */ + function offWifiRssiChange(type: 'wifiRssiChange', callback?: Callback): void; + /** * Subscribe Wi-Fi stream change events. * @permission ohos.permission.MANAGE_WIFI_CONNECTION @@ -1827,11 +2004,28 @@ declare namespace wifiManager { * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'streamChange', callback: Callback): void; + /** + * Subscribe Wi-Fi stream change events. + * @permission ohos.permission.MANAGE_WIFI_CONNECTION + * @param { 'streamChange' } type - event name. + * @param { Callback } callback - the callback of on, 1: stream down, 2: stream up, 3: stream bidirectional + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function onStreamChange(type: 'streamChange', callback: Callback): void; + /** * Unsubscribe Wi-Fi stream change events. * All callback functions will be deregistered If there is no specific callback parameter.

@@ -1846,11 +2040,29 @@ declare namespace wifiManager { * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'streamChange', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi stream change events. + * All callback functions will be deregistered If there is no specific callback parameter.

+ * @permission ohos.permission.MANAGE_WIFI_CONNECTION + * @param { 'streamChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function offStreamChange(type: 'streamChange', callback?: Callback): void; + /** * Subscribe Wi-Fi device config change events. * @permission ohos.permission.GET_WIFI_INFO @@ -1864,8 +2076,7 @@ declare namespace wifiManager { * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'deviceConfigChange', callback: Callback): void; @@ -1873,7 +2084,7 @@ declare namespace wifiManager { * Subscribe Wi-Fi device config change events. * @permission ohos.permission.GET_WIFI_INFO * @param { 'deviceConfigChange' } type - event name. - * @param { Callback } callback - the callback of off, 0: config is added, 1: config is changed, 2: config is removed. + * @param { Callback } callback - the callback of on, 0: config is added, 1: config is changed, 2: config is removed. * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. @@ -1882,28 +2093,80 @@ declare namespace wifiManager { * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function off(type: 'deviceConfigChange', callback?: Callback): void; + function onDeviceConfigChange(type: 'deviceConfigChange', callback: Callback): void; /** - * Subscribe Wi-Fi hotspot state change events. - * When the service exits, call off(type: 'hotspotStateChange', callback?: Callback<number>) to unregister the callback registered. + * Subscribe Wi-Fi device config change events. * @permission ohos.permission.GET_WIFI_INFO - * @param { 'hotspotStateChange' } type - event name. - * @param { Callback } callback - the callback of on, 0: inactive, 1: active, 2: activating, 3: de-activating + * @param { 'deviceConfigChange' } type - event name. + * @param { Callback } callback - the callback of off, 0: config is added, 1: config is changed, 2: config is removed. * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2601000 - Operation failed. - * @syscap SystemCapability.Communication.WiFi.AP.Core - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 - */ - function on(type: 'hotspotStateChange', callback: Callback): void; + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @systemapi Hide this for inner system use. + * @since 9 + */ + function off(type: 'deviceConfigChange', callback?: Callback): void; + + /** + * Subscribe Wi-Fi device config change events. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'deviceConfigChange' } type - event name. + * @param { Callback } callback - the callback of off, 0: config is added, 1: config is changed, 2: config is removed. + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function offDeviceConfigChange(type: 'deviceConfigChange', callback?: Callback): void; + + /** + * Subscribe Wi-Fi hotspot state change events. + * When the service exits, call off(type: 'hotspotStateChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'hotspotStateChange' } type - event name. + * @param { Callback } callback - the callback of on, 0: inactive, 1: active, 2: activating, 3: de-activating + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2601000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @since 9 + */ + function on(type: 'hotspotStateChange', callback: Callback): void; + + /** + * Subscribe Wi-Fi hotspot state change events. + * When the service exits, call off(type: 'hotspotStateChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'hotspotStateChange' } type - event name. + * @param { Callback } callback - the callback of on, 0: inactive, 1: active, 2: activating, 3: de-activating + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2601000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @since 20 + * @arkts 1.2 + */ + function onHotspotStateChange(type: 'hotspotStateChange', callback: Callback): void; /** * Unsubscribe Wi-Fi hotspot state change events. @@ -1918,11 +2181,28 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'hotspotStateChange', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi hotspot state change events. + * All callback functions will be deregistered If there is no specific callback parameter.

+ * @permission ohos.permission.GET_WIFI_INFO + * @param { 'hotspotStateChange'} type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2601000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @since 20 + * @arkts 1.2 + */ + function offHotspotStateChange(type: 'hotspotStateChange', callback?: Callback): void; + /** * Subscribe Wi-Fi hotspot sta join events. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT @@ -1936,11 +2216,28 @@ declare namespace wifiManager { * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'hotspotStaJoin', callback: Callback): void; + /** + * Subscribe Wi-Fi hotspot sta join events. + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @param { 'hotspotStaJoin' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2601000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function onHotspotStaJoin(type: 'hotspotStaJoin', callback: Callback): void; + /** * Unsubscribe Wi-Fi hotspot sta join events. * All callback functions will be deregistered If there is no specific callback parameter.

@@ -1955,11 +2252,29 @@ declare namespace wifiManager { * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'hotspotStaJoin', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi hotspot sta join events. + * All callback functions will be deregistered If there is no specific callback parameter.

+ * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @param { 'hotspotStaJoin' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2601000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function offHotspotStaJoin(type: 'hotspotStaJoin', callback?: Callback): void; + /** * Subscribe Wi-Fi hotspot sta leave events. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT @@ -1974,11 +2289,29 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.AP.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'hotspotStaLeave', callback: Callback): void; + /** + * Subscribe Wi-Fi hotspot sta leave events. + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @param { 'hotspotStaLeave' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2601000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.AP.Core + + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function onHotspotStaLeave(type: 'hotspotStaLeave', callback: Callback): void; + /** * Unsubscribe Wi-Fi hotspot sta leave events. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT @@ -1992,11 +2325,28 @@ declare namespace wifiManager { * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @systemapi Hide this for inner system use. - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'hotspotStaLeave', callback?: Callback): void; + /** + * Unsubscribe Wi-Fi hotspot sta leave events. + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @param { 'hotspotStaLeave' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by Non-system application. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2601000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function offHotspotStaLeave(type: 'hotspotStaLeave', callback?: Callback): void; + /** * Subscribe P2P status change events. * When the service exits, call off(type: 'p2pStateChange', callback?: Callback<number>) to unregister the callback registered. @@ -2009,11 +2359,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'p2pStateChange', callback: Callback): void; + /** + * Subscribe P2P status change events. + * When the service exits, call off(type: 'p2pStateChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pStateChange' } type - event name. + * @param { Callback } callback - the callback of on, 1: idle, 2: starting, 3:started, 4: closing, 5: closed + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function onP2pStateChange(type: 'p2pStateChange', callback: Callback): void; + /** * Unsubscribe P2P status change events. * @permission ohos.permission.GET_WIFI_INFO @@ -2025,11 +2391,26 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'p2pStateChange', callback?: Callback): void; + /** + * Unsubscribe P2P status change events. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pStateChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function offP2pStateChange(type: 'p2pStateChange', callback?: Callback): void; + /** * Subscribe P2P connection change events. * When the service exits, call off(type: 'p2pConnectionChange', callback?: Callback<WifiP2pLinkedInfo>) to unregister the callback registered. @@ -2042,11 +2423,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'p2pConnectionChange', callback: Callback): void; + /** + * Subscribe P2P connection change events. + * When the service exits, call off(type: 'p2pConnectionChange', callback?: Callback<WifiP2pLinkedInfo>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pConnectionChange' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function onP2pConnectionChange(type: 'p2pConnectionChange', callback: Callback): void; + /** * Unsubscribe P2P connection change events. * @permission ohos.permission.GET_WIFI_INFO @@ -2058,11 +2455,26 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'p2pConnectionChange', callback?: Callback): void; + /** + * Unsubscribe P2P connection change events. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pConnectionChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function offP2pConnectionChange(type: 'p2pConnectionChange', callback?: Callback): void; + /** * Subscribe P2P local device change events. * When the service exits, call off(type: 'p2pDeviceChange', callback?: Callback<WifiP2pDevice>) to unregister the callback registered. @@ -2089,11 +2501,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function on(type: 'p2pDeviceChange', callback: Callback): void; + /** + * Subscribe P2P local device change events. + * When the service exits, call off(type: 'p2pDeviceChange', callback?: Callback<WifiP2pDevice>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pDeviceChange' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function onP2pDeviceChange(type: 'p2pDeviceChange', callback: Callback): void; + /** * Unsubscribe P2P local device change events. * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION @@ -2117,11 +2545,25 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function off(type: 'p2pDeviceChange', callback?: Callback): void; + /** + * Unsubscribe P2P local device change events. + * @param { 'p2pDeviceChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function offP2pDeviceChange(type: 'p2pDeviceChange', callback?: Callback): void; + /** * Subscribe P2P peer device change events. * When the service exits, call off(type: 'p2pPeerDeviceChange', callback?: Callback<WifiP2pDevice[]>) to unregister the callback registered. @@ -2148,11 +2590,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function on(type: 'p2pPeerDeviceChange', callback: Callback): void; + /** + * Subscribe P2P peer device change events. + * When the service exits, call off(type: 'p2pPeerDeviceChange', callback?: Callback<WifiP2pDevice[]>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pPeerDeviceChange' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function onP2pPeerDeviceChange(type: 'p2pPeerDeviceChange', callback: Callback): void; + /** * Unsubscribe P2P peer device change events. * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION @@ -2176,11 +2634,25 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'10', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ function off(type: 'p2pPeerDeviceChange', callback?: Callback): void; + /** + * Unsubscribe P2P peer device change events. + * @param { 'p2pPeerDeviceChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function offP2pPeerDeviceChange(type: 'p2pPeerDeviceChange', callback?: Callback): void; + /** * Subscribe P2P persistent group change events. * When the service exits, call off(type: 'p2pPersistentGroupChange', callback?: Callback<void>) to unregister the callback registered. @@ -2193,11 +2665,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'p2pPersistentGroupChange', callback: Callback): void; + /** + * Subscribe P2P persistent group change events. + * When the service exits, call off(type: 'p2pPersistentGroupChange', callback?: Callback<void>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pPersistentGroupChange' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function onP2pPersistentGroupChange(type: 'p2pPersistentGroupChange', callback: Callback): void; + /** * Unsubscribe P2P persistent group change events. * @permission ohos.permission.GET_WIFI_INFO @@ -2209,11 +2697,26 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'p2pPersistentGroupChange', callback?: Callback): void; + /** + * Unsubscribe P2P persistent group change events. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pPersistentGroupChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function offP2pPersistentGroupChange(type: 'p2pPersistentGroupChange', callback?: Callback): void; + /** * Subscribe P2P discovery events. * When the service exits, call off(type: 'p2pDiscoveryChange', callback?: Callback<number>) to unregister the callback registered. @@ -2226,11 +2729,27 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function on(type: 'p2pDiscoveryChange', callback: Callback): void; + /** + * Subscribe P2P discovery events. + * When the service exits, call off(type: 'p2pDiscoveryChange', callback?: Callback<number>) to unregister the callback registered. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pDiscoveryChange' } type - event name. + * @param { Callback } callback - the callback of on + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function onP2pDiscoveryChange(type: 'p2pDiscoveryChange', callback: Callback): void; + /** * Unsubscribe P2P discovery events. * @permission ohos.permission.GET_WIFI_INFO @@ -2242,11 +2761,70 @@ declare namespace wifiManager { * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P - * @since arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ function off(type: 'p2pDiscoveryChange', callback?: Callback): void; + /** + * Unsubscribe P2P discovery events. + * @permission ohos.permission.GET_WIFI_INFO + * @param { 'p2pDiscoveryChange' } type - event name. + * @param { Callback } callback - the callback of off + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified. + * 2. Incorrect parameter types. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 + */ + function offP2pDiscoveryChange(type: 'p2pDiscoveryChange', callback?: Callback): void; + + /** + * @since 20 + * @arkts 1.2 + */ + overload on { + onWifiStateChange, + onWifiConnectionChange, + onWifiScanStateChange, + onWifiRssiChange, + onStreamChange, + onDeviceConfigChange, + onHotspotStateChange, + onHotspotStaJoin, + onHotspotStaLeave, + onP2pStateChange, + onP2pConnectionChange, + onP2pDeviceChange, + onP2pPeerDeviceChange, + onP2pPersistentGroupChange, + onP2pDiscoveryChange + }; + + /** + * @since 20 + * @arkts 1.2 + */ + overload off { + offWifiStateChange, + offWifiConnectionChange, + offWifiScanStateChange, + offWifiRssiChange, + offStreamChange, + offDeviceConfigChange, + offHotspotStateChange, + offHotspotStaJoin, + offHotspotStaLeave, + offP2pStateChange, + offP2pConnectionChange, + offP2pDeviceChange, + offP2pPeerDeviceChange, + offP2pPersistentGroupChange, + offP2pDiscoveryChange + }; + /** * Wi-Fi device address( mac / bssid ) type. * @enum { number }