Package org.ka2ddo.yaac.io
Class ExternalMessageSourceConnector
java.lang.Object
org.ka2ddo.ax25.Connector
org.ka2ddo.yaac.io.PortConnector
org.ka2ddo.yaac.io.ExternalMessageSourceConnector
- All Implemented Interfaces:
jssc.SerialPortEventListener
public class ExternalMessageSourceConnector
extends PortConnector
implements jssc.SerialPortEventListener
This implements a TCP or UDP socket or serial port reader for receiving
ASCII-text messages to transmit to the RF and APRS-IS networks for APRS.
This is useful for forwarding messages from other applications (direction
finders, weather stations, telemetry, etc.). Either YAAC or the other
application can initiate the connection or listen for incoming connections.
The message format is ASCII lines (terminated by CR or LF control character
for TCP or serial port, the whole datagram body for UDP) in one of these
formats as explicitly configured here:
- ASCII message body alone
- ASCII message body with source and tocall destination callsigns in TNC-2 format (without any digipeaters)
- Author:
- Andrew Pavlin, KA2DDO
-
Nested Class Summary
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 ExternalMessageSourceConnector.static final String
The PortConnector type name for ExternalMessageSourceConnector.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
Specify what capabilities a port of this type has.boolean
isOpen()
Reports whether this PortConnector has an open connection to its port.void
serialEvent
(jssc.SerialPortEvent event) Process incoming serial port event.toString()
Returns a string representation of the object.Methods inherited from class org.ka2ddo.yaac.io.PortConnector
addPortEventListener, createPort, fillinConfigDefaultsForType, fireFailed, fireReceiving, fireTransmitting, getBitRate, getCollectedStatsTypes, getPortConfig, getPortConnectorClass, getPortConnectorInactivityTimer, getStats, portConnectorClasses, portTypeNames, registerPortConnectorType, removePortEventListener, setPortConfig
Methods inherited from class org.ka2ddo.ax25.Connector
addFrameListener, finalize, fireConsumeFrame, fireConsumeFrame, getCallsign, getStats, getType, hasCapability, removeFrameListener
-
Field Details
-
TYPE_NAME
The PortConnector type name for ExternalMessageSourceConnector.- See Also:
-
CONFIG_GUI
The fully-qualified platform-wildcarded class name for the configuration editor for ExternalMessageSourceConnector.- See Also:
-
-
Constructor Details
-
ExternalMessageSourceConnector
public ExternalMessageSourceConnector()
-
-
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
-
isOpen
public boolean isOpen()Reports whether this PortConnector has an open connection to its port. -
close
public void close()Shut down this port connection. Expected to be overridden by sub-classes. -
serialEvent
public void serialEvent(jssc.SerialPortEvent event) Process incoming serial port event.- Specified by:
serialEvent
in interfacejssc.SerialPortEventListener
- Parameters:
event
- SerialPortEvent describing the handling needed
-
getCapabilities
public int getCapabilities()Specify what capabilities a port of this type has.- Overrides:
getCapabilities
in classConnector
- Returns:
- bitmask of capability flags
- See Also:
-
Connector.CAP_RCV_PACKET_DATA
Connector.CAP_XMT_PACKET_DATA
Connector.CAP_FAST_RF_9600
Connector.CAP_FULL_DUPLEX
Connector.CAP_GPS_DATA
Connector.CAP_HF
Connector.CAP_IGATE
Connector.CAP_KENWOOD_CMD
Connector.CAP_OPENTRAC
Connector.CAP_ADSB
Connector.CAP_RAW_AX25
Connector.CAP_RF
Connector.CAP_WAYPOINT_SENDER
Connector.CAP_WEATHER
Connector.CAP_SUBCLIENT
-
toString
Returns a string representation of the object.
-