小程序蓝牙连接中,ios获取到的服务少两个了?

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

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

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

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

有什么好的解决办法吗

2 回复
juanfan
juanfan1 楼6 年前

麻烦提供能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

fangchen
fangchen2 楼5 年前

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)

},

上边是代码