关于wx.startBluetoothDevicesDiscovery蓝牙扫描广播是否存在漏包?
发布于 6 年前 作者 jing14 10817 次浏览 来自 问答

测试方法:蓝牙设备每秒广播一次,且数据自增0.1。

现象:调试时发现大概5秒才会接收到一次广播数据。

已排出蓝牙设备本身问题,因为用其他蓝牙调试工具检测可以测出每秒广播一次

function startBluetoothDevicesDiscovery(callback){
if (!bleState.discoverStarted){
//deviceList = []
//调用扫描接口
setTimeout(()=>{
wx.startBluetoothDevicesDiscovery({
allowDuplicatesKey: true,
interval: 1000,
success: function (res) {
bleState.discoverStarted = true
//callback(false, '正在扫描')
//接口调用成功,设置监听事件
onBluetoothDeviceFound(callback)
},
fail: function (res) {
bleState.discoverStarted = false
startBluetoothDevicesDiscovery(callback)
}
})
},1000)
}
}
1 回复

你好,是安卓还是ios呢?麻烦再重现一次,在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点

回到顶部