improved LTE cell id function

This commit is contained in:
Russel Yasol
2024-03-29 23:39:24 +08:00
parent 802c90e7b4
commit 618f978018

View File

@@ -187,7 +187,7 @@
<button <button
class="button is-info" class="button is-info"
@click="cellLock()" @click="cellLock()"
:disabled="isLoading" :disabled="isLocking"
> >
Lock Cell Lock Cell
</button> </button>
@@ -196,7 +196,7 @@
class="button is-warning" class="button is-warning"
style="margin-left: 1rem" style="margin-left: 1rem"
@click="restoreCell()" @click="restoreCell()"
:disabled="isLoading" :disabled="isLocking"
> >
Restore Cell Restore Cell
</button> </button>
@@ -205,10 +205,10 @@
<div class="card-footer" style="padding: 0.25rem"> <div class="card-footer" style="padding: 0.25rem">
<p class="card-footer-item"> <p class="card-footer-item">
To utilize cell locking, first, select the network mode, then To utilize cell locking, first, select the network mode, then
specify the number of cells you wish to lock onto (max 10) if you specify the number of cells you wish to lock onto (max 10) if
are using LTE. Next, input the EARFCN and PCI values for each you are using LTE. Next, input the EARFCN and PCI values for
cell number. If you are locking through NR5G-SA instead, simply each cell number. If you are locking through NR5G-SA instead,
fill up all the required parameters. simply fill up all the required parameters.
</p> </p>
</div> </div>
</div> </div>
@@ -429,36 +429,36 @@
</button> </button>
<button <button
class="button is-link" class="button is-link"
@click="servingCellInfo()" @click="servingCellInfo()"
:disabled="isLoading" :disabled="isLoading"
> >
Serving Cell Info Serving Cell Info
</button> </button>
<button <button
class="button is-link" class="button is-link"
@click="scanNeighbourCells()" @click="scanNeighbourCells()"
:disabled="isLoading" :disabled="isLoading"
> >
Scan Neighbour Cells Scan Neighbour Cells
</button> </button>
<button <button
class="button is-link" class="button is-link"
@click="scanNsaCells()" @click="scanNsaCells()"
:disabled="isLoading" :disabled="isLoading"
> >
Scan NSA Cells Scan NSA Cells
</button> </button>
<button <button
class="button is-link" class="button is-link"
@click="fullNetworkScan()" @click="fullNetworkScan()"
:disabled="isLoading" :disabled="isLoading"
> >
Full Network Scan Full Network Scan
</button> </button>
</div> </div>
</div> </div>
<div class="card-footer" style="padding: 0.25rem"> <div class="card-footer" style="padding: 0.25rem">
@@ -609,66 +609,29 @@
return; return;
} }
// Construct the atcmd based on the selected network mode // Construct the AT command based on the selected network mode
// LTE: AT+QNWLOCK="common/4g",<1-3>,<EARFCN>,<PCI>
// NR5G-SA: AT+QNWLOCK="common/5g",<PCI>,<EARFCN>,<SCS>,<BAND>
let atcmd; let atcmd;
if (this.networkMode2 === "LTE") { if (this.networkMode2 === "LTE") {
switch (this.cellNum) { if (parseInt(this.cellNum) > 10) {
case "1": this.isError = true;
atcmd = `AT+QNWLOCK="common/4g",1,${this.earfcn1},${this.pci1}`; this.startCountdown();
console.log(atcmd); console.error("Invalid frequency number.");
break; return;
case "2":
atcmd = `AT+QNWLOCK="common/4g",2,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2}`;
console.log(atcmd);
break;
case "3":
atcmd = `AT+QNWLOCK="common/4g",3,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3}`;
console.log(atcmd);
break;
case "4":
atcmd = `AT+QNWLOCK="common/4g",4,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4}`;
console.log(atcmd);
break;
case "5":
atcmd = `AT+QNWLOCK="common/4g",5,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5}`;
console.log(atcmd);
break;
case "6":
atcmd = `AT+QNWLOCK="common/4g",6,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6}`;
console.log(atcmd);
break;
case "7":
atcmd = `AT+QNWLOCK="common/4g",7,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7}`;
console.log(atcmd);
break;
case "8":
atcmd = `AT+QNWLOCK="common/4g",8,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7},${this.earfcn8},${this.pci8}`;
console.log(atcmd);
break;
case "9":
atcmd = `AT+QNWLOCK="common/4g",9,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7},${this.earfcn8},${this.pci8},${this.earfcn9},${this.pci9}`;
console.log(atcmd);
break;
case "10":
atcmd = `AT+QNWLOCK="common/4g",10,${this.earfcn1},${this.pci1},${this.earfcn2},${this.pci2},${this.earfcn3},${this.pci3},${this.earfcn4},${this.pci4},${this.earfcn5},${this.pci5},${this.earfcn6},${this.pci6},${this.earfcn7},${this.pci7},${this.earfcn8},${this.pci8},${this.earfcn9},${this.pci9},${this.earfcn10},${this.pci10}`;
console.log(atcmd);
break;
default:
console.log(atcmd);
this.isError = true;
this.startCountdown();
console.error("Invalid frequency number.");
return;
} }
}
if (this.networkMode2 === "NR5G-SA") { this.isLocking = true;
atcmd = `AT+QNWLOCK="common/4g",${this.cellNum}`;
for (let i = 1; i <= parseInt(this.cellNum); i++) {
atcmd += `,${this["earfcn" + i]},${this["pci" + i]}`;
}
console.log(atcmd);
} else if (this.networkMode2 === "NR5G-SA") {
this.isLocking = true;
atcmd = `AT+QNWLOCK="common/5g",${this.pci1},${this.earfcn1},${this.scs},${this.band}`; atcmd = `AT+QNWLOCK="common/5g",${this.pci1},${this.earfcn1},${this.scs},${this.band}`;
console.log(atcmd); console.log(atcmd);
} }
this.sendAtCommand(atcmd); this.sendAtCommand(atcmd);
}, },
restoreBands() { restoreBands() {
@@ -799,7 +762,7 @@
}) })
) )
.then(() => { .then(() => {
console.log("Enable Success.") console.log("Enable Success.");
// Show a temporary loading query message // Show a temporary loading query message
this.queryCommandResponse = this.queryCommandResponse =
"Enabling NSA cell scan. Please wait..."; "Enabling NSA cell scan. Please wait...";