com.esri.core.gps
Enum GPSStatus

java.lang.Object
  extended by java.lang.Enum<GPSStatus>
      extended by com.esri.core.gps.GPSStatus
All Implemented Interfaces:
Serializable, Comparable<GPSStatus>

public enum GPSStatus
extends Enum<GPSStatus>

This indicates the status of the IGPSWatcher. Since the IGPSWatcher is connected to an underlying GPS source, this status also represents the state of the GPS source. Different states are:

  • INVALID
  • CRITICAL_FAILURE
  • PARSE_FAILURE
  • NOT_CONNECTED
  • TIMEOUT
  • RUNNING
  • STOPPED

  • Enum Constant Summary
    CRITICAL_FAILURE
              Critical failure.
    INVALID
              Invalid state.
    NOT_CONNECTED
              GPS source is not connected.
    PARSE_FAILURE
              Any failure in parsing NMEA sentence.
    RUNNING
              Watcher is connected, and receiving proper data at expected intervals.
    STOPPED
              Watcher has been stopped explicitly.
    TIMEOUT
              Timed out trying to read from the GPS source.
     
    Method Summary
    static GPSStatus getFromCode(int statusCode)
              Returns a GPSStatus based on input code.
     int getStatusCode()
               
    static GPSStatus valueOf(String name)
              Returns the enum constant of this type with the specified name.
    static GPSStatus[] values()
              Returns an array containing the constants of this enum type, in the order they are declared.
     
    Methods inherited from class java.lang.Enum
    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
     
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
     

    Enum Constant Detail

    INVALID

    public static final GPSStatus INVALID
    Invalid state. This should never happen.


    CRITICAL_FAILURE

    public static final GPSStatus CRITICAL_FAILURE
    Critical failure. Re-start the watcher to re-connect to the GPS source. If re-start fails, try to re-create the watcher.


    PARSE_FAILURE

    public static final GPSStatus PARSE_FAILURE
    Any failure in parsing NMEA sentence. Watcher is still connected and receiving data at expected intervals. This is an temporary failure. Status will switch to # on next valid NMEA sentence. This state implies that the watcher is still running.


    NOT_CONNECTED

    public static final GPSStatus NOT_CONNECTED
    GPS source is not connected. Will need to re-connect the GPS source and then start the watcher.


    TIMEOUT

    public static final GPSStatus TIMEOUT
    Timed out trying to read from the GPS source. The source is still connected. Watcher is still connected but not receiving data at expected intervals. This is an temporary failure. Status will switch to RUNNING on next data from source. This state implies that the watcher is still running.


    RUNNING

    public static final GPSStatus RUNNING
    Watcher is connected, and receiving proper data at expected intervals.


    STOPPED

    public static final GPSStatus STOPPED
    Watcher has been stopped explicitly. Also, the watcher is set to this status immediately after its creation.

    Method Detail

    values

    public static GPSStatus[] values()
    Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
    for (GPSStatus c : GPSStatus.values())
        System.out.println(c);
    

    Returns:
    an array containing the constants of this enum type, in the order they are declared

    valueOf

    public static GPSStatus valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

    Parameters:
    name - the name of the enum constant to be returned.
    Returns:
    the enum constant with the specified name
    Throws:
    IllegalArgumentException - if this enum type has no constant with the specified name
    NullPointerException - if the argument is null

    getStatusCode

    public int getStatusCode()
    Returns:
    the status code for this GPSStatus.

    getFromCode

    public static GPSStatus getFromCode(int statusCode)
    Returns a GPSStatus based on input code.

    Parameters:
    statusCode - status code.
    Returns:
  • CRITICAL_FAILURE, if input is -4
  • PARSE_FAILURE, if input is -3
  • NOT_CONNECTED, if input is -2
  • TIMEOUT, if input is -1
  • RUNNING, if input is 0
  • STOPPED, if input is 1
  • INVALID, otherwise


  • Copyright © 2012. All Rights Reserved.