| @@ -182,8 +182,9 @@ Page({ | |||
| wx.getBLEDeviceServices({ | |||
| deviceId, | |||
| success: (res) => { | |||
| console.log(res) | |||
| for (let i = 0; i < res.services.length; i++) { | |||
| if (res.services[i].isPrimary) { | |||
| if (res.services[i].isPrimary && res.services[i].uuid.indexOf("FFE0")>-1) { | |||
| this.getBLEDeviceCharacteristics(deviceId, res.services[i].uuid) | |||
| return | |||
| } | |||
| @@ -235,6 +236,7 @@ Page({ | |||
| wx.onBLECharacteristicValueChange((characteristic) => { | |||
| // 解析特征值,返回解密后的数据 | |||
| console.log("===" + plugin.ab2hex(characteristic.value)) | |||
| let bleData = plugin.parseBleData(characteristic.value) | |||
| if (bleData.status == 0) { | |||
| console.log("握手成功") | |||