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.
Revision 4:d911d7c4e09d, committed 2016-02-15
- Comitter:
- chris215
- Date:
- Mon Feb 15 05:26:36 2016 +0000
- Parent:
- 3:20f8faf2ad18
- Child:
- 5:8a73e34b3978
- Commit message:
- Added gps message reception timeout.
Changed in this revision
--- a/Decoders/GPVTGdecoder.hpp Mon Feb 15 00:42:32 2016 +0000 +++ b/Decoders/GPVTGdecoder.hpp Mon Feb 15 05:26:36 2016 +0000 @@ -2,7 +2,8 @@ #include "DecodersUtils.h" #include "mbedGPSDefs.h" - +#include "USBSerial.h" +extern USBSerial pc; // Virtual serial port over USB void DecodeGPVTG(char * tokenStr,GPSInfo& data) {
--- a/GPS.cpp Mon Feb 15 00:42:32 2016 +0000 +++ b/GPS.cpp Mon Feb 15 05:26:36 2016 +0000 @@ -3,6 +3,8 @@ GPS::GPS(PinName tx, PinName rx) : RawSerial(tx, rx) { + _gpsTimer.start(); + _gpsTimer.reset(); RxQueueSize=0; RxQueueWriteIndex=0; RxQueueReadIndex=0; @@ -53,21 +55,30 @@ { GPSRMCMessage.MessageIsNew = 0; DecodeMessage(GPSRMCMessage,info); + _gpsTimer.reset(); } if(GPSGGAMessage.MessageIsNew > 0) { GPSGGAMessage.MessageIsNew = 0; DecodeMessage(GPSGGAMessage,info); + _gpsTimer.reset(); } if(GPSVTGMessage.MessageIsNew > 0) { GPSVTGMessage.MessageIsNew = 0; DecodeMessage(GPSVTGMessage,info); + _gpsTimer.reset(); } if(GPSGSAMessage.MessageIsNew > 0) { GPSGSAMessage.MessageIsNew = 0; DecodeMessage(GPSGSAMessage,info); + _gpsTimer.reset(); + } + + if(_gpsTimer.read_ms() > 5000) + { + info.fix = 1; } }
--- a/GPS.h Mon Feb 15 00:42:32 2016 +0000 +++ b/GPS.h Mon Feb 15 05:26:36 2016 +0000 @@ -39,6 +39,7 @@ uint32_t RxQueueWriteIndex; uint32_t RxQueueReadIndex; char insertIndex; + Timer _gpsTimer; }; #endif \ No newline at end of file