Update of /cvsroot/playerstage/code/player/server/drivers/gps
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23325

Modified Files:
        garminnmea.cc 
Log Message:
applied patch 1696209

Index: garminnmea.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/gps/garminnmea.cc,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** garminnmea.cc       23 Feb 2006 02:21:49 -0000      1.24
--- garminnmea.cc       19 Apr 2007 17:02:26 -0000      1.25
***************
*** 136,139 ****
--- 136,143 ----
  #define NMEA_GPRTE "GPRTE"
  
+ // these are standard NMEA sentences that come
+ // out of other units (NovaTel)
+ #define NMEA_GPGST "GPGST"
+ 
  // these are the proprietary NMEA sentences that 
  // come out of the geko 201
***************
*** 143,147 ****
  
  // spec says 82, but that done mean squat. Make it big
! #define NMEA_MAX_SENTENCE_LEN 83
  
  #define NMEA_START_CHAR '$'
--- 147,151 ----
  
  // spec says 82, but that done mean squat. Make it big
! #define NMEA_MAX_SENTENCE_LEN 128
  
  #define NMEA_START_CHAR '$'
***************
*** 220,223 ****
--- 224,228 ----
      int ParseGPRMC(const char *buf);
      int ParsePGRME(const char *buf);
+     int ParseGPGST(const char *buf);
      char* GetNextField(char* field, size_t len, const char* ptr);
  
***************
*** 366,369 ****
--- 371,389 ----
      cfsetospeed(&term, B38400);
    }
+   else if (gps_baud == 57600)
+   {
+     cfsetispeed(&term, B57600);
+        cfsetospeed(&term, B57600);
+   }
+   else if (gps_baud == 115200)
+   {
+     cfsetispeed(&term, B115200);
+        cfsetospeed(&term, B115200);
+   }
+   else if (gps_baud == 230400)
+   {
+     cfsetispeed(&term, B230400);
+        cfsetospeed(&term, B230400);
+   }
    else
    {
***************
*** 838,845 ****
      ParseGPRMC(ptr);
  
!   // the PGRME msg has the error
    if(!strcmp(tmp,NMEA_PGRME))
      ParsePGRME(ptr);
  
    return(0);
  }
--- 858,869 ----
      ParseGPRMC(ptr);
  
!   // the PGRME msg has the error (Garmin)
    if(!strcmp(tmp,NMEA_PGRME))
      ParsePGRME(ptr);
  
+   // the GPGST msg has the error (NMEA)
+   if(!strcmp(tmp,NMEA_GPGST))
+     ParseGPGST(ptr);
+ 
    return(0);
  }
***************
*** 1130,1133 ****
--- 1154,1218 ----
  }
  
+ /*
+  * Parse the GPGST sentence, which has esimated position error.
+  */
+ int GarminNMEA::ParseGPGST(const char *buf)
+ {
+   const char *ptr = buf;
+   char field[32];
+   double err;
+   double utc;
+   
+ //  printf("got GPGST (%s)\n", buf);
+ //  fflush(stdout);
+   
+   if(!(ptr = GetNextField(field, sizeof(field), ptr)))
+     return(-1);
+   
+   // First field is UTC time
+   utc = atof(field);
+   /* Maybe do a check to make sure current packet is the right packet */
+ 
+   if(!(ptr = GetNextField(field, sizeof(field), ptr)))
+        return(-1);
+   
+   // Second field is RMS deviation
+   err = atof(field);
+ 
+   if(!(ptr = GetNextField(field, sizeof(field), ptr)))
+        return(-1);
+   
+   // Third field is Semi-minor deviation
+   err = atof(field);
+ 
+   if(!(ptr = GetNextField(field, sizeof(field), ptr)))
+        return(-1);
+   
+   // Fourth field is Semi-major deviation
+   err = atof(field);
+ 
+   if(!(ptr = GetNextField(field, sizeof(field), ptr)))
+        return(-1);
+   
+   // Fifth field is Latitude error deviation
+   err = atof(field);
+   data.err_horz = (uint32_t) ( err * 1000);
+ 
+ 
+   // Sixth field is Longitude error deviation
+   err = atof(field);
+   data.err_vert = (uint32_t) ( err * 1000);
+ 
+   // Seventh field is Altitude error deviation
+   err = atof(field);
+ 
+   /* Dont write here
+   PutData(&data,sizeof(player_gps_data_t),0,0);
+   */
+ 
+   return 0;
+ }
+ 
+ 
  
  /*


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to