Package org.ka2ddo.aprs
Class TelemetryMessage
java.lang.Object
org.ka2ddo.ax25.AX25Message
org.ka2ddo.aprs.Message
org.ka2ddo.aprs.TelemetryMessage
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<AX25Message>
,CommentedMessage
,SendableMessage
This class contains a decoded APRS telemetry message (APRS protocol specification chapter 13).
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ka2ddo.ax25.AX25Message
AX25Message.Precedence
-
Field Summary
Modifier and TypeFieldDescriptionfloat[]
A 5-element array of the 5 non-boolean analog values in the telemetry message.int
A bitmask containing the 8 boolean digits from the telemetry message.static final int
Constant representing the decoded representation of the "MIC" sequence "number".int
The extracted sequence number of the telemetry data.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
ConstructorDescriptionCreate a TelemetryMessage suitable for transmission to another station.TelemetryMessage
(byte[] body, int offset, String tp, long rcvTimestamp) Constructor for a TelemetryMessage from an AX25Frame.TelemetryMessage
(PositionMessage pm, int startPos, int endPos) Construct a TelemetryMessage based on Base91 Telemetry data extracted from a PositionMessage's comment, per the proposed extension documented in http://he.fi/doc/aprs-base91-comment-telemetry.txt. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compare the contents of the body of the message, reporting if they match.void
Specify that message should no longer be transmitted.Encode this telemetry data in the format for base-91 appending to the comment of an APRS PositionReport, per http://he.fi/doc/aprs-base91-comment-telemetry.txt.byte[]
getBody
(boolean countTransmission, ProtocolFamily protocolId, AX25Frame frame) Get an instance of this message, suitable for transmitting.boolean
Test if message should still be transmitted.Descriptive text about this message, to be included in the toString() method's response.Methods inherited from class org.ka2ddo.aprs.Message
compareTo, decodeDatestamp, decodeHurricaneParams, decodeTimestamp, decodeWeatherParams, decodeWeatherParams, dup, encodeTimestamp, extractComment, extractComment, extractSymbol, formatBody, getComment, getExtensionString, getMsgType, getPrecedence, getProtocols, 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, hasPosition, 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
-
Field Details
-
MIC
public static final int MICConstant representing the decoded representation of the "MIC" sequence "number".- See Also:
-
sequenceNum
public int sequenceNumThe extracted sequence number of the telemetry data. -
analogValues
public float[] analogValuesA 5-element array of the 5 non-boolean analog values in the telemetry message. -
bitmask
public int bitmaskA bitmask containing the 8 boolean digits from the telemetry message.
-
-
Constructor Details
-
TelemetryMessage
public TelemetryMessage()Create a TelemetryMessage suitable for transmission to another station. -
TelemetryMessage
Constructor for a TelemetryMessage from an AX25Frame. The caller is responsible for ensuring the byte array contains a TelemetryMessage before using this class to decode it.- Parameters:
body
- byte array containing the messageoffset
- index into the byte array where the telemetry message text startstp
- String of third-party routing data (may be null)rcvTimestamp
- time in Java milliseconds since Jan 1 1970 UTC when this message was received
-
TelemetryMessage
Construct a TelemetryMessage based on Base91 Telemetry data extracted from a PositionMessage's comment, per the proposed extension documented in http://he.fi/doc/aprs-base91-comment-telemetry.txt.- Parameters:
pm
- PositionMessage containing the base-91 telemetry datastartPos
- index into the PositionMessage's comment where the telemetry data starts (after the '|' character)endPos
- index into the PositionMessage's comment where the telemetry data ends (the closing '|' character)
-
-
Method Details
-
paramString
Descriptive text about this message, to be included in the toString() method's response. This method may be overridden, and the override may concatenate the results of the superclass's paramString) method with additional text of its own.- Overrides:
paramString
in classMessage
- Returns:
- String describing the contents of this message
- See Also:
-
getBase91Encoding
Encode this telemetry data in the format for base-91 appending to the comment of an APRS PositionReport, per http://he.fi/doc/aprs-base91-comment-telemetry.txt.- Returns:
- base-91 encoded telemetry String
- Throws:
IllegalArgumentException
- if any value of telemetry message is out of range to fit in base-91 encoding
-
bodyEquals
Compare the contents of the body of the message, reporting if they match.- Overrides:
bodyEquals
in classMessage
- Parameters:
o
- another AX25Message to compare against- Returns:
- boolean true if the body values are equivalent
-
getBody
Get an instance of this message, suitable for transmitting.- Specified by:
getBody
in interfaceSendableMessage
- Parameters:
countTransmission
- number of times the message has been transmitted.protocolId
- ProtocolFamily to generate the message in; currently, only APRS is 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:
-
isEnabled
public boolean isEnabled()Test if message should still be transmitted.- Specified by:
isEnabled
in interfaceSendableMessage
- Returns:
- boolean true if message should still be transmitted
-
disableForTransmit
public void disableForTransmit()Specify that message should no longer be transmitted.- Specified by:
disableForTransmit
in interfaceSendableMessage
-