org.ka2ddo.aprs
Class DefaultMessage
java.lang.Object
org.ka2ddo.ax25.AX25Message
org.ka2ddo.aprs.Message
org.ka2ddo.aprs.DefaultMessage
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AX25Message>, CommentedMessage, SendableMessage
public class DefaultMessage
- extends Message
- implements 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.
- See Also:
- Serialized Form
Constructor Summary |
DefaultMessage(byte[] body,
int offset,
java.lang.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 |
byte[] |
getBody(boolean countTransmission,
byte protocolId,
AX25Frame frame)
Get an ASCII-text version of this message, suitable for transmitting. |
boolean |
isEnabled()
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, getExtension, getExtensionString, getMsgType, getReadOnlyExtensionMap, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isSymbolInferred, looksLikeLongFormatLatitude, paramString, 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, hasPosition, 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 |
DefaultMessage
public DefaultMessage(byte[] body,
int offset,
java.lang.String tp,
long rcvTimestamp)
- 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.
getBody
public byte[] getBody(boolean countTransmission,
byte protocolId,
AX25Frame frame)
- Get an ASCII-text version of this message, suitable for transmitting.
- Specified by:
getBody
in interface SendableMessage
- Parameters:
countTransmission
- number of times the message has been transmittedprotocolId
- AX.25 protocol ID 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:
AX25Frame.parsedAX25Msg
isEnabled
public boolean isEnabled()
- Test if message should still be transmitted.
- Specified by:
isEnabled
in interface SendableMessage
- Returns:
- boolean true if message should still be transmitted