startBlueScan 开始扫描蓝牙

startBlueScan ^5.9.0

开始扫描蓝牙

建议:扫描到设备之后再建立蓝牙连接

超时之后的返回和停止蓝牙扫描接口返回一致

#请求参数

Prop Type Required Default Description
param Object Y {} 属性: name:{ Type: String, Default: N/A, Description: 蓝牙名称 (可以使用getDeviceInfo中返回的ssid字段) } mac:{ Type: String, Default: N/A, Description: 蓝牙mac地址((可以使用getDeviceInfo中返回的mac字段)) } duration: 请求参数

#接口调用示例

参数支持2种方式:



eg1:ssid过滤,支持发现一个设备

let param={
name:"midea_xx_xxxx",

duration: 10//自定义数值

}

eg2:mac过滤,支持发现一个设备

let param={

mac:"xxxxxxxxxxxx",

duration: 10//自定义数值

}

this.$bridge
    .startBlueScan(params)
    .then(res => {    
    this.$alert(res)
    })
    .catch(err => {
    this.$toast(err)
    })

#返回参数

Prop Type Default Description
messageType String singleBlueScanResult H5用来判断消息类型
messageBody Object {} 属性: name: 属性: mac: 属性: moduleType: 属性: authStatus: APP传递的JSON对象

TIP

该接口基于mSmart 协议,底层由singleBlueToothModule单蓝牙支持

posted on 2024-12-16 09:44  AtlasLapetos  阅读(11)  评论(0)    收藏  举报