public class APRSStack extends java.lang.Object implements AX25ParserWithDistributor, DebugCtl.DbgListener
Message
Modifier and Type | Method and Description |
---|---|
static void |
addAprsMessageListener(AprsMessageListener listener)
Register an AprsMessageListener to be notified of incoming parsed APRS messages.
|
static APRSStack |
getInstance()
Get the singleton instance of APRSStack.
|
AX25Message |
parse(byte[] body,
AX25Callsign src,
AX25Callsign dest,
AX25Callsign[] digipeaters,
long rcvTimestamp,
Connector connector)
Parse a message to the appropriate object class.
|
static Message |
parse(byte[] body,
int offset,
AX25Callsign src,
AX25Callsign dest,
AX25Callsign[] digipeaters,
java.lang.String tp,
long rcvTimestamp,
Connector connector)
Analyze the contents of an AX.25 packet that appears to be identified as an APRS packet.
|
void |
processParsedAX25Packet(AX25Frame frame,
AX25Message parsedMsg)
Send this message (and its associated frame) to the APRS consumers.
|
static void |
removeAprsMessageListener(AprsMessageListener listener)
Unregister an AprsMessageListener to be notified of incoming parsed APRS messages.
|
void |
setDebug(java.lang.String categoryName,
boolean setting)
Specify if a specific category of debug messages should be printed out.
|
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 APRSStack getInstance()
public static Message parse(byte[] body, int offset, AX25Callsign src, AX25Callsign dest, AX25Callsign[] digipeaters, java.lang.String tp, long rcvTimestamp, Connector connector)
body
- byte array containing the packet bodyoffset
- zero-based starting index in the body array where the message is supposed to startsrc
- AX25Callsign of transmitting stationdest
- AX25Callsign of destination station (or tocall)digipeaters
- array of AX25Callsigns for the digipeaters of the frametp
- String of third party prefix, or null if no third-party prefix detected yetrcvTimestamp
- time (in milliseconds since Jan 1 1970 UTC) that message was receivedconnector
- Connector that received the packetpublic AX25Message parse(byte[] body, AX25Callsign src, AX25Callsign dest, AX25Callsign[] digipeaters, long rcvTimestamp, Connector connector)
parse
in interface AX25Parser
body
- byte array containing the message to be parsedsrc
- AX25Callsign of the sending stationdest
- AX25Callsign of the destination (probably an APRS alias)digipeaters
- array of AX25Callsigns for digipeaters, or null if nonercvTimestamp
- the time in Java/Unix milliseconds since midnight Jan 1, 1970 UTC when this
message was actually received (as opposed to any timestamp that might be
embedded in the message body)connector
- Connector over which the message was received (null if from a file)public static void addAprsMessageListener(AprsMessageListener listener)
listener
- AprsMessageListener to registerpublic static void removeAprsMessageListener(AprsMessageListener listener)
listener
- AprsMessageListener to unregisterpublic void processParsedAX25Packet(AX25Frame frame, AX25Message parsedMsg)
processParsedAX25Packet
in interface AX25ParserWithDistributor
frame
- AX25Frame containing the APRS messageparsedMsg
- AX25Message that was decoded from the frame