Skip to content

获取当前连接的wifi信息

方法名

startScan

用法

  • 用法如下:
    js
    module.getConnectionInfo({
      complete: (res) => {}
    })
    js
    module.getConnectionInfo({
      complete: (res : LevenResult) => {}
    } as LevenOptions)
  • 参数说明
    参数名参数类型是否必填默认值参数描述
    successFunction执行成功的函数
    failFunction执行失败的函数
    completeFunction执行完成的函数,不管成功还是失败都会执行

回调

  • 示例
    json
    {
      "data": {},
      "message": "",
      "code": 0
    }
  • 回调说明:
    参数名参数类型参数描述
    messageString消息提示
    dataObject数据对象
    data.wifiStandardIntegerWi-Fi连接标准
    data.maxSupportedRxLinkSpeedMbpsInteger支持的最大接收链路速度(单位:Mbps)
    data.maxSupportedTxLinkSpeedMbpsInteger支持的最大传输链路速度(单位:Mbps)
    data.apMloLinkIdIntegerWi-Fi 7接入点的多链路操作(MLO)链路ID
    data.mloLinkListObject[]Wi-Fi 7接入点的多链路操作(MLO)关联链路
    data.apMldMacAddressObject已连接接入点的多链路设备(MLD)MAC地址
    data.isRestrictedBoolean当前Wifi网络是受限网络
    data.applicableRedactionsInteger返回一个位掩码,该掩码包含所有基于此TransportInfo(传输信息)进行的适用审查(基于接收方应用程序所拥有的权限)
    data.currentSecurityTypeInteger当前802的安全类型
    data.subscriptionIdInteger如果此网络由运营商配置,则返回设备上相关SIM卡对应的订阅ID
    data.associatedMloLinksObject[]返回Wi-Fi 7接入点的相关多链路操作(MLO)链路
    data.passpointFqdnString如果网络是Passpoint网络,则返回其完全限定域名
    data.passpointProviderFriendlyNameString如果网络是Passpoint网络,则返回该网络的提供商友好名称
    data.rxLinkSpeedMbpsInteger返回当前接收链接速度(单位为 Mbps)
    data.txLinkSpeedMbpsInteger返回当前传输链路速度(单位为 Mbps)
    data.BSSIDString当前接入点的基本服务集标识符
    data.frequencyInteger频率
    data.hiddenSSIDBoolean是否隐藏SSID
    data.linkSpeedInteger当前链接速度
    data.macAddressString连接所使用的MAC地址
    data.networkIdInteger网络标识
    data.rssiInteger信号强度
    data.SSIDInteger网络名称
    data.ipAddressIntegerIP地址整形
    codeInteger返回类型,0.成功,其他:失败