蓝牙打印startBluetoothDevicesDiscovery的BUG?
发布于 4 年前 作者 lei98 20276 次浏览 来自 问答

调用蓝牙4.0打印机,打印小票,startBluetoothDevicesDiscovery设置了allowDuplicatesKey为false,但依然会上报重复设备。是我调用错了?还是API有BUG?

微信版本6.5.14.32

IOS10.3.3

wx.startBluetoothDevicesDiscovery({
   allowDuplicatesKey: false,
   success: function (res) {
 
     if (!res.isDiscovering) {
       wx.showToast({
         title: '错误',
       })
 
     }
   },
   fail:function() {
     wx.showToast({
       title: '手机无法搜索蓝牙打印机',
     })
   }
 })
wx.onBluetoothDeviceFound(function (data) {
 
    var _d = data.devices[0];
    if (deviceId == _d.deviceId) {
     //此处会执行多次
       
    }
  })
1 回复

能问下你用的是什么打印机吗

回到顶部