1
0
mirror of https://github.com/Ylianst/MeshCommander synced 2026-01-05 18:03:14 +00:00

Fixed setup.bin provisioning server address.

This commit is contained in:
Ylian Saint-Hilaire
2021-03-12 20:59:56 -08:00
parent 92d53fa971
commit 6e830013e7
2 changed files with 32 additions and 6 deletions

View File

@@ -12537,9 +12537,12 @@
var hash = rstr2hex(val.substring(1, hashsize + 1));
var hashnamesize = val.charCodeAt(1 + hashsize);
var hashname = val.substring(2 + hashsize, 2 + hashsize + hashnamesize)
val = ["SHA1", "SHA256", "SHA384"][hashtype - 1] + ', ' + hashname + ', ' + hash;
val = ['SHA1', 'SHA256', 'SHA384'][hashtype - 1] + ', ' + hashname + ', ' + hash;
}
}
if (v.moduleid == 2 && v.varid == 17) {
val = val.charCodeAt(3) + '.' + val.charCodeAt(2) + '.' + val.charCodeAt(1) + '.' + val.charCodeAt(0);
}
x += '<div style=margin-right:12px><table onclick=\'usb_editvariable(event,' + i + ',' + j + ')\' class=\'itemBar us\' cellpadding=0 cellspacing=0 style=width:100%;border-radius:4px;margin-top:2px;margin-bottom:2px;padding:0><tr><td><p style=float:right;margin-right:8px><b>' + val + '</b><p>' + v['desc'] + '<tr style=height:4px></table></div>';
}
@@ -12636,6 +12639,10 @@
Q('idx_d16valc3').value = hashname;
}
usb_ond16checkhash();
} else if (modid == 2 && varid == 17) { // Provisioning server address
QV('d16genericvalue', true);
var ip = setupbin.records[i].variables[j].value;
idx_d16value1.value = idx_d16value2.value = ip.charCodeAt(3) + '.' + ip.charCodeAt(2) + '.' + ip.charCodeAt(1) + '.' + ip.charCodeAt(0);
} else {
QV('d16genericvalue', true);
idx_d16value1.value = idx_d16value2.value = setupbin.records[i].variables[j].value;
@@ -12651,11 +12658,16 @@
var varid = +ids[1];
var value = '';
var vardescription = AmtSetupBinVarIds[modid][varid];
if (modid == 2 && varid == 8) {
if ((modid == 2) && (varid == 8)) {
value = String.fromCharCode(Q('idx_d16valc1').value) + hex2rstr(Q('idx_d16valc2').value) + String.fromCharCode(Q('idx_d16valc3').value.length) + Q('idx_d16valc3').value;
} else {
if (vardescription[2]) { value = idx_d16value1.value; } else { value = idx_d16value2.value; }
}
if ((modid == 2) && (varid == 17)) { // Provisioning server address
var ipSplit = value.split('.');
if (ipSplit.length != 4) return;
value = String.fromCharCode(parseInt(ipSplit[3]), parseInt(ipSplit[2]), parseInt(ipSplit[1]), parseInt(ipSplit[0]));
}
setupbin.records[selectedRecord].variables[selectedVariable].value = value;
}
if (r == 2) { setupbin.records[selectedRecord].variables.splice(selectedVariable, 1); } // Delete
@@ -12679,11 +12691,16 @@
var varid = +ids[1];
var value = '';
var vardescription = AmtSetupBinVarIds[modid][varid];
if (modid == 2 && varid == 8) {
if ((modid == 2) && (varid == 8)) {
value = String.fromCharCode(Q('idx_d16valc1').value) + hex2rstr(Q('idx_d16valc2').value) + String.fromCharCode(Q('idx_d16valc3').value.length) + Q('idx_d16valc3').value;
} else {
if (vardescription[2]) { value = idx_d16value1.value; } else { value = idx_d16value2.value; }
}
if ((modid == 2) && (varid == 17)) { // Provisioning server address
var ipSplit = value.split('.');
if (ipSplit.length != 4) return;
value = String.fromCharCode(parseInt(ipSplit[3]), parseInt(ipSplit[2]), parseInt(ipSplit[1]), parseInt(ipSplit[0]));
}
// Create a new variable
var v = {};