readBlueToothData 读取蓝牙数据
readBlueToothData ^7.8
读取蓝牙数据
#请求参数
| Prop | Type | Default | Comment |
|---|---|---|---|
| mac | String | N/A | 安卓:蓝牙Mac地址;iOS:外设uuid |
| serviceUuid | String | N/A | 服务通道的uuid |
| readUuid | String | N/A | 写通道的uuid |
#接口调用示例
const params = {
"mac": "安卓:蓝牙Mac地址;iOS:外设uuid",
"serviceUuid": "服务通道的uuid",
"readUuid": "写通道的uuid"
}
this.$bridge
.readBlueToothData(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
#接口返回示例
// 通过事件回调方式返回。
receiveMessageFromApp(
{
messageType: "receivebuletoothData",
messageBody:
{
mac:"xxx", data: "xxx",
serviceUuid:xxx,readUuid:xxx
}
}
)
浙公网安备 33010602011771号