Class MicE

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

public class MicE extends PositionMessage implements SendableMessage
This class defines a Mic-E message (APRS protocol specification chapter 10).
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • MicE

      public MicE(byte[] body, int offset, String thirdParty, AX25Callsign dest, long rcvTimestamp)
      Decode a Mic-E message from a byte array,
      Parameters:
      body - byte array containing the Mic-E message
      offset - index into the byte array where the Mic-E message starts
      thirdParty - third-party routing path, or null if not routed from another network
      dest - destination callsign (to extract part of the position and status information from)
      rcvTimestamp - time in Java milliseconds since 1 Jan 1970 UTC when this message was received
    • MicE

      public MicE(long now)
      Alternate constructor for creating a locally-originated MicE message.
      Parameters:
      now - current time in milliseconds since midnight Jan 1 1970 UTC
  • Method Details

    • paramString

      public String paramString()
      Descriptive text about this message, to be included in the toString() method's response.
      Overrides:
      paramString in class PositionMessage
      Returns:
      String describing the contents of this message
      See Also:
    • getRadioModel

      public String getRadioModel()
      Get the model string (if any) decoded from the Mic-E model type codes in the free-text field.
      Returns:
      model String, or null if no known model
    • getPrecedence

      public AX25Message.Precedence getPrecedence()
      Report the traffic-handling precedence for this message instance.
      Overrides:
      getPrecedence in class Message
      Returns:
      Precedence level for this Message
    • encodeDestination

      public static String encodeDestination(double latitude, double longitude, byte status, boolean isCustom)
      Build the tocall destination "callsign" for a Mic-E message, containing the latitude, the status, and part of the longitude information.
      Parameters:
      latitude - latitude in fractional degrees North
      longitude - longitude in fractional degrees East
      status - Mic-E status code in the range 0 to 7
      isCustom - boolean true if this is a custom status code instead of a standard status code
      Returns:
      tocall destination callsign String to use with transmitted Mic-E message
    • 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; currently, only APRS and OPENTRAC are supported.
      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:
    • disableForTransmit

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

      public char getMicETypeCode()
      Get the Mic-E type code of the transmitter (if one exists).
      Returns:
      type code character
    • isUseExperimentalYAACModelCode

      public static boolean isUseExperimentalYAACModelCode()
      Test whether locally-generated Mic-E messages should use an experimental model code for YAAC.
      Returns:
      boolean true if locally originated Mic-E messages have a model code
    • setUseExperimentalYAACModelCode

      public static void setUseExperimentalYAACModelCode(boolean useExperimentalYAACModelCode)
      Specify whether locally-generated Mic-E messages should use an experimental model code for YAAC.
      Parameters:
      useExperimentalYAACModelCode - boolean true if locally originated Mic-E messages have a model code