public final class Transmitter extends PortManager implements java.lang.Runnable, Transmitting, SetBeaconRatesIfc, java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static class |
Transmitter.Close
Class to shut down the Transmitter as a parallel thread.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARISS_DIGIPEAT_CHOICE
Suggested path for messaging through the International Space Station.
|
static java.lang.String |
OUTNET_CHOICE
Suggested path to forward to the Outernet.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Shut down the transmitter.
|
void |
delayedQueue(AX25FrameSource entry,
long timeToSend)
Queue the specified frame source for transmission over the specified (or all, if not
specified) transmit-enabled PortConnectors.
|
void |
flushLog()
Force an immediate flush of the transmit log file.
|
int |
getDecayRatio()
Get the scaling factor by which the message repeat interval is enlarged
(until the default slow send rate is reached).
|
java.lang.String |
getDefaultDigipeatPath()
Get the default sequence of digipeat aliases that should be used for locally
originated messages (assuming proportional pathing isn't being used).
|
static java.lang.String |
getFarthestReachingDigipeatPathChoice()
Return the longest range digipeat alias path configured for the local station.
|
int |
getFastSpeed()
Fastest speed of station motion such that position message transmission intervals
are maximized to the initial transmission rate, regardless of how fast the station
is actually moving.
|
int |
getInitialSendRate()
Get the time interval between retransmissions when a message is newly
introduced into the system.
|
static Transmitter |
getInstance()
Get a reference to the singleton Transmitter object.
|
PacketExportMode |
getLoggerFormat()
Get the current format for AX.25 message logging.
|
int |
getMinTurnAngle()
Get the minimum amount of turn angle change before YAAC will accelerate reporting beacon position
updates ("corner pegging").
|
int |
getRetransmitCount()
Get the locally-originated message retransmit count.
|
int |
getSlowSendRate()
The slowest rate a message should be sent.
|
int |
getSlowSpeed()
Slowest speed of station motion such that position message transmissions are scheduled
as if station was not moving.
|
static java.lang.String[] |
getStandardDigipeatPathChoices()
Build a sorted list of all the currently registered known choices for
digipeat alias paths.
|
int |
getTurnSlope()
Get the turn slope, which is the scaling factor for the increase over the minimum turn angle before
beacon retransmissions will be accelerated.
|
boolean |
isLocalDest(java.lang.String destCallsign)
Test if this callsign is addressed to the local station.
|
boolean |
isUseGpsForPosition()
Indicate whether beacon data source can dynamically change its position (latitude/longitude),
such as for a mobile station with a GPS.
|
void |
logTransmittedPacket(AX25Frame frame)
Log a packet to the transmit log.
|
void |
logTransmittedPacket(AX25Frame frame,
long timestamp)
Log a packet to the transmit log.
|
static ConnState |
openConnection(AX25Callsign src,
AX25Callsign dest,
AX25Callsign[] via,
ConnectionEstablishmentListener callback,
java.lang.Object sessionIdentifier)
Attempt to initiate an I-frame connected-mode session from the specified source (usually, the local station)
to another station by sending a SABME frame.
|
void |
queue(AX25FrameSource entry)
Queue the specified frame source for transmission over the specified (or all, if not
specified) transmit-enabled PortConnectors.
|
void |
run()
DO NOT CALL.
|
void |
setDecayRatio(int decayRatio)
Set the scaling factor by which the message repeat interval is enlarged
(until the default slow send rate is reached).
|
void |
setDefaultDigipeatPath(java.lang.String defaultDigipeatPath)
Set the default sequence of digipeat aliases that should be used for locally
originated messages (assuming proportional pathing isn't being used).
|
void |
setFastSpeed(int fastSpeed)
Set fastest speed of station motion such that position message transmission intervals
are maximized to the initial transmission rate, regardless of how fast the station
is actually moving.
|
void |
setInitialSendRate(int initialSendRate)
Set the time interval between retransmissions when a message is newly
introduced into the system.
|
void |
setLoggerFormat(PacketExportMode pem)
Set the format for AX.25 message logging.
|
void |
setMinTurnAngle(int minTurnAngle)
Set the minimum amount of turn angle change before YAAC will accelerate reporting beacon position
updates ("corner pegging").
|
void |
setRetransmitCount(int retransmitCount)
Set the locally-originated message retransmit count.
|
void |
setSlowSendRate(int slowSendRate)
Set the slowest rate a message should be sent.
|
void |
setSlowSpeed(int slowSpeed)
Set slowest speed of station motion such that position message transmissions are scheduled
as if station was not moving.
|
void |
setTurnSlope(int turnSlope)
Set the turn slope, which is the scaling factor for the increase over the minimum turn angle before
beacon retransmissions will be accelerated.
|
addPortMgmtListener, addPortStatusListener, createPortIfNonexistent, firePortClosed, firePortCreated, firePortDeleted, firePortOpened, firePortStatusChanged, getCallsign, getConnector, getMatchingConnector, getNextAvailablePortNumber, getPortList, getPreferredConnector, getTuneIfc, removePortMgmtListener, removePortStatusListener, setSuggestedLocalCallsign, setTuneIfc
public static final java.lang.String ARISS_DIGIPEAT_CHOICE
public static final java.lang.String OUTNET_CHOICE
public static Transmitter getInstance()
public static java.lang.String[] getStandardDigipeatPathChoices()
public static java.lang.String getFarthestReachingDigipeatPathChoice()
public int getDecayRatio()
getDecayRatio
in interface SetBeaconRatesIfc
public void setDecayRatio(int decayRatio)
setDecayRatio
in interface SetBeaconRatesIfc
decayRatio
- int decay ratio (should be 2 or 3)public int getInitialSendRate()
getInitialSendRate
in interface SetBeaconRatesIfc
public void setInitialSendRate(int initialSendRate)
setInitialSendRate
in interface SetBeaconRatesIfc
initialSendRate
- send interval in secondspublic int getSlowSendRate()
getSlowSendRate
in interface SetBeaconRatesIfc
public void setSlowSendRate(int slowSendRate)
setSlowSendRate
in interface SetBeaconRatesIfc
slowSendRate
- transmission interval in secondspublic boolean isUseGpsForPosition()
isUseGpsForPosition
in interface SetBeaconRatesIfc
public int getSlowSpeed()
DistanceUnit
public void setSlowSpeed(int slowSpeed)
slowSpeed
- slowest speed in current speed units (nm, mi, or km)DistanceUnit
public int getFastSpeed()
DistanceUnit
public void setFastSpeed(int fastSpeed)
fastSpeed
- fastest speed in current speed units (nm/hr, mi/hr, or km/hr)DistanceUnit
public int getMinTurnAngle()
getTurnSlope()
public void setMinTurnAngle(int minTurnAngle)
minTurnAngle
- the current minimum turn anglepublic int getTurnSlope()
getMinTurnAngle()
public void setTurnSlope(int turnSlope)
turnSlope
- the turn slope scaling factorpublic int getRetransmitCount()
getRetransmitCount
in interface Transmitting
public void setRetransmitCount(int retransmitCount)
retransmitCount
- number of times to retransmit a locally transmitted message when not acknowledgedpublic java.lang.String getDefaultDigipeatPath()
public void setDefaultDigipeatPath(java.lang.String defaultDigipeatPath)
defaultDigipeatPath
- comma-separated ordered list of digipeat aliasespublic PacketExportMode getLoggerFormat()
public void setLoggerFormat(PacketExportMode pem)
pem
- PacketExportMode to usepublic void queue(AX25FrameSource entry)
queue
in interface Transmitting
entry
- AX25FrameSource of the frame to be transmittedpublic void delayedQueue(AX25FrameSource entry, long timeToSend)
delayedQueue
in interface Transmitting
entry
- AX25FrameSource of the frame to be transmittedtimeToSend
- long time in milliseconds since Unix epoch when packet is to be dequeued and transmittedpublic void run()
run
in interface java.lang.Runnable
public boolean isLocalDest(java.lang.String destCallsign)
isLocalDest
in interface Transmitting
destCallsign
- String of AX.25 callsign-SSID to test as a destinationpublic static ConnState openConnection(AX25Callsign src, AX25Callsign dest, AX25Callsign[] via, ConnectionEstablishmentListener callback, java.lang.Object sessionIdentifier) throws java.net.UnknownServiceException, java.io.IOException
src
- AX25Callsign of originating station (should be a local callsign)dest
- AX25Callsign of destination for connectionvia
- digipeater path (may be null)callback
- ConnectionEstablishmentListener to be notified of changes in state of the connectionsessionIdentifier
- arbitrary unique identifier for the connection, so that the ConnectionEstablishmentListener
can tell which connection is being reported aboutjava.net.UnknownServiceException
- if station configured to not support connected-mode packet protocoljava.io.IOException
- if connection initiation (SABM frame) could not be sentpublic void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public void flushLog()
public void logTransmittedPacket(AX25Frame frame)
frame
- already-timestamped AX25Frame that was just transmittedpublic void logTransmittedPacket(AX25Frame frame, long timestamp)
frame
- AX25Frame that was just transmittedtimestamp
- long time in milliseconds since UTC epoch when packet was transmitted