lejos.addon.gps
Class NMEASentence

java.lang.Object
  extended by lejos.addon.gps.NMEASentence
Direct Known Subclasses:
GGASentence, GSASentence, GSVSentence, RMCSentence, VTGSentence

public abstract class NMEASentence
extends Object

Class designed to manage all NMEA Sentence. GGA and RMC Sentence needs to validate data. This class has methods to validate received data

Author:
BB

Constructor Summary
NMEASentence()
           
 
Method Summary
abstract  String getHeader()
          Retrieve the header constant for this sentence.
 long getTimeStamp()
          This method returns the system time at which the data for the NMEA Sentence was collected.
static boolean isValid(String sentence)
          Return if your NMEA Sentence is valid or not
 void setSentence(String sentence)
          Set a new nmea sentence into the object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NMEASentence

public NMEASentence()
Method Detail

getHeader

public abstract String getHeader()
Retrieve the header constant for this sentence.

Returns:
The NMEA header string ($GPGGA, $GPVTG, etc...)

setSentence

public void setSentence(String sentence)
Set a new nmea sentence into the object

Parameters:
sentence -

getTimeStamp

public long getTimeStamp()
This method returns the system time at which the data for the NMEA Sentence was collected. It uses System.currentTimeMillis() to create the time stamp. Note: It might seem strange not to use the satellite time to time-stamp the data, but in fact the javax.microedition.location API calls for the system time.

Returns:
system time when the data was collected

isValid

public static boolean isValid(String sentence)
Return if your NMEA Sentence is valid or not

Parameters:
sentence - the NMEA sentence
Returns:
true iff the NMEA Sentence is true