Package lejos.hardware.gps
Class GPS
- java.lang.Object
-
- java.lang.Thread
-
- lejos.hardware.gps.SimpleGPS
-
- lejos.hardware.gps.GPS
-
- All Implemented Interfaces:
java.lang.Runnable
public class GPS extends SimpleGPS
This class manages data received from a GPS Device. GPS Class manages the following NMEA Sentences: GPRMC GPGSV GPGSA GPGGA (superclass) GPVTG (superclass)- Author:
- BB, Juan Antonio Brenha Moral
-
-
Field Summary
-
Fields inherited from class lejos.hardware.gps.SimpleGPS
ggaSentence, gsaSentence, vtgSentence
-
-
Constructor Summary
Constructors Constructor Description GPS(java.io.InputStream in)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetCompassDegrees()Return Compass Degrees in a range: 0.0-359.9java.util.DategetDate()Return a Date Object with data from GGA and RMC NMEA SentenceSatellitegetSatellite(int index)Get NMEA Satellite.intgetSatellitesInView()The satellites in view is a list of satellites the GPS could theoretically connect to (i.e.intgetSatellitesTracked()Returns the number of satellites being tracked to determine the coordinates.protected voidsentenceChooser(java.lang.String header, java.lang.String s)Internal helper method to aid in the subclass architecture.-
Methods inherited from class lejos.hardware.gps.SimpleGPS
addListener, close, getAltitude, getCourse, getFixMode, getFixType, getHDOP, getLatitude, getLatitudeDirection, getLongitude, getLongitudeDirection, getPDOP, getPRN, getSelectionType, getSpeed, getTimeStamp, getVDOP, notifyListeners, removeListener, run
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
getCompassDegrees
public float getCompassDegrees()
Return Compass Degrees in a range: 0.0-359.9- Returns:
- the compass degrees
-
getDate
public java.util.Date getDate()
Return a Date Object with data from GGA and RMC NMEA Sentence- Returns:
- the date
-
getSatellite
public Satellite getSatellite(int index)
Get NMEA Satellite. The satellite list is retrieved from the almanac data. Satellites are ordered by their elevation: highest elevation (index 0) -> lowest elevation.- Parameters:
index- the satellite index- Returns:
- the NMEASaltellite object for the selected satellite
-
getSatellitesTracked
public int getSatellitesTracked()
Returns the number of satellites being tracked to determine the coordinates. This method overwrites the superclass method and returns the number from the GSV sentence.- Overrides:
getSatellitesTrackedin classSimpleGPS- Returns:
- Number of satellites e.g. 8
-
getSatellitesInView
public int getSatellitesInView()
The satellites in view is a list of satellites the GPS could theoretically connect to (i.e. satellites that are not over the earth's horizon). The getSatellitesInView() method will always return an equal or greater number than getSatellitesTracked().- Returns:
- Number of satellites e.g. 8
-
sentenceChooser
protected void sentenceChooser(java.lang.String header, java.lang.String s)Internal helper method to aid in the subclass architecture. Overwrites the superclass method and calls it internally.- Overrides:
sentenceChooserin classSimpleGPS- Parameters:
header-s-
-
-