com.esri.core.gps
Class SerialPortGPSWatcher

java.lang.Object
  extended by com.esri.core.internal.gps.GPSWatcher
      extended by com.esri.core.gps.SerialPortGPSWatcher
All Implemented Interfaces:
IGPSWatcher

public final class SerialPortGPSWatcher
extends com.esri.core.internal.gps.GPSWatcher

A IGPSWatcher with a serial port source such as GPS receivers, using NMEA standard.

  • Use SerialPortGPSWatcher(GPSEventListener) to automatically use one of the connected GPS receivers. The connected GPS device information can be obtained using getPortInfo().
  • Use SerialPortGPSWatcher(SerialPortInfo, GPSEventListener) to use a specific GPS receiver.
  • Use GPSWatcher.start() and GPSWatcher.stop() to start and stop reading from the receiver, respectively.

  • See Also:
    SerialPortGPSWatcher(GPSEventListener), SerialPortGPSWatcher(SerialPortInfo, GPSEventListener), GPSWatcher.start(), GPSWatcher.stop(), findGPSPorts(), SerialPortInfo, IGPSWatcher

    Field Summary
     
    Fields inherited from class com.esri.core.internal.gps.GPSWatcher
    gpsEventListeners
     
    Constructor Summary
    SerialPortGPSWatcher()
              Creates a SerialPortGPSWatcher that connects automatically to a GPS device.
    SerialPortGPSWatcher(GPSEventListener gpsEventListener)
              Creates a SerialPortGPSWatcher that connects automatically to a GPS device.
    SerialPortGPSWatcher(SerialPortInfo portInfo)
              Creates a SerialPortGPSWatcher that connects to the specified GPS device.
    SerialPortGPSWatcher(SerialPortInfo portInfo, GPSEventListener gpsEventListener)
              Creates a SerialPortGPSWatcher that connects to the specified GPS device.
     
    Method Summary
    protected  void connect()
              Establishes a connection by creating a native driver.
    static List<SerialPortInfo> findGPSPorts()
              Scans the standard serial ports (COM* on Windows, /dev/ttyS* on Linux) to search for GPS devices.
     SerialPortInfo getPortInfo()
               
     
    Methods inherited from class com.esri.core.internal.gps.GPSWatcher
    addListener, createCOMGPSDriver, createCOMGPSDriver, createFileGPSDriver, getStatus, getTimeout, getTimeoutInterval, scanGpsPorts, setStatus, setTimeout, setTimeoutInterval, start, startGps, stop, stopGps, updateLocation, updateSentence, updateStatus
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    SerialPortGPSWatcher

    public SerialPortGPSWatcher()
    Creates a SerialPortGPSWatcher that connects automatically to a GPS device.

    The connected GPS device information can be obtained using getPortInfo().


    SerialPortGPSWatcher

    public SerialPortGPSWatcher(GPSEventListener gpsEventListener)
    Creates a SerialPortGPSWatcher that connects automatically to a GPS device.

    GPS messages from the device will be directed to the specified GPSEventListener. The connected GPS device information can be obtained using getPortInfo().

    Parameters:
    gpsEventListener - listener to which the GPS messages will be directed.

    SerialPortGPSWatcher

    public SerialPortGPSWatcher(SerialPortInfo portInfo)
    Creates a SerialPortGPSWatcher that connects to the specified GPS device.

    *

    Parameters:
    portInfo - information about the GPS device to connect to.

    SerialPortGPSWatcher

    public SerialPortGPSWatcher(SerialPortInfo portInfo,
                                GPSEventListener gpsEventListener)
    Creates a SerialPortGPSWatcher that connects to the specified GPS device.

    Parameters:
    portInfo - information about the GPS device to connect to.
    gpsEventListener - listener to which the GPS messages will be directed. *
    Method Detail

    findGPSPorts

    public static List<SerialPortInfo> findGPSPorts()
    Scans the standard serial ports (COM* on Windows, /dev/ttyS* on Linux) to search for GPS devices. Note: This currently detects 1 GPS device only.

    Returns:
    a list of information about serial ports to which GPS devices are connected; an empty list if there are no GPS devices connected.

    getPortInfo

    public SerialPortInfo getPortInfo()
    Returns:
    the port information currently used by the watcher.

    connect

    protected void connect()
    Establishes a connection by creating a native driver.

    Specified by:
    connect in class com.esri.core.internal.gps.GPSWatcher


    Copyright © 2012. All Rights Reserved.