Class UdpSubmitConnector

All Implemented Interfaces:
TransmittingConnector, NeedsAppVersionInfoIfc

public class UdpSubmitConnector extends TNCConnector implements TransmittingConnector, NeedsAppVersionInfoIfc
This class provides a PortConnector for write-only access to the APRS-IS via UDP submit.
Author:
Andrew Pavlin, KA2DDO
  • Field Details

    • TYPE_NAME

      public static final String TYPE_NAME
      Specify the PortConnector type name for UdpSubmitConnector.
      See Also:
    • CONFIG_GUI

      public static final String CONFIG_GUI
      Specify the fully-qualified platform-wildcarded class name for the editor for AprsIsConnector.
      See Also:
    • BLANK_FIELDS

      public static final Set<PortConfig.Fields> BLANK_FIELDS
      Set of PortConfig field identifiers for fields that should not be copied from another system and should therefore be blanked out when copying configuration files.
    • REQ_FIELDS

      public static final Map<PortConfig.Fields,PortConfig.RequireHints> REQ_FIELDS
      List of PortConfig field identifiers that are mandated for this port type to work, and the ResourceBundle key to prompt for a value if missing.
  • Constructor Details

    • UdpSubmitConnector

      public UdpSubmitConnector()
      Create an uninitialized instance of UdpSubmitConnector.
  • Method Details

    • fillinConfigDefaults

      public static void fillinConfigDefaults(PortConfig.Cfg cfg)
      Set the correct defaults for a port in process of being created.
      Parameters:
      cfg - PortConfig.Cfg whose defaults should be adjusted
    • setAppVersion

      public void setAppVersion(String name, String version)
      Sets the name and version of the containing application.
      Specified by:
      setAppVersion in interface NeedsAppVersionInfoIfc
      Parameters:
      name - String name of the application (cannot contain whitespace)
      version - String version of the application (cannot contain whitespace)
    • configure

      public void configure(PortConfig config) throws IOException, IllegalArgumentException
      Update the configuration of the connector to match the updated setup.
      Specified by:
      configure in class PortConnector
      Parameters:
      config - PortConfig defining new port settings
      Throws:
      IOException - if interface changes could not be applied
      IllegalArgumentException - if type information is invalid for changing the settings of this PortConnector
    • sendFrame

      public void sendFrame(AX25Frame frame) throws IOException
      Transmit an AX.25 frame through this port. May fail silently if port is not configured for transmission (receive-only). May also queue for later transmission if timeslotting is used. Should be thread-safe so that multiple simultaneous calls do not interleave bytes of different frames.
      Specified by:
      sendFrame in interface TransmittingConnector
      Parameters:
      frame - AX25Frame object to transmit
      Throws:
      IOException - if transmit failed for any reason other than a receive-only port
    • isOpen

      public boolean isOpen()
      Reports whether this Connector has an open connection to its port.
      Specified by:
      isOpen in interface TransmittingConnector
      Specified by:
      isOpen in class Connector
      Returns:
      boolean true if Connector is open
    • close

      public void close()
      Shut down this port connection. Must be idempotent (may be called repeatedly on an already-closed Connector).
      Overrides:
      close in class Connector
    • getCapabilities

      public int getCapabilities()
      Specify what capabilities a port of this type has.
      Specified by:
      getCapabilities in interface TransmittingConnector
      Overrides:
      getCapabilities in class Connector
      Returns:
      bitmask of capability flags
      See Also:
    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • getCurrentConnectAddress

      public InetSocketAddress getCurrentConnectAddress()
      Return the address of the remote APRS-IS server this port is connected to.
      Returns:
      InetSocketAddress of remote server, or null if port is not open
    • getAcceptableProtocolsMask

      public int getAcceptableProtocolsMask()
      Get the bitmask of AX.25 protocols supported by this port.
      Specified by:
      getAcceptableProtocolsMask in interface TransmittingConnector
      Overrides:
      getAcceptableProtocolsMask in class TNCConnector
      Returns:
      protocol bitmask, or 0 for no AX.25 protocols supported