public class ConnState extends java.lang.Object implements AX25FrameSource, java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static class |
ConnState.ConnTransition
Enum identifying the transitional condition of the connection.
|
static class |
ConnState.ConnType
Enumeration specifying the different types of connection-oriented AX.25 sessions.
|
Modifier and Type | Field and Description |
---|---|
AX25Callsign |
dst
Recipient of session.
|
ConnectionEstablishmentListener |
listener
Listener to be asynchronously informed of state changes in the session.
|
java.lang.Object |
sessionIdentifier
Arbitrary identifier for a particular connected-mode session.
|
AX25Callsign |
src
Originator of session.
|
ConnState.ConnTransition |
transition
The current state of this session.
|
AX25Callsign[] |
via
Digipeater path to use for transmitting from source to destination station.
|
NO_FRAMES
Modifier and Type | Method and Description |
---|---|
void |
clearResendableFrame()
Cancel an outstanding resendable frame's timer.
|
void |
close()
Closes this connection and releases any system resources associated
with it.
|
Connector |
getConnector()
Report the Connector this message should be transmitted through.
|
ConnState.ConnType |
getConnType()
Get the connection windowing type.
|
AX25Callsign |
getDst()
Get the callsign of the station that received this connection session.
|
AX25Frame[] |
getFrames(boolean incrementXmtCount,
ProtocolFamily protocolId,
java.lang.String senderCallsign)
Get one or more AX25Frames of the data to transmit.
|
java.io.InputStream |
getInputStream()
Get a Java-style InputStream associated with this connection.
|
long |
getLastUpdateInSession()
Report the last time this connected-mode session was updated.
|
int |
getNumTransmitsBeforeDecay()
Get number of times frame will be retransmitted before inter-packet delay is increased.
|
java.io.OutputStream |
getOutputStream()
Get a Java-style OutputStream for writing to this connection.
|
AX25Callsign |
getSrc()
Get the callsign of the station that originated this connection session.
|
java.lang.String |
getStateOfConn()
Provide textual description of connection state.
|
boolean |
isOpen()
Get the current state of this connection.
|
void |
setConnector(TransmittingConnector connector)
Set the Connector through which frames for this connected-mode session should be transmitted.
|
void |
setConnType(ConnState.ConnType connType)
Set the connection windowing type.
|
void |
setResendableFrame(AX25Frame frame,
int retryCount)
Specify that this transmitted unconnected frame needs a timeout timer in case the appropriate
response does not come back.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
updateSessionTime()
Update the last-updated timestamp of this session.
|
public final AX25Callsign src
public final AX25Callsign dst
public ConnState.ConnTransition transition
public AX25Callsign[] via
public ConnectionEstablishmentListener listener
public java.lang.Object sessionIdentifier
public boolean isOpen()
public ConnState.ConnType getConnType()
public void setConnType(ConnState.ConnType connType)
connType
- ConnType enum describing the sliding window modepublic java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
- if session not to or from this stationpublic java.io.OutputStream getOutputStream() throws java.io.IOException
java.io.IOException
- if session not to or from this stationpublic AX25Callsign getSrc()
public AX25Callsign getDst()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getStateOfConn()
public void setResendableFrame(AX25Frame frame, int retryCount)
frame
- AX25Frame that was transmitted and is expecting a responseretryCount
- int number of times this frame should be retried before giving up on a response
and failing whatever condition the frame was trying to set uppublic void clearResendableFrame()
public AX25Frame[] getFrames(boolean incrementXmtCount, ProtocolFamily protocolId, java.lang.String senderCallsign)
getFrames
in interface AX25FrameSource
incrementXmtCount
- indicate whether the transmit counter (used to cycle through
proportional pathing) should be incrementedprotocolId
- indicate the protocol to generate this frame forsenderCallsign
- String of local callsign sending this message (may be ignored if digipeating
a message from another station)public int getNumTransmitsBeforeDecay()
getNumTransmitsBeforeDecay
in interface AX25FrameSource
public Connector getConnector()
getConnector
in interface AX25FrameSource
Connector.CAP_XMT_PACKET_DATA
public void setConnector(TransmittingConnector connector)
connector
- Connector that is capable of transmitting AX.25 framespublic void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public long getLastUpdateInSession()
public void updateSessionTime()