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.
Decoders/GPVTGdecoder.hpp
- Committer:
- chris215
- Date:
- 2014-08-06
- Revision:
- 0:0c1aa5906cef
- Child:
- 3:20f8faf2ad18
File content as of revision 0:0c1aa5906cef:
#include "mbed.h" #include "mbedGPSDefs.h" void DecodeGPVTG(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.TrueTrack = atof(token); if(parameterCount == 3) data.MagneticTrack = atof(token); if(parameterCount == 5) data.GroundSpeedN = atof(token); if(parameterCount == 7) data.GroundSpeedK = atof(token); parameterCount++; ptr = rest; // rest contains the left over part..assign it to ptr. token = strtok_r(ptr, ",",&rest); } }