Class Query

All Implemented Interfaces:
Serializable, Cloneable, 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.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Field Details

    • queryType

      public final String queryType
      Query type (text between question marks '?' in the message).
    • rangeLatitude

      public double rangeLatitude
      Latitude in fractional degrees North of center of query range limit.
    • rangeLongitude

      public double rangeLongitude
      Longitude in fractional degrees East of center of query range limit.
    • rangeDistance

      public double rangeDistance
      Radius of range limit in statute miles.
  • Constructor Details

    • Query

      public Query(byte[] body, int offset, String tp, long rcvTimestamp)
      Constructor for Query message when decoding a binary AX.25 frame.
      Parameters:
      body - byte array of frame body
      offset - 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 wrapper
      rcvTimestamp - Unix time when message was actually received by YAAC
    • Query

      public Query(String queryType)
      Constructor for locally-originated (outbound) general Query message.
      Parameters:
      queryType - String of general query to make
  • Method Details

    • paramString

      public 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:
    • getBody

      public byte[] getBody(boolean countTransmission, ProtocolFamily 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 same
      protocolId - AX.25 protocol to format message in
      frame - AX25Frame into which the message will be placed, so any alternate AX25Message can be linked to it
      Returns:
      byte array of message
      See Also:
    • 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
    • disableForTransmit

      public void disableForTransmit()
      Specify that message should no longer be transmitted.
      Specified by:
      disableForTransmit in interface SendableMessage
    • 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