收藏
回答

IOS下蓝牙不正常 setNotifyOnCharacteristics error 10007?

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

同样的代码,同一个设备,安卓没有问题,但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)
      }


回答关注问题邀请回答
收藏
登录 后发表内容