org.iu.gps
Class NMEA

java.lang.Object
  |
  +--org.iu.gps.NMEA

public class NMEA
extends java.lang.Object

NMEA0183 message parser. Uses reflection to be able to easily specify new NMEA messages (see below: sentenceDef).


Field Summary
static java.lang.String[] sentenceDef
          Definition of understood NMEA0183 sentences.
 
Constructor Summary
NMEA()
           
 
Method Summary
static void main(java.lang.String[] arg)
          Main method
static boolean parse(java.lang.String sentence, GPSInfo info)
          Parses a given NMEA0183 message (usually from GPS device) and automatically converts the parsed values to fit into the given info structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sentenceDef

public static final java.lang.String[] sentenceDef
Definition of understood NMEA0183 sentences. The values given here as symbolic names are taken as field names of the info object given to the parse method; values from the sentence are automatically converted to the field's type in the info object. E.g. the definition of
$GPTST,lat,long
specifies a new message that has the header $GPTST, and two parameters lat and long. Those two values are automatically parsed and stored inside the GPSInfo class, in the fields with names lat and long. The type of the value is automatically converted to fit the type of the fields.
Constructor Detail

NMEA

public NMEA()
Method Detail

parse

public static boolean parse(java.lang.String sentence,
                            GPSInfo info)
Parses a given NMEA0183 message (usually from GPS device) and automatically converts the parsed values to fit into the given info structure.
Parameters:
sentence - NMEA sentence to parse
info - Object to fill in values from sentence
Returns:
true if successful, false otherwise

main

public static void main(java.lang.String[] arg)
                 throws java.lang.Exception
Main method
Parameters:
arg - User arguments
Throws:
java.lang.Exception - Throws all exeptions