微信公开课
如何看待微信公开课小程序热门讨论「小程序wxgetBluetoothDevices返回的name是未知设备」
摘要:小程序wxgetBluetoothDevices返回的name是未知设备
展开:现象如下:用下面的代码,在从来没有扫描过本小程序的iOS上,扫描进入,调用对应代码,会打印出一系列的:扫到的:未知设备扫到的:未知设备扫到的:未知设备扫到的:未知设备而关闭系统蓝牙再打开,再扫,还是如此。而将微信后台清掉,再进入微信,进入本小程序,再扫,每个设备的名字就准确的扫描出来了。之后,就都能准确扫到了。使用新的iOS手机能复现。代码片段如下:wx.startBluetoothDevicesDiscovery({services:[FFE5],//只搜索含有FFE5主服务的uuidallowDuplicatesKey:false,interval:100,success:function(res){console.log(开启BLE发现服务成功)that.DeviceScanInterval(operType)},fail:function(res){}})DeviceScanInterval:function(operType){wx.getBluetoothDevices({success:function(res){console.log(在寻找设备:+that.data.DeviceId)that.data.signalStrength0vari0for(;ires.devices.length;i++){console.log(扫到的:+res.devices[i].name)if(res.devices[i].namethat.data.DeviceId){console.log(已搜索到指定设备)//停止蓝牙BLE扫描wx.stopBluetoothDevicesDiscovery({complete:function(){}},})break}}},fail:function(res){console.log(res)that.data.signalStrength0},})}了解更多
方法1:微信扫描微信公开课小程序码即可订阅热门讨论「小程序wxgetBluetoothDevices返回的name是未知设备」
方法2:微信搜索微信公开课小程序名称进入,即可订阅热门讨论「小程序wxgetBluetoothDevices返回的name是未知设备」
方法3:微信网页访问即速商店,长按识别微信公开课小程序码即可订阅热门讨论「小程序wxgetBluetoothDevices返回的name是未知设备」
微信公开课小程序热门讨论「小程序wxgetBluetoothDevices返回的name是未知设备」由微信公开课原创摘录于微信小程序商店shop.jisuapp.cn,转载请注明出处。
微信公开课热门讨论「小程序wxgetBluetoothDevices返回的name是未知设备」由微信公开课开发者向微信用户提供,并对本服务内容、数据资料及其运营行为等真实性、合法性及有效性承担全部责任。