Bibliothèque pur gps, trame NMEA, conversion des coordonnées au format WSG84
Dependencies: mbed
Fork of GPSINT by
Diff: GPSINT.cpp
- Revision:
- 2:de2d5174457f
- Parent:
- 1:c266b90b4c74
--- a/GPSINT.cpp Wed Nov 05 16:43:55 2014 +0000 +++ b/GPSINT.cpp Wed Jun 01 15:09:42 2016 +0000 @@ -25,7 +25,7 @@ #include "GPSINT.h" GPSINT::GPSINT(PinName tx, PinName rx) : _gps(tx, rx) { - _gps.baud(4800); + _gps.baud(9600); GPSidx=0; // Index for GPS buffer GPSstate=0; // Used to wait for '$' in GPS interrupt _gps.attach(this,&GPSINT::GPSSerialRecvInterrupt, _gps.RxIrq); // Recv interrupt handler @@ -71,8 +71,8 @@ void GPSINT::parseGPSString(char *GPSstrParse){ //check if $GPGGA string - if(!strncmp(GPSstrParse, "$GPGGA", 6)){ - if (sscanf(GPSstrParse, "$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) { + if(!strncmp(GPSstrParse, "$GNGGA", 6)){ + if (sscanf(GPSstrParse, "$GNGGA,%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) { // printf("%s", GPSstrParse); return; }