添加候选网络配置,使用有关能力接口添加候选网络配置

使用有关能力接口添加候选网络配置

HarmonyOS
2024-05-28 20:48:18
3905浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
唯你而画

使用的核心API

@connection.addcandidateconfig

核心代码解释

import wifiManager from '@ohos.wifiManager'; 
 
try { 
  let config:wifiManager.WifiDeviceConfig = { 
    ssid : "1111", 
    preSharedKey : "", 
    securityType : 0 
  } 
  wifiManager.addCandidateConfig(config,(error,result) => { 
    console.info("result:" + JSON.stringify(result)); 
  }); 
}catch(error){ 
  console.error("failed:" + JSON.stringify(error)); 
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.

注明适配的版本信息

  • IDE:DevEco Studio 3.1.0.601
  • SDK:HarmoneyOS 4.0.10.10
分享
微博
QQ
微信
回复
2024-05-29 21:50:36


相关问题
wifi连接候选网络报错{code : 2501000 }
1120浏览 • 1回复 待解决
抓取http请求包代理配置添加
1573浏览 • 1回复 待解决
HarmonyOS rcp网络请求证书配置
937浏览 • 1回复 待解决
怎么把应用放入文件打开的候选项?
303浏览 • 0回复 待解决
HarmonyOS 如何在网络请求前添加Loading?
785浏览 • 1回复 待解决
Waterflow怎么添加header能力?
1096浏览 • 1回复 待解决
基于原生的水印添加能力
1741浏览 • 1回复 待解决