org.ka2ddo.aprs
Class PositionReport

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

public class PositionReport
extends PositionMessage
implements SendableMessage

This class defines a APRS Position Report message (APRS protocol specification chapter 6).

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.PositionMessage
abc, altitude, altitudeUnit, COMPRESSED_LAT_SCALING, CONV_MPH_TO_METERS_PER_SEC, DHM, fLatitude, fLatPrecision, fLongitude, fmtMonitorFreq, HMS, isCustom, latitude, LN_BASE1_08, longitude, MDHM
 
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
PositionReport(byte[] body, int offset, java.lang.String tp, long rcvTimestamp)
          Constructor for Position message when decoding a binary AX.25 frame.
PositionReport(long now, boolean encodeCompressed, char msgType)
          Alternate constructor for creating a non-timestamped locally originated PositionReport.
 
Method Summary
 byte[] getBody(boolean countTransmission, byte protocolId, AX25Frame frame)
          Get an instance of this message, suitable for transmitting.
 boolean isUsingCompressedFormat()
          Indicates whether this PositionMessage is using compressed-mode (but not Mic-E) encoding of latitude and longitude, because this affects what are legal symbol overlay codes.
 
Methods inherited from class org.ka2ddo.aprs.PositionMessage
appendAreaParameters, appendRepeaterParameters, appendSignpostParameters, bodyEquals, createObjectFromThisPosition, decodeDataExtension, decodeLatitude, decodeLongitude, decodeOnlyLatitude, decodeOnlyLongitude, encodeLatitudeCompressed, encodeLatitudePlainText, encodeLongitudeCompressed, encodeLongitudePlainText, extractCompressedLatitude, extractCompressedLongitude, extractLatitude, extractLongitude, getAbc, getAltitude, getAltitudeUnit, getCustom, getLatitude, getLatitudeAccuracy, getLongitude, hasPosition, isEnabled, isShowDate, looksLikeFrequency, looksLikeFrequency, paramString, setAbc, setLatitude, setLocation, setLongitude, setShowDate, testIfValidCompressedLocation
 
Methods inherited from class org.ka2ddo.aprs.Message
compareTo, decodeDatestamp, decodeHurricaneParams, decodeTimestamp, decodeWeatherParams, decodeWeatherParams, dup, encodeTimestamp, extractComment, extractComment, extractSymbol, formatBody, getComment, getExtension, getExtensionString, getMsgType, getReadOnlyExtensionMap, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isSymbolInferred, looksLikeLongFormatLatitude, 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, 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, isEnabled
 

Constructor Detail

PositionReport

public PositionReport(byte[] body,
                      int offset,
                      java.lang.String tp,
                      long rcvTimestamp)
Constructor for Position 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

PositionReport

public PositionReport(long now,
                      boolean encodeCompressed,
                      char msgType)
Alternate constructor for creating a non-timestamped locally originated PositionReport.

Parameters:
now - current time in milliseconds since midnight 1 Jan 1970 UTC
encodeCompressed - boolean true if encoding of this message into APRS format should use compressed encoding
msgType - char to use for APRS message type; caller is required to ensure this is legal by APRS protocol specification
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 this message has been transmitted
protocolId - AX.25 protocol ID to format this message in
frame - AX25Frame into which the message will be placed, so any alternate AX25Message can be linked to it
Returns:
byte array of message
See Also:
AX25Frame.parsedAX25Msg

isUsingCompressedFormat

public boolean isUsingCompressedFormat()
Indicates whether this PositionMessage is using compressed-mode (but not Mic-E) encoding of latitude and longitude, because this affects what are legal symbol overlay codes.

Overrides:
isUsingCompressedFormat in class PositionMessage
Returns:
boolean true if compressed encoding in use