Class StatusMessage

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

public class StatusMessage extends Message implements SendableMessage
This class decodes a Status message (APRS protocol specification chapter 16). Note that Status messages with Maidenhead locator prefixes are decoded as MaidenheadLocatorBeacon class objects instead,
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • StatusMessage

      public StatusMessage(byte[] body, int offset, String tp, long rcvTimestamp)
      Constructor for Status 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
    • StatusMessage

      public StatusMessage(long now, String comment)
      Alternate constructor for creating transmittable StatusMessage.
      Parameters:
      now - current time in Java milliseconds since midnight Jan 1 1970 UTC
      comment - status String
  • 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 the message has been transmitted.
      protocolId - ProtocolFamily to generate the message in
      frame - 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, or null if message body cannot be generated in specified protocol, or retransmission count has been exceeded.
      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
    • 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