Package org.ka2ddo.aprs
Class PositionReport
java.lang.Object
org.ka2ddo.ax25.AX25Message
org.ka2ddo.aprs.Message
org.ka2ddo.aprs.PositionMessage
org.ka2ddo.aprs.PositionReport
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<AX25Message>
,CommentedMessage
,SendableMessage
This class defines a APRS Position Report message (APRS protocol specification chapter 6).
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
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, enabledForTransmit, fLatitude, fLatPrecision, fLongitude, fmtMonitorFreq, HMS, HUNDREDTH_MINUTE_F, isCustom, latitude, LN_BASE1_08, longitude, ONE_DEGREE_F, ONE_MINUTE_F, TEN_MINUTES_F, TENTH_MINUTE_F
Fields inherited from class org.ka2ddo.aprs.Message
appendCR, APRS_AND_OPENTRAC_AND_RAW, APRS_AND_RAW, comment, msgType, S_PERMANENT, S_PERMANENT_UC, symbolCode, symTableId
Fields inherited from class org.ka2ddo.ax25.AX25Message
APRS_AND_OPENTRAC, ax25Frame, extensions, invalid, originatingCallsign, originatingDest, PERMANENT, rcptTime, thirdParty, timestamp, UTC
-
Constructor Summary
ConstructorDescriptionPositionReport
(byte[] body, int offset, 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
Modifier and TypeMethodDescriptionvoid
Specify that message should no longer be transmitted.byte[]
getBody
(boolean countTransmission, ProtocolFamily protocolId, AX25Frame frame) Get an instance of this message, suitable for transmitting.Get the protocol family or families that this message corresponds to, so ports that don't support all protocols will not forward inappropriate packets.boolean
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, getLatitude, getLatitudeAccuracy, getLongitude, hasPosition, isCustom, isEnabled, isShowDate, looksLikeFrequency, looksLikeFrequency, paramString, setAbc, setAmbiguity, setCustom, 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, getExtensionString, getMsgType, getPrecedence, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isAppendCR, isSymbolInferred, looksLikeLongFormatLatitude, setAppendCR, setComment, setSymbolCode, setSymTableId, toString
Methods inherited from class org.ka2ddo.ax25.AX25Message
equals, extractSource, getAx25Frame, getExtension, getFirstDigipeat, getLastDigipeat, getNthDigipeat, getOriginalDestination, getOriginalSource, getOriginatingCallsign, getOriginatingDest, getRcptTime, getReadOnlyExtensionMap, getTimestamp, hashCode, hasThisFirstDigi, indexOf, indexOf, isDirect, isInvalid, isRf, onlyDigits, onlyDigits, onlyDigitsOrMinus, onlyDigitsOrPeriod, onlyDigitsOrSpace, onlyDigitsPlus, onlyPeriods, setAx25Frame, setInvalid, setOriginatingCallsign, setRcptTime, setTimestamp, split, storeExtension
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 Details
-
PositionReport
public PositionReport(byte[] body, int offset, String tp, long rcvTimestamp) throws IllegalArgumentException Constructor for Position message when decoding a binary AX.25 frame.- Parameters:
body
- byte array of frame bodyoffset
- 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 wrapperrcvTimestamp
- Unix time when message was actually received by YAAC- Throws:
IllegalArgumentException
- if body has invalid syntax in any fields
-
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 UTCencodeCompressed
- boolean true if encoding of this message into APRS format should use compressed encodingmsgType
- char to use for APRS message type; caller is required to ensure this is legal by APRS protocol specification
-
-
Method Details
-
getBody
Get an instance of this message, suitable for transmitting.- Specified by:
getBody
in interfaceSendableMessage
- Parameters:
countTransmission
- number of times this message has been transmittedprotocolId
- AX.25 protocol ID to format this message inframe
- AX25Frame into which the message will be placed, so any alternate AX25Message can be linked to it- Returns:
- byte array of message
- See Also:
-
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 classPositionMessage
- Returns:
- boolean true if compressed encoding in use
-
disableForTransmit
public void disableForTransmit()Specify that message should no longer be transmitted.- Specified by:
disableForTransmit
in interfaceSendableMessage
-
getProtocols
Get the protocol family or families that this message corresponds to, so ports that don't support all protocols will not forward inappropriate packets.- Overrides:
getProtocols
in classMessage
- Returns:
- array of supported ProtocolFamily enums
-