
AHRS - Advanced Configuration - User Guide
MU-AHRS-AN-002 Ed. E November 2015
26
Appendices
A
NMEA
C
HECKSUM
W
EB
P
AGE
To get a simple NMEA computation tool, copy following code into a new file (nmea.html)
and save it, and open this file with your internet navigator:
<html><head><title>NMEA MTK checksum calculator</title>
<script><!--
function updateChecksum(cmd)
{
var checksum = 0;
for(var i = 0; i < cmd.length; i++) checksum = checksum ^ cmd.charCodeAt(i);
var hexsum = Number(checksum).toString(16).toUpperCase();
if (hexsum.length < 2) hexsum = ("00" + hexsum).slice(-2);
settext(document.getElementById("output"), "$" + cmd + "*" + hexsum);
}
function settext(span, text)
{
if (!span.hasChildNodes()) {
span.appendChild(span.ownerDocument.createTextNode(text));
return;
} else span.firstChild.nodeValue = text;
}
--></script></head><body>
<h1>MTK NMEA checksum calculator</h1>
<p>This is a simple calculator to compute the checksum field of NMEA frames.</p>
<p> The checksum is simple, just an XOR of all the bytes between the
<tt>$</tt> and the <tt>*</tt> (not including the delimiters themselves), and written in
hexadecimal.</p>
<p>For this to work you'll need to be using a browser that supports JavaScript and DHTML
(most modern browsers do).</p>
<div style="margin:1em; padding: 2em; background: #ddddff;">
<form onsubmit="document.getElementById('commandfld').select(); return false;">
<table>
<tr><th align=right>Command:</th><td><tt>$<input id="commandfld" size=80 type="text"
onchange="updateChecksum(this.value);"
value="PIXSE,CONFIG,WAKEUP">*</tt></td></tr>
<tr><th align=right>With checksum:</th><td><span id="output" style="font-family:
monospace;"></span></td></tr>
</table></form></div>
<script>updateChecksum(document.getElementById("commandfld").value);</script>
<hr></body></html>
Содержание Octans
Страница 1: ...AHRS Advanced Configuration User Guide...
Страница 2: ......