org.ka2ddo.aprs
Class StatusMessage

java.lang.Object
  extended by org.ka2ddo.ax25.AX25Message
      extended by org.ka2ddo.aprs.Message
          extended by org.ka2ddo.aprs.StatusMessage
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AX25Message>, CommentedMessage, SendableMessage

public class StatusMessage
extends Message
implements SendableMessage

This class decodes a Status message (APRS protocol specification chapter 16).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ka2ddo.ax25.AX25Message
AX25Message.Precedence
 
Field Summary
 
Fields inherited from class org.ka2ddo.aprs.Message
comment, extensions, msgType, S_PERMANENT, S_PERMANENT_UC, symbolCode, symTableId, USASCII
 
Fields inherited from class org.ka2ddo.ax25.AX25Message
ax25Frame, invalid, ISO_8859_1, originatingCallsign, PERMANENT, rcptTime, thirdParty, timestamp, UTC, UTF8
 
Constructor Summary
StatusMessage(byte[] body, int offset, java.lang.String tp, long rcvTimestamp)
          Constructor for Status message when decoding a binary AX.25 frame.
StatusMessage(long now, java.lang.String comment)
          Alternate constructor for creating transmittable StatusMessage.
 
Method Summary
 byte[] getBody(boolean countTransmission, byte protocolId, AX25Frame frame)
          Get an instance of this message, suitable for transmitting.
 boolean isEnabled()
          Test if message should still be transmitted.
 
Methods inherited from class org.ka2ddo.aprs.Message
bodyEquals, compareTo, decodeDatestamp, decodeHurricaneParams, decodeTimestamp, decodeWeatherParams, decodeWeatherParams, dup, encodeTimestamp, extractComment, extractComment, extractSymbol, formatBody, getComment, getExtension, getExtensionString, getMsgType, getReadOnlyExtensionMap, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isSymbolInferred, looksLikeLongFormatLatitude, paramString, setComment, setSymbolCode, setSymTableId, storeExtension, toString
 
Methods inherited from class org.ka2ddo.ax25.AX25Message
equals, extractSource, getAx25Frame, getFirstDigipeat, getLastDigipeat, getOriginalDestination, getOriginalSource, getOriginatingCallsign, getPrecedence, getRcptTime, getTimestamp, hashCode, hasPosition, hasThisFirstDigi, indexOf, indexOf, isInvalid, onlyDigits, onlyDigits, onlyDigitsOrPeriod, onlyDigitsOrSpace, onlyDigitsPlus, onlyPeriods, setAx25Frame, setInvalid, setOriginatingCallsign, setRcptTime, setTimestamp, split
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ka2ddo.ax25.SendableMessage
dup
 

Constructor Detail

StatusMessage

public StatusMessage(byte[] body,
                     int offset,
                     java.lang.String tp,
                     long rcvTimestamp)
Constructor for Status message when decoding a binary AX.25 frame.

Parameters:
body - byte array of frame body
offset - int array index offset for start of message (non-zero for encapsulated messages)
tp - third-party relay String for encapsulated messages, or null for no third-party wrapper
rcvTimestamp - Unix time when message was actually received by YAAC

StatusMessage

public StatusMessage(long now,
                     java.lang.String comment)
Alternate constructor for creating transmittable StatusMessage.

Parameters:
now - current time in Java milliseconds since midnight Jan 1 1970 UTC
comment - status String
Method Detail

getBody

public byte[] getBody(boolean countTransmission,
                      byte protocolId,
                      AX25Frame frame)
Get an instance of this message, suitable for transmitting.

Specified by:
getBody in interface SendableMessage
Parameters:
countTransmission - number of times the message has been transmitted.
protocolId - AX.25 protocol ID to generate the message in, or 0 for default protocol; currently, only NOLVL3 (APRS) and OPENTRAC are supported.
frame - AX25Frame into which the message will be placed; the decoded message (as opposed to the byte array encoding) should be stored into the field frame.parsedAX25Msg
Returns:
byte array of message, or null if message body cannot be generated in specified protocol, or retransmission count has been exceeded.
See Also:
AX25Frame.parsedAX25Msg

isEnabled

public boolean isEnabled()
Test if message should still be transmitted.

Specified by:
isEnabled in interface SendableMessage
Returns:
boolean true if message should still be transmitted