com.esri.core.gps
Interface IGPSWatcher

All Known Implementing Classes:
FileGPSWatcher, com.esri.core.internal.gps.GPSWatcher, SerialPortGPSWatcher

public interface IGPSWatcher

The purpose of the watcher are

  • watch GPS messages sent from the GPS source it connects to.
  • watch for change in status of the GPS source.
  • notify GPSEventListener, if any, based on the GPS message received and the status of its source.
  • See Also:
    #start()}, {@link #stop()}, GPSEventListener, GPSStatus

    Method Summary
     void addListener(GPSEventListener gpsEventListener)
              Adds a GPS event listener to the watcher.
     GPSStatus getStatus()
              Gets the current status of the watcher.
     int getTimeout()
              Returns the timeout.
     void setTimeout(int timeout)
              Sets the timeout period to receive GPS messages from the GPS device.
     void start()
              Starts the GPS Watcher.
     void stop()
              Stops the GPS Watcher.
     

    Method Detail

    addListener

    void addListener(GPSEventListener gpsEventListener)
                     throws GPSException
    Adds a GPS event listener to the watcher. The listeners will be notified of the GPS messages based on GPS messages.

    Parameters:
    gpsEventListener - GPS event listener.
    Throws:
    GPSException - if trying to add a listener when the status is GPSStatus.RUNNING.

    getStatus

    GPSStatus getStatus()
    Gets the current status of the watcher.

    Returns:
    the current status of the watcher.

    start

    void start()
               throws GPSException
    Starts the GPS Watcher.
  • The watcher with be in GPSStatus.RUNNING state if this is successful.
  • This will be a no-op if the current status is GPSStatus.RUNNING.
  • Throws:
    GPSException - on any error while starting the watcher.

    stop

    void stop()
              throws GPSException
    Stops the GPS Watcher.
  • The watcher will be in GPSStatus.STOPPED state if this is successful.
  • This will be a no-op if the current status is GPSStatus.STOPPED.
  • Throws:
    GPSException - on any error while stopping the watcher.

    setTimeout

    void setTimeout(int timeout)
                    throws GPSException
    Sets the timeout period to receive GPS messages from the GPS device. If no message is received within the timeout period, the watcher will go in GPSStatus.TIMEOUT state.

    Parameters:
    timeout - interval, in milliseconds.
    Throws:
    GPSException - on error, such as if timeout is not more than 0.

    getTimeout

    int getTimeout()
    Returns the timeout.

    Returns:
    the current timeout interval, in milliseconds.


    Copyright © 2012. All Rights Reserved.