楼主你好,请问这个问题你后来解决了嘛,可以分享一下解决思路么。谢谢你
蓝牙连接成功后,BLEConnectionStateChange返回false 是为什么?微信版本号 :8.0及以上 手机链接上蓝牙设备后1-5秒内会触发onBLEConnectionStateChange函数 返回false 蓝牙链接被断开 提示 The connection has timed out unexpectedly wx.onBLEConnectionStateChange(function(res) { console.log(res.deviceId + "连接状态:" + res.connected) if(res.connected == false){ console.log(res.deviceId + "连接状态connectedconnected:" + res.connected) uni.onBluetoothAdapterStateChange(res=>{ //监听蓝牙适配器是否打开,若打开则自动搜索蓝牙设备(onBluetoothAdapterStateChange) if (res.available) { store.commit('isblueTooth',true) that.startBluetoothDevicesDiscovery(); } }); // that.openBluetoothAdapter() // store.state.connected store.commit("connected",false); store.commit("isblueTooth",false); } })
2022-10-17