Class TNCConnector

Direct Known Subclasses:
AGWPEConnector, AprsIsConnector, FileTNCConnector, KenwoodConnector, KissOverTcpConnector, OuternetConnector, SerialTNCConnector, SslAprsIsConnector, UdpSubmitConnector, YaesuConnector

public abstract class TNCConnector extends PortConnector
This class defines a generic bidirectional TNC interface port, which can both send and receive AX.25 frames.
Author:
Andrew Pavlin, KA2DDO
  • Field Details

    • RF_SEND_TIME_PER_BYTE_9600

      protected static final float RF_SEND_TIME_PER_BYTE_9600
      The transmission time per byte in milliseconds for a 9600-baud RF modem.
      See Also:
    • RF_SEND_TIME_PER_BYTE_1200

      protected static final float RF_SEND_TIME_PER_BYTE_1200
      The transmission time per byte in milliseconds for a 1200-baud RF modem.
      See Also:
    • RF_SEND_TIME_PER_BYTE_300

      protected static final float RF_SEND_TIME_PER_BYTE_300
      The transmission time per byte in milliseconds for a 300-baud RF modem.
      See Also:
    • timeslotTimer

      protected static final ReschedulableTimer timeslotTimer
      Timer to use for port timeslot timing.
  • Constructor Details

    • TNCConnector

      public TNCConnector()
  • Method Details

    • convertTNC2FormatToAX25Frame

      public static AX25Frame convertTNC2FormatToAX25Frame(int bufLen, byte[] buf)
      Convert a String of a TNC2 format APRS packet into an AX25Frame object.
      Parameters:
      bufLen - the number of bytes to use in the buffer
      buf - the byte array containing the TNC2 format message
      Returns:
      an AX25Frame object filled in with the frame as if it was received as third-party APRS-IS traffic
    • getPortAddress

      public AX25Callsign getPortAddress()
      Get the AX.25 callsign associated with this TNC port.
      Returns:
      AX25Callsign for this port (may be null if port is not configured)
    • setPortAddress

      public void setPortAddress(AX25Callsign portAddress)
      Set the AX.25 callsign associated with this TNC port.
      Parameters:
      portAddress - AX25Callsign for this port (may be null if port is not configured)
    • getCallsign

      public String getCallsign()
      Get the string representation AX.25 callsign associated with this TNC port.
      Overrides:
      getCallsign in class Connector
      Returns:
      String callsign for this port (may be empty string if port is not configured)
    • getBitRate

      public int getBitRate()
      Get the bit transmission rate on this port.
      Overrides:
      getBitRate in class PortConnector
      Returns:
      bit rate in bits per second (baud)
    • getRFSendTimePerByte

      public float getRFSendTimePerByte()
      Calculate the estimated RF transmission time per frame byte for the TNC on this port.
      Returns:
      estimated time in milliseconds for one frame byte on the TNC
    • getAcceptableProtocolsMask

      public int getAcceptableProtocolsMask()
      Get the bitmask of AX.25 protocols supported by this port. Bit positions correspond to the Enum.ordinal() value of the ProtocolFamily enum.
      Returns:
      protocol bitmask, or 0 for no AX.25 protocols supported