public class PortManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
addPortMgmtListener(PortMgmtListener l)
Register a listener to be informed when PortConnectors are created or deleted.
|
static void |
addPortStatusListener(PortStatusListener l)
Register a listener to be informed when PortConnectors are opened or closed.
|
static void |
createPortIfNonexistent(java.lang.String portParams)
Check the existing ports to see if a port matching the specified parameter string
exists, and create a new one if a match is not found.
|
static void |
firePortClosed(PortConnector p)
Service method for PortConnectors to call when they are closed, so
PortStatusListeners can be notified of the status change.
|
static void |
firePortCreated(PortConnector p)
Service method for PortConnectors to call when they are added to the operational
configuration, so PortMgmtListeners can be notified of the status change.
|
static void |
firePortDeleted(PortConnector p)
Service method for PortConnectors to call when they are removed from the operational
configuration, so PortMgmtListeners can be notified of the status change.
|
static void |
firePortOpened(PortConnector p)
Service method for PortConnectors to call when they are opened, so
PortStatusListeners can be notified of the status change.
|
static void |
firePortStatusChanged(PortConnector p)
Service method for PortConnectors to call when their capabilities change, so
PortExtendedStatusListeners can be notified of the status change.
|
static java.lang.String |
getCallsign()
Get the "best" callsign for this station, based on the callsigns associated with the open
ports.
|
static PortConnector |
getConnector(PortConfig portConfig)
Return the PortConnector associated with a specific PortConfig.
|
static PortConnector |
getMatchingConnector(int capMask)
Get the first PortConnector defined in the location station which has all the
requested capabilities, regardless of whether it is currently open.
|
static int |
getNextAvailablePortNumber()
Find the next port number that is not currently in use.
|
static java.util.ArrayList<PortConnector> |
getPortList()
Get all the currently defined PortConnectors, whether or not they are open.
|
static PortConnector |
getPreferredConnector(int capMask)
Get the first PortConnector defined in the location station which has all the
requested capabilities.
|
static TuneIfc |
getTuneIfc()
Get the current implementation of the TuneIfc.
|
static void |
removePortMgmtListener(PortMgmtListener l)
Unregister a PortMgmtListener; it will no longer be informed when ports are
created or deleted.
|
static void |
removePortStatusListener(PortStatusListener l)
Unregister a PortStatusListener; it will no longer be informed when ports are
opened or closed.
|
static void |
setSuggestedLocalCallsign(java.lang.String suggestedLocalCallsign)
Set the suggested callsign for the ports.
|
static void |
setTuneIfc(TuneIfc tuneIfc)
Set the implementation that can provide the TuneIfc service
for the TUNE button on the radio view pane.
|
public static java.util.ArrayList<PortConnector> getPortList()
public static PortConnector getPreferredConnector(int capMask)
capMask
- int bitmask of capabilities to test forConnector.CAP_FULL_DUPLEX
,
Connector.CAP_GPS_DATA
,
Connector.CAP_HF
,
Connector.CAP_IGATE
,
Connector.CAP_OPENTRAC
,
Connector.CAP_RCV_PACKET_DATA
,
Connector.CAP_RF
,
Connector.CAP_WAYPOINT_SENDER
,
Connector.CAP_WEATHER
,
Connector.CAP_XMT_PACKET_DATA
public static PortConnector getMatchingConnector(int capMask)
capMask
- int bitmask of capabilities to test forConnector.CAP_FULL_DUPLEX
,
Connector.CAP_GPS_DATA
,
Connector.CAP_HF
,
Connector.CAP_IGATE
,
Connector.CAP_OPENTRAC
,
Connector.CAP_RCV_PACKET_DATA
,
Connector.CAP_RF
,
Connector.CAP_WAYPOINT_SENDER
,
Connector.CAP_WEATHER
,
Connector.CAP_XMT_PACKET_DATA
public static PortConnector getConnector(PortConfig portConfig)
portConfig
- PortConfig of PortConnector to be locatedpublic static int getNextAvailablePortNumber()
public static void addPortStatusListener(PortStatusListener l)
l
- PortStatusListener instance to registerpublic static void removePortStatusListener(PortStatusListener l)
l
- PortStatusListener to unregisterpublic static void firePortOpened(PortConnector p)
p
- PortConnector which has been openedPortConnector.configure(org.ka2ddo.yaac.io.PortConfig)
public static void firePortClosed(PortConnector p)
p
- PortConnector which has been closedPortConnector.configure(org.ka2ddo.yaac.io.PortConfig)
,
Connector.close()
public static void firePortStatusChanged(PortConnector p)
p
- PortConnector which has been closedPortConnector.configure(org.ka2ddo.yaac.io.PortConfig)
,
Connector.close()
public static void addPortMgmtListener(PortMgmtListener l)
l
- PortMgmtListener instance to registerpublic static void removePortMgmtListener(PortMgmtListener l)
l
- PortMgmtListener to unregisterpublic static void firePortCreated(PortConnector p)
p
- PortConnector which has been addedPortConnector.configure(org.ka2ddo.yaac.io.PortConfig)
,
Connector.close()
public static void firePortDeleted(PortConnector p)
p
- PortConnector which has been removedPortConnector.configure(org.ka2ddo.yaac.io.PortConfig)
,
Connector.close()
public static void setSuggestedLocalCallsign(java.lang.String suggestedLocalCallsign)
suggestedLocalCallsign
- suggested port callsignpublic static java.lang.String getCallsign()
public static void createPortIfNonexistent(java.lang.String portParams)
portParams
- String of port parameters in PortConfig.generatePrefsString()
formatpublic static TuneIfc getTuneIfc()
public static void setTuneIfc(TuneIfc tuneIfc)
tuneIfc
- TuneIfc implementation to use, or null to disable tuning ability