1
0
forked from dyf/APP

蓝牙模块添加在web平台默认成功方便调试功能,4877功能完成

This commit is contained in:
liub
2025-10-27 10:52:17 +08:00
parent d37ccfeabc
commit 61ed91695f
13 changed files with 575 additions and 318 deletions

View File

@ -156,14 +156,39 @@
if (these.device.deviceId == receive.deviceId) {
console.log("11111:", receive);
these.device.imei = f.imei;
if (receive.bytes[0] == 0xFC || receive.str.indexOf('mac address:') == 0) {
let flag=false;
if (receive.bytes && receive.bytes.length && receive.bytes[0] == 0xFC) {//6155 7305
if (f && f.macAddress) {
these.device.macAddress = f.macAddress;
console.log("222222");
these.Statu.isSearch = false;
these.initDevice();
flag=true;
}
}
else if(receive.str.indexOf('mac address:') == 0){//650 670
if (f && f.macAddress) {
flag=true;
}
}
else{
try{
let json=JSON.parse(receive.str);
let key = "sta_address";
if (key in json) {//100
if (f && f.macAddress) {
flag=true;
}
}
}catch(err){
console.log("出现异常,",err);
}
}
if(flag){
these.device.macAddress = f.macAddress;
console.log("222222");
these.Statu.isSearch = false;
these.initDevice();
}
}
}, pagePath);
eventChannel = this.getOpenerEventChannel();