For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/js-api/device/wifi/startWifi.md.

startWifi

初始化 Wi-Fi 模块。

扫码预览

扫码预览 startWifi

支持版本

前端库版本不低于 0.0.25。

支持平台

平台支持情况
Android支持
iOS支持
PC不支持
HarmonyOS不支持

支持场景

场景支持情况
页面支持
卡片不支持

使用说明

Wi-Fi 流程入口。调用其他 Wi-Fi 接口前需先调用本接口完成初始化。

调用方式

异步 API

startWifi(params?: object): Promise<object>

入参

无。

调用示例

import { startWifi } from '@doubao-dev/framework/api';

await startWifi();

成功返回

无返回字段。

返回示例

{}

错误处理

错误对象和通用错误码见 通用错误处理。

失败示例

{
  "errNo": 103,
  "errMsg": "feature not support"
}

错误码

errNoerrMsg平台触发条件处理建议
103feature not supportAndroid设备无可用的 Wi-Fi 能力(缺少系统 Wi-Fi 服务)检查设备是否支持 Wi-Fi,不支持时不要调用

通用错误码

errNoerrMsg说明平台
102internal error内部错误Android

平台差异

  • iOS:初始化恒返回成功,不返回失败错误码。