onBluetoothDeviceFound 监听为什么会返回两条相同数据?

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

wx.onBluetoothDeviceFound((res) => {

          res.devices[0].RSSI = BlueTooth.max(0, res.devices[0].RSSI + 100)

          res.devices[0].advertisData = BlueTooth.ab2hex(res.devices[0].advertisData).slice(4, 16)

          if (res.devices[0].advertisData == mac) {

            this.stopBluetoothDevicesDiscovery()

            console.log(res.devices[0].advertisData, mac,res.devices[0].deviceId ,‘xxxxx’)

          }

        })

1 回复
jie66
jie661 楼5 年前

试试wx.startBluetoothDevicesDiscovery设置allowDuplicatesKey为false