小程序蓝牙连接中,ios获取到的服务少两个了?
发布于 6 年前 作者 yan39 3014 次浏览 来自 官方Issues

上边是安卓版本获取的服务,

而用ios获取的服务只有FFB0一个,其他的都显示不出来

做了延迟处理还是没有显示

有什么好的解决办法吗

2 回复

getServiceId(deviceId) {

var that = this;

console.log(‘deviceId’,deviceId);

setTimeout(function () {

wx.getBLEDeviceServices({

deviceId: deviceId,

success: function (res) {

console.log(“获取服务成功”, res)

that.setData({

serviceId: res.services[0].uuid,

notifyServiceId: res.services[2].uuid,

})

that.getCharacteristicId(deviceId, res.services[0].uuid)

},

fail: function (res) {

console.log(“获取服务错误:”, res)

}

}) //这里面写搜索的内容

},1500)

},

上边是代码

回到顶部