sendBlueToothData 发送蓝牙数据
sendBlueToothData ^7.8
发送蓝牙数据
#请求参数
| Prop | Type | Default | Comment |
|---|---|---|---|
| mac | String | N/A | 安卓:蓝牙Mac地址;iOS:外设uuid |
| serviceUuid | String | N/A | 服务通道的uuid |
| writeUuid | String | N/A | 写通道的uuid |
| data | String | N/A | 数据的16进制字符串 |
#接口调用示例
const params = {
"mac": "安卓:蓝牙Mac地址;iOS:外设uuid",
"serviceUuid": "服务通道的uuid",
"writeUuid": "写通道的uuid",
"data": "数据的16进制字符串"
}
this.$bridge
.sendBlueToothData(params)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
#接口返回示例
//成功出参:
{
errorCode:0//发送成功
}
// 失败出参:
{
errorCode:1, //1发送失败、2蓝牙未连接
errorMsg: '' //失败原因描述
}
浙公网安备 33010602011771号