46 Star 173 Fork 4.7K

OpenHarmony/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.wifiManager.d.ts 166.78 KB
一键复制 编辑 原始数据 按行查看 历史
孙浚予 提交于 28天前 . qiangji2.0wifi
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828
/*
* Copyright (C) 2022-2023 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 ConnectivityKit
*/
import { AsyncCallback, Callback } from './@ohos.base';
/**
* Provides methods to operate or manage Wi-Fi.
* @namespace wifiManager
* @since 9
*/
/**
* Provides methods to operate or manage Wi-Fi.
* @namespace wifiManager
* @atomicservice
* @since 11
*/
/**
* Provides methods to operate or manage Wi-Fi.
* @namespace wifiManager
* @syscap SystemCapability.Communication.WiFi.STA
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
declare namespace wifiManager {
/**
* Enable Wi-Fi.
* @permission ohos.permission.SET_WIFI_INFO and (ohos.permission.MANAGE_WIFI_CONNECTION or
* ohos.permission.MANAGE_ENTERPRISE_WIFI_CONNECTION)
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501003 - Operation failed because the service is being closed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'15', '1.2':'20'}
* @arkts 1.1&1.2
*/
function enableWifi(): void;
/**
* Disable Wi-Fi.
* @permission ohos.permission.SET_WIFI_INFO and (ohos.permission.MANAGE_WIFI_CONNECTION or
* ohos.permission.MANAGE_ENTERPRISE_WIFI_CONNECTION)
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501004 - Operation failed because the service is being opened.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'20', '1.2':'20'}
* @arkts 1.1&1.2
*/
function disableWifi(): void;
/**
* Enable semi - Wifi.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @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.
* @throws {BusinessError} 2501004 - Operation failed because the service is being opened.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function enableSemiWifi(): void;
/**
* Query the Wi-Fi status
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } Returns {@code true} if the Wi-Fi is active, returns {@code false} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Query the Wi-Fi status
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } Returns {@code true} if the Wi-Fi is active, returns {@code false} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 11
*/
/**
* Query the Wi-Fi status
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } Returns {@code true} if the Wi-Fi is active, returns {@code false} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @crossplatform
* @atomicservice
* @since 12
*/
/**
* Query the Wi-Fi status
* @returns { boolean } Returns {@code true} if the Wi-Fi is active, returns {@code false} otherwise.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'13', '1.2':'20'}
* @arkts 1.1&1.2
*/
function isWifiActive(): boolean;
/**
* Scan Wi-Fi hotspot.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
* @deprecated since 10
* @useinstead wifiManager.startScan
*/
function scan(): void;
/**
* Scan Wi-Fi hotspot.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @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 10
*/
function startScan(): void;
/**
* Obtain the scanned sta list.
* @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or
* (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION))
* @returns { Promise<Array<WifiScanInfo>> } Returns information about scanned Wi-Fi hotspot if any.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
* @deprecated since 10
* @useinstead wifiManager.getScanInfoList
*/
function getScanResults(): Promise<Array<WifiScanInfo>>;
/**
* Obtains information about a Wi-Fi detail state.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @returns { WifiDetailState } Returns information about wifi state.
* @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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getWifiDetailState(): WifiDetailState;
/**
* Obtain the scanned sta list.
* @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or
* (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION))
* @param { AsyncCallback<Array<WifiScanInfo>> } callback - Returns information about scanned Wi-Fi hotspot if any.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
* @deprecated since 10
* @useinstead wifiManager.getScanInfoList
*/
function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void;
/**
* Obtain the scanned sta list.
* @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or
* (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION))
* @returns { Array<WifiScanInfo> } Returns information about scanned Wi-Fi hotspot if any.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
* @deprecated since 10
* @useinstead wifiManager.getScanInfoList
*/
function getScanResultsSync(): Array<WifiScanInfo>;
/**
* Obtain the scanned station list. If does't have the permission of ohos.permission.GET_WIFI_PEERS_MAC, return random bssid.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Array<WifiScanInfo> } Returns information about scanned Wi-Fi hotspot if any.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
/**
* Obtain the scanned station list. If does't have the permission of ohos.permission.GET_WIFI_PEERS_MAC, return random bssid.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Array<WifiScanInfo> } Returns information about scanned Wi-Fi hotspot if any.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getScanInfoList(): Array<WifiScanInfo>;
/**
* User can trigger scan even Wi-Fi is disabled.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
* @param { boolean } isScanAlwaysAllowed - true for allow trigger scan, otherwise don't allow trigger scan when Wi-Fi is disabled.
* @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 10
*/
function setScanAlwaysAllowed(isScanAlwaysAllowed: boolean): void;
/**
* Get scan always allowed flag.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @returns { boolean } Returns {@code true} if scan running state is true, returns {@code false} otherwise.
* @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 10
*/
function getScanAlwaysAllowed(): boolean;
/**
* Add Wi-Fi connection configuration to the device. The configuration will be updated when the configuration is added.</p>
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
* @param { WifiDeviceConfig } config - Indicates the device configuration for connection to the Wi-Fi network.
* @returns { Promise<number> } Returns {@code networkId} if the configuration is added; returns {@code -1} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 15
*/
function addDeviceConfig(config: WifiDeviceConfig): Promise<number>;
/**
* Add Wi-Fi connection configuration to the device. The configuration will be updated when the configuration is added.</p>
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
* @param { WifiDeviceConfig } config - Indicates the device configuration for connection to the Wi-Fi network.
* @param { AsyncCallback<number> } callback - Indicates call back of addDeviceConfig.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 15
*/
function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void;
/**
* Add a specified candidate hotspot configuration and returns the networkId.
* This method adds one configuration at a time. After this configuration is added,
* your device will determine whether to connect to the hotspot.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { WifiDeviceConfig } config - candidate config.
* @returns { Promise<number> } Returns {@code networkId} if the configuration is added; returns {@code -1} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Add a specified candidate hotspot configuration and returns the networkId.
* This method adds one configuration at a time. After this configuration is added,
* your device will determine whether to connect to the hotspot.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { WifiDeviceConfig } config - candidate config.
* @returns { Promise<number> } Returns {@code networkId} if the configuration is added; returns {@code -1} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
function addCandidateConfig(config: WifiDeviceConfig): Promise<number>;
/**
* Add a specified candidate hotspot configuration and returns the networkId.
* This method adds one configuration at a time. After this configuration is added,
* your device will determine whether to connect to the hotspot.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { WifiDeviceConfig } config - candidate config.
* @param { AsyncCallback<number> } callback - Indicates call back of addCandidateConfig.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Add a specified candidate hotspot configuration and returns the networkId.
* This method adds one configuration at a time. After this configuration is added,
* your device will determine whether to connect to the hotspot.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { WifiDeviceConfig } config - candidate config.
* @param { AsyncCallback<number> } callback - Indicates call back of addCandidateConfig.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void;
/**
* Remove a specified candidate hotspot configuration, only the configuration which is added by ourself is allowed
* to be removed.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { number } networkId - Network ID which will be removed.
* @returns { Promise<void> } Return results.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Remove a specified candidate hotspot configuration, only the configuration which is added by ourself is allowed
* to be removed.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { number } networkId - Network ID which will be removed.
* @returns { Promise<void> } Return results.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
function removeCandidateConfig(networkId: number): Promise<void>;
/**
* Remove a specified candidate hotspot configuration, only the configuration which is added by ourself is allowed
* to be removed.
* The app must be in the foreground
* @permission ohos.permission.SET_WIFI_INFO
* @param { number } networkId - Network ID which will be removed.
* @param { AsyncCallback<void> } callback - Indicates call back of removeCandidateConfig.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Remove a specified candidate hotspot configuration, only the configuration which is added by ourself is allowed
* to be removed.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { number } networkId - Network ID which will be removed.
* @param { AsyncCallback<void> } callback - Indicates call back of removeCandidateConfig.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
function removeCandidateConfig(networkId: number, callback: AsyncCallback<void>): void;
/**
* Obtain the list of all existed candidate Wi-Fi configurations which added by ourself.
* You can obtain only the Wi-Fi configurations you created on your own application.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @returns { Array<WifiDeviceConfig> } Returns the list of all existed Wi-Fi configurations you created on your application.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Obtain the list of all existed candidate Wi-Fi configurations which added by ourself.
* You can obtain only the Wi-Fi configurations you created on your own application.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Array<WifiDeviceConfig> } Returns the list of all existed Wi-Fi configurations you created on your application.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
/**
* Obtain the list of all existed candidate Wi-Fi configurations which added by ourself.
* You can obtain only the Wi-Fi configurations you created on your own application.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Array<WifiDeviceConfig> } Returns the list of all existed Wi-Fi configurations you created on your application.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
function getCandidateConfigs(): Array<WifiDeviceConfig>;
/**
* Connect to a specified candidate hotspot by networkId, only the configuration which is added by ourself
* is allowed to be connected. This method connect to a configuration at a time.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { number } networkId - Network ID which will be connected. The value of networkId cannot be less than 0.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Connect to a specified candidate hotspot by networkId, only the configuration which is added by ourself
* is allowed to be connected. This method connect to a configuration at a time.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { number } networkId - Network ID which will be connected. The value of networkId cannot be less than 0.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
function connectToCandidateConfig(networkId: number): void;
/**
* Connect to a specified candidate hotspot by networkId, and wait for user respond result.
* Only the configuration which is added by ourself is allowed to be connected.
* This method connect to a configuration at a time.
* The app must be in the foreground.
* @permission ohos.permission.SET_WIFI_INFO
* @param { number } networkId - Network ID which will be connected. The value of networkId cannot be less than 0.
* @returns { Promise<void> } - Returns the promise object that used to return the operation result.
* If the operation fails, an error message is returned.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2501000 - Operation failed.
* @throws { BusinessError } 2501001 - Wi-Fi STA disabled.
* @throws { BusinessError } 2501005 - The user does not respond.
* @throws { BusinessError } 2501006 - The user refused the action.
* @throws { BusinessError } 2501007 - Parameter validation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 20
*/
function connectToCandidateConfigWithUserAction(networkId: number): Promise<void>;
/**
* Connect to Wi-Fi hotspot by networkId.
* @permission ohos.permission.MANAGE_WIFI_CONNECTION or ohos.permission.MANAGE_ENTERPRISE_WIFI_CONNECTION
* @param { number } networkId - ID of the connected network. The value of networkId cannot be less than 0.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 15
*/
function connectToNetwork(networkId: number): void;
/**
* Connect to Wi-Fi hotspot by WifiDeviceConfig.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG and
* ohos.permission.MANAGE_WIFI_CONNECTION
* @param { WifiDeviceConfig } config - Indicates the device configuration for connection to the Wi-Fi hotspot.
* @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. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
function connectToDevice(config: WifiDeviceConfig): void;
/**
* Disconnect connection between sta and Wi-Fi hotspot.
* @permission ohos.permission.SET_WIFI_INFO and (ohos.permission.MANAGE_WIFI_CONNECTION or
* ohos.permission.MANAGE_ENTERPRISE_WIFI_CONNECTION)
* @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
* @since 15
*/
function disconnect(): void;
/**
* Calculate the Wi-Fi signal level based on the Wi-Fi RSSI and frequency band.
* @permission ohos.permission.GET_WIFI_INFO
* @param { number } rssi - Indicates the Wi-Fi RSSI.
* @param { number } band - Indicates the Wi-Fi frequency band.
* @returns { number } Returns Wi-Fi signal level ranging from 0 to 4.
* @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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getSignalLevel(rssi: number, band: number): number;
/**
* 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<WifiLinkedInfo> } 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
* @since 9
*/
/**
* 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<WifiLinkedInfo> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getLinkedInfo(): Promise<WifiLinkedInfo>;
/**
* 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.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Array<WifiLinkedInfo> } Returns Wi-Fi multiple link 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
* @since 18
*/
function getMultiLinkedInfo(): Array<WifiLinkedInfo>;
/**
* Obtain connection information about the Wi-Fi connection.
* @permission ohos.permission.GET_WIFI_INFO
* @param { AsyncCallback<WifiLinkedInfo> } 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
* @since 9
*/
/**
* Obtain connection information about the Wi-Fi connection.
* @permission ohos.permission.GET_WIFI_INFO
* @param { AsyncCallback<WifiLinkedInfo> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getLinkedInfo(callback: AsyncCallback<WifiLinkedInfo>): void;
/**
* 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.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { WifiLinkedInfo } 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
* @since arkts {'1.1':'18', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getLinkedInfoSync(): WifiLinkedInfo;
/**
* Check whether the Wi-Fi connection has been set up.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } Returns {@code true} if a Wi-Fi connection has been set up, returns {@code false} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Check whether the Wi-Fi connection has been set up.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } Returns {@code true} if a Wi-Fi connection has been set up, returns {@code false} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function isConnected(): boolean;
/**
* Obtain the features supported by the device.
* To check whether this device supports a specified feature.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { number } Returns the features supported by this device.
* @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} 2401000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
function getSupportedFeatures(): number;
/**
* Check whether the device supports a specified feature.
* @permission ohos.permission.GET_WIFI_INFO
* @param { number } featureId Indicates the ID of the feature.
* @returns { boolean } Returns {@code true} if this device supports the specified feature, returns {@code false} otherwise.
* @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} 2401000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.Core
* @since 9
*/
function isFeatureSupported(featureId: number): boolean;
/**
* Obtain the MAC address of a Wi-Fi device. Wi-Fi must be enabled.
* The MAC address is unique and cannot be changed.
* @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO
* @returns { string[] } Returns the MAC address of the Wi-Fi device.
* @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
* @since 15
*/
function getDeviceMacAddress(): string[];
/**
* Obtain the IPv4 information of the Wi-Fi connection.
* The IP information includes the host IP address, gateway address, and DNS information.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { IpInfo } Returns the IP information of the Wi-Fi connection.
* @throws {BusinessError} 201 - Permission denied.
* @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
*/
function getIpInfo(): IpInfo;
/**
* Obtain the IPv6 information of the Wi-Fi connection.
* The IPv6 information includes the host IP address, gateway address, and DNS information.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Ipv6Info } Returns the IPv6 information of the Wi-Fi connection.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getIpv6Info(): Ipv6Info;
/**
* Obtain the country code of the device.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { string } Returns the country code of this device.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2401000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.Core
* @since 9
*/
function getCountryCode(): string;
/**
* Re-associate to current network.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @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.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
function reassociate(): void;
/**
* Re-connect to current network.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @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.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
function reconnect(): void;
/**
* Obtain the list of all existed Wi-Fi configurations.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @returns { Array<WifiDeviceConfig> } Returns the list of all existing Wi-Fi configurations you created on your application.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 15
*/
function getDeviceConfigs(): Array<WifiDeviceConfig>;
/**
* Update the specified Wi-Fi configuration.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
* @param { WifiDeviceConfig } config Indicates the Wi-Fi configuration to update.
* @returns { number } Returns the network ID in the updated Wi-Fi configuration if the update is successful;
* returns {@code -1} if the specified Wi-Fi configuration is not contained in the list.
* @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. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
function updateNetwork(config: WifiDeviceConfig): number;
/**
* Set whther to allow automatic connnect by networkId.
* The network can be associated with again if isAllowed is true, else not.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @param { number } netId Identifies the network to be set. The value of networkId cannot be less than 0.
* @param { boolean } isAllowed Identifies whether allow auto connect or not.
* @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. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 17
*/
function allowAutoConnect(netId: number, isAllowed: boolean): void;
/**
* Disable the specified DeviceConfig by networkId.
* The disabled DeviceConfig will not be associated with again.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @param { number } netId Identifies the network to disable. The value of networkId cannot be less than 0.
* @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. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
function disableNetwork(netId: number): void;
/**
* Remove all the saved Wi-Fi configurations.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @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.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
function removeAllNetwork(): void;
/**
* Remove a Wi-Fi DeviceConfig with networkId.
* After a Wi-Fi DeviceConfig is removed, its configuration will be deleted from the list of Wi-Fi configurations.
* If the Wi-Fi DeviceConfig is being connected, the connection will be interrupted.
* The application can only delete Wi-Fi DeviceConfig it has created.
* @permission ohos.permission.SET_WIFI_INFO and (ohos.permission.MANAGE_WIFI_CONNECTION or
* ohos.permission.MANAGE_ENTERPRISE_WIFI_CONNECTION)
* @param { number } id - Indicate the ID of the Wi-Fi DeviceConfig. The value of networkId cannot be less than 0.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified.
* 2. Incorrect parameter types. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 15
*/
function removeDevice(id: number): void;
/**
* Check whether the current device supports the specified band.
* @permission ohos.permission.GET_WIFI_INFO
* @param { WifiBandType } bandType - Indicates the band type.
* @returns { boolean }Returns {@code true} if the specified band is supported, returns {@code false} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
function isBandTypeSupported(bandType: WifiBandType): boolean;
/**
* Obtain the supported 5G channel list of the device.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @returns { Array<number> } Returns 5G channel list.
* @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 10
*/
function get5GChannelList(): Array<number>;
/**
* Obtain the latest disconnected reason.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @returns { DisconnectedReason } Returns the latest disconnected reason.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
function getDisconnectedReason(): DisconnectedReason;
/**
* Start Portal certification.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @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.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 11
*/
function startPortalCertification(): void;
/**
* Whether the hotspot is metered hotspot or not.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } Returns {@code true} if the hotspot is metered hotspot, returns {@code false} otherwise.
* @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
* @since arkts {'1.1':'11', '1.2':'20'}
* @arkts 1.1&1.2
*/
function isMeteredHotspot(): boolean;
/**
* Enable hiLink handshake.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @param { boolean } isHiLinkEnable - Indicates the HiLink enable or not.
* @param { string } bssid - Indicates the Wi-Fi bssid.
* @param { WifiDeviceConfig } config - Indicates the Wi-Fi device config.
* @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. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2501000 - Operation failed.
* @throws {BusinessError} 2501001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 12
*/
function enableHiLinkHandshake(isHiLinkEnable: boolean, bssid: string, config: WifiDeviceConfig): void;
/**
* Reset all saved device configure.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
* @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 11
*/
function factoryReset(): void;
/**
* Enable Wi-Fi hotspot function.
* After the Wi-Fi hotspot is enabled, Wi-Fi may be disabled.
* @permission ohos.permission.MANAGE_WIFI_HOTSPOT
* @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 9
*/
function enableHotspot(): void;
/**
* Disable Wi-Fi hotspot function.
* If Wi-Fi is enabled after the Wi-Fi hotspot is disabled, Wi-Fi may be re-enabled.
* @permission ohos.permission.MANAGE_WIFI_HOTSPOT
* @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 9
*/
function disableHotspot(): void;
/**
* Check whether a device serving as a Wi-Fi hotspot supports both the 2.4 GHz and 5 GHz Wi-Fi.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT
* @returns { boolean } Returns {@code true} if the method is called successfully, returns {@code false} otherwise.
* @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 9
*/
function isHotspotDualBandSupported(): boolean;
/**
* Check whether Wi-Fi hotspot is can be operated under some situation. When the airplane mode is turned on
* and does not support the coexistence of softap and sta, nor does it support signal bridge,
* the hotspot switch cannot be operated.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT
* @returns { boolean } {@code true} if Wi-Fi hotspot can be operated, returns {@code false} otherwise.
* @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 arkts {'1.1':'18', '1.2':'20'}
* @arkts 1.1&1.2
*/
function isOpenSoftApAllowed(): boolean;
/**
* Check whether Wi-Fi hotspot is active on a device.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } {@code true} if Wi-Fi hotspot is enabled, returns {@code false} otherwise.
* @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 9
*/
/**
* Check whether Wi-Fi hotspot is active on a device.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { boolean } {@code true} if Wi-Fi hotspot is enabled, returns {@code false} otherwise.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2601000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @since 15
*/
function isHotspotActive(): boolean;
/**
* Set the hotspot configuration for the device.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @param { HotspotConfig } config - Indicates the Wi-Fi hotspot configuration.
* The SSID and {@code securityType} must be available and correct.
* If {@code securityType} is not {@code open}, {@code preSharedKey} must be available and correct.
* @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. Incorrect parameter types.
* 2.Parameter verification failed.
* @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 9
*/
function setHotspotConfig(config: HotspotConfig): void;
/**
* Obtain the Wi-Fi hotspot configuration.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @returns { HotspotConfig } Returns the configuration of an existed or enabled Wi-Fi hotspot.
* @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 9
*/
function getHotspotConfig(): HotspotConfig;
/**
* Obtain the list of stations that are connected to the Wi-Fi hotspot.
* This method can only be used on a device that serves as a Wi-Fi hotspot.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT
* @returns { Array<StationInfo> } the list of clients that are connected to the Wi-Fi hotspot.
* @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 9
*/
/**
* Obtain the list of stations that are connected to the Wi-Fi hotspot.
* This method can only be used on a device that serves as a Wi-Fi hotspot.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT
* @returns { Array<StationInfo> } the list of clients that are connected to the Wi-Fi hotspot.
* @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 arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
function getStations(): Array<StationInfo>;
/**
* Add the station into the block list, the station can NOT access the hotspot.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT
* @param { StationInfo } stationInfo - station which will be added in the block list.
* @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.Incorrect parameter types.
* 2.Parameter verification failed.
* @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 11
*/
function addHotspotBlockList(stationInfo: StationInfo);
/**
* Delete the station from block list, the station can access the hotspot.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT
* @param { StationInfo } stationInfo - station which will be deleted in the block list.
* @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.Incorrect parameter types.
* 2.Parameter verification failed.
* @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 11
*/
function delHotspotBlockList(stationInfo: StationInfo);
/**
* Get all the stations in the block list. If does't have the permission of ohos.permission.GET_WIFI_PEERS_MAC, return random bssid.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT
* @returns { Array<StationInfo> } stations in the block list.
* @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} 801 - Capability not supported.
* @throws {BusinessError} 2601000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @systemapi Hide this for inner system use.
* @since 11
*/
function getHotspotBlockList(): Array<StationInfo>;
/**
* Obtain information about the P2P connection.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Promise<WifiP2pLinkedInfo> } Returns p2p linked information.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
function getP2pLinkedInfo(): Promise<WifiP2pLinkedInfo>;
/**
* Obtain information about the P2P connection.
* @permission ohos.permission.GET_WIFI_INFO
* @param { AsyncCallback<WifiP2pLinkedInfo> } callback - Indicates callback of function.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
function getP2pLinkedInfo(callback: AsyncCallback<WifiP2pLinkedInfo>): void;
/**
* Obtain information about the current p2p group.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @returns { Promise<WifiP2pGroupInfo> } Returns p2p group information.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Obtain information about the current p2p group.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Promise<WifiP2pGroupInfo> } Returns p2p group information.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 10
*/
function getCurrentGroup(): Promise<WifiP2pGroupInfo>;
/**
* Obtain information about the current p2p group.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { AsyncCallback<WifiP2pGroupInfo> } callback - Indicates callback of function.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Obtain information about the current p2p group.
* @permission ohos.permission.GET_WIFI_INFO
* @param { AsyncCallback<WifiP2pGroupInfo> } callback - Indicates callback of function.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 10
*/
function getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void;
/**
* Obtain the information about the found devices.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @returns { Promise<WifiP2pDevice[]> } Returns p2p device information.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Obtain the information about the found devices.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Promise<WifiP2pDevice[]> } Returns p2p device information.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 10
*/
function getP2pPeerDevices(): Promise<WifiP2pDevice[]>;
/**
* Obtain the information about the found devices.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { AsyncCallback<WifiP2pDevice[]> } callback - Indicates callback of function.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Obtain the information about the found devices.
* @permission ohos.permission.GET_WIFI_INFO
* @param { AsyncCallback<WifiP2pDevice[]> } callback - Indicates callback of function.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 10
*/
function getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void;
/**
* Obtain the information about own device information.
* DeviceAddress in the returned WifiP2pDevice will be set "00:00:00:00:00:00",
* if ohos.permission.GET_WIFI_LOCAL_MAC is not granted.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @returns { Promise<WifiP2pDevice> } Returns the information about own device info.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Obtain the information about own device information.
* DeviceAddress in the returned WifiP2pDevice will be set "00:00:00:00:00:00",
* if ohos.permission.GET_WIFI_LOCAL_MAC is not granted.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Promise<WifiP2pDevice> } Returns the information about own device info.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 11
*/
function getP2pLocalDevice(): Promise<WifiP2pDevice>;
/**
* Obtain the information about own device information.
* DeviceAddress in the returned WifiP2pDevice will be set "00:00:00:00:00:00",
* if ohos.permission.GET_WIFI_LOCAL_MAC is not granted.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
* @param { AsyncCallback<WifiP2pDevice> } callback - Indicates callback of function.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Obtain the information about own device information.
* DeviceAddress in the returned WifiP2pDevice will be set "00:00:00:00:00:00",
* if ohos.permission.GET_WIFI_LOCAL_MAC is not granted.
* @permission ohos.permission.GET_WIFI_INFO
* @param { AsyncCallback<WifiP2pDevice> } callback - Indicates callback of function.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 11
*/
function getP2pLocalDevice(callback: AsyncCallback<WifiP2pDevice>): void;
/**
* Create a P2P group.
* @permission ohos.permission.GET_WIFI_INFO
* @param { WifiP2PConfig } config - Indicates the configuration for a group.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1.Incorrect parameter types.
* 2.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
function createGroup(config: WifiP2PConfig): void;
/**
* Remove a P2P group.
* @permission ohos.permission.GET_WIFI_INFO
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
function removeGroup(): void;
/**
* Initiate a P2P connection to a device with the specified configuration.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { WifiP2PConfig } config - Indicates the configuration for connecting to a specific group.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Initiate a P2P connection to a device with the specified configuration.
* @permission ohos.permission.GET_WIFI_INFO
* @param { WifiP2PConfig } config - Indicates the configuration for connecting to a specific group.
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 401 - Invalid parameters. Possible causes: 1.Incorrect parameter types.
* 2.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 10
*/
function p2pConnect(config: WifiP2PConfig): void;
/**
* Stop an ongoing p2p connection that is being established.
* @permission ohos.permission.GET_WIFI_INFO
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
function p2pCancelConnect(): void;
/**
* Start discover Wi-Fi P2P devices.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
/**
* Start discover Wi-Fi P2P devices.
* @permission ohos.permission.GET_WIFI_INFO
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 10
*/
function startDiscoverDevices(): void;
/**
* Stop discover Wi-Fi P2P devices.
* @permission ohos.permission.GET_WIFI_INFO
* @throws {BusinessError} 201 - Permission denied.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
function stopDiscoverDevices(): void;
/**
* Delete the persistent P2P group with the specified network ID.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @param { number } netId - Indicates the network ID of the group to be deleted.
* @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.Incorrect parameter types.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @systemapi Hide this for inner system use.
* @since 9
*/
function deletePersistentGroup(netId: number): void;
/**
* Obtain information about the groups.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @returns { Promise<Array<WifiP2pGroupInfo>> } Returns the information about own device info.
* @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} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @systemapi Hide this for inner system use.
* @since 9
*/
/**
* Obtain information about the groups.
* @permission ohos.permission.GET_WIFI_INFO
* @returns { Promise<Array<WifiP2pGroupInfo>> } Returns the information about own device info.
* @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} 2801000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @systemapi Hide this for inner system use.
* @since 10
*/
function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>;
/**
* Obtain information about the groups.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { AsyncCallback<Array<WifiP2pGroupInfo>> } callback - Indicates callback of function.
* @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} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @systemapi Hide this for inner system use.
* @since 9
*/
/**
* Obtain information about the groups.
* @permission ohos.permission.GET_WIFI_INFO
* @param { AsyncCallback<Array<WifiP2pGroupInfo>> } callback - Indicates callback of function.
* @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} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @systemapi Hide this for inner system use.
* @since 10
*/
function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void;
/**
* Set the name of the Wi-Fi P2P device.
* @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION
* @param { string } devName - Indicate the name to be set.
* @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. 3.Parameter verification failed.
* @throws {BusinessError} 801 - Capability not supported.
* @throws {BusinessError} 2801000 - Operation failed.
* @throws {BusinessError} 2801001 - Wi-Fi STA disabled.
* @syscap SystemCapability.Communication.WiFi.P2P
* @systemapi Hide this for inner system use.
* @since 9
*/
function setDeviceName(devName: string): void;
/**
* Subscribe Wi-Fi status change events.
* When the service exits, call off(type: 'wifiStateChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiStateChange' } type - event name.
* @param { Callback<number> } 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
* @since 9
*/
/**
* Subscribe Wi-Fi status change events.
* When the service exits, call off(type: 'wifiStateChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiStateChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'wifiStateChange', callback: Callback<number>): void;
/**
* Unsubscribe Wi-Fi status change events.
*
* <p>All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiStateChange' } type - event name.
* @param { Callback<number> } 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 9
*/
/**
* Unsubscribe Wi-Fi status change events.
*
* <p>All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiStateChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'wifiStateChange', callback?: Callback<number>): void;
/**
* Subscribe Wi-Fi connection change events.
* When the service exits, call off(type: 'wifiConnectionChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiConnectionChange' } type - event name.
* @param { Callback<number> } 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
* @since 9
*/
/**
* Subscribe Wi-Fi connection change events.
* When the service exits, call off(type: 'wifiConnectionChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiConnectionChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'wifiConnectionChange', callback: Callback<number>): void;
/**
* Unsubscribe Wi-Fi connection change events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiConnectionChange' } type - event name.
* @param { Callback<number> } 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 9
*/
/**
* Unsubscribe Wi-Fi connection change events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiConnectionChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'wifiConnectionChange', callback?: Callback<number>): void;
/**
* Subscribe Wi-Fi scan status change events.
* When the service exits, call off(type: 'wifiScanStateChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiScanStateChange' } type - event name.
* @param { Callback<number> } 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
* @since 9
*/
/**
* Subscribe Wi-Fi scan status change events.
* When the service exits, call off(type: 'wifiScanStateChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiScanStateChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'wifiScanStateChange', callback: Callback<number>): void;
/**
* Unsubscribe Wi-Fi scan status change events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiScanStateChange' } type - event name.
* @param { Callback<number> } 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 9
*/
/**
* Unsubscribe Wi-Fi scan status change events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiScanStateChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'wifiScanStateChange', callback?: Callback<number>): void;
/**
* Subscribe Wi-Fi rssi change events.
* When the service exits, call off(type: 'wifiRssiChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiRssiChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'wifiRssiChange', callback: Callback<number>): void;
/**
* Unsubscribe Wi-Fi rssi change events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'wifiRssiChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'wifiRssiChange', callback?: Callback<number>): void;
/**
* Subscribe Wi-Fi stream change events.
* @permission ohos.permission.MANAGE_WIFI_CONNECTION
* @param { 'streamChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'streamChange', callback: Callback<number>): void;
/**
* Unsubscribe Wi-Fi stream change events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.MANAGE_WIFI_CONNECTION
* @param { 'streamChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'streamChange', callback?: Callback<number>): void;
/**
* Subscribe Wi-Fi device config change events.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'deviceConfigChange' } type - event name.
* @param { Callback<number> } 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.
* 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
*/
function on(type: 'deviceConfigChange', callback: Callback<number>): void;
/**
* Subscribe Wi-Fi device config change events.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'deviceConfigChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'deviceConfigChange', callback?: Callback<number>): void;
/**
* Subscribe Wi-Fi hotspot state change events.
* When the service exits, call off(type: 'hotspotStateChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'hotspotStateChange' } type - event name.
* @param { Callback<number> } 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} 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<number>): void;
/**
* Unsubscribe Wi-Fi hotspot state change events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'hotspotStateChange'} type - event name.
* @param { Callback<number> } 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} 2601000 - Operation failed.
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'hotspotStateChange', callback?: Callback<number>): void;
/**
* Subscribe Wi-Fi hotspot sta join events.
* @permission ohos.permission.MANAGE_WIFI_HOTSPOT
* @param { 'hotspotStaJoin' } type - event name.
* @param { Callback<StationInfo> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'hotspotStaJoin', callback: Callback<StationInfo>): void;
/**
* Unsubscribe Wi-Fi hotspot sta join events.
* All callback functions will be deregistered If there is no specific callback parameter.</p>
* @permission ohos.permission.MANAGE_WIFI_HOTSPOT
* @param { 'hotspotStaJoin' } type - event name.
* @param { Callback<StationInfo> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'hotspotStaJoin', callback?: Callback<StationInfo>): void;
/**
* Subscribe Wi-Fi hotspot sta leave events.
* @permission ohos.permission.MANAGE_WIFI_HOTSPOT
* @param { 'hotspotStaLeave' } type - event name.
* @param { Callback<StationInfo> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'hotspotStaLeave', callback: Callback<StationInfo>): void;
/**
* Unsubscribe Wi-Fi hotspot sta leave events.
* @permission ohos.permission.MANAGE_WIFI_HOTSPOT
* @param { 'hotspotStaLeave' } type - event name.
* @param { Callback<StationInfo> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'hotspotStaLeave', callback?: Callback<StationInfo>): void;
/**
* Subscribe P2P status change events.
* When the service exits, call off(type: 'p2pStateChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pStateChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'p2pStateChange', callback: Callback<number>): void;
/**
* Unsubscribe P2P status change events.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pStateChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'p2pStateChange', callback?: Callback<number>): void;
/**
* Subscribe P2P connection change events.
* When the service exits, call off(type: 'p2pConnectionChange', callback?: Callback&lt;WifiP2pLinkedInfo&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pConnectionChange' } type - event name.
* @param { Callback<WifiP2pLinkedInfo> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'p2pConnectionChange', callback: Callback<WifiP2pLinkedInfo>): void;
/**
* Unsubscribe P2P connection change events.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pConnectionChange' } type - event name.
* @param { Callback<WifiP2pLinkedInfo> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'p2pConnectionChange', callback?: Callback<WifiP2pLinkedInfo>): void;
/**
* Subscribe P2P local device change events.
* When the service exits, call off(type: 'p2pDeviceChange', callback?: Callback&lt;WifiP2pDevice&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { 'p2pDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice> } 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 9
*/
/**
* Subscribe P2P local device change events.
* When the service exits, call off(type: 'p2pDeviceChange', callback?: Callback&lt;WifiP2pDevice&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice> } 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 arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'p2pDeviceChange', callback: Callback<WifiP2pDevice>): void;
/**
* Unsubscribe P2P local device change events.
* @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { 'p2pDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice> } 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 9
*/
/**
* Unsubscribe P2P local device change events.
* @param { 'p2pDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice> } 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 arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'p2pDeviceChange', callback?: Callback<WifiP2pDevice>): void;
/**
* Subscribe P2P peer device change events.
* When the service exits, call off(type: 'p2pPeerDeviceChange', callback?: Callback&lt;WifiP2pDevice[]&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { 'p2pPeerDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice[]> } 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 9
*/
/**
* Subscribe P2P peer device change events.
* When the service exits, call off(type: 'p2pPeerDeviceChange', callback?: Callback&lt;WifiP2pDevice[]&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pPeerDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice[]> } 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 arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'p2pPeerDeviceChange', callback: Callback<WifiP2pDevice[]>): void;
/**
* Unsubscribe P2P peer device change events.
* @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
* @param { 'p2pPeerDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice[]> } 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 9
*/
/**
* Unsubscribe P2P peer device change events.
* @param { 'p2pPeerDeviceChange' } type - event name.
* @param { Callback<WifiP2pDevice[]> } 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 arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'p2pPeerDeviceChange', callback?: Callback<WifiP2pDevice[]>): void;
/**
* Subscribe P2P persistent group change events.
* When the service exits, call off(type: 'p2pPersistentGroupChange', callback?: Callback&lt;void&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pPersistentGroupChange' } type - event name.
* @param { Callback<void> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'p2pPersistentGroupChange', callback: Callback<void>): void;
/**
* Unsubscribe P2P persistent group change events.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pPersistentGroupChange' } type - event name.
* @param { Callback<void> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'p2pPersistentGroupChange', callback?: Callback<void>): void;
/**
* Subscribe P2P discovery events.
* When the service exits, call off(type: 'p2pDiscoveryChange', callback?: Callback&lt;number&gt;) to unregister the callback registered.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pDiscoveryChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function on(type: 'p2pDiscoveryChange', callback: Callback<number>): void;
/**
* Unsubscribe P2P discovery events.
* @permission ohos.permission.GET_WIFI_INFO
* @param { 'p2pDiscoveryChange' } type - event name.
* @param { Callback<number> } 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 arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
function off(type: 'p2pDiscoveryChange', callback?: Callback<number>): void;
/**
* Wi-Fi device address( mac / bssid ) type.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.Core
* @since 10
*/
/**
* Wi-Fi device address( mac / bssid ) type.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.Core
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
enum DeviceAddressType {
/**
* random device address
* @syscap SystemCapability.Communication.WiFi.Core
* @since 10
*/
/**
* random device address
* @syscap SystemCapability.Communication.WiFi.Core
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
RANDOM_DEVICE_ADDRESS,
/**
* real device address
* @syscap SystemCapability.Communication.WiFi.Core
* @since 10
*/
/**
* real device address
* @syscap SystemCapability.Communication.WiFi.Core
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
REAL_DEVICE_ADDRESS,
}
/**
* Wi-Fi EAP method.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
enum EapMethod {
/**
* EAP NONE
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_NONE,
/**
* EAP PEAP
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_PEAP,
/**
* EAP TLS
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_TLS,
/**
* EAP TTLS
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_TTLS,
/**
* EAP PWD
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_PWD,
/**
* EAP SIM
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_SIM,
/**
* EAP AKA
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_AKA,
/**
* EAP AKA PRIME
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_AKA_PRIME,
/**
* EAP UNAUTH TLS
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
EAP_UNAUTH_TLS
}
/**
* Wi-Fi phase 2 method.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
enum Phase2Method {
/**
* Phase2 NONE
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_NONE,
/**
* Phase2 PAP
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_PAP,
/**
* Phase2 MSCHAP
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_MSCHAP,
/**
* Phase2 MSCHAPV2
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_MSCHAPV2,
/**
* Phase2 GTC
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_GTC,
/**
* Phase2 SIM
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_SIM,
/**
* Phase2 AKA
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_AKA,
/**
* Phase2 AKA+
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
PHASE2_AKA_PRIME
}
/**
* Wi-Fi disconnected reason.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
enum DisconnectedReason {
/**
* Default reason
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
DISC_REASON_DEFAULT = 0,
/**
* Password is wrong
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
DISC_REASON_WRONG_PWD = 1,
/**
* The number of router's connection reaches the maximum number limit
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
DISC_REASON_CONNECTION_FULL = 2
}
/**
* Wi-Fi detail state.
* @enum { number } WifiDetailState
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
enum WifiDetailState {
/**
* state is unknown
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
UNKNOWN = -1,
/**
* wifi is closed
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
INACTIVE = 0,
/**
* wifi is opened
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
ACTIVATED = 1,
/**
* wifi is opening
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
ACTIVATING = 2,
/**
* wifi is closing
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
DEACTIVATING = 3,
/**
* wifi sta is entering semi active
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
SEMI_ACTIVATING = 4,
/**
* wifi sta is semi active
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
SEMI_ACTIVE = 5,
}
/**
* Wi-Fi Proxy method.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
enum ProxyMethod {
/**
* No proxy is to be used.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
METHOD_NONE = 0,
/**
* Use auto configured proxy.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
METHOD_AUTO = 1,
/**
* Use manual configured proxy.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
METHOD_MANUAL = 2
}
/**
* Wi-Fi Category.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
enum WifiCategory {
/**
* Default.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
DEFAULT = 1,
/**
* Wifi6.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI6 = 2,
/**
* Wifi6+.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI6_PLUS = 3,
/**
* Wifi7.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'15', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI7 = 4,
/**
* Wifi7+.
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'15', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI7_PLUS = 5
}
/**
* Wi-Fi link type.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 18
*/
enum WifiLinkType {
/**
* Default link.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 18
*/
DEFAULT_LINK = 0,
/**
* Wi-Fi7 single link.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 18
*/
WIFI7_SINGLE_LINK = 1,
/**
* Wi-Fi7 MLSR.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 18
*/
WIFI7_MLSR = 2,
/**
* Wi-Fi7 EMLSR.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 18
*/
WIFI7_EMLSR = 3,
/**
* Wi-Fi7 STR.
* @syscap SystemCapability.Communication.WiFi.STA
* @since 18
*/
WIFI7_STR = 4
}
/**
* Wi-Fi Proxy config.
* @typedef WifiProxyConfig
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
interface WifiProxyConfig {
/**
* Wi-Fi proxy method
* @type { ?ProxyMethod }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
proxyMethod?: ProxyMethod;
/**
* PAC web address for auto configured proxy.
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
pacWebAddress?: string;
/**
* Server host name for manual configured proxy.
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
serverHostName?: string;
/**
* Server port for manual configured proxy.
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
serverPort?: number;
/**
* Exclusion objects for manual configured proxy. objects are separated by ','.
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
exclusionObjects?: string;
}
/**
* Wi-Fi EAP config.
* @typedef WifiEapConfig
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
interface WifiEapConfig {
/**
* EAP authentication method
* @type { EapMethod }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
eapMethod: EapMethod;
/**
* Phase 2 authentication method
* @type { Phase2Method }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
phase2Method: Phase2Method;
/**
* The identity
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
identity: string;
/**
* Anonymous identity
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
anonymousIdentity: string;
/**
* Password
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
password: string;
/**
* CA certificate alias
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
caCertAlias: string;
/**
* CA certificate path
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
caPath: string;
/**
* Client certificate alias
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
clientCertAlias: string;
/**
* content of user's certificate
* @type { Uint8Array }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
certEntry: Uint8Array;
/**
* Password of user's certificate
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
certPassword: string;
/**
* Alternate subject match
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
altSubjectMatch: string;
/**
* Domain suffix match
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
domainSuffixMatch: string;
/**
* Realm for Passpoint credential
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
realm: string;
/**
* Public Land Mobile Network of the provider of Passpoint credential
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
plmn: string;
/**
* Sub ID of the SIM card
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
eapSubId: number;
}
/**
* Wi-Fi device configuration information.
* @typedef WifiDeviceConfig
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Wi-Fi device configuration information.
* @typedef WifiDeviceConfig
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
interface WifiDeviceConfig {
/**
* Wi-Fi SSID: the maximum length is 32.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Wi-Fi SSID: the maximum length is 32.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
ssid: string;
/**
* Wi-Fi bssid(MAC): the length is 6.
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Wi-Fi bssid(MAC): the length is 6.
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
bssid?: string;
/**
* Wi-Fi bssid type.
* @type { ?DeviceAddressType }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
/**
* Wi-Fi bssid type.
* @type { ?DeviceAddressType }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
bssidType?: DeviceAddressType;
/**
* Wi-Fi key: maximum length is 64.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Wi-Fi key: maximum length is 64.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
preSharedKey: string;
/**
* Hide SSID or not, false(default): not hide
* @type { ?boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
isHiddenSsid?: boolean;
/**
* Security type: reference definition of WifiSecurityType
* @type { WifiSecurityType }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Security type: reference definition of WifiSecurityType
* @type { WifiSecurityType }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
securityType: WifiSecurityType;
/**
* The UID of the Wi-Fi configuration creator.
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
creatorUid?: number;
/**
* Disable reason
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
disableReason?: number;
/**
* Allocated networkId
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
netId?: number;
/**
* Random mac type
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
randomMacType?: number;
/**
* Random mac address, the length is 6.
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
randomMacAddr?: string;
/**
* IP Type
* @type { ?IpType }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
ipType?: IpType;
/**
* Static IP family: 0 - IPv4, 1 - Ipv6.
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
family?: number;
/**
* IP config of static
* @type { ?IpConfig }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
staticIp?: IpConfig;
/**
* IPv6 config of static
* @type { ?Ipv6Config }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
staticIpv6?: Ipv6Config;
/**
* EAP config info.
* @type { ?WifiEapConfig }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
eapConfig?: WifiEapConfig;
/**
* Proxy config.
* @type { ?WifiProxyConfig }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 10
*/
proxyConfig?: WifiProxyConfig;
/**
* WAPI config info.
* @type { ?WifiWapiConfig }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
wapiConfig?: WifiWapiConfig;
/**
* Device config status: 0 - enabled, 1 - disabled, 2 - permanent disabled, 3 - unknown.
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 12
*/
configStatus?: number;
/**
* Allow auto connect config: false - not, true - yes.
* @type { ?boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 17
*/
isAutoConnectAllowed?: boolean;
/**
* Secure wifi detect config: false - not, true - yes.
* @type { ?boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
isSecureWifi?: boolean;
}
/**
* Wi-Fi WAPI config.
* @typedef WifiWapiConfig
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
interface WifiWapiConfig {
/**
* WAPI pre-shared key type.
* @type { WapiPskType }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
wapiPskType: WapiPskType;
/**
* WAPI AS certification.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
wapiAsCert: string;
/**
* WAPI user certification.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
wapiUserCert: string;
}
/**
* Wi-Fi IP configuration information.
* @typedef IpConfig
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
interface IpConfig {
/**
* IP address.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
ipAddress: number;
/**
* Gate way.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
gateway: number;
/**
* Prefix length.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
prefixLength: number;
/**
* DNS servers.
* @type { number[] }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
dnsServers: number[];
/**
* Domains.
* @type { Array<string> }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
domains: Array<string>;
}
/**
* Wi-Fi Ipv6 configuration information.
* @typedef Ipv6Config
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
interface Ipv6Config {
/**
* IPv6 address.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
ipAddress: string;
/**
* Gate way.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
gateway: string;
/**
* Prefix length.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
prefixLength: number;
/**
* DNS servers.
* @type { Array<string> }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
dnsServers: Array<string>;
/**
* Domains.
* @type { Array<string> }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
domains: Array<string>;
}
/**
* Wi-Fi information elements.
* @typedef WifiInfoElem
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
interface WifiInfoElem {
/**
* Element id
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
eid: number;
/**
* Element content
* @type { Uint8Array }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
content: Uint8Array;
}
/**
* Describes the wifi channel width.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
enum WifiChannelWidth {
/**
* 20MHz.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
WIDTH_20MHZ = 0,
/**
* 40MHz.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
WIDTH_40MHZ = 1,
/**
* 80MHz.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
WIDTH_80MHZ = 2,
/**
* 160MHz.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
WIDTH_160MHZ = 3,
/**
* 80MHz plus.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
WIDTH_80MHZ_PLUS = 4,
/**
* Invalid.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
WIDTH_INVALID
}
/**
* Describes the scanned Wi-Fi information.
* @typedef WifiScanInfo
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Describes the scanned Wi-Fi information.
* @typedef WifiScanInfo
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
interface WifiScanInfo {
/**
* Wi-Fi SSID: the maximum length is 32
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Wi-Fi SSID: the maximum length is 32
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
ssid: string;
/**
* Wi-Fi bssid(MAC): the length is 6
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Wi-Fi bssid(MAC): the length is 6
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
bssid: string;
/**
* Wi-Fi bssid type
* @type { DeviceAddressType }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
/**
* Wi-Fi bssid type
* @type { DeviceAddressType }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
bssidType: DeviceAddressType;
/**
* Hotspot capability
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
capabilities: string;
/**
* Security type: reference definition of WifiSecurityType
* @type { WifiSecurityType }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Security type: reference definition of WifiSecurityType
* @type { WifiSecurityType }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
securityType: WifiSecurityType;
/**
* Received signal strength indicator (RSSI)
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Received signal strength indicator (RSSI)
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
rssi: number;
/**
* Frequency band, 1: 2.4G, 2: 5G
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
band: number;
/**
* Frequency
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Frequency
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
frequency: number;
/**
* Channel width
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
channelWidth: number;
/**
* Center frequency 0.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
centerFrequency0: number;
/**
* Center frequency 1.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
centerFrequency1: number;
/**
* Information elements.
* @type { Array<WifiInfoElem> }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
infoElems: Array<WifiInfoElem>;
/**
* Time stamp
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
timestamp: number;
/**
* Supported wifi category
* @type { WifiCategory }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
supportedWifiCategory: WifiCategory;
/**
* Whether the Wi-Fi hotspot is HiLink network.
* @type { boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
isHiLinkNetwork: boolean;
/**
* Whether the Wi-Fi hotspot is HiLinkPro network.
* @type { ?boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
isHiLinkProNetwork?: boolean;
}
/**
* Describes the wifi security type.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.Core
* @since 9
*/
/**
* Describes the wifi security type.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.Core
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
enum WifiSecurityType {
/**
* Invalid security type
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_INVALID = 0,
/**
* Open
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since 9
*/
/**
* Open
*
* @syscap SystemCapability.Communication.WiFi.Core
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_OPEN = 1,
/**
* Wired Equivalent Privacy (WEP)
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_WEP = 2,
/**
* Pre-shared key (PSK)
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_PSK = 3,
/**
* Simultaneous Authentication of Equals (SAE)
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_SAE = 4,
/**
* EAP authentication.
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_EAP = 5,
/**
* SUITE_B_192 192 bit level.
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_EAP_SUITE_B = 6,
/**
* Opportunistic Wireless Encryption.
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_OWE = 7,
/**
* WAPI certificate to be specified.
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_WAPI_CERT = 8,
/**
* WAPI pre-shared key to be specified.
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
WIFI_SEC_TYPE_WAPI_PSK = 9
}
/**
* Describes the WAPI pre-shared key Type.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.Core
* @since 12
*/
enum WapiPskType {
/**
* ASCII character type of WAPI pre-shared key.
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since 12
*/
WAPI_PSK_ASCII = 0,
/**
* HEX character type of WAPI pre-shared key.
*
* @syscap SystemCapability.Communication.WiFi.Core
* @since 12
*/
WAPI_PSK_HEX = 1
}
/**
* Wi-Fi band type.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
enum WifiBandType {
/**
* Default.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_BAND_NONE,
/**
* Band 2.4G.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_BAND_2G,
/**
* Band 5G.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_BAND_5G,
/**
* Band 6G.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_BAND_6G,
/**
* Band 60G.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_BAND_60G
}
/**
* Wi-Fi standard.
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
enum WifiStandard {
/**
* Undefined
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_UNDEFINED,
/**
* Wifi 802.11a
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_11A,
/**
* Wifi 802.11b
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_11B,
/**
* Wifi 802.11g
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_11G,
/**
* Wifi 802.11n
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_11N,
/**
* Wifi 802.11ac
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_11AC,
/**
* Wifi 802.11ax
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_11AX,
/**
* Wifi 802.11ad
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
WIFI_STANDARD_11AD
}
/**
* Wi-Fi connection information.
* @typedef WifiLinkedInfo
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* Wi-Fi connection information.
* @typedef WifiLinkedInfo
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
interface WifiLinkedInfo {
/**
* The SSID of the Wi-Fi hotspot
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* The SSID of the Wi-Fi hotspot
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
ssid: string;
/**
* The BSSID of the Wi-Fi hotspot
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* The BSSID of the Wi-Fi hotspot
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
bssid: string;
/**
* The ID(uniquely identifies) of a Wi-Fi connection.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
networkId: number;
/**
* The RSSI(dBm) of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* The RSSI(dBm) of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
rssi: number;
/**
* The frequency band of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
band: number;
/**
* The speed of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
linkSpeed: number;
/**
* The rx speed of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
rxLinkSpeed: number;
/**
* Max tx speed of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
maxSupportedTxLinkSpeed: number;
/**
* Max rx speed of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
maxSupportedRxLinkSpeed: number;
/**
* The frequency of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
/**
* The frequency of a Wi-Fi access point.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @atomicservice
* @since 12
*/
frequency: number;
/**
* Whether the SSID of the access point (AP) of this Wi-Fi connection is hidden.
* @type { boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
isHidden: boolean;
/**
* Whether this Wi-Fi connection restricts the data volume.
* @type { boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
isRestricted: boolean;
/**
* The load value of this Wi-Fi connection. A greater value indicates a higher load.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
chload: number;
/**
* The signal-to-noise ratio (SNR) of this Wi-Fi connection.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
snr: number;
/**
* Type of macAddress: 0 - real mac, 1 - random mac.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
macType: number;
/**
* The Wi-Fi MAC address of a device.
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
macAddress: string;
/**
* The IP address of this Wi-Fi connection.
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
ipAddress: number;
/**
* The state of the supplicant of this Wi-Fi connection.
* @type { SuppState }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
suppState: SuppState;
/**
* The state of this Wi-Fi connection.
* @type { ConnState }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
connState: ConnState;
/**
* Channel width of the connected hotspot.
* @type { WifiChannelWidth }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
channelWidth: WifiChannelWidth;
/**
* Wifi standard of current connection.
* @type { WifiStandard }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
wifiStandard: WifiStandard;
/**
* Supported wifi category
* @type { WifiCategory }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
supportedWifiCategory: WifiCategory;
/**
* Whether the Wi-Fi hotspot is HiLink network.
* @type { boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
isHiLinkNetwork: boolean;
/**
* Whether the Wi-Fi hotspot is HiLinkPro network.
* @type { ?boolean }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 20
*/
isHiLinkProNetwork?: boolean;
/**
* Wi-Fi link type
* @type { ?WifiLinkType }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 18
*/
wifiLinkType?: WifiLinkType;
}
/**
* Wi-Fi IP information.
* @typedef IpInfo
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
interface IpInfo {
/**
* The IP address of the Wi-Fi connection
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
ipAddress: number;
/**
* The gateway of the Wi-Fi connection
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
gateway: number;
/**
* The network mask of the Wi-Fi connection
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
netmask: number;
/**
* The primary DNS server IP address of the Wi-Fi connection
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
primaryDns: number;
/**
* The secondary DNS server IP address of the Wi-Fi connection
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
secondDns: number;
/**
* The DHCP server IP address of the Wi-Fi connection
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
serverIp: number;
/**
* The IP address lease duration of the Wi-Fi connection
* @type { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 9
*/
leaseDuration: number;
}
/**
* Wi-Fi IPv6 information.
* @typedef Ipv6Info
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
interface Ipv6Info {
/**
* The link IPv6 address of the Wi-Fi connection
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
linkIpv6Address: string;
/**
* The global IPv6 address of the Wi-Fi connection
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
globalIpv6Address: string;
/**
* The rand Global IPv6 address of the Wi-Fi connection
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
randomGlobalIpv6Address: string;
/**
* The unique IPv6 address of the Wi-Fi connection
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
uniqueIpv6Address?: string;
/**
* The rand unique IPv6 address of the Wi-Fi connection
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 12
*/
randomUniqueIpv6Address?: string;
/**
* The gateway of the Wi-Fi connection
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
gateway: string;
/**
* The network mask of the Wi-Fi connection
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
netmask: string;
/**
* The primary DNS server IPV6 address of the Wi-Fi connection
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
primaryDNS: string;
/**
* The secondary DNS server IPV6 address of the Wi-Fi connection
* @type { string }
* @syscap SystemCapability.Communication.WiFi.STA
* @since 10
*/
secondDNS: string;
}
/**
* Wi-Fi hotspot configuration information.
* @typedef HotspotConfig
* @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
*/
interface HotspotConfig {
/**
* The SSID of the Wi-Fi hotspot
* @type { string }
* @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
*/
ssid: string;
/**
* The encryption mode of the Wi-Fi hotspot
* @type { WifiSecurityType }
* @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
*/
securityType: WifiSecurityType;
/**
* The frequency band of the Wi-Fi hotspot
* @type { number }
* @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
*/
band: number;
/**
* The channel of the Wi-Fi hotspot.
* @type { ?number }
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
channel?: number;
/**
* The password of the Wi-Fi hotspot
* @type { string }
* @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
*/
preSharedKey: string;
/**
* The maximum number of connections allowed by the Wi-Fi hotspot
* @type { number }
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
maxConn: number;
/**
* IP address of the dhcp server, it's a string, For example 192.168.43.1
* @type { ?string }
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
ipAddress?: string;
}
/**
* Wi-Fi station information.
* @typedef StationInfo
* @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
*/
interface StationInfo {
/**
* The network name of the Wi-Fi client
* @type { string }
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
name: string;
/**
* The MAC address of the Wi-Fi client
* @type { string }
* @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
*/
macAddress: string;
/**
* The MAC address type of the Wi-Fi client
* @type { ?DeviceAddressType }
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @systemapi Hide this for inner system use.
* @since 10
*/
macAddressType?: DeviceAddressType;
/**
* The IP address of the Wi-Fi client
* @type { string }
* @syscap SystemCapability.Communication.WiFi.AP.Core
* @systemapi Hide this for inner system use.
* @since 9
*/
ipAddress: string;
}
/**
* Wi-Fi IP type enumeration.
*
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
enum IpType {
/**
* Use statically configured IP settings
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
STATIC,
/**
* Use dynamically configured IP settings
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
DHCP,
/**
* No IP details are assigned
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
UNKNOWN
}
/**
* The state of the supplicant enumeration.
*
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
export enum SuppState {
/**
* The supplicant is not associated with or is disconnected from the AP.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
DISCONNECTED,
/**
* The network interface is disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
INTERFACE_DISABLED,
/**
* The supplicant is disabled.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
INACTIVE,
/**
* The supplicant is scanning for a Wi-Fi connection.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
SCANNING,
/**
* The supplicant is authenticating with a specified AP.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
AUTHENTICATING,
/**
* The supplicant is associating with a specified AP.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
ASSOCIATING,
/**
* The supplicant is associated with a specified AP.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
ASSOCIATED,
/**
* The four-way handshake is ongoing.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
FOUR_WAY_HANDSHAKE,
/**
* The group handshake is ongoing.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
GROUP_HANDSHAKE,
/**
* All authentication is completed.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
COMPLETED,
/**
* Failed to establish a connection to the supplicant.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
UNINITIALIZED,
/**
* The supplicant is in an unknown or invalid state.
* @syscap SystemCapability.Communication.WiFi.STA
* @systemapi Hide this for inner system use.
* @since 9
*/
INVALID
}
/**
* The state of Wi-Fi connection enumeration.
*
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
export enum ConnState {
/**
* The device is searching for an available AP.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
SCANNING,
/**
* The Wi-Fi connection is being set up.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
CONNECTING,
/**
* The Wi-Fi connection is being authenticated.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
AUTHENTICATING,
/**
* The IP address of the Wi-Fi connection is being obtained.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
OBTAINING_IPADDR,
/**
* The Wi-Fi connection has been set up.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
CONNECTED,
/**
* The Wi-Fi connection is being torn down.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
DISCONNECTING,
/**
* The Wi-Fi connection has been torn down.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
DISCONNECTED,
/**
* Failed to set up the Wi-Fi connection.
*
* @syscap SystemCapability.Communication.WiFi.STA
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
UNKNOWN
}
/**
* P2P device information.
*
* @typedef WifiP2pDevice
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
interface WifiP2pDevice {
/**
* Device name
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
deviceName: string;
/**
* Device mac address
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
deviceAddress: string;
/**
* Device mac address type
* @type { ?DeviceAddressType }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'10', '1.2':'20'}
* @arkts 1.1&1.2
*/
deviceAddressType?: DeviceAddressType;
/**
* Primary device type
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
primaryDeviceType: string;
/**
* Device status
* @type { P2pDeviceStatus }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
deviceStatus: P2pDeviceStatus;
/**
* Device group capabilities
* @type { number }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
groupCapabilities: number;
}
/**
* P2P config.
*
* @typedef WifiP2PConfig
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
interface WifiP2PConfig {
/**
* Device mac address
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
deviceAddress: string;
/**
* Device mac address type
* @type { ?DeviceAddressType }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 10
*/
deviceAddressType?: DeviceAddressType;
/**
* Group network ID. When creating a group, -1 indicates creates a temporary group,
* -2: indicates creates a persistent group
* @type { number }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
netId: number;
/**
* The passphrase of this {@code WifiP2pConfig} instance
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
passphrase: string;
/**
* Group name
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
groupName: string;
/**
* Group owner band
* @type { GroupOwnerBand }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
goBand: GroupOwnerBand;
}
/**
* P2P group information.
*
* @typedef WifiP2pGroupInfo
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
interface WifiP2pGroupInfo {
/**
* Indicates whether it is group owner
* @type { boolean }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
isP2pGo: boolean;
/**
* Group owner information
* @type { WifiP2pDevice }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
ownerInfo: WifiP2pDevice;
/**
* The group passphrase
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
passphrase: string;
/**
* Interface name
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
interface: string;
/**
* Group name
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
groupName: string;
/**
* Network ID
* @type { number }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
networkId: number;
/**
* Frequency
* @type { number }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
frequency: number;
/**
* Client list
* @type { WifiP2pDevice[] }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
clientDevices: WifiP2pDevice[];
/**
* Group owner IP address
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
goIpAddress: string;
}
/**
* P2P connection status.
*
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
enum P2pConnectState {
/**
* p2p is disconnected
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
DISCONNECTED = 0,
/**
* p2p is connected
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
CONNECTED = 1
}
/**
* P2P linked information.
*
* @typedef WifiP2pLinkedInfo
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
interface WifiP2pLinkedInfo {
/**
* Connection status
* @type { P2pConnectState }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
connectState: P2pConnectState;
/**
* Indicates whether it is group owner
* @type { boolean }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
isGroupOwner: boolean;
/**
* Group owner address
* @type { string }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
groupOwnerAddr: string;
}
/**
* P2P device status.
*
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
enum P2pDeviceStatus {
/**
* Indicate p2p device is connected.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
CONNECTED = 0,
/**
* Indicate p2p device is invited.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
INVITED = 1,
/**
* Indicate p2p device is failed.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
FAILED = 2,
/**
* Indicate p2p device is available.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
AVAILABLE = 3,
/**
* Indicate p2p device is unavailable.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since arkts {'1.1':'9', '1.2':'20'}
* @arkts 1.1&1.2
*/
UNAVAILABLE = 4
}
/**
* P2P group owner band.
*
* @enum { number }
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
enum GroupOwnerBand {
/**
* default band.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
GO_BAND_AUTO = 0,
/**
* 2.4G band.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
GO_BAND_2GHZ = 1,
/**
* 5G band.
* @syscap SystemCapability.Communication.WiFi.P2P
* @since 9
*/
GO_BAND_5GHZ = 2
}
}
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

搜索帮助