Skip to content

getBluetoothAdapterState

描述

获取蓝牙适配器状态

网页应用需要完成鉴权后调用该接口。

支持说明

客户端平台WPS协作版本要求
iOS>=5.19.0
Android>=5.19.0

输入

名称数据类型是否必填描述
onSuccessFunction
onErrorFunction

输出

名称类型描述
availableboolean蓝牙适配器是否可用或蓝牙适配器是否处于搜素状态
discoveringboolean是否正在查找蓝牙设备

示例代码

ts
window.ksoxz_sdk.getBluetoothAdapterState({onSuccess,onError})

错误码

errnomsg含义
1002007User not granted webApp bluetooth permission用户未授予网页应用蓝牙权限
1021009Bluetooth permission not obtained用户未授予 App 蓝牙权限
1023001Bluetooth not available设备不支持蓝牙(缺少相关硬件支持)
1502006Bluetooth resetting蓝牙重置中
1022103Bluetooth is disabled蓝牙未打开

除以上错误外,还可能存在公共错误,参考:公共错误码