收藏
回答

怎么样才能停掉notify

我的小程序和手表链接上了  我往手表写入数据之后  手表返回数据但是一值返回 不知道怎么停掉


wx.notifyBLECharacteristicValueChange({

         state: false, // 启用 notify 功能

         // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取

        deviceId: that.data.deviceId,

          // 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取

         serviceId: that.data.useData,

         // 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取

        characteristicId: that.data.useCharacteristicsData1,

          success: function (res) {

                console.log('开启notify', res.errMsg)

            }

  })

像这样设置为false  不起作用啊


回答关注问题邀请回答
收藏

11 个回答

  • 王翊夫if
    王翊夫if
    2017-08-30

    安卓平台还是iOS平台呢?

    这里调用  wx.notifyBLECharacteristicValueChange 有走进success回调或者fail回调么

    2017-08-30
    有用
    回复

正在加载...

登录 后发表内容