Package org.ka2ddo.yaac.io
Class TNCConnector
java.lang.Object
org.ka2ddo.ax25.Connector
org.ka2ddo.yaac.io.PortConnector
org.ka2ddo.yaac.io.TNCConnector
- Direct Known Subclasses:
AGWPEConnector
,AprsIsConnector
,FileTNCConnector
,KenwoodConnector
,KissOverTcpConnector
,OuternetConnector
,SerialTNCConnector
,SslAprsIsConnector
,UdpSubmitConnector
,YaesuConnector
This class defines a generic bidirectional TNC interface port, which can
both send and receive AX.25 frames.
- 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 TypeFieldDescriptionprotected static final float
The transmission time per byte in milliseconds for a 1200-baud RF modem.protected static final float
The transmission time per byte in milliseconds for a 300-baud RF modem.protected static final float
The transmission time per byte in milliseconds for a 9600-baud RF modem.protected static final ReschedulableTimer
Timer to use for port timeslot timing.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 TypeMethodDescriptionstatic AX25Frame
convertTNC2FormatToAX25Frame
(int bufLen, byte[] buf) Convert a String of a TNC2 format APRS packet into an AX25Frame object.int
Get the bitmask of AX.25 protocols supported by this port.int
Get the bit transmission rate on this port.Get the string representation AX.25 callsign associated with this TNC port.Get the AX.25 callsign associated with this TNC port.float
Calculate the estimated RF transmission time per frame byte for the TNC on this port.void
setPortAddress
(AX25Callsign portAddress) Set the AX.25 callsign associated with this TNC port.Methods inherited from class org.ka2ddo.yaac.io.PortConnector
addPortEventListener, configure, createPort, fillinConfigDefaultsForType, fireFailed, fireReceiving, fireTransmitting, getCollectedStatsTypes, getPortConfig, getPortConnectorClass, getPortConnectorInactivityTimer, getStats, portConnectorClasses, portTypeNames, registerPortConnectorType, removePortEventListener, setPortConfig
Methods inherited from class org.ka2ddo.ax25.Connector
addFrameListener, close, finalize, fireConsumeFrame, fireConsumeFrame, getCapabilities, getStats, getType, hasCapability, isOpen, removeFrameListener
-
Field Details
-
RF_SEND_TIME_PER_BYTE_9600
protected static final float RF_SEND_TIME_PER_BYTE_9600The 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_1200The 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_300The transmission time per byte in milliseconds for a 300-baud RF modem.- See Also:
-
timeslotTimer
Timer to use for port timeslot timing.
-
-
Constructor Details
-
TNCConnector
public TNCConnector()
-
-
Method Details
-
convertTNC2FormatToAX25Frame
Convert a String of a TNC2 format APRS packet into an AX25Frame object.- Parameters:
bufLen
- the number of bytes to use in the bufferbuf
- 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
Get the AX.25 callsign associated with this TNC port.- Returns:
- AX25Callsign for this port (may be null if port is not configured)
-
setPortAddress
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
Get the string representation AX.25 callsign associated with this TNC port.- Overrides:
getCallsign
in classConnector
- 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 classPortConnector
- 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 theEnum.ordinal()
value of theProtocolFamily
enum.- Returns:
- protocol bitmask, or 0 for no AX.25 protocols supported
-