nmea gps library - without any serial

Dependents:   HARP2 HARP3 20180621_FT813

Fork of GPS_parser by Tyler Weaver

NMEA GPS Serial Output parser.

Routine taken from NMEA Software Standard (NMEA 0183) http://www.winsystems.com/software/nmea.pdf

Only handles GGA and RMC Messages

Files at this revision

API Documentation at this revision

Comitter:
tylerjw
Date:
Fri Dec 07 19:18:35 2012 +0000
Parent:
2:682663c5b1ee
Child:
4:6e2d98b5cb86
Commit message:
0.2

Changed in this revision

GPS.cpp Show annotated file Show diff for this revision Revisions of this file
GPS.h Show annotated file Show diff for this revision Revisions of this file
--- a/GPS.cpp	Fri Nov 23 21:16:27 2012 +0000
+++ b/GPS.cpp	Fri Dec 07 19:18:35 2012 +0000
@@ -32,25 +32,8 @@
     speed_km_unit = ' ';
 
     altitude_ft = 0.0;
-#ifdef OPEN_LOG
-    is_logging = false;
-#endif
 }
 
-#ifdef OPEN_LOG
-void GPS::start_log() {
-    is_logging = true;
-}
-
-void GPS::new_file(void) {
-    _openLog.newFile();
-}
-
-void GPS::stop_log(void) {
-    is_logging = false;
-}
-#endif
-
 float GPS::nmea_to_dec(float deg_coord, char nsew) {
     int degree = (int)(deg_coord/100);
     float minutes = deg_coord - degree*100;
@@ -67,13 +50,6 @@
 
     if (_gps.readable()) {
         getline();
-    
-#ifdef OPEN_LOG
-        if (is_logging && lock) {
-            format_for_log();
-            _openLog.write(bfr);
-        }
-#endif
 
         // Check if it is a GPGGA msg (matches both locked and non-locked msg)
         if (sscanf(msg, "GPGGA,%f,%f,%c,%f,%c,%d,%d,%f,%f,%c", &utc_time, &nmea_latitude, &ns, &nmea_longitude, &ew, &lock, &satelites, &hdop, &msl_altitude, &msl_units) >= 1) {
@@ -83,14 +59,6 @@
         else if (sscanf(msg, "GPRMC,%f,%f,%c,%f,%c,%f,%f,%d", &utc_time, &nmea_latitude, &ns, &nmea_longitude, &ew, &speed_k, &course_d, &date) >= 1) {
             line_parsed = RMC;
         }
-        // GLL - Geographic Position-Lat/Lon
-        else if (sscanf(msg, "GPGLL,%f,%c,%f,%c,%f,%c", &nmea_latitude, &ns, &nmea_longitude, &ew, &utc_time, &gll_status) >= 1) {
-            line_parsed = GLL;
-        }
-        // VTG-Course Over Ground and Ground Speed
-        else if (sscanf(msg, "GPVTG,%f,%c,%f,%c,%f,%c,%f,%c", &course_t, &course_t_unit, &course_m, &course_m_unit, &speed_k, &speed_k_unit, &speed_km, &speed_km_unit) >= 1) {
-            line_parsed = VTG;
-        }
         
         if(satelites == 0) {
             lock = 0;
--- a/GPS.h	Fri Nov 23 21:16:27 2012 +0000
+++ b/GPS.h	Fri Dec 07 19:18:35 2012 +0000
@@ -44,12 +44,6 @@
     double calc_dist_to_km(float, float);
     double calc_dist_to_m(float, float);
     
-#ifdef OPEN_LOG
-    void start_log(void);
-    void new_file(void);
-    void stop_log(void);
-#endif    
-    
 private:
     float nmea_to_dec(float, char);
     float trunc(float v);
@@ -60,9 +54,6 @@
     char msg[1024];
     char bfr[1030];
     bool is_logging;
-#ifdef OPEN_LOG
-    Logger _openLog;
-#endif
     // calculated values
     float dec_longitude;
     float dec_latitude;