Class AbstractGpsConnector

All Implemented Interfaces:
Thread.UncaughtExceptionHandler, AprsMessageListener, ParsedAX25MessageListener
Direct Known Subclasses:
SerialGpsConnector

public abstract class AbstractGpsConnector extends PortConnector implements AprsMessageListener, ParsedAX25MessageListener, Thread.UncaughtExceptionHandler
This class provides common functionality for PortConnectors that receive NMEA-0183 data from some kind of connection to a GPS receiver.
Author:
Andrew Pavlin, KA2DDO
  • Field Details

    • rtQueue

      protected final FastBlockingQueue<String> rtQueue
      Queue for passing NMEA-0183 GPS sentences from interface-specific subclasses to the common parsing code in the AbstractGpsConnector superclass.
    • dispatchThread

      protected transient Thread dispatchThread
      Pointer to consumer thread for rtQueue.
    • queuedButNotConsumed

      protected transient boolean queuedButNotConsumed
      Flag indicating when traffic has been queued to the dispatch thread and not yet consumed.
    • gpsDistributor

      protected final GPSDistributor gpsDistributor
      Instance specific pointer to GPS parser.
    • QUEUE_READER

      protected final Runnable QUEUE_READER
      Runnable to extract, parse, and process incoming NMEA-0183 sentences.
  • Constructor Details

    • AbstractGpsConnector

      protected AbstractGpsConnector()
      Initialize attributes of this abstract superclass.
  • Method Details

    • startQueueReader

      protected void startQueueReader()
      Start the thread that drains the queue
    • stopQueueReader

      protected void stopQueueReader()
      Cause the queue draining thread to shut down.
    • getCapabilities

      public int getCapabilities()
      Specify what capabilities a port of this type has.
      Overrides:
      getCapabilities in class Connector
      Returns:
      bitmask of capability flags
      See Also:
    • aprsMessageReceived

      public void aprsMessageReceived(Message msg)
      Delivers the next message received by YAAC that is an APRS message. Used to forward APRS positions to GPS devices with screens to display as waypoints.
      Specified by:
      aprsMessageReceived in interface AprsMessageListener
      Parameters:
      msg - some subclass of Message containing the message contents; the message should have an AX25Frame connected to it
      See Also:
    • write

      public abstract void write(String line)
      Transmit a line of text containing a waypoint sentence to the GPS device.
      Parameters:
      line - String text to transmit
    • parsedAX25MessageReceived

      public void parsedAX25MessageReceived(byte pid, AX25Message msg)
      Delivers the next message received by YAAC that is some sort of parsed AX.25 higher-level message.
      Specified by:
      parsedAX25MessageReceived in interface ParsedAX25MessageListener
      Parameters:
      pid - AX.25 protocol ID
      msg - some subclass of AX25Message containing the message contents; the message should have an AX25Frame connected to it
      See Also:
    • uncaughtException

      public final void uncaughtException(Thread t, Throwable e)
      Method invoked when the given thread terminates due to the given uncaught exception.

      Any exception thrown by this method will be ignored by the Java Virtual Machine.

      Specified by:
      uncaughtException in interface Thread.UncaughtExceptionHandler
      Parameters:
      t - the thread
      e - the exception