Sync Changes with development-SDXPINN

-Updated QuecManager to 0.0.2 from PR #87

- Change-log:

https: //github.com/iamromulan/quectel-rgmii-toolkit/pull/87
Co-Authored-By: Russel Yasol <73575327+dr-dolomite@users.noreply.github.com>
This commit is contained in:
iamromulan
2024-10-11 14:35:17 -04:00
parent 28c39a4829
commit be9ee7def5
27 changed files with 3156 additions and 436 deletions

View File

@@ -66,6 +66,19 @@ const DATA_MAP = {
}),
elementIds: ["IPv4", "IPv6"],
},
QGETCAPABILITY: {
// Changed from LTECATERGORY to match the actual command
parse: (response) => {
const lines = response.split("\n");
for (const line of lines) {
if (line.includes("LTE-CATEGORY")) {
return `CAT-${line.split(":").pop().trim()}`;
}
}
return "";
},
elementId: "lteCategory",
},
};
// DOM Element Selectors
@@ -240,39 +253,6 @@ async function saveIMEISetting() {
}
}
// Data Parsing Functions
function parseDeviceData(response, key) {
const dataMap = {
CGMI: (response) => response.split("\n")[1].trim(),
CGMM: (response) => response.split("\n")[1].trim(),
CGMR: (response) => response.split("\n")[1].trim(),
CNUM: (response) =>
response
.split("\n")[1]
.split(":")[1]
.split(",")[1]
.replace(/"/g, "")
.trim(),
CIMI: (response) => response.split("\n")[1].trim(),
ICCID: (response) => response.split("\n")[1].split(":")[1].trim(),
CGSN: (response) => response.split("\n")[1].trim(),
LANIP: (response) =>
response.split("\n")[1].split(":")[1].split(",")[3].trim(),
WWAN: (response) => ({
IPv4: response
.split("\n")[1]
.split(":")[1]
.split(",")[4]
.replace(/"/g, "")
.trim(),
IPv6: response.split("\n")[2].split(",")[4].replace(/"/g, "").trim(),
}),
};
return dataMap[key]?.(response);
}
// Data Fetching and Display
// Data Parsing and Update Functions
function updateDeviceInfo(key, value) {
const mapping = DATA_MAP[key];
@@ -317,6 +297,7 @@ async function fetchAboutData() {
Object.keys(DATA_MAP).forEach((key) => {
if (item.response.includes(key)) {
const value = DATA_MAP[key].parse(item.response);
console.log("Parsed value:", value);
updateDeviceInfo(key, value);
}
});