Quang Anh Le / GPS

Dependents:   GPS-Tracking-Velo

Embed: (wiki syntax)

« Back to documentation index

GPS Class Reference

GPS Class Reference

A GPS interface for reading from a Globalsat EM-406 GPS Module. More...

#include <GPS.h>

Public Member Functions

 GPS (PinName tx, PinName rx)
 Create the GPS interface, connected to the specified serial port.
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 utc
 The UTC time.
int fix
 fix quality
int fix_3d
 fix3D fix - values include: 1 = no fix,2 = 2D fix,3 = 3D fix
float altitude
 Altitude, Meters, above mean sea level.
int sat_tracked
 Number of satellites being tracked.
float speed
 dilution of precision (PDOP)
int date
 date of object
int id1
 PRNs (IDS) of satellites used for fix (space for 12)

Detailed Description

A GPS interface for reading from a Globalsat EM-406 GPS Module.

Definition at line 29 of file GPS.h.


Constructor & Destructor Documentation

GPS ( PinName  tx,
PinName  rx 
)

Create the GPS interface, connected to the specified serial port.

Definition at line 25 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

$GPGSA,A,3,04,05,,09,12,,,24,,,,,2.5,1.3,2.1*39

Where: GSA Satellite status A Auto selection of 2D or 3D fix (M = manual) 3 3D fix - values include: 1 = no fix 2 = 2D fix 3 = 3D fix 04,05... PRNs of satellites used for fix (space for 12) 2.5 PDOP (dilution of precision) 1.3 Horizontal dilution of precision (HDOP) 2.1 Vertical dilution of precision (VDOP) 39 the checksum data, always begins with

Definition at line 33 of file GPS.cpp.


Field Documentation

float altitude

Altitude, Meters, above mean sea level.

Definition at line 60 of file GPS.h.

int date

date of object

Definition at line 79 of file GPS.h.

int fix

fix quality

Definition at line 54 of file GPS.h.

int fix_3d

fix3D fix - values include: 1 = no fix,2 = 2D fix,3 = 3D fix

Definition at line 57 of file GPS.h.

int id1

PRNs (IDS) of satellites used for fix (space for 12)

Definition at line 82 of file GPS.h.

float latitude

The latitude (call sample() to set)

Definition at line 46 of file GPS.h.

float longitude

The longitude (call sample() to set)

Definition at line 43 of file GPS.h.

Number of satellites being tracked.

Definition at line 63 of file GPS.h.

float speed

dilution of precision (PDOP)

Horizontal dilution of precision (HDOP) Vertical dilution of precision (VDOP) speed in knots

Definition at line 76 of file GPS.h.

float utc

The UTC time.

Definition at line 49 of file GPS.h.