org.ka2ddo.yaac.io
Class SerialGpsConnector

java.lang.Object
  extended by org.ka2ddo.ax25.Connector
      extended by org.ka2ddo.yaac.io.PortConnector
          extended by org.ka2ddo.yaac.io.AbstractGpsConnector
              extended by org.ka2ddo.yaac.io.SerialGpsConnector
All Implemented Interfaces:
gnu.io.SerialPortEventListener, java.lang.Thread.UncaughtExceptionHandler, java.util.EventListener, AprsMessageListener, ParsedAX25MessageListener

public class SerialGpsConnector
extends AbstractGpsConnector
implements gnu.io.SerialPortEventListener

This class implements a port to a GPS receiver connected by a serial port over RS-232C (or USB emulating a RS-232C serial port). It optionally can send waypoint sentences back to the GPS (similar to the Kenwood D710 and TH-D72 working with AvMap GPS's) that are derived from the various formats of APRS and OpenTRAC position messages.

Note: For backwards compatibility, we are treating the FLAGS_LOCAL bit inversely (if clear, is a local GPS; if set, is a remote GPS).


Nested Class Summary
 
Nested classes/interfaces inherited from class org.ka2ddo.ax25.Connector
Connector.PortStats
 
Field Summary
static java.lang.String CONFIG_GUI
           
static java.lang.String TYPE_NAME
           
 
Fields inherited from class org.ka2ddo.yaac.io.AbstractGpsConnector
cachedToString, dispatchThread, QUEUE_READER, queuedButNotConsumed, rtQueue
 
Fields inherited from class org.ka2ddo.yaac.io.PortConnector
currentCfg, portConfig
 
Fields inherited from class org.ka2ddo.ax25.Connector
CAP_FULL_DUPLEX, CAP_GPS_DATA, CAP_HF, CAP_IGATE, CAP_OPENTRAC, CAP_RCV_PACKET_DATA, CAP_RF, CAP_WAYPOINT_SENDER, CAP_WEATHER, CAP_XMT_PACKET_DATA, stats
 
Constructor Summary
SerialGpsConnector()
           
 
Method Summary
 void close()
          Shut down this port connection.
 void configure(PortConfig portConfig)
          Update the configuration of the connector to match the updated setup.
 boolean isOpen()
          Reports whether this PortConnector has an open connection to its port.
 void serialEvent(gnu.io.SerialPortEvent event)
          Process incoming serial port event.
 java.lang.String toString()
          Returns a string representation of the object.
 void write(java.lang.String line)
          Transmit a line of text containing a waypoint sentence to the GPS device.
 
Methods inherited from class org.ka2ddo.yaac.io.AbstractGpsConnector
aprsMessageReceived, getCapabilities, parsedAX25MessageReceived, startQueueReader, uncaughtException
 
Methods inherited from class org.ka2ddo.yaac.io.PortConnector
addFrameListener, addPortEventListener, createPort, fireConsumeFrame, fireConsumeFrame, fireFailed, fireReceiving, fireTransmitting, getPortConnectorClass, portConnectorClasses, portTypeNames, registerPortConnectorType, removeFrameListener, removePortEventListener, setPortConfig
 
Methods inherited from class org.ka2ddo.ax25.Connector
finalize, getCallsign, getStats, hasCapability
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_NAME

public static final java.lang.String TYPE_NAME
See Also:
Constant Field Values

CONFIG_GUI

public static final java.lang.String CONFIG_GUI
See Also:
Constant Field Values
Constructor Detail

SerialGpsConnector

public SerialGpsConnector()
Method Detail

configure

public void configure(PortConfig portConfig)
               throws java.io.IOException,
                      java.lang.IllegalArgumentException
Update the configuration of the connector to match the updated setup.

Specified by:
configure in class PortConnector
Parameters:
portConfig - PortConfig defining new port settings
Throws:
java.io.IOException - if interface changes could not be applied
java.lang.IllegalArgumentException - 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.

Specified by:
isOpen in class Connector
Returns:
boolean true if PortConnector is open

serialEvent

public void serialEvent(gnu.io.SerialPortEvent event)
Process incoming serial port event.

Specified by:
serialEvent in interface gnu.io.SerialPortEventListener
Parameters:
event - SerialPortEvent describing the handling needed

close

public void close()
Shut down this port connection.

Overrides:
close in class Connector

write

public void write(java.lang.String line)
Transmit a line of text containing a waypoint sentence to the GPS device.

Specified by:
write in class AbstractGpsConnector
Parameters:
line - String text to transmit

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.