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 |
#引入接口模块
import bridge from '@minix-iot/etsbridge-sdk'
#接口调用示例
const params = {
mac: '安卓:蓝牙Mac地址;iOS:外设uuid',
serviceUuid: '服务通道的uuid',
readUuid: '写通道的uuid',
}
bridge
.readBlueToothData(params)
.then((res) => {
console.log(res)
})
.catch((err) => {
console.log(err)
})
#接口返回示例
// 通过事件回调方式返回。
receiveMessageFromApp({
messageType: 'receivebuletoothData',
messageBody: {
mac: 'xxx',
data: 'xxx',
serviceUuid: xxx,
readUuid: xxx,
},
})
浙公网安备 33010602011771号