Jump to content

OTA PACKET PARSER: Difference between revisions

From Transight Wiki
No edit summary
No edit summary
Line 18: Line 18:
</head>
</head>
<body>
<body>
<h2>OTA Packet Parser</h2>
<h2>OTA Packet Parser</h2>
<textarea id="hexInput" placeholder="Paste packet here..."></textarea><br>
<textarea id="hexInput" placeholder="Paste OTA packet hex here..."></textarea><br>
<button onclick="parseTelemetry()">Parse Packet</button>
<button id="parseBtn">Parse OTA Packet</button>


<h3>Parsed Output:</h3>
<h3>Parsed Output:</h3>
Line 52: Line 53:
}
}


// Correct IMEI parser from hex (BCD)
function parseIMEIFromHex(hex, bitStart, bitEnd) {
function parseIMEIFromHex(hex, bitStart, bitEnd) {
   const byteStart = bitStart / 8;
   const byteStart = bitStart / 8;
Line 85: Line 85:
   };
   };


   // Correct IMEI using hex logic, not bit-based bigint
   // ✅ Corrected IMEI bit range: 24–74
   const imei = parseIMEIFromHex(hex, 25, 75);
   const imei = parseIMEIFromHex(hex, 24, 74);
   output("IMEI", imei);
   output("IMEI", imei);


Line 125: Line 125:
   output("Response", bitsToAscii(respBits));
   output("Response", bitsToAscii(respBits));
}
}
// ✅ Attach parse function to button click
document.getElementById("parseBtn").addEventListener("click", parseOTAPacket);
</script>
</script>
</body>
</body>
</html>
</html>

Revision as of 09:41, 21 July 2025

OTA Packet Parser

OTA Packet Parser


Parsed Output:

FieldValue