Merge pull request #165 from clndwhr/bug/fix-PCI-and-EARFCN-on-Homepage
[BUG FIX] PCI and EARFCN for NSA on Simple Admin Home Page
This commit is contained in:
@@ -981,7 +981,7 @@
|
|||||||
// find this value from lines "+QCAINFO: \"PCC\"
|
// find this value from lines "+QCAINFO: \"PCC\"
|
||||||
const lte_pcc_arfcn = lines
|
const lte_pcc_arfcn = lines
|
||||||
.find((line) => line.includes('+QCAINFO: "PCC"'))
|
.find((line) => line.includes('+QCAINFO: "PCC"'))
|
||||||
.split(",")[5];
|
.split(",")[1];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
|
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
|
||||||
@@ -1050,7 +1050,6 @@
|
|||||||
const lte_pcc_pci = lines
|
const lte_pcc_pci = lines
|
||||||
.find((line) => line.includes('+QCAINFO: "PCC"'))
|
.find((line) => line.includes('+QCAINFO: "PCC"'))
|
||||||
.split(",")[5];
|
.split(",")[5];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
|
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
|
||||||
const lte_scc_pci = lines.filter((line) =>
|
const lte_scc_pci = lines.filter((line) =>
|
||||||
@@ -1075,39 +1074,38 @@
|
|||||||
this.sccPCI = "-";
|
this.sccPCI = "-";
|
||||||
}
|
}
|
||||||
} else if (this.networkMode == "5G NSA") {
|
} else if (this.networkMode == "5G NSA") {
|
||||||
// find this value from lines "+QCAINFO: \"PCC\"
|
const pccparts = lines.find((m) => m.includes("QCAINFO: \"PCC\"")).split(":")[1].split(",");
|
||||||
const lte_pcc_pci = lines
|
const sccarr = lines.filter((m) => m.includes("QCAINFO: \"SCC\""));
|
||||||
.find((line) => line.includes('+QCAINFO: "PCC"'))
|
const sccpci = [];
|
||||||
.split(",")[5];
|
sccarr.forEach((s) => {
|
||||||
|
const sccparts = s.split(":")[1].split(",");
|
||||||
try {
|
let sccIndex = 5;
|
||||||
// Look for all the lines with this value "+QCAINFO: \"SCC\" and store them in an array
|
switch (sccparts.length) {
|
||||||
const lte_scc_pci = lines.filter((line) =>
|
case 8: // length 8, PCI is at index 4, NR5G PCC and NR5G SCC Band when NR5G-NSA
|
||||||
line.includes('+QCAINFO: "SCC"')
|
sccIndex = 4;
|
||||||
);
|
break;
|
||||||
|
case 13: // length 13, PCI is at index 5, LTE SCC Band
|
||||||
// if empty, then proceed to error block
|
case 12: // length 12, PCI is at index 5, NR5G SCC Band
|
||||||
if (lte_scc_pci.length == 0) {
|
case 10: // length 10, PCI is at index 5, LTE PCC Band
|
||||||
throw "No SCC PCI";
|
default:
|
||||||
|
sccIndex = 5;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
sccpci.push(sccparts[sccIndex]);
|
||||||
// process all the values in the array and extract the PCI part only
|
});
|
||||||
for (let i = 0; i < lte_scc_pci.length; i++) {
|
this.sccPCI = sccpci.join(', ');
|
||||||
// if line contains LTE BAND then do this process
|
switch (pccparts.length) {
|
||||||
if (lte_scc_pci[i].includes("LTE BAND")) {
|
case 8: // length 8, PCI is at index 4, NR5G PCC and NR5G SCC Band when NR5G-NSA
|
||||||
lte_scc_pci[i] = lte_scc_pci[i].split(",")[5];
|
pccIndex = 4;
|
||||||
} else {
|
break;
|
||||||
lte_scc_pci[i] = lte_scc_pci[i].split(",")[4];
|
case 13: // length 13, PCI is at index 5, LTE SCC Band
|
||||||
}
|
case 12: // length 12, PCI is at index 5, NR5G SCC Band
|
||||||
}
|
case 10: // length 10, PCI is at index 5, LTE PCC Band
|
||||||
|
default:
|
||||||
// combine the PCC and SCC PCI values
|
pccIndex = 5;
|
||||||
this.pccPCI = lte_pcc_pci;
|
break;
|
||||||
this.sccPCI = lte_scc_pci.join(", ");
|
|
||||||
} catch (error) {
|
|
||||||
this.pccPCI = lte_pcc_pci.replace(/,/g, "");
|
|
||||||
this.sccPCI = "-";
|
|
||||||
}
|
}
|
||||||
|
this.pccPCI = pccparts[pccIndex]?.trim();
|
||||||
} else {
|
} else {
|
||||||
this.pccPCI = "0";
|
this.pccPCI = "0";
|
||||||
this.sccPCI = "-";
|
this.sccPCI = "-";
|
||||||
|
|||||||
Reference in New Issue
Block a user