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.
Diff: Decoders/GPVTGdecoder.hpp
- Revision:
- 3:20f8faf2ad18
- Parent:
- 0:0c1aa5906cef
- Child:
- 4:d911d7c4e09d
diff -r 72ac4d7044a7 -r 20f8faf2ad18 Decoders/GPVTGdecoder.hpp --- a/Decoders/GPVTGdecoder.hpp Sun Feb 14 05:55:38 2016 +0000 +++ b/Decoders/GPVTGdecoder.hpp Mon Feb 15 00:42:32 2016 +0000 @@ -1,15 +1,21 @@ #include "mbed.h" +#include "DecodersUtils.h" #include "mbedGPSDefs.h" + + void DecodeGPVTG(char * tokenStr,GPSInfo& data) { + //pc.printf("VTGDecoder debug: %s\n\r",tokenStr); 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); + //token = strtok_single(ptr, ","); + token = strtok_single(ptr, ","); while (token != NULL) { + //pc.printf("%d:%s ",parameterCount,token); if(parameterCount == 1) data.TrueTrack = atof(token); @@ -24,6 +30,8 @@ parameterCount++; ptr = rest; // rest contains the left over part..assign it to ptr. - token = strtok_r(ptr, ",",&rest); + //token = strtok_r(ptr, ",",&rest); + token = strtok_single(NULL, ","); } + //pc.printf("\n\r"); } \ No newline at end of file