LoRaSpace / GPS

Fork of NEO-6m-GPS by t k

Embed: (wiki syntax)

« Back to documentation index

GPS Class Reference

GPS Class Reference

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

#include <GPS.h>

Public Member Functions

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

Data Fields

int hour
 Beijig time format(shi,fen,miao)
float longitude
 The longitude (call sample() to set)
char ns
 display north/south, east/west unit
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 GPS interface for reading from a serial GPS module.

Definition at line 30 of file GPS.h.


Constructor & Destructor Documentation

GPS ( PinName  tx,
PinName  rx,
int  Baud 
)

Create the GPS 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 GPS.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 33 of file GPS.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 73 of file GPS.h.

float geoid

The geoid (call sample() to set)

Definition at line 76 of file GPS.h.

float hdop

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

Definition at line 67 of file GPS.h.

int hour

Beijig time format(shi,fen,miao)

Definition at line 47 of file GPS.h.

float latitude

The latitude (call sample() to set)

Definition at line 58 of file GPS.h.

float longitude

The longitude (call sample() to set)

Definition at line 52 of file GPS.h.

char msg[256]

The NMEA sentence.

Definition at line 79 of file GPS.h.

char ns

display north/south, east/west unit

Definition at line 55 of file GPS.h.

int sats

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

Definition at line 64 of file GPS.h.

float time

The time (call sample() to set)

Definition at line 61 of file GPS.h.