org.ka2ddo.aprs
Class Query
java.lang.Object
org.ka2ddo.ax25.AX25Message
org.ka2ddo.aprs.Message
org.ka2ddo.aprs.Query
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AX25Message>, CommentedMessage, ScopeableMessage, SendableMessage
public class Query
- extends Message
- implements ScopeableMessage
This class defines a broadcast general Query message (APRS protocol specification chapter 15).
Queries can be both transmitted and received.
- See Also:
- Serialized Form
Field Summary |
java.lang.String |
queryType
Query type (text between question marks '?' in the message). |
Constructor Summary |
Query(byte[] body,
int offset,
java.lang.String tp,
long rcvTimestamp)
Constructor for Query message when decoding a binary AX.25 frame. |
Query(java.lang.String queryType)
Constructor for locally-originated (outbound) general Query message. |
Method Summary |
byte[] |
getBody(boolean countTransmission,
byte protocolId,
AX25Frame frame)
Get an instance of this message, suitable for transmitting. |
Scope |
getScope()
Get the transmission scope for this message (so the digipeat path can be derived). |
boolean |
isEnabled()
Test if message should still be transmitted. |
java.lang.String |
paramString()
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, getExtension, getExtensionString, getMsgType, getReadOnlyExtensionMap, getSymbolCode, getSymTableId, hasWeather, inferSymbol, isSymbolInferred, looksLikeLongFormatLatitude, 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 |
queryType
public final java.lang.String queryType
- Query type (text between question marks '?' in the message).
Query
public Query(byte[] body,
int offset,
java.lang.String tp,
long rcvTimestamp)
- Constructor for Query 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
Query
public Query(java.lang.String queryType)
- Constructor for locally-originated (outbound) general Query message.
- Parameters:
queryType
- String of general query to make
paramString
public java.lang.String paramString()
- Descriptive text about this message, to be included in the toString() method's response.
- Overrides:
paramString
in class Message
- Returns:
- String describing the contents of this message
- See Also:
Message.toString()
getBody
public byte[] getBody(boolean countTransmission,
byte protocolId,
AX25Frame frame)
- Get an instance of this message, suitable for transmitting.
- Specified by:
getBody
in interface SendableMessage
- Parameters:
countTransmission
- ignored, because queries are always the sameprotocolId
- AX.25 protocol to format 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:
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
getScope
public Scope getScope()
- Get the transmission scope for this message (so the digipeat path can be derived).
- Specified by:
getScope
in interface ScopeableMessage
- Returns:
- Scope of this message