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.

Files at this revision

API Documentation at this revision

Comitter:
chris215
Date:
Tue Feb 16 02:57:35 2016 +0000
Parent:
4:d911d7c4e09d
Commit message:
Function renaming. Adding gps update calls.

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
diff -r d911d7c4e09d -r 8a73e34b3978 GPS.cpp
--- a/GPS.cpp	Mon Feb 15 05:26:36 2016 +0000
+++ b/GPS.cpp	Tue Feb 16 02:57:35 2016 +0000
@@ -49,7 +49,7 @@
             RxMessageBuffer.data[(insertIndex++)%RX_BUFFER_SIZE] = in;
     }
 }
-void GPS::PumpGpsMessages(void)
+void GPS::UpdateGPS(void)
 {
     if(GPSRMCMessage.MessageIsNew > 0)
     {
@@ -88,11 +88,13 @@
 }
 ECEFDistance GPS::DistanceBetweenTwoWP(ECEFPoint p1,ECEFPoint p2)
 {
+    
     return DistanceBetweenTwoECEFPoints(p1,p2);
 }
 
 geodPoint   GPS::ReadDecGeodLoc(void){
     geodPoint newLoc;
+    UpdateGPS();
     newLoc.latitude = nmea_to_dec(info.latitude,info.latLoc);
     newLoc.longitude = nmea_to_dec(info.longitude,info.lonLoc);
     newLoc.altitude = info.GPSAltitude;
@@ -101,6 +103,7 @@
     
 geodPoint   GPS::ReadRawGeodLoc(void){
     geodPoint newLoc;
+    UpdateGPS();
     newLoc.latitude = info.latitude;
     newLoc.longitude = info.longitude;
     newLoc.altitude = info.GPSAltitude;
@@ -109,12 +112,15 @@
     
     
 bool    GPS::FixIs3d(void){
+    UpdateGPS();
     return (info.fix == 3);
     }
 bool    GPS::FixIs2d(void){
+    UpdateGPS();
     return (FixIs3d() || (info.fix == 2));
     }
 bool    GPS::GPSFixValid(void){
+        UpdateGPS();
         return (info.GPSStatus == 'A');
     }
 
diff -r d911d7c4e09d -r 8a73e34b3978 GPS.h
--- a/GPS.h	Mon Feb 15 05:26:36 2016 +0000
+++ b/GPS.h	Tue Feb 16 02:57:35 2016 +0000
@@ -26,7 +26,7 @@
     
     GPSInfo info;   //current gps information
     
-    void PumpGpsMessages(void);       
+    void UpdateGPS(void);       
 
     private:
     void RxIrqHandler(void);