05.03.2013 Views

Data Hacking

Data Hacking

Data Hacking

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9 — Examining the <strong>Data</strong><br />

BWC (Bearing and Distance to Waypoint Using a Great Circle Route)<br />

This represents time, distance, bearing to, and location of a specified waypoint from the present<br />

position calculated along the great circle path. The great circle path means along the surface of<br />

the earth as opposed to a straight-line path.<br />

$GPBWC,hhmmss,llll.ll,e,yyyyy.yy,f,xxx,T,yyy,M,zzz,N,###*hh<br />

hhmmss UTC time<br />

1111.11 Destination waypoint latitude<br />

e N or S (for latitude)<br />

yyyyy.yy Destination waypoint longitude<br />

f E or W (for longitude)<br />

xxx Bearing to waypoint (degrees True)<br />

T Degrees True<br />

yyy Bearing to waypoint (degrees Magnetic)<br />

M Degrees Magnetic<br />

zzz Distance to waypoint (measured in nautical miles)<br />

N Nautical miles<br />

### Waypoint ID<br />

*hh Checksum<br />

NMEA Checksum<br />

You may have noticed the checksum that appears at the end of the NMEA sentences. If you<br />

are wondering what this is and how it is calculated, it’s not that tricky, and it generally only<br />

applies to mathematicians and programmers.<br />

The checksum is always a two-character hexadecimal number. It is determined by looking at all<br />

the characters that fall between the $ symbol and the * symbol, converting them to byte values<br />

and then performing an exclusive OR or XOR on the bytes and then converting the final byte<br />

checksum to hexadecimal.<br />

You can find numerous examples of code on the web that will show you how to check this<br />

value in a variety of languages. Using your favorite search engine, enter the words “NMEA<br />

checksum” and you will find hundreds of code samples in several languages.<br />

This might seem rather academic, but if you plan to write applications that interface with GPS<br />

receivers and work on the NMEA sentences, then checking the checksum is vital.<br />

205

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!