蓝牙开发,在设备连接成功后,进行Notify操作时会报错10008是什么原因呢
试过各种方法都能未得到解决,我看了一下连接的结果,是支持notify的,因为项目比较急,希望能尽快帮我解答一下,十分感谢!
//判断有满足条件的特征值if (!isnotcmm) { that.data.issupportwrite = res.characteristics[index].properties.write that.data.issupportread = res.characteristics[index].properties.read that.data.issupportnotify = res.characteristics[index].properties.notify that.data.issupportindicate = res.characteristics[index].properties.indicate if (that.data.issupportnotify) { console.log("支持notify") wx.notifyBLECharacteristicValueChange({ deviceId: equipmentId, serviceId: servicehuuid, characteristicId: characterhuuid, state: true, success: function (res) { console.log(res) }, fail: function (res) { console.log(res) } }) } console.log("equipmentId:" + equipmentId); console.log("servicehuuid:" + servicehuuid); console.log("characterhuuid:" + characterhuuid); wx.onBLECharacteristicValueChange(function (res) { console.log(res) for (var i = 0; i < res.value.length; i++) { console.log(res.value[i]) } }) |
