# 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)
  })
 1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
# 接口返回示例
// 通过事件回调方式返回。
receiveMessageFromApp(
  { 
    messageType: "receivebuletoothData",
    messageBody: 
    { 
        mac:"xxx", data: "xxx",
        serviceUuid:xxx,readUuid:xxx
    } 
  }
)
 1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12