wx.getBluetoothDevices

发布于 7 年前作者 suping14780 次浏览最后编辑 7 年前来自 ask

wx.getBLEDeviceServices({ // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接 deviceId: that.connectedDeviceId,

success: function(res) {

    console.log(res);

    that.services = res.services;

    that.lanya7();

},

fail: function(err) {

console.log(“失败”);

}

});

安卓机可以获取到,苹果机获取不到已经连接设备的uuid

3 回复
na25
na251 楼6 年前

that.connectedDeviceId

你是怎么拿到的?代码片段贴全一点

duxiulan
duxiulan2 楼6 年前

打印下

fail: function(res) { 

console.log(res)

看看在ios上提示什么

xiadai
xiadai3 楼5 年前

这个deviceId是通过wx.onBluetoothDeviceFound获取到的