Mbed library to handle GPS data reception and parsing

Dependents:   GPS_U-blox_NEO-6M_Code

Features

  • All positionning parameters are contained into a global data structure.
  • Automatic nema string parsing and data structure update.
    • GSA,GGA,VTG and RMC
  • Convert latitude and longitude to decimal value.
  • Converts latittude,longitude and altitude to ECEF coordinates.

Planed developement

  • Test library for RTOS use.
  • Complete the nema parsing decoders (couple of parameters are not parsed yet and not present in the data structure).
  • Add conversion tool to get ENU coordinates.
Revision:
0:0c1aa5906cef
Child:
3:20f8faf2ad18
diff -r 000000000000 -r 0c1aa5906cef Decoders/GPGGAdecoder.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Decoders/GPGGAdecoder.hpp	Wed Aug 06 01:37:39 2014 +0000
@@ -0,0 +1,54 @@
+#include "mbed.h"
+#include "mbedGPSDefs.h"
+
+void DecodeGPGGA(char * tokenStr,GPSInfo& data)
+{
+    int parameterCount = 0;
+    char *rest; // to point to the rest of the string after token extraction.
+    char *token; // to point to the actual token returned.
+    char *ptr = tokenStr; // make q point to start of hello.
+    token = strtok_r(ptr, ",",&rest);
+    while (token != NULL)
+    {
+        if(parameterCount == 1)
+            data.GPStime = atof(token);
+            
+        if(parameterCount == 2)
+            data.latitude = atof(token);
+            
+        if(parameterCount == 3)
+            data.latLoc = *token;
+                      
+        if(parameterCount == 4)
+            data.longitude = atof(token);
+            
+        if(parameterCount == 5)
+            data.lonLoc = *token;
+            
+        if(parameterCount == 6)
+            data.FixQal = atoi(token);
+            
+        if(parameterCount == 7)
+            data.TrackedSatCnt = atoi(token);
+            
+        if(parameterCount == 8)
+            data.HDOP = atof(token);
+            
+        if(parameterCount == 9)
+            data.GPSAltitude = atof(token);
+            
+        if(parameterCount == 11)
+            data.GEOIDHeight = atof(token);
+            
+        parameterCount++;
+        ptr = rest; // rest contains the left over part..assign it to ptr.
+        token = strtok_r(ptr, ",",&rest);
+    }
+    /*printf("Time:%lf\n",data.GPStime);
+    printf("Latitude:%4.4lf\n",data.latitude);
+    printf("Longitude:%4.4lf\n",data.longitude);
+    printf("GPS FIX:%d\n",data.GPSFix);
+    printf("GPS Altitude:%f\n",data.GPSAltitude);
+    printf("GPS Geoide Heigth:%f\n",data.GEOIDHeight);*/
+
+}
\ No newline at end of file