46 Star 176 Fork 4.8K

OpenHarmony/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.enterprise.wifiManager.d.ts 33.30 KB
一键复制 编辑 原始数据 按行查看 历史
先希 提交于 4个月前 . update new errorCode
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
/*
* Copyright (c) 2023-2025 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit MDMKit
*/
import type { AsyncCallback } from './@ohos.base';
import type Want from './@ohos.app.ability.Want';
/**
* This module offers set wifi policies on the devices.
*
* @namespace wifiManager
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 10
*/
declare namespace wifiManager {
/**
* Describes the wifi security type.
*
* @enum { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
enum WifiSecurityType {
/**
* Invalid security type
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_INVALID = 0,
/**
* Open
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_OPEN = 1,
/**
* Wired Equivalent Privacy (WEP)
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_WEP = 2,
/**
* Pre-shared key (PSK)
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_PSK = 3,
/**
* Simultaneous Authentication of Equals (SAE)
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_SAE = 4,
/**
* EAP authentication.
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_EAP = 5,
/**
* SUITE_B_192 192 bit level.
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_EAP_SUITE_B = 6,
/**
* Opportunistic Wireless Encryption.
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_OWE = 7,
/**
* WAPI certificate to be specified.
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_WAPI_CERT = 8,
/**
* WAPI pre-shared key to be specified.
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
WIFI_SEC_TYPE_WAPI_PSK = 9
}
/**
* Wi-Fi IP type enumeration.
*
* @enum { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
enum IpType {
/**
* Use statically configured IP settings
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
STATIC,
/**
* Use dynamically configured IP settings
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
DHCP,
/**
* No IP details are assigned
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
UNKNOWN
}
/**
* Wi-Fi IP profile.
*
* @typedef IpProfile
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
interface IpProfile {
/**
* The ip address
*
* @type { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
ipAddress: number;
/**
* The gateway
*
* @type { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
gateway: number;
/**
* The length of prefix
*
* @type { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
prefixLength: number;
/**
* The DNS services
*
* @type { number[] }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
dnsServers: number[];
/**
* The domains
*
* @type { Array<string> }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
domains: Array<string>;
}
/**
* Wi-Fi EAP method.
*
* @enum { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
enum EapMethod {
/**
* Not specified
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_NONE,
/**
* Protected extensible authentication protocol
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_PEAP,
/**
* Transport layer security
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_TLS,
/**
* Tunneled transport layer security
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_TTLS,
/**
* Password
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_PWD,
/**
* Subscriber identity module
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_SIM,
/**
* Authentication and key agreement
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_AKA,
/**
* AKA prime
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_AKA_PRIME,
/**
* Unauth TLS
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
EAP_UNAUTH_TLS
}
/**
* Wi-Fi phase 2 method.
*
* @enum { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
enum Phase2Method {
/**
* Not specified
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_NONE,
/**
* Password authentication protocol
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_PAP,
/**
* Microsoft challenge handshake authentication protocol
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_MSCHAP,
/**
* Microsoft challenge handshake authentication protocol version 2
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_MSCHAPV2,
/**
* Generic token card
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_GTC,
/**
* Subscriber identity module
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_SIM,
/**
* Authentication and key agreement
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_AKA,
/**
* AKA Prime
*
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
PHASE2_AKA_PRIME
}
/**
* Wi-Fi EAP profile.
*
* @typedef WifiEapProfile
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
interface WifiEapProfile {
/**
* EAP authentication method
*
* @type { EapMethod }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
eapMethod: EapMethod;
/**
* Phase 2 authentication method
*
* @type { Phase2Method }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
phase2Method: Phase2Method;
/**
* The identity
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
identity: string;
/**
* Anonymous identity
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
anonymousIdentity: string;
/**
* Password
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
password: string;
/**
* CA certificate alias
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
caCertAliases: string;
/**
* CA certificate path
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
caPath: string;
/**
* Client certificate alias
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
clientCertAliases: string;
/**
* content of user's certificate
*
* @type { Uint8Array }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
certEntry: Uint8Array;
/**
* Password of user's certificate
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
certPassword: string;
/**
* Alternate subject match
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
altSubjectMatch: string;
/**
* Domain suffix match
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
domainSuffixMatch: string;
/**
* Realm for Passpoint credential
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
realm: string;
/**
* Public Land Mobile Network of the provider of Passpoint credential
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
plmn: string;
/**
* Sub ID of the SIM card
*
* @type { number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
eapSubId: number;
}
/**
* Wi-Fi profile.
*
* @typedef WifiProfile
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
interface WifiProfile {
/**
* Wi-Fi SSID: the maximum length is 32
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
ssid: string;
/**
* Wi-Fi bssid(MAC): the length is 6
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
bssid?: string;
/**
* Wi-Fi key: maximum length is 64
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
preSharedKey: string;
/**
* Hide SSID or not, false(default): not hide
*
* @type { ?boolean }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
isHiddenSsid?: boolean;
/**
* Security type: reference definition of WifiSecurityType
*
* @type { WifiSecurityType }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
securityType: WifiSecurityType;
/**
* The UID of the Wi-Fi profile creator
*
* @type { ?number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
creatorUid?: number;
/**
* Disable reason
*
* @type { ?number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
disableReason?: number;
/**
* Allocated networkId
*
* @type { ?number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
netId?: number;
/**
* Random mac type
*
* @type { ?number }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
randomMacType?: number;
/**
* Random mac address, the length is 6
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
randomMacAddr?: string;
/**
* IP Type
*
* @type { ?IpType }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
ipType?: IpType;
/**
* IP profile of static
*
* @type { ?IpProfile }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
staticIp?: IpProfile;
/**
* EAP profile info.
*
* @type { ?WifiEapProfile }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
eapProfile?: WifiEapProfile;
}
/**
* Gets state of whether the wifi is active.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_SET_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { AsyncCallback<boolean> } callback - the callback of isWifiActive.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function isWifiActive(admin: Want, callback: AsyncCallback<boolean>): void;
/**
* Gets state of whether the wifi is active.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_SET_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @returns { Promise<boolean> } the promise returned by isWifiActive.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function isWifiActive(admin: Want): Promise<boolean>;
/**
* Gets state of whether the Wi-Fi is active.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @returns { boolean } true if Wi-Fi is active.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
function isWifiActiveSync(admin: Want): boolean;
/**
* Sets the wifi profile.
*
* @permission ohos.permission.ENTERPRISE_SET_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { WifiProfile } profile - profile indicates the profile of wifi.
* @param { AsyncCallback<void> } callback - the callback of setWifiProfile.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function setWifiProfile(admin: Want, profile: WifiProfile, callback: AsyncCallback<void>): void;
/**
* Sets the wifi profile.
*
* @permission ohos.permission.ENTERPRISE_SET_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { WifiProfile } profile - profile indicates the profile of wifi.
* @returns { Promise<void> } the promise returned by setWifiProfile.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 10
*/
function setWifiProfile(admin: Want, profile: WifiProfile): Promise<void>;
/**
* Sets the Wi-Fi profile.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { WifiProfile } profile - profile indicates the profile of Wi-Fi.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 12
*/
function setWifiProfileSync(admin: Want, profile: WifiProfile): void;
/**
* Sets the Wi-Fi disabled.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* The admin must have the corresponding permission.
* @param { boolean } disabled - true if set the Wi-Fi disabled, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function setWifiDisabled(admin: Want, disabled: boolean): void;
/**
* Gets state of whether the Wi-Fi is disabled.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the administrator ability information.If the admin is not empty, it must
* have the corresponding permission.
* @returns { boolean } true if the Wi-Fi is disabled, otherwise false.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
* 2. Incorrect parameter types; 3. Parameter verification failed.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @systemapi
* @stagemodelonly
* @since 11
*/
function isWifiDisabled(admin: Want): boolean;
/**
* Wi-Fi access information.
*
* @typedef WifiAccessInfo
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
interface WifiAccessInfo {
/**
* ssid info.
*
* @type { string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
ssid: string;
/**
* bssid info.
*
* @type { ?string }
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
bssid?: string;
}
/**
* Adds disallowed wifi list by {@link WifiAccessInfo} array.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the administrator ability information.
* @param { Array<WifiAccessInfo> } list - an array of added Wi-Fi access information.
* The size of the array after setting cannot be greater 200.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 9200010 - A conflict policy has been configured.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
function addDisallowedWifiList(admin: Want, list: Array<WifiAccessInfo>): void;
/**
* Removes disallowed wifi list by {@link WifiAccessInfo} array.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the administrator ability information.
* @param { Array<WifiAccessInfo> } list - an array of removed Wi-Fi access information.
* The size of the array after setting cannot be greater 200.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
function removeDisallowedWifiList(admin: Want, list: Array<WifiAccessInfo>): void;
/**
* Gets the disallowed wifi list.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the administrator ability information.
* @returns { Array<WifiAccessInfo> } disallowed Wi-Fi access information.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
function getDisallowedWifiList(admin: Want): Array<WifiAccessInfo>;
/**
* Adds allowed wifi list by {@link WifiAccessInfo} array.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the administrator ability information.
* @param { Array<WifiAccessInfo> } list - an array of added Wi-Fi access information.
* The size of the array after setting cannot be greater 200.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 9200010 - A conflict policy has been configured.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
function addAllowedWifiList(admin: Want, list: Array<WifiAccessInfo>): void;
/**
* Removes allowed wifi list by {@link WifiAccessInfo} array.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the administrator ability information.
* @param { Array<WifiAccessInfo> } list - an array of removed Wi-Fi access information.
* The size of the array after setting cannot be greater 200.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
function removeAllowedWifiList(admin: Want, list: Array<WifiAccessInfo>): void;
/**
* Gets the allowed wifi list.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the administrator ability information.
* @returns { Array<WifiAccessInfo> } allowed Wi-Fi access information.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 19
*/
function getAllowedWifiList(admin: Want): Array<WifiAccessInfo>;
/**
* Turn on wifi.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @param { boolean } isForce - True means force open wifi, user can not turn off it, false means user can turn off it.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 203 - This function is prohibited by enterprise management policies.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
function turnOnWifi(admin: Want, isForce: boolean): void;
/**
* Turn off wifi.
* This function can be called by a super administrator.
*
* @permission ohos.permission.ENTERPRISE_MANAGE_WIFI
* @param { Want } admin - admin indicates the enterprise admin extension ability information.
* If the admin is not empty, it must have the corresponding permission.
* @throws { BusinessError } 9200001 - The application is not an administrator application of the device.
* @throws { BusinessError } 9200002 - The administrator application does not have permission to manage the device.
* @throws { BusinessError } 201 - Permission verification failed. The application does not have the permission required to call the API.
* @throws { BusinessError } 203 - This function is prohibited by enterprise management policies.
* @syscap SystemCapability.Customization.EnterpriseDeviceManager
* @stagemodelonly
* @since 20
*/
function turnOffWifi(admin: Want): void;
}
export default wifiManager;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助