Merge branch 'development' of https://github.com/iamromulan/quectel-rgmii-toolkit into development
This commit is contained in:
@@ -682,10 +682,17 @@
|
|||||||
|
|
||||||
// --- Temperature ---
|
// --- Temperature ---
|
||||||
// find this example value from lines "+QTEMP:"cpuss-0-usr","50"
|
// find this example value from lines "+QTEMP:"cpuss-0-usr","50"
|
||||||
this.temperature = lines
|
try {
|
||||||
.find((line) => line.includes('+QTEMP:"cpuss-0-usr"'))
|
this.temperature = lines
|
||||||
.split(",")[1]
|
.find((line) => line.includes('+QTEMP:"cpuss-0-usr"'))
|
||||||
.replace(/"/g, "");
|
.split(",")[1]
|
||||||
|
.replace(/"/g, "");
|
||||||
|
} catch (error) {
|
||||||
|
this.temperature = lines
|
||||||
|
.find((line) => line.includes('+QTEMP:"cpu0-a7-usr"'))
|
||||||
|
.split(",")[1]
|
||||||
|
.replace(/"/g, "");
|
||||||
|
}
|
||||||
|
|
||||||
// --- SIM Status ---
|
// --- SIM Status ---
|
||||||
// find this example value from lines "+QSIMSTAT: 0,1"
|
// find this example value from lines "+QSIMSTAT: 0,1"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ function parseCurrentSettings(rawdata) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
this.apn = lines
|
this.apn = lines
|
||||||
.find((line) => line.includes("+CGCONTRDP: 1,0"))
|
.find((line) => line.includes("+CGCONTRDP: 1"))
|
||||||
.split(",")[2]
|
.split(",")[2]
|
||||||
.replace(/\"/g, "");
|
.replace(/\"/g, "");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -49,10 +49,22 @@ function parseCurrentSettings(rawdata) {
|
|||||||
.replace(/\"/g, "");
|
.replace(/\"/g, "");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.bands = lines
|
const PCCbands = lines
|
||||||
.find((line) => line.includes("+QCAINFO:"))
|
.find((line) => line.includes('+QCAINFO: "PCC"'))
|
||||||
.split(",")[3]
|
.split(",")[3]
|
||||||
.replace(/\"/g, "");
|
.replace(/\"/g, "");
|
||||||
|
|
||||||
|
// Loop over all QCAINFO: "SCC" lines and get the bands
|
||||||
|
try {
|
||||||
|
const SCCbands = lines
|
||||||
|
.filter((line) => line.includes('+QCAINFO: "SCC"'))
|
||||||
|
.map((line) => line.split(",")[3].replace(/\"/g, ""))
|
||||||
|
.join(", ");
|
||||||
|
this.bands = `${PCCbands}, ${SCCbands}`;
|
||||||
|
} catch (error) {
|
||||||
|
this.bands = PCCbands;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.bands = "Failed fetching bands";
|
this.bands = "Failed fetching bands";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function populateCheckboxes(lte_band, nsa_nr5g_band, nr5g_band, locked_lte_bands
|
|||||||
checkboxesForm.innerHTML = ""; // Clear existing checkboxes
|
checkboxesForm.innerHTML = ""; // Clear existing checkboxes
|
||||||
|
|
||||||
var bandsArray;
|
var bandsArray;
|
||||||
if (bands !== null) {
|
if (bands !== null && bands !== "0") {
|
||||||
bandsArray = bands.split(":");
|
bandsArray = bands.split(":");
|
||||||
bandsArray.forEach(function(band, index) {
|
bandsArray.forEach(function(band, index) {
|
||||||
if (index % 5 === 0) {
|
if (index % 5 === 0) {
|
||||||
@@ -68,7 +68,11 @@ function populateCheckboxes(lte_band, nsa_nr5g_band, nr5g_band, locked_lte_bands
|
|||||||
currentRow.appendChild(checkboxDiv);
|
currentRow.appendChild(checkboxDiv);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Do nothing
|
// Create a text saying that no bands are available
|
||||||
|
var noBandsText = document.createElement("p");
|
||||||
|
noBandsText.className = "text-center";
|
||||||
|
noBandsText.innerText = "No supported bands available";
|
||||||
|
checkboxesForm.appendChild(noBandsText);
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentRow;
|
var currentRow;
|
||||||
|
|||||||
@@ -132,6 +132,18 @@
|
|||||||
Reset
|
Reset
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
value=""
|
||||||
|
id="providerBands"
|
||||||
|
onchange="saveCheckboxState()"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="providerBands">
|
||||||
|
Show Provider Supported Bands
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer">
|
<div class="card-footer">
|
||||||
@@ -488,15 +500,34 @@
|
|||||||
rawdata: null,
|
rawdata: null,
|
||||||
|
|
||||||
getSupportedBands() {
|
getSupportedBands() {
|
||||||
const atcmd = 'AT+QNWPREFCFG="policy_band"';
|
// Load the checkbox state from localStorage
|
||||||
this.sendATcommand(atcmd)
|
const isChecked =
|
||||||
.then((rawdata) => {
|
localStorage.getItem("providerBandsChecked") === "true";
|
||||||
this.rawdata = rawdata;
|
const providerBands = document.getElementById("providerBands");
|
||||||
this.parseSupportedBands(rawdata);
|
providerBands.checked = isChecked;
|
||||||
})
|
|
||||||
.then(() => {
|
// If the checkbox is checked, then show only the provider bands
|
||||||
this.getLockedBands();
|
if (providerBands.checked) {
|
||||||
});
|
const atcmd = 'AT+QNWPREFCFG="ue_capability_band"';
|
||||||
|
this.sendATcommand(atcmd)
|
||||||
|
.then((rawdata) => {
|
||||||
|
this.rawdata = rawdata;
|
||||||
|
this.parseSupportedBands(rawdata);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getLockedBands();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
const atcmd = 'AT+QNWPREFCFG="policy_band"';
|
||||||
|
this.sendATcommand(atcmd)
|
||||||
|
.then((rawdata) => {
|
||||||
|
this.rawdata = rawdata;
|
||||||
|
this.parseSupportedBands(rawdata);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.getLockedBands();
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
parseSupportedBands(rawdata) {
|
parseSupportedBands(rawdata) {
|
||||||
@@ -613,7 +644,6 @@
|
|||||||
'AT+QUIMSLOT?;+CGCONTRDP=1;+QNWLOCK="common/4g";+QNWLOCK="common/5g";+QNWPREFCFG="mode_pref";+QNWPREFCFG="nr5g_disable_mode";+QCAINFO;+CGDCONT?';
|
'AT+QUIMSLOT?;+CGCONTRDP=1;+QNWLOCK="common/4g";+QNWLOCK="common/5g";+QNWPREFCFG="mode_pref";+QNWPREFCFG="nr5g_disable_mode";+QCAINFO;+CGDCONT?';
|
||||||
|
|
||||||
this.sendATcommand(atcmd).then((rawdata) => {
|
this.sendATcommand(atcmd).then((rawdata) => {
|
||||||
console.log(rawdata);
|
|
||||||
const settings = parseCurrentSettings(rawdata);
|
const settings = parseCurrentSettings(rawdata);
|
||||||
this.sim = settings.sim;
|
this.sim = settings.sim;
|
||||||
this.apn = settings.apn;
|
this.apn = settings.apn;
|
||||||
@@ -622,8 +652,6 @@
|
|||||||
this.prefNetwork = settings.prefNetwork;
|
this.prefNetwork = settings.prefNetwork;
|
||||||
this.nrModeControl = settings.nrModeControl;
|
this.nrModeControl = settings.nrModeControl;
|
||||||
this.bands = settings.bands;
|
this.bands = settings.bands;
|
||||||
|
|
||||||
console.log(settings);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
lockSelectedBands() {
|
lockSelectedBands() {
|
||||||
@@ -639,19 +667,16 @@
|
|||||||
atcmd = `AT+QNWPREFCFG="lte_band",${newCheckedValues.join(
|
atcmd = `AT+QNWPREFCFG="lte_band",${newCheckedValues.join(
|
||||||
":"
|
":"
|
||||||
)}`;
|
)}`;
|
||||||
console.log(atcmd);
|
|
||||||
this.sendATcommand(atcmd);
|
this.sendATcommand(atcmd);
|
||||||
} else if (selectedMode === "NSA") {
|
} else if (selectedMode === "NSA") {
|
||||||
atcmd = `AT+QNWPREFCFG="nsa_nr5g_band",${newCheckedValues.join(
|
atcmd = `AT+QNWPREFCFG="nsa_nr5g_band",${newCheckedValues.join(
|
||||||
":"
|
":"
|
||||||
)}`;
|
)}`;
|
||||||
console.log(atcmd);
|
|
||||||
this.sendATcommand(atcmd);
|
this.sendATcommand(atcmd);
|
||||||
} else if (selectedMode === "SA") {
|
} else if (selectedMode === "SA") {
|
||||||
atcmd = `AT+QNWPREFCFG="nr5g_band",${newCheckedValues.join(
|
atcmd = `AT+QNWPREFCFG="nr5g_band",${newCheckedValues.join(
|
||||||
":"
|
":"
|
||||||
)}`;
|
)}`;
|
||||||
console.log(atcmd);
|
|
||||||
this.sendATcommand(atcmd);
|
this.sendATcommand(atcmd);
|
||||||
} else {
|
} else {
|
||||||
alert("Invalid network mode selected");
|
alert("Invalid network mode selected");
|
||||||
@@ -707,8 +732,6 @@
|
|||||||
ATNetwork = "";
|
ATNetwork = "";
|
||||||
ATNRMode = "";
|
ATNRMode = "";
|
||||||
|
|
||||||
console.log(this.newApnIP);
|
|
||||||
|
|
||||||
if (newApn !== null) {
|
if (newApn !== null) {
|
||||||
if (this.newApnIP === "1") {
|
if (this.newApnIP === "1") {
|
||||||
atAPN = `+CGDCONT=1,"IPV4","${newApn}";`;
|
atAPN = `+CGDCONT=1,"IPV4","${newApn}";`;
|
||||||
@@ -945,6 +968,32 @@
|
|||||||
checkbox.checked = false;
|
checkbox.checked = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Function for setting the provider bands checkbox and fetching the bands
|
||||||
|
document
|
||||||
|
.getElementById("providerBands")
|
||||||
|
.addEventListener("change", function () {
|
||||||
|
cellLocking().getSupportedBands();
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", (event) => {
|
||||||
|
loadCheckboxState();
|
||||||
|
});
|
||||||
|
|
||||||
|
function saveCheckboxState() {
|
||||||
|
const providerBandsCheckbox = document.getElementById("providerBands");
|
||||||
|
localStorage.setItem(
|
||||||
|
"providerBandsChecked",
|
||||||
|
providerBandsCheckbox.checked
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadCheckboxState() {
|
||||||
|
const providerBandsCheckbox = document.getElementById("providerBands");
|
||||||
|
const isChecked =
|
||||||
|
localStorage.getItem("providerBandsChecked") === "true";
|
||||||
|
providerBandsCheckbox.checked = isChecked;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="js/dark-mode.js"></script>
|
<script src="js/dark-mode.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user