wx.getBluetoothDevices
发布于 6 年前 作者 suping 14637 次浏览 来自 问答

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 回复

that.connectedDeviceId

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

打印下

fail: function(res) { 

console.log(res)

看看在ios上提示什么

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

回到顶部