Package org.ka2ddo.aprs
Class DefaultMessage
java.lang.Object
org.ka2ddo.ax25.AX25Message
org.ka2ddo.aprs.Message
org.ka2ddo.aprs.DefaultMessage
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<AX25Message>
,CommentedMessage
,SendableMessage
This class defines a default message (suitable to contain any other type of APRS message
that YAAC doesn't explicitly understand). The lead character of such messages
is kept in the comment instead of being stripped off.
- 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.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
ConstructorDescriptionDefaultMessage
(byte[] body, int offset, String tp, long rcvTimestamp) Create a DefaultMessage from the bytes in a byte array (such as the body of an AX25Frame).DefaultMessage
(char type) Create an empty DefaultMessage with the specified message type character. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Specify that message should no longer be transmitted.byte[]
getBody
(boolean countTransmission, ProtocolFamily protocolId, AX25Frame frame) Get an ASCII-text version 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.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, isSymbolInferred, looksLikeLongFormatLatitude, paramString, 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
-
Constructor Details
-
DefaultMessage
Create a DefaultMessage from the bytes in a byte array (such as the body of an AX25Frame).- Parameters:
body
- byte array containing the transmission format of the messageoffset
- index into the array where the message startstp
- String of third-party routing information (or null if this was not routed over another network)rcvTimestamp
- the time (in milliseconds in Jan 1970 UTC) when this message was received
-
DefaultMessage
public DefaultMessage(char type) Create an empty DefaultMessage with the specified message type character.- Parameters:
type
- char type code of this message.
-
-
Method Details
-
getBody
Get an ASCII-text version of this message, suitable for transmitting.- Specified by:
getBody
in interfaceSendableMessage
- Parameters:
countTransmission
- number of times the message has been transmittedprotocolId
- ProtocolFamily to format this message inframe
- 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
- 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
-
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
-