|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.discotools.io.aprs.APRS
public final class APRS
Common fields and methods class.
APRS Report Format parser use fields and methods
in this class to parse common fields like
ALTITUDE
in comment text and
CSE/SPD
in APRS extensions.
All fields and methods are static.
Field Summary | |
---|---|
static String |
ALT
ALTITUDE in Comment Text (/A=aaaaaa) (p. 26, APRS Protocol version 1.0.1) This REGEX contains three groups: |
static String |
C_COORD
Compressed coordinate pattern |
static String |
C_CST
Compressed Extension Format (p. 39, APRS Protocol version 1.0.1) This REGEX contains four groups: |
static String |
C_EXT_CS
Compressed CSE/SPD (COURSE/SPEED) Extension Format (p. 38-39, APRS Protocol version 1.0.1) This REGEX contains two groups: |
static byte |
C_EXT_T_GGA
Compression Type (T) Byte - GGA (NMEA source) flag (p. 39, APRS Protocol version 1.0.1) This flag codifies that the extension field 'cs' is an ALTITUDE from a GGA sentences. |
static byte |
C_EXT_T_NMEA
Compression Type (T) Byte - NMEA flag mask (p. 39, APRS Protocol version 1.0.1) This mask is bitwise AND'ed with NMEA flags to detect NMEA source codified in the extension field 'T'. |
static String |
C_POS
Compressed LAT/LON position pattern |
static String |
EXT_CS
COURSE/SPEED Extension Format (p. 58,59, APRS Protocol version 1.0.1) This REGEX contains three groups: |
static String |
EXT_CS_BNRQ
BRG/NRQ (BEARING/NUMBER/RANGE/QUALITY) Extension Format (p. 34, APRS Protocol version 1.0.1) This REGEX contains five groups: |
static String |
LAT
Latitude pattern |
static String |
LON
Longitude pattern |
static String |
POS
LAT/LON position pattern |
static String |
TIME
Time stamp pattern |
static String |
VERSION
IO-APRS version string |
static String |
ZULU
Zulu (GMT+0) time zone pattern. |
Constructor Summary | |
---|---|
APRS()
|
Method Summary | |
---|---|
static double |
decodeCoord(String coord)
|
static double |
decodeLAT(String lat)
|
static double |
decodeLON(String lon)
|
static com.vividsolutions.jts.geom.Point |
decodePoint(String lat,
String lon)
|
static boolean |
isNMEASource(char type,
Byte source)
Check if given compression type byte is given NMEA source. |
static Matcher |
matcher(String regexp,
String data)
|
static String |
parseALT(AprsPosition report,
String data,
boolean decode)
Parse ALTITUDE from comment text or compressed extension field (p. 33, 38-40, APRS Protocol version 1.0.1) If decode true , ALTITUDE decoded as compressed extension data. |
static String |
parseBNRQ(AprsDirection report,
String extension)
Parse BRG/NRQ (bearing/number-range-quality) extension (p. 34, APRS Protocol version 1.0.1) This method should only be called from parseCS(AprsReport, String, boolean) ! |
static String |
parseCS(AprsReport report,
String extension,
boolean decode)
Parse CSE/SPD (COURSE/SPEED) extension (p. 33, 38-39, APRS Protocol version 1.0.1) If COURSE/SPEED extension format is found, current AprsReport.getExtension() is
merged and replaced with a new
AprsDirection instance. |
static AprsReport |
parsePOS(AprsPosition position,
String payload,
Matcher matcher,
int offset,
boolean decode)
Common Position Report and Extension payload parser This methods parse position report data from payload with POS and C_POS
format. |
static Pattern |
pattern(String regexp)
|
static String |
residue(String data,
Matcher matcher)
|
static String |
residue(String payload,
Matcher matcher,
int... groups)
|
static boolean |
setPoint(AprsPosition position,
String lat,
String lon,
boolean decode)
|
static void |
setSymbol(AprsReport report,
int table,
char code,
char overlay)
|
static boolean |
setTime(AprsReport report,
String field,
boolean isNMEA)
|
static boolean |
setTime(AprsReport report,
String date,
String time)
|
static byte[] |
toAddress(String callsign,
boolean toAX25)
Convert APRS callsign to AX.25 address This conversion is based on the method Callsign.toAX25() in javAPRSlib. |
static String |
toAPRS(byte[] packet)
Convert from AX.25 packet to APRS packet with "TNC-2" source path header format The packet should not include the |
static String |
toCallsign(byte[] packet,
int offset)
Convert AX.25 address to APRS callsign This conversion is based on the Callsign class constructor in javAPRSlib. |
static long |
toDate(String date,
String time)
Get timestamp value from Day/Month/Year (DMY) format. |
static long |
toDHM(String field,
boolean isZulu)
Get timestamp value from Day/Hours/Minutes (DHM) format. |
static long |
toHMS(String field,
boolean isNMEA,
boolean isZulu)
Get timestamp value from Hour/Minutes/Seconds (HMS) format. |
static long |
toMHDM(String field,
boolean isZulu)
Get timestamp value from Month/Day/Hours/Minutes (MDHM) format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERSION
public static final String ZULU
public static final String TIME
public static final String LAT
public static final String LON
public static final String POS
public static final String C_COORD
public static final String C_POS
public static final String EXT_CS
(p. 58,59, APRS Protocol version 1.0.1)
This REGEX contains three groups:
public static final String EXT_CS_BNRQ
(p. 34, APRS Protocol version 1.0.1)
This REGEX contains five groups:
public static final String ALT
(p. 26, APRS Protocol version 1.0.1)
This REGEX contains three groups:
public static final String C_EXT_CS
(p. 38-39, APRS Protocol version 1.0.1)
This REGEX contains two groups:
public static final String C_CST
(p. 39, APRS Protocol version 1.0.1)
This REGEX contains four groups:
public static final byte C_EXT_T_NMEA
(p. 39, APRS Protocol version 1.0.1)
This mask is bitwise AND'ed with NMEA flags to detect NMEA source codified in the extension field 'T'.
public static final byte C_EXT_T_GGA
Compression Type (T) Byte - GGA (NMEA source) flag
(p. 39, APRS Protocol version 1.0.1)
This flag codifies that the extension field 'cs' is an ALTITUDE from a GGA sentences.
Constructor Detail |
---|
public APRS()
Method Detail |
---|
public static final String toAPRS(byte[] packet) throws org.discotools.io.ParseException
The packet should not include the
packet
- - byte array with single AX.25 frame
org.discotools.io.ParseException
public static String toCallsign(byte[] packet, int offset)
This conversion is based on the Callsign class constructor in javAPRSlib.
packet
- offset
-
public static byte[] toAddress(String callsign, boolean toAX25) throws org.discotools.io.ParseException
This conversion is based on the method Callsign.toAX25() in javAPRSlib.
NOTE: SSIDs on AX.25 are constrained to the range [0,16] (integer). SSIDs on the
Internet (APRS-IS) however, are not constrained by the AX.25 address length in the
AX.25 header (maximum of 7 bytes), and therefore allow any characters in SSIDs. This method
will throw an ParseException
if SSID is not an integer in the range [0,16] (see
SSID documentation).
callsign
- toAX25
- - if true
, byte 0 through 5 are shifted to the left
(AX.25). If false
, the byte array is an APRS callsign in ASCII format
with a SSID in the range [0,16] (integer).
org.discotools.io.ParseException
- if SSID is not an integer in the range [0,16].public static final AprsReport parsePOS(AprsPosition position, String payload, Matcher matcher, int offset, boolean decode)
This methods parse position report data from
payload with POS
and C_POS
format. All APRS report formats which contains
uncompressed LAT
/LON
data,
contains the same position format. The difference is
the position field offset from the first
field in any given format. The same applies to
compressed LAT
/LON
data, which
this method is able to decode into uncompressed format.
Unsupported formats and extensions in parsed as comment text.
position
- - an AprsPosition
instance which data is parsed into.payload
- - payload containing position datamatcher
- - an REGEX matcher for any report format which contains data on common position formatoffset
- - position field offset from first field in given payloaddecode
- - if true
, position and extension data is decoded into uncompressed format.
AprsReport
public static String parseCS(AprsReport report, String extension, boolean decode)
(p. 33, 38-39, APRS Protocol version 1.0.1)
If COURSE/SPEED extension format is found,
current AprsReport.getExtension()
is
merged and replaced with a new
AprsDirection
instance.
report
- - AprsReport
instanceextension
- - APRS extension fielddecode
- - if true
, extension is compressed.
public static String parseALT(AprsPosition report, String data, boolean decode)
(p. 33, 38-40, APRS Protocol version 1.0.1)
If decode true
, ALTITUDE decoded as compressed extension data.
report
- - AprsReport
instancedata
- - APRS datadecode
- - if true
, extension data is compressed.
public static boolean isNMEASource(char type, Byte source)
(p. 39, APRS Protocol version 1.0.1)
type
- - compression type byte 'T'source
- - NMEA source flag
true
if source match type.public static String parseBNRQ(AprsDirection report, String extension)
(p. 34, APRS Protocol version 1.0.1)
This method should only be called from parseCS(AprsReport, String, boolean)
!
report
- - AprsReport
instanceextension
- - APRS extension field
public static boolean setPoint(AprsPosition position, String lat, String lon, boolean decode)
public static boolean setTime(AprsReport report, String field, boolean isNMEA)
public static boolean setTime(AprsReport report, String date, String time)
public static long toHMS(String field, boolean isNMEA, boolean isZulu) throws org.discotools.io.ParseException
(see page 22 in APRS specification 1.0.1 for complete list)
field
- - In NMEA sentences, a 6-character
timestamp: hour, minute, second UTC. In APRS Data,
a 7-character timestamp: hour, minute, second, zulu 'z'|'h' or local '/' time.isNMEA
- - if true
, field in NMEA sentenceisZulu
- - if true
, field should be parsed in Zulu (GMT=UTC) time
org.discotools.io.ParseException
public static long toMHDM(String field, boolean isZulu) throws org.discotools.io.ParseException
(see page 22 in APRS specification 1.0.1 for complete list)
field
- - a 8-byte timestamp: month, day, hour, minute
(used in positionless weather station reports).
org.discotools.io.ParseException
public static long toDHM(String field, boolean isZulu) throws org.discotools.io.ParseException
(see page 22 in APRS specification 1.0.1 for complete list)
field
- - a 7-character timestamp: day-of-the-month, hour, minute, zulu 'z'|'h' or local '/' time.
org.discotools.io.ParseException
- If not a valid DHM formatpublic static long toDate(String date, String time) throws org.discotools.io.ParseException
(NMEA GPRMC sentence)
date
- - a 6-character timestamp: day-of-month, month, yeartime
- - a 6-character timestamp: hourd, minutes, seconds, zulu
org.discotools.io.ParseException
public static com.vividsolutions.jts.geom.Point decodePoint(String lat, String lon)
public static double decodeLAT(String lat)
public static double decodeLON(String lon)
public static double decodeCoord(String coord)
public static Pattern pattern(String regexp)
public static Matcher matcher(String regexp, String data)
public static String residue(String data, Matcher matcher)
public static String residue(String payload, Matcher matcher, int... groups)
public static void setSymbol(AprsReport report, int table, char code, char overlay)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |