public class GPSParser extends java.lang.Object implements DebugCtl.DbgListener
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
parseNMEA0183DataLine(java.lang.String line,
GpsFix fix,
SatelliteCatalog satCatalog,
java.lang.String source)
Parse an NMEA-0183 standard data sentence into GPS data structure values.
|
static boolean |
registerSentenceParser(java.lang.String sentenceName,
GPSSentenceParser parser)
Register a parser for a particular NMEA-0183 sentence.
|
void |
setDebug(java.lang.String categoryName,
boolean setting)
Specify if a specific category of debug messages should be printed out.
|
protected static java.lang.String[] |
split(java.lang.String line,
char separator)
This is a more optimized version of String.split() that doesn't require
compiling and evaluating regular expression patterns to do it, thereby
saving chunks of transient heap (and probably some CPU time as well).
|
static boolean |
unregisterSentenceParser(java.lang.String sentenceName)
Unregister a parser for a particular NMEA-0183 sentence.
|
public void setDebug(java.lang.String categoryName, boolean setting)
setDebug
in interface DebugCtl.DbgListener
categoryName
- String name of category to enable debug logging forsetting
- boolean true or false to enable or disable debugging this categorypublic static java.lang.Object parseNMEA0183DataLine(java.lang.String line, GpsFix fix, SatelliteCatalog satCatalog, java.lang.String source)
line
- String line to parsefix
- GpsFix data structure to populate, or null if a new one should be allocatedsatCatalog
- SatelliteCatalog data structure to populate, or null if a new one should be allocatedsource
- callsign of source (used only for error messages)public static boolean registerSentenceParser(java.lang.String sentenceName, GPSSentenceParser parser)
sentenceName
- String sentence name, starting with the '$' character and ending just
before the delimiting comma; if multiple constellations are to
be supported by a parser, the same parser must be registered for
each variant, i.e., $GPTXT and $GATXT.parser
- GPSSentenceParser instance to call for the specified sentence namepublic static boolean unregisterSentenceParser(java.lang.String sentenceName)
sentenceName
- String sentence name, starting with the '$' character and ending just
before the delimiting comma; if multiple constellations are to
be supported by a parser, the same parser must be registered for
each variant, i.e., $GPTXT and $GATXT.protected static java.lang.String[] split(java.lang.String line, char separator)
line
- the String to split at occurrences of the separatorseparator
- the char delimiting substrings of the line