7.0 KiB
Choosing your configuration
There are only a few configurations provided by examples. If your application needs something slightly different, here is a general configuration process.
What number do you want?
First, decide which data members of gps_fix
and NMEAGPS
you need (see [Data Model](Data Model.md) for member descriptions). Those members must be enabled in GPSfix_cfg.h
.
Next, figure out what messages can fill out those members, because those messages must be enabled in NMEAGPS_cfg.h
. Here is a table of the NMEA messages parsed by NeoGPS, and which data members they affect:
Message Data Member |
GGA |
GLL |
GSA |
GST |
GSV |
RMC |
VTG |
ZDA |
PUBX |
PUBX |
class gps_fix | ||||||||||
status |
* | * | * | * | * | * | ||||
date2 |
* | * | * | |||||||
time2 |
* | * | * | * | * | * | * | |||
lat/lon |
* | * | * | * | ||||||
altitude |
* | * | ||||||||
speed |
* | * | * | |||||||
heading |
* | * | * | |||||||
satellites 3 |
* | * | * | |||||||
HDOP |
* | * | * | |||||||
VDOP |
* | * | ||||||||
PDOP |
* | |||||||||
TDOP |
* | |||||||||
Velocity North, |
* 4 * 4 * |
|||||||||
lat, lon, alt error |
* | * | ||||||||
speed error, |
||||||||||
class NMEAGPS | ||||||||||
satellite IDs 3 |
* | * | ||||||||
satellite azimuth, |
* |
This table illustrates the poor design of the NMEA message set: it requires multiple messages to deliver a complete fix (i.e., all members of gps_fix
). This also explains why many manufacturers provide proprietary messages that are more complete. Above, you can see that the $PUBX,00
1 message contains all members except date
.
While the manufacturer's specification will document all sentences supported for your device, you can also find general descriptions of many NMEA sentences here, here or here.
1 The NMEA proprietary messages "PUBX" are only availble in the ubloxNMEA
class. See ublox-specific instructions for adding this class to your configuration.
2 Date and time are both stored in one member of gps_fix
, called dateTime
. The fix.dateTime
member is a C++ class that has both date-oriented members (Date, Month and Year) and time-oriented members (Hours, Minutes and Seconds). See NeoTime.h for the complete description and capabilities of the dateTime
member, such as date/time arithmetic and conversion to/from seconds since the epoch. Hundredths of a second are stored in a separate member of gps_fix
, called dateTime_cs
, and can also be accessed with the functions dateTime_ms()
and dateTime_us()
.
3 The fix.satellites
member identifies how many of these satellites were used to calculate a fix. The number of satellites' information available in the gps.satellites[]
array is stored in gps.sat_count
. This the total number of satellites that may or may not be used for calculating a fix.
4 Only Velocity Down is provided by the PUBX,00 message. A utility routine is provided to calculate Velocity North and East from Speed and Heading, if enabled. See calculateNorthAndEastVelocityFromSpeedAndHeading
in gps_fix.h.
5 These fields are only available from UBX binary messages.