Package org.ka2ddo.yaac.io
Class GpsdConnector
java.lang.Object
org.ka2ddo.ax25.Connector
org.ka2ddo.yaac.io.PortConnector
org.ka2ddo.yaac.io.GpsdConnector
- All Implemented Interfaces:
Runnable
,Thread.UncaughtExceptionHandler
public class GpsdConnector
extends PortConnector
implements Runnable, Thread.UncaughtExceptionHandler
This class provides a driver to connect YAAC to a gpsd daemon, so that YAAC
can use a shared GPS receiver, or non-standard hardware that acts like a GPS
receiver or speaks protocols other than NMEA 0183.
More information can be found at the gpsd website.
- 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 Set<PortConfig.Fields>
Set of PortConfig field identifiers for fields that should not be copied from another system and should therefore be blanked out when copying configuration files.static final String
The fully-qualified platform-wildcarded class name for the configuration editor for GpsdConnector.static final Map<PortConfig.Fields,
PortConfig.RequireHints> List of PortConfig field identifiers that are mandated for this port type to work, and the ResourceBundle key to prompt for a value if missing.static final String
The configuration type name for GPSD ports.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
Get the bit transmission rate on this port.int
Specify what capabilities a port of this type has.boolean
isOpen()
Reports whether this PortConnector has an open connection to its port.void
run()
Read the socket connection until it closes.toString()
Returns a string representation of the GpsdConnector object.final void
uncaughtException
(Thread t, Throwable e) Method invoked when the given thread terminates due to the given uncaught exception.Methods inherited from class org.ka2ddo.yaac.io.PortConnector
addPortEventListener, createPort, fillinConfigDefaultsForType, fireFailed, fireReceiving, fireTransmitting, 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 configuration type name for GPSD ports.- See Also:
-
CONFIG_GUI
The fully-qualified platform-wildcarded class name for the configuration editor for GpsdConnector.- See Also:
-
BLANK_FIELDS
Set of PortConfig field identifiers for fields that should not be copied from another system and should therefore be blanked out when copying configuration files. -
REQ_FIELDS
List of PortConfig field identifiers that are mandated for this port type to work, and the ResourceBundle key to prompt for a value if missing.
-
-
Constructor Details
-
GpsdConnector
public GpsdConnector()
-
-
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. -
run
public void run()Read the socket connection until it closes. -
close
public void close()Shut down this port connection. Expected to be overridden by sub-classes. -
getCapabilities
public int getCapabilities()Specify what capabilities a port of this type has.- Overrides:
getCapabilities
in classConnector
- Returns:
- bitmask of capability flags
- See Also:
-
getBitRate
public int getBitRate()Get the bit transmission rate on this port.- Overrides:
getBitRate
in classPortConnector
- Returns:
- guesstimated bit rate in bits per second (baud)
-
toString
Returns a string representation of the GpsdConnector object. -
uncaughtException
Method invoked when the given thread terminates due to the given uncaught exception.- Specified by:
uncaughtException
in interfaceThread.UncaughtExceptionHandler
- Parameters:
t
- the threade
- the exception
-