Components / SerialGPS

Dependents:   Sparkfun_GPS_Shield My_GPS Teste_GPS_luis STM32L152RE ... more

Fork of SerialGPS by Components

Embed: (wiki syntax)

« Back to documentation index

SerialGPS Class Reference

SerialGPS Class Reference

A SerialGPS interface for reading from a serial GPS module. More...

#include <SerialGPS.h>

Public Member Functions

 SerialGPS (PinName tx, PinName rx, int Baud)
 Create the SerialGPS interface, connected to the specified serial port and speed.
int sample ()
 Sample the incoming GPS data, returning whether there is a lock.

Data Fields

float longitude
 The longitude (call sample() to set)
float latitude
 The latitude (call sample() to set)
float time
 The time (call sample() to set)
int sats
 Number of satellites received (call sample() to set)
float hdop
 Horizontal dilusion of precision (call sample() to set)
float alt
 The altitude (call sample() to set) Note that the accurate altitude is corrected by the geoid See http://homepages.slingshot.co.nz/~geoff36/datum.htm.
float geoid
 The geoid (call sample() to set)
char msg [256]
 The NMEA sentence.

Detailed Description

A SerialGPS interface for reading from a serial GPS module.

Definition at line 30 of file SerialGPS.h.


Constructor & Destructor Documentation

SerialGPS ( PinName  tx,
PinName  rx,
int  Baud 
)

Create the SerialGPS interface, connected to the specified serial port and speed.

for example, GlobalSat EM406-A (e.g. on SparkFun GPS Shield) is 4800 Baud, Adafruit Ultimate GPSv3 (connected to serial) is 9600 Baud

Definition at line 26 of file SerialGPS.cpp.


Member Function Documentation

int sample (  )

Sample the incoming GPS data, returning whether there is a lock.

Returns:
1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0

Definition at line 32 of file SerialGPS.cpp.


Field Documentation

float alt

The altitude (call sample() to set) Note that the accurate altitude is corrected by the geoid See http://homepages.slingshot.co.nz/~geoff36/datum.htm.

Definition at line 64 of file SerialGPS.h.

float geoid

The geoid (call sample() to set)

Definition at line 67 of file SerialGPS.h.

float hdop

Horizontal dilusion of precision (call sample() to set)

Definition at line 58 of file SerialGPS.h.

float latitude

The latitude (call sample() to set)

Definition at line 49 of file SerialGPS.h.

float longitude

The longitude (call sample() to set)

Definition at line 46 of file SerialGPS.h.

char msg[256]

The NMEA sentence.

Definition at line 70 of file SerialGPS.h.

int sats

Number of satellites received (call sample() to set)

Definition at line 55 of file SerialGPS.h.

float time

The time (call sample() to set)

Definition at line 52 of file SerialGPS.h.