Class OuternetConnector


public class OuternetConnector extends TNCConnector
This class implements a polling file reader for files accessed over HTTP from a webserver such as an OUTERNET receiver, where the file contains APRS messages in TNC2 ASCII/UTF-8 format.
Author:
Andrew Pavlin, KA2DDO
  • Field Details

    • TYPE_NAME

      public static final String TYPE_NAME
      The PortConnector type name for OuternetConnector.
      See Also:
    • CONFIG_GUI

      public static final String CONFIG_GUI
      The fully-qualified platform-wildcarded class name for the configuration editor for OuternetConnector.
      See Also:
  • Constructor Details

    • OuternetConnector

      public OuternetConnector()
  • 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
    • 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
    • readMostRecentFile

      public boolean readMostRecentFile(OuternetConnector.OuternetTestListener listener) throws IOException
      Attempt to read both files from the OUTERNET receiver, and extract the records from the most recent file and forward them to the AX25Stack.
      Parameters:
      listener - OuternetTestListener if receive is supposed to be redirected to a test widget, or null for normal operation
      Returns:
      boolean true if file read succeeded (even if old data)
      Throws:
      IOException - if web pages can't be read
    • isOpen

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

      public void close()
      Shut down this port connection.
      Overrides:
      close in class Connector
    • getCapabilities

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

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

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