|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread lejos.addon.gps.SimpleGPS
public class SimpleGPS
This class manages data received from a GPS Device. SimpleGPS Class manages the following NMEA Sentences which supply location, heading, and speed data:
This class is primarily for use by the javax.microedition.location package. The preferred class to use for obtaining GPS data is the GPS class.
Field Summary | |
---|---|
int |
errors
|
protected GGASentence |
ggaSentence
|
protected static Vector |
listeners
|
protected VTGSentence |
vtgSentence
|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
SimpleGPS(InputStream in)
The constructor. |
Method Summary | |
---|---|
static void |
addListener(GPSListener listener)
add a listener to manage events with GPS |
void |
close()
Method used to close connection. |
float |
getAltitude()
The altitude above mean sea level |
float |
getCourse()
Get the course heading of the GPS unit. |
int |
getFixMode()
Fix quality: 0 = invalid 1 = GPS fix (SPS) 2 = DGPS fix 3 = PPS fix 4 = Real Time Kinematic 5 = Float RTK 6 = estimated (dead reckoning) (2.3 feature) 7 = Manual input mode 8 = Simulation mode |
int |
getFixType()
3D fix - values include: 1 = no fix 2 = 2D fix 3 = 3D fix |
float |
getHDOP()
Get the Horizontal Dilution of Precision (HDOP). |
double |
getLatitude()
Get Latitude |
char |
getLatitudeDirection()
Get Latitude Direction |
double |
getLongitude()
Get Longitude |
char |
getLongitudeDirection()
Get Longitude Direction |
float |
getPDOP()
Get the 3D Position Dilution of Precision (PDOP). |
int[] |
getPRN()
Get an Array of Pseudo-Random Noise codes (PRN). |
int |
getSatellitesTracked()
Returns the number of satellites being tracked to determine the coordinates. |
String |
getSelectionType()
Selection type of 2D or 3D fix 'M' = manual 'A' = automatic |
float |
getSpeed()
Get speed in kilometers per hour |
int |
getTimeStamp()
Get the last time stamp from the satellite for GGA sentence. |
float |
getVDOP()
Get the Vertical Dilution of Precision (VDOP). |
protected static void |
notifyListeners(NMEASentence sen)
|
static void |
removeListener(GPSListener listener)
Remove a listener |
void |
run()
Keeps reading sentences from GPS receiver stream and extracting data. |
protected void |
sentenceChooser(String header,
String s)
Internal helper method to aid in the subclass architecture. |
Methods inherited from class java.lang.Thread |
---|
currentThread, getName, getPriority, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, setDaemon, setName, setPriority, sleep, start, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int errors
protected GGASentence ggaSentence
protected VTGSentence vtgSentence
protected static Vector listeners
Constructor Detail |
---|
public SimpleGPS(InputStream in)
in
- An input stream from the GPS receiverMethod Detail |
---|
public double getLatitude()
public char getLatitudeDirection()
public double getLongitude()
public char getLongitudeDirection()
public float getAltitude()
public int getSatellitesTracked()
public int getFixMode()
public int getTimeStamp()
public float getSpeed()
public float getCourse()
public String getSelectionType()
public int getFixType()
public int[] getPRN()
public float getPDOP()
public float getHDOP()
public float getVDOP()
public void close() throws IOException
IOException
public void run()
protected void sentenceChooser(String header, String s)
header
- s
- protected static void notifyListeners(NMEASentence sen)
public static void addListener(GPSListener listener)
listener
- public static void removeListener(GPSListener listener)
listener
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |