diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 32577605a6c0f2cb547733b9516aa02920c8a63b..58f1af867786ef91bbfa9f8ce080ccea70c36af8 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -624,11 +624,26 @@ 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. * If does't have the permission of ohos.permission.GET_WIFI_PEERS_MAC, return random bssid. @@ -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,31 @@ 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} 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. @@ -1596,7 +1632,7 @@ declare namespace wifiManager { * 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 + * @param { Callback } callback - the callback of on, 0: inactive, 1: active, 2: activating, 3: de-activating * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -1605,10 +1641,26 @@ 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<int>) 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} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 */ - function on(type: 'wifiStateChange', callback: Callback): void; + function onWifiStateChange(type: 'wifiStateChange', callback: Callback): void; /** * Unsubscribe Wi-Fi status change events. @@ -1632,7 +1684,7 @@ declare namespace wifiManager { *

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 + * @param { Callback } callback - the callback of off * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -1641,10 +1693,27 @@ 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; + 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} 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. @@ -1666,7 +1735,7 @@ declare namespace wifiManager { * 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 + * @param { Callback } callback - the callback of on, 0: disconnected, 1: connected * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -1675,10 +1744,26 @@ 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<int>) 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} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 */ - function on(type: 'wifiConnectionChange', callback: Callback): void; + function onWifiConnectionChange(type: 'wifiConnectionChange', callback: Callback): void; /** * Unsubscribe Wi-Fi connection change events. @@ -1700,7 +1785,7 @@ declare namespace wifiManager { * 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 + * @param { Callback } callback - the callback of off * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -1709,10 +1794,26 @@ 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} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 */ - function off(type: 'wifiConnectionChange', callback?: Callback): void; + function offWifiConnectionChange(type: 'wifiConnectionChange', callback?: Callback): void; /** * Subscribe Wi-Fi scan status change events. @@ -1734,7 +1835,7 @@ declare namespace wifiManager { * 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 + * @param { Callback } callback - the callback of on, 0: scan fail, 1: scan success * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -1742,10 +1843,25 @@ 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<int>) 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} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @atomicservice + * @since 20 + * @arkts 1.2 */ - function on(type: 'wifiScanStateChange', callback: Callback): void; + function onWifiScanStateChange(type: 'wifiScanStateChange', callback: Callback): void; /** * Unsubscribe Wi-Fi scan status change events. @@ -1767,7 +1883,7 @@ declare namespace wifiManager { * 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 + * @param { Callback } callback - the callback of off * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. @@ -1775,27 +1891,72 @@ 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} 801 - Capability not supported. + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @atomicservice + * @since 20 + * @arkts 1.2 */ - function off(type: 'wifiScanStateChange', callback?: Callback): void; + 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. * @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 - Parameter error. 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 9 + */ + function on(type: 'wifiRssiChange', callback: Callback): void; + + /** + * Subscribe Wi-Fi rssi change events. + * When the service exits, call off(type: 'wifiRssiChange', callback?: Callback<int>) 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} 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.

+ * @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 - Parameter error. 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 arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ - function on(type: 'wifiRssiChange', callback: Callback): void; + function off(type: 'wifiRssiChange', callback?: Callback): void; /** * Unsubscribe Wi-Fi rssi change events. @@ -1804,15 +1965,30 @@ declare namespace wifiManager { * @param { 'wifiRssiChange' } type - event name. * @param { Callback } callback - the callback of off * @throws {BusinessError} 201 - Permission denied. + * @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 + * @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 - Parameter error. 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 arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @systemapi Hide this for inner system use. + * @since 9 */ - function off(type: 'wifiRssiChange', callback?: Callback): void; + function on(type: 'streamChange', callback: Callback): void; /** * Subscribe Wi-Fi stream change events. @@ -1821,16 +1997,32 @@ declare namespace wifiManager { * @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} 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.

+ * @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 - Parameter error. 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 arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 9 */ - function on(type: 'streamChange', callback: Callback): void; + function off(type: 'streamChange', callback?: Callback): void; /** * Unsubscribe Wi-Fi stream change events. @@ -1840,22 +2032,20 @@ declare namespace wifiManager { * @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 - Parameter error. 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 arkts {'1.1':'9', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 20 + * @arkts 1.2 */ - function off(type: 'streamChange', callback?: Callback): void; + function offStreamChange(type: 'streamChange', 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 on, 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 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. @@ -1864,62 +2054,122 @@ 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; + function on(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. + * @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 - Parameter error. 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 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 - Parameter error. 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 + * @throws {BusinessError} 2501000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.STA + * @systemapi Hide this for inner system use. + * @since 9 */ - function on(type: 'hotspotStateChange', callback: Callback): void; + function off(type: 'deviceConfigChange', callback?: Callback): void; /** - * Unsubscribe Wi-Fi hotspot state change events. - * All callback functions will be deregistered If there is no specific callback parameter.

+ * Subscribe Wi-Fi device config change events. * @permission ohos.permission.GET_WIFI_INFO - * @param { 'hotspotStateChange' } type - event name. - * @param { Callback } callback - the callback of off - * @throws {BusinessError} 201 - Permission denied. + * @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} 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} 401 - Parameter error. 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 + * @since 9 */ - function off(type: 'hotspotStateChange', callback?: Callback): void; + function on(type: 'hotspotStateChange', callback: Callback): void; + + /** + * Subscribe Wi-Fi hotspot state change events. + * When the service exits, call off(type: 'hotspotStateChange', callback?: Callback<int>) 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} 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. + * 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} 401 - Parameter error. 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 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} 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. @@ -1928,17 +2178,32 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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.

@@ -1947,7 +2212,7 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2601000 - Operation failed. @@ -1958,6 +2223,23 @@ declare namespace wifiManager { */ 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} 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 @@ -1965,18 +2247,32 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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 @@ -1984,49 +2280,91 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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. * @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 + * @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 - Parameter error. 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 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<int>) 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} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 */ - function on(type: 'p2pStateChange', callback: Callback): void; + function onP2pStateChange(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 + * @param { Callback } callback - the callback of off * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. 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 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} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 */ - function off(type: 'p2pStateChange', callback?: Callback): void; + function offP2pStateChange(type: 'p2pStateChange', callback?: Callback): void; /** * Subscribe P2P connection change events. @@ -2035,32 +2373,59 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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 * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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. @@ -2068,7 +2433,7 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. @@ -2082,23 +2447,37 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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 * @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. + * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. @@ -2110,16 +2489,28 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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. @@ -2127,7 +2518,7 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. @@ -2141,23 +2532,37 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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 * @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. + * @throws {BusinessError} 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. * 2. Incorrect parameter types. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. @@ -2169,16 +2574,28 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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. @@ -2186,64 +2603,162 @@ declare namespace wifiManager { * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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 * @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. + * @throws {BusinessError} 401 - Parameter error. 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 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} 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. * @permission ohos.permission.GET_WIFI_INFO * @param { 'p2pDiscoveryChange' } type - event name. - * @param { Callback } callback - the callback of on + * @param { Callback } callback - the callback of on * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. 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 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<int>) 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} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 */ - function on(type: 'p2pDiscoveryChange', callback: Callback): void; + function onP2pDiscoveryChange(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 + * @param { Callback } callback - the callback of off * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Parameter error. 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 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} 801 - Capability not supported. + * @throws {BusinessError} 2801000 - Operation failed. + * @syscap SystemCapability.Communication.WiFi.P2P + * @since 20 + * @arkts 1.2 */ - function off(type: 'p2pDiscoveryChange', callback?: Callback): void; + 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.