Package org.ka2ddo.yaac.io
Class OuternetConnector
java.lang.Object
org.ka2ddo.ax25.Connector
org.ka2ddo.yaac.io.PortConnector
org.ka2ddo.yaac.io.TNCConnector
org.ka2ddo.yaac.io.OuternetConnector
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface for listeners (such as the Test Port button on the configuration GUI panel) to intercept the data read from the Outernet receiver.Nested classes/interfaces inherited from class org.ka2ddo.yaac.io.PortConnector
PortConnector.PortStatsType
Nested classes/interfaces inherited from class org.ka2ddo.ax25.Connector
Connector.ConnectorType, Connector.PortStats
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The fully-qualified platform-wildcarded class name for the configuration editor for OuternetConnector.static final String
The PortConnector type name for OuternetConnector.Fields inherited from class org.ka2ddo.yaac.io.TNCConnector
RF_SEND_TIME_PER_BYTE_1200, RF_SEND_TIME_PER_BYTE_300, RF_SEND_TIME_PER_BYTE_9600, timeslotTimer
Fields inherited from class org.ka2ddo.yaac.io.PortConnector
currentCfg, portConfig
Fields inherited from class org.ka2ddo.ax25.Connector
CAP_ADSB, CAP_FAST_RF_9600, CAP_FULL_DUPLEX, CAP_GPS_DATA, CAP_HF, CAP_IGATE, CAP_KENWOOD_CMD, CAP_OPENTRAC, CAP_RAW_AX25, CAP_RCV_PACKET_DATA, CAP_RF, CAP_SUBCLIENT, CAP_WAYPOINT_SENDER, CAP_WEATHER, CAP_XMT_PACKET_DATA, stats
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Shut down this port connection.void
configure
(PortConfig config) Update the configuration of the connector to match the updated setup.static void
Set the correct defaults for a port in process of being created.int
Get the bitmask of AX.25 protocols supported by this port.int
Specify what capabilities a port of this type has.boolean
isOpen()
Reports whether this Connector has an open connection to its port.boolean
Attempt to read both files from the OUTERNET receiver, and extract the records from the most recent file and forward them to the AX25Stack.toString()
Returns a string representation of the OuternetConnector object.Methods inherited from class org.ka2ddo.yaac.io.TNCConnector
convertTNC2FormatToAX25Frame, getBitRate, getCallsign, getPortAddress, getRFSendTimePerByte, setPortAddress
Methods inherited from class org.ka2ddo.yaac.io.PortConnector
addPortEventListener, createPort, fillinConfigDefaultsForType, fireFailed, fireReceiving, fireTransmitting, getCollectedStatsTypes, getPortConfig, getPortConnectorClass, getPortConnectorInactivityTimer, getStats, portConnectorClasses, portTypeNames, registerPortConnectorType, removePortEventListener, setPortConfig
Methods inherited from class org.ka2ddo.ax25.Connector
addFrameListener, finalize, fireConsumeFrame, fireConsumeFrame, getStats, getType, hasCapability, removeFrameListener
-
Field Details
-
TYPE_NAME
The PortConnector type name for OuternetConnector.- See Also:
-
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
Set the correct defaults for a port in process of being created.- Parameters:
cfg
- PortConfig.Cfg whose defaults should be adjusted
-
configure
Update the configuration of the connector to match the updated setup.- Specified by:
configure
in classPortConnector
- Parameters:
config
- PortConfig defining new port settings- Throws:
IOException
- if interface changes could not be appliedIllegalArgumentException
- 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. -
close
public void close()Shut down this port connection. -
getCapabilities
public int getCapabilities()Specify what capabilities a port of this type has.- Overrides:
getCapabilities
in classConnector
- Returns:
- bitmask of capability flags
- See Also:
-
toString
Returns a string representation of the OuternetConnector object. -
getAcceptableProtocolsMask
public int getAcceptableProtocolsMask()Get the bitmask of AX.25 protocols supported by this port.- Overrides:
getAcceptableProtocolsMask
in classTNCConnector
- Returns:
- protocol bitmask, or 0 for no AX.25 protocols supported
-