com.esf.device.gps.service
Interface IGPSService

All Superinterfaces:
IEsfFoundationService

public interface IGPSService
extends IEsfFoundationService

Gets data from GPS device.

Author:
larry.lendo

Field Summary
static java.lang.String SERVICE_NAME
          Helper method.
 
Method Summary
 float getAltitude()
          Returns the current altitude reported by the GPS device
 java.lang.String getFOM()
          Returns the most recent FOM message
 java.lang.String getGPGGA()
          Returns the most recent GPGGA message
 java.lang.String getGPGLL()
          Returns the most recent GPGLL message
 java.lang.String getGPGSA()
          Returns the most recent GPGSA message
 java.lang.String getGPGSV1()
          Returns the most recent GPGSV1 message
 java.lang.String getGPGSV2()
          Returns the most recent GPGSV2 message
 java.lang.String getGPGSV3()
          Returns the most recent GPGSV3 message
 java.lang.String getGPGSV4()
          Returns the most recent GPGSV4 message
 java.lang.String getGPRMC()
          Returns the most recent GPRMC message
 boolean getGpsLock()
          Returns a boolean value indicating if the GPS input stream indicates a GPS position fix.
 java.lang.String getGPVTG()
          Returns the most recent GPVTG message
 int getHeading()
          Returns the current heading reported by the GPS device.
 float getLat()
          Returns the latitude value reported by the GPS device.
 float getLon()
          Returns the longitude value reported by the GPS device.
 int getNumOfGSVMessages()
          Returns the number of GPGSV messages currently available
 int getPacc()
          Returns the dilution of precision of the current satellite fix.
 java.lang.String getPPS()
          Returns the most recent PPS message
 int getSats()
          Returns the number satellites locked by the GPS device.
 float getSpeedKPH()
          Returns the speed reported by the GPS device.
 float getSpeedMPH()
          Returns the speed reported by the GPS device.
 int getStat()
          Returns a status indicator for the GPS data.
 long getTime()
          Returns the current GPS time in UTC seconds.
 void sendCommand(java.lang.String command)
          Sends a command to the GPS device
 void setGpsBaudRate(int newBaudRate)
          Set the baud rate to be used of the next open of the GPS serial port.
 void setGpsPort(java.lang.String newPortName)
          Set the serial port (Linux device name) that will be used to open a connection to the GPS receiver.
 boolean setSystemTime()
          Sets the system clock based on the GPS time.
 
Methods inherited from interface com.esf.core.foundation.service.IEsfFoundationService
isRunning, restart, setPersistent, start, stop
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Helper method. Returns the class name of this Interface.

Method Detail

setGpsPort

void setGpsPort(java.lang.String newPortName)
Set the serial port (Linux device name) that will be used to open a connection to the GPS receiver. This port will be used on any subsequent call to enableStream().

Parameters:
newPortName - Linux device name of GPS serial port.

setGpsBaudRate

void setGpsBaudRate(int newBaudRate)
Set the baud rate to be used of the next open of the GPS serial port. This value will be used on any subsequent call to enableStream().

Parameters:
newBaudRate - serial port baud rate

getGpsLock

boolean getGpsLock()
Returns a boolean value indicating if the GPS input stream indicates a GPS position fix. If the GPS input stream is not currently available for any reason, then this value will be false.

Returns:
The position fix, as reported by the GPS receiver.

sendCommand

void sendCommand(java.lang.String command)
                 throws java.lang.Exception
Sends a command to the GPS device

Parameters:
command - the string representing the command to send to the GPS device
Throws:
java.lang.Exception - if an I/O error occurred on the GPS port, or if the GPS is not enabled.

getGPGGA

java.lang.String getGPGGA()
Returns the most recent GPGGA message

Returns:
the most recent GPGGA message

getGPGLL

java.lang.String getGPGLL()
Returns the most recent GPGLL message

Returns:
the most recent GPGLL message

getGPGSA

java.lang.String getGPGSA()
Returns the most recent GPGSA message

Returns:
the most recent GPGSA message

getNumOfGSVMessages

int getNumOfGSVMessages()
Returns the number of GPGSV messages currently available

Returns:
the total number of GSV messages currently available

getGPGSV1

java.lang.String getGPGSV1()
Returns the most recent GPGSV1 message

Returns:
the most recent GPGSV1 message

getGPGSV2

java.lang.String getGPGSV2()
Returns the most recent GPGSV2 message

Returns:
the most recent GPGSV2 message

getGPGSV3

java.lang.String getGPGSV3()
Returns the most recent GPGSV3 message

Returns:
the most recent GPGSV3 message

getGPGSV4

java.lang.String getGPGSV4()
Returns the most recent GPGSV4 message

Returns:
the most recent GPGSV4 message

getGPRMC

java.lang.String getGPRMC()
Returns the most recent GPRMC message

Returns:
the most recent GPRMC message

getGPVTG

java.lang.String getGPVTG()
Returns the most recent GPVTG message

Returns:
the most recent GPVTG message

getFOM

java.lang.String getFOM()
Returns the most recent FOM message

Returns:
the most recent FOM message

getPPS

java.lang.String getPPS()
Returns the most recent PPS message

Returns:
the most recent PPS message

setSystemTime

boolean setSystemTime()
Sets the system clock based on the GPS time. This will only occur if a valid GPS lock is available. If not, setSystemTime() will return false and not set the system time. Otherwise, the system time will be set and true will be returned

Returns:
boolean, true if the operation completed without errors

getTime

long getTime()
Returns the current GPS time in UTC seconds.

Returns:
UTC time in seconds since Jan 1, 1970 00:00:00

getStat

int getStat()
Returns a status indicator for the GPS data. Statuses are: 1 = no GPS response; 2 = error in response; 4 = valid.

Returns:
status

getSats

int getSats()
Returns the number satellites locked by the GPS device.

Returns:
number of satellites locked by the GPS device.

getLat

float getLat()
Returns the latitude value reported by the GPS device.

Returns:
latitude, in units of seconds.

getLon

float getLon()
Returns the longitude value reported by the GPS device.

Returns:
longitude, in units of seconds, accurate to the nearest minute.

getSpeedMPH

float getSpeedMPH()
Returns the speed reported by the GPS device.

Returns:
current speed, in miles per hour.

getSpeedKPH

float getSpeedKPH()
Returns the speed reported by the GPS device.

Returns:
current speed, in kilometers per hour.

getHeading

int getHeading()
Returns the current heading reported by the GPS device.

Returns:
heading in degrees.

getPacc

int getPacc()
Returns the dilution of precision of the current satellite fix. DOP (dilution of precision) is an indication of the effect of satellite geometry on the accuracy of the fix. It is a unitless number where smaller is better. For 3D fixes using 4 satellites a 1.0 would be considered to be a perfect number, however for overdetermined solutions it is possible to see numbers below 1.0.

Returns:
dilution of precision

getAltitude

float getAltitude()
Returns the current altitude reported by the GPS device

Returns:
altitude in feet