wx.onBLECharacteristicValueChange 不执行
发布于 5 年前 作者 xiulan56 12963 次浏览 来自 问答

wx.notifyBLECharacteristicValueChange({ //notifyBLECharacteristicValueChange

deviceId: deviceId,

serviceId: serviceID,

characteristicId: characterID,

state: true,

success: function (res) {

console.log(’*****notifyBLECharacteristicValueChange – success’);

console.log(res);

//初始化蓝牙 1.福瑞泰克    2.博思凯  --ps:这里同钥匙列表.js不同

wx.onBLECharacteristicValueChange(function (res) { //福瑞泰克 

            wx.hideLoading();   

       utils.showModelDialog(“开门成功”); //福瑞泰克

})

},

fail: function (res) {

that.relaseBle();

wx.hideLoading(); //启用低功耗蓝牙设备特征值变化时的 notify 功能,订阅特征值

that.wxShowModel(“开门失败”);

},

});

启用低功耗蓝牙设备特征值变化时的 notify功能成功后,一直不执行wx.onBLECharacteristicValueChange,或者说执行的时间太长,很慢,就只一直等待

1 回复

你好,请具体描述问题,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部