Package org.ka2ddo.aprs
Class PositionlessWeatherReport
java.lang.Object
org.ka2ddo.ax25.AX25Message
org.ka2ddo.aprs.Message
org.ka2ddo.aprs.PositionlessWeatherReport
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<AX25Message>
,CommentedMessage
,SendableMessage
This class decodes a Positionless Weather APRS message (APRS protocol specification chapter 12).
- 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 TypeFieldDescriptionprotected static final String
Date format String to parse 8-character date/time strings.char
Code for type of software the sending weather station is using.Weather station hardware type.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
ConstructorDescriptionPositionlessWeatherReport
(byte[] body, int offset, String tp, AX25Callsign dst, long rcvTimestamp) Standard constructor for PositionlessWeatherReport, for decoding from an AX.25 frame (or equivalent).PositionlessWeatherReport
(long now) Alternate constructor, used to create an empty message for population by local weather data.PositionlessWeatherReport
(String body, int offset) Alternate constructor, used only to decode $PKWDWXI special message from Kenwood TH-D72 HT's built-in TNC when weather data is expected to be imported into the TNC from a local weather station. -
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
Test if message should still be transmitted.boolean
Report whether the non-null APRS symbol reported by this message is explicit or inferred from destination or source callsign.Descriptive text about this message, to be included in the toString() method's response.Methods inherited from class org.ka2ddo.aprs.Message
bodyEquals, compareTo, decodeDatestamp, decodeHurricaneParams, decodeTimestamp, decodeWeatherParams, decodeWeatherParams, dup, encodeTimestamp, extractComment, extractComment, extractSymbol, formatBody, getComment, getExtensionString, getMsgType, getPrecedence, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isAppendCR, 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
-
MDHM
Date format String to parse 8-character date/time strings.- See Also:
-
softwareType
public char softwareTypeCode for type of software the sending weather station is using. -
wsType
Weather station hardware type.
-
-
Constructor Details
-
PositionlessWeatherReport
public PositionlessWeatherReport(byte[] body, int offset, String tp, AX25Callsign dst, long rcvTimestamp) Standard constructor for PositionlessWeatherReport, for decoding from an AX.25 frame (or equivalent).- Parameters:
body
- byte array of frame bodyoffset
- starting point in the array (in case of third-party header)tp
- extracted third-party header Stringdst
- destination AX25Callsign from framercvTimestamp
- timestamp at which message was received
-
PositionlessWeatherReport
Alternate constructor, used only to decode $PKWDWXI special message from Kenwood TH-D72 HT's built-in TNC when weather data is expected to be imported into the TNC from a local weather station.- Parameters:
body
- String containing the $PKWDWXI messageoffset
- index of first byte after the message header
-
PositionlessWeatherReport
public PositionlessWeatherReport(long now) Alternate constructor, used to create an empty message for population by local weather data.- Parameters:
now
- time of weather data, in Java milliseconds since Jan 1, 1970 UTC
-
-
Method Details
-
paramString
Descriptive text about this message, to be included in the toString() method's response.- Overrides:
paramString
in classMessage
- Returns:
- String describing the contents of this message
- See Also:
-
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 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:
-
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
-
isSymbolInferred
public boolean isSymbolInferred()Report whether the non-null APRS symbol reported by this message is explicit or inferred from destination or source callsign. Intended to be overridden by message types which can infer a symbol but can't explicitly specify the symbol.- Overrides:
isSymbolInferred
in classMessage
- Returns:
- boolean true if symbol is inferred
-
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
-