- createBLEConnection:fail:connection fail status:22
机型:PHB110arm64-v8a 微信版本:8.0.40 系统:33 微信号:Designer_Andy 时间:2020.9.18 10:00 报错内容: 安卓机型报错 errCode: 10003 errMsg: "createBLEConnection:fail:connection fail status:22" errno: 1509001 代码: // 连接蓝牙 获取服务 const connectBluetooth = (deviceId) => { // 连接蓝牙 uni.createBLEConnection({ deviceId, // 搜索到蓝牙设备地址 success: (res) => { console.log('蓝牙连接成功', res) connectState.isScanDeviceLoading = true connectState.isScanDeviceSuccess = true // 连接成功,获取服务,拿到喜羊羊设备主服务uuid,需要延迟一下,防止连接成功立即获取服务号获取不到 servicesTimer.value = setTimeout(() => { clearTimeout(servicesTimer.value) onGetBLEDeviceServices() }, 1000) }, fail: (error) => { console.log('连接蓝牙失败', error) // 连接蓝牙失败 if (error.errCode === 10003) { connectState.isScanDeviceSuccess = false successIndex.value = 0 uni.stopBluetoothDevicesDiscovery() searchBluetooth() } } }) }
2023-09-18 - notifyBLECharacteristicValueChange报10008错误
API名称:wx.notifyBLECharacteristicValueChange 机型:IPhone XS Max 微信版本:8.0.41 系统:IOS 15.4.1 微信号:XINtt778 时间:2020.9.15 17:56 报错内容:The attribute could not be found ---------------------------------------------------------------------------------------------- 机型:PHB110arm64-v8a 微信版本:8.0.40 系统:33 微信号:Designer_Andy 时间:2020.9.15 17:57 报错内容:notifyBLECharacteristicValueChange:fail:no descriptor 代码片段:https://developers.weixin.qq.com/s/FkqhZfmG7ULu 代码:openNotify:function(){ var that = this wx.notifyBLECharacteristicValueChange({ deviceId: that.data.deviceId, serviceId: that.data.serviceId, characteristicId: that.data.characteristicId, state: true, success: function(res) { console.log(res) that.setData({motto1:'成功' + res.errMsg}) }, fail:function(res){ console.log(res) that.setData({ motto1: '失败' + res.errMsg }) } }) }
2023-09-15