Class PositionReport

All Implemented Interfaces:
Serializable, Cloneable, Comparable<AX25Message>, CommentedMessage, SendableMessage

public class PositionReport extends PositionMessage implements SendableMessage
This class defines a APRS Position Report message (APRS protocol specification chapter 6).
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • PositionReport

      public PositionReport(byte[] body, int offset, String tp, long rcvTimestamp) throws IllegalArgumentException
      Constructor for Position 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
      Throws:
      IllegalArgumentException - if body has invalid syntax in any fields
    • PositionReport

      public PositionReport(long now, boolean encodeCompressed, char msgType)
      Alternate constructor for creating a non-timestamped locally originated PositionReport.
      Parameters:
      now - current time in milliseconds since midnight 1 Jan 1970 UTC
      encodeCompressed - boolean true if encoding of this message into APRS format should use compressed encoding
      msgType - char to use for APRS message type; caller is required to ensure this is legal by APRS protocol specification
  • Method Details

    • 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 - number of times this message has been transmitted
      protocolId - AX.25 protocol ID to format this 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:
    • isUsingCompressedFormat

      public boolean isUsingCompressedFormat()
      Indicates whether this PositionMessage is using compressed-mode (but not Mic-E) encoding of latitude and longitude, because this affects what are legal symbol overlay codes.
      Overrides:
      isUsingCompressedFormat in class PositionMessage
      Returns:
      boolean true if compressed encoding in use
    • disableForTransmit

      public void disableForTransmit()
      Specify that message should no longer be transmitted.
      Specified by:
      disableForTransmit in interface SendableMessage
    • getProtocols

      public Set<ProtocolFamily> 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 class Message
      Returns:
      array of supported ProtocolFamily enums