修复650id大小写错误
This commit is contained in:
@ -286,55 +286,37 @@
|
|||||||
ble = BleTool.getBleTool();
|
ble = BleTool.getBleTool();
|
||||||
let eventChannel = this.getOpenerEventChannel();
|
let eventChannel = this.getOpenerEventChannel();
|
||||||
|
|
||||||
//eventChannel.on('receivdata', function(data) {
|
eventChannel.on('detailData', function(data) {
|
||||||
|
|
||||||
let data = {
|
|
||||||
data: {
|
|
||||||
deviceMac: '35:06:00:EF:46:51',
|
|
||||||
bluetoothName: 'JQZM-EF4651',
|
|
||||||
deviceName: 'JQZM-EF4651',
|
|
||||||
devicePic: '',
|
|
||||||
id: '35:06:00:EF:46:51'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
console.log("收到父页面的参数:" + JSON.stringify(data));
|
|
||||||
var device = data.data;
|
|
||||||
these.device.deviceId = device.deviceMac;
|
|
||||||
these.formData.name = device.bluetoothName ? device.bluetoothName : device.deviceName;
|
|
||||||
these.formData.img = device.devicePic;
|
|
||||||
these.formData.id = device.id;
|
|
||||||
//});
|
|
||||||
ble.addReceiveCallback(these.bleValueNotify);
|
|
||||||
|
|
||||||
let startLink=()=>{
|
console.log("收到父页面的参数:" + JSON.stringify(data));
|
||||||
ble.addDeviceFound((res) => {
|
var device = data.data;
|
||||||
console.log("发现新设备,",res);
|
|
||||||
let f = res.devices.find((v) => {
|
let f = ble.data.LinkedList.find((v) => {
|
||||||
return v.name == device.deviceName;
|
if (v.macAddress == device.deviceMac) {
|
||||||
});
|
console.log("找到设备了");
|
||||||
if (f) {
|
these.device.deviceId = v.deviceId;
|
||||||
console.log("找到了目标设备,正在连接:"+f.deviceId)
|
return true;
|
||||||
these.device.deviceId = f.deviceId;
|
}
|
||||||
these.formData.id = f.deviceId;
|
return false;
|
||||||
ble.LinkBlue(f.deviceId);
|
});
|
||||||
}
|
if (!f) {
|
||||||
});
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
ble.StartSearch();
|
content: "当前手机未连接过此设备,请删除后重新使用蓝牙添加"
|
||||||
}
|
})
|
||||||
if(ble.data.LinkedList && ble.data.LinkedList.length>0){
|
return;
|
||||||
let f=ble.data.LinkedList.find((v)=>{
|
}
|
||||||
return v.name==device.deviceName;
|
|
||||||
});
|
these.formData.name = device.bluetoothName ? device.bluetoothName : device.deviceName;
|
||||||
if(!f){
|
these.formData.img = device.devicePic;
|
||||||
startLink();
|
these.formData.id = device.id;
|
||||||
}else{
|
if (f) {
|
||||||
these.device.deviceId = f.deviceId;
|
|
||||||
these.formData.id = f.deviceId;
|
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId);
|
||||||
}
|
|
||||||
}else{
|
|
||||||
startLink();
|
}
|
||||||
}
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
|
Reference in New Issue
Block a user