IOS下蓝牙不正常 setNotifyOnCharacteristics error 10007?
发布于 5 年前 作者 fanyang 599 次浏览 来自 官方Issues

蓝牙监听不一致,几天了都没解决,求助!!

同样的代码,同一个设备,安卓没有问题,但IOS就会报:

notifyBLECharacteristicValueChange:fail setNotifyOnCharacteristics error 10007

var that = this;
    wx.notifyBLECharacteristicValueChange({
      statetrue// 启用 notify 功能
      deviceId: that.data.deviceId,
      serviceId: that.data.serviceId,
      characteristicId: that.data.notifyCharacteristicId,
      successfunction (res{
        console.log('[ok]8.2 notify启动成功', res.errMsg);
        console.log('[监听]' + that.data.deviceId + '--' + that.data.serviceId + '--' + that.data.notifyCharacteristicId);
        that.onBLECharacteristicValueChange(); //监听特征值变化
      },
      failfunction (res{
        console.log('[ok]8.2 notify启动失败', res.errMsg);
        console.log('[监听]' + that.data.deviceId + '--' + that.data.serviceId + '--' + that.data.notifyCharacteristicId);
        wx.showToast({
          title'notify启动失败',
          masktrue
        });
        setTimeout(function () {
          wx.hideToast();
        }, 2000)
      }
1 回复
回到顶部