# @ohos.enterprise.wifiManager (Wi-Fi Management) The **wifiManager** module provides Wi-Fi management capabilities for enterprise devices. Only the enterprise device administrator applications can call the APIs provided by this module. > **NOTE** > > The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import ```js import wifiManager from '@ohos.enterprise.wifiManager'; ``` ## wifiManager.isWifiActive isWifiActive(admin: Want, callback: AsyncCallback<boolean>): void Checks whether Wi-Fi is enabled. This API uses an asynchronous callback to return the result. **Required permissions**: ohos.permission.ENTERPRISE_SET_WIFI **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Parameters** | Name | Type | Mandatory | Description | | -------- | ---------------------------------------- | ---- | ------------------------------- | | admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application. | | callback | AsyncCallback<boolean> | Yes | Callback invoked to return whether Wi-Fi is enabled. | **Error codes** For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). | ID| Error Message | | ------- | ---------------------------------------------------------------------------- | | 9200001 | The application is not an administrator application of the device. | | 9200002 | The administrator application does not have permission to manage the device. | **Example** ```js let wantTemp = { bundleName: "com.example.myapplication", abilityName: "EntryAbility", }; wifiManager.isWifiActive(wantTemp, (error, result) => { if (error != null) { console.log("error code:" + error.code + " error message:" + error.message); return; } console.log(result); }); ``` ## wifiManager.isWifiActive isWifiActive(admin: Want): Promise<boolean> Checks whether Wi-Fi is active. This API uses a promise to return the result. **Required permissions**: ohos.permission.ENTERPRISE_SET_WIFI **System capability**: SystemCapability.Customization.EnterpriseDeviceManager **System API**: This is a system API. **Parameters** | Name | Type | Mandatory | Description | | ----- | ----------------------------------- | ---- | ------- | | admin | [Want](js-apis-app-ability-want.md) | Yes | Device administrator application.| **Return value** | Type | Description | | --------------------- | ------------------------- | | Promise<boolean> | Promise used to return whether Wi-Fi is active. | **Error codes** For details about the error codes, see [Enterprise Device Management Error Codes](../errorcodes/errorcode-enterpriseDeviceManager.md). | ID| Error Message | | ------- | ---------------------------------------------------------------------------- | | 9200001 | The application is not an administrator application of the device. | | 9200002 | The administrator application does not have permission to manage the device. | **Example** ```js let wantTemp = { bundleName: "com.example.myapplication", abilityName: "EntryAbility", }; wifiManager.isWifiActive(wantTemp).then((result) => { console.log(result); }).catch(error => { console.log("error code:" + error.code + " error message:" + error.message); }); ```