Fixed compiler errors/warnings (declaration of _uidx, scope of index variables i)

Dependents:   GPSDevice LogData_UM6-to-SDcard UM6withGPS mbed-cansat-test-GPS ... more

Fork of MODGPS by Andy K

Revision:
2:8aa059e7d8b1
Parent:
0:db98027c0bbb
Child:
5:7f130f85d5a4
--- a/GPS_Time.cpp	Sat Nov 20 21:02:06 2010 +0000
+++ b/GPS_Time.cpp	Fri Apr 15 12:23:52 2011 +0000
@@ -33,6 +33,10 @@
     tenths = 0;
     hundreths = 0;
     status = 'V';
+    velocity = 0;
+    track = 0;    
+    magvar_dir = 'W';
+    magvar = 0;
 }
 
 GPS_Time *
@@ -98,6 +102,7 @@
     }
 }
 
+// $GPRMC,112709.735,A,5611.5340,N,00302.0306,W,000.0,307.0,150411,,,A*70
 void 
 GPS_Time::nmea_rmc(char *s)
 {
@@ -106,13 +111,21 @@
     char *time   = (char *)NULL;
     char *date   = (char *)NULL;
     char *stat   = (char *)NULL;
-    
+    char *vel    = (char *)NULL;
+    char *trk    = (char *)NULL;
+    char *magv   = (char *)NULL;
+    char *magd   = (char *)NULL;
+
     token = strtok(s, ",");
     while (token) {
         switch (token_counter) {
-            case 9: date   = token; break;
-            case 1: time   = token; break;
-            case 2: stat   = token; break;
+            case 9:  date   = token; break;
+            case 1:  time   = token; break;
+            case 2:  stat   = token; break;
+            case 7:  vel    = token; break;
+            case 8:  trk    = token; break;
+            case 10: magv   = token; break;
+            case 11: magd   = token; break;
         }
         token = strtok((char *)NULL, ",");
         token_counter++;
@@ -126,7 +139,10 @@
         month      = (char)((date[2] - '0') * 10) + (date[3] - '0');
         year       =  (int)((date[4] - '0') * 10) + (date[5] - '0') + 2000;
         status     = stat[0];
-        
+        velocity   = atof(vel);
+        track      = atof(trk);
+        magvar     = atof(magv);
+        magvar_dir = magd[0];
     }    
 }