蓝牙连接成功后,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); } })