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/DecodersUtils.h@3:20f8faf2ad18, 2016-02-15 (annotated)
- Committer:
- chris215
- Date:
- Mon Feb 15 00:42:32 2016 +0000
- Revision:
- 3:20f8faf2ad18
Code refactor. Replace usage of strtok_r() with a custom version to fix parsing issues when the token is empty.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
chris215 | 3:20f8faf2ad18 | 1 | #ifndef _DECODERSUTILS_H_ |
chris215 | 3:20f8faf2ad18 | 2 | #define _DECODERSUTILS_H_ |
chris215 | 3:20f8faf2ad18 | 3 | |
chris215 | 3:20f8faf2ad18 | 4 | #include "mbed.h" |
chris215 | 3:20f8faf2ad18 | 5 | |
chris215 | 3:20f8faf2ad18 | 6 | char * strtok_single(char * str, char const * delims) |
chris215 | 3:20f8faf2ad18 | 7 | { |
chris215 | 3:20f8faf2ad18 | 8 | static char * src = NULL; |
chris215 | 3:20f8faf2ad18 | 9 | char * p, * ret = 0; |
chris215 | 3:20f8faf2ad18 | 10 | |
chris215 | 3:20f8faf2ad18 | 11 | if (str != NULL) |
chris215 | 3:20f8faf2ad18 | 12 | src = str; |
chris215 | 3:20f8faf2ad18 | 13 | |
chris215 | 3:20f8faf2ad18 | 14 | if (src == NULL) |
chris215 | 3:20f8faf2ad18 | 15 | return NULL; |
chris215 | 3:20f8faf2ad18 | 16 | |
chris215 | 3:20f8faf2ad18 | 17 | if ((p = strpbrk (src, delims)) != NULL) { |
chris215 | 3:20f8faf2ad18 | 18 | *p = 0; |
chris215 | 3:20f8faf2ad18 | 19 | ret = src; |
chris215 | 3:20f8faf2ad18 | 20 | src = ++p; |
chris215 | 3:20f8faf2ad18 | 21 | |
chris215 | 3:20f8faf2ad18 | 22 | } else if (*src) { |
chris215 | 3:20f8faf2ad18 | 23 | ret = src; |
chris215 | 3:20f8faf2ad18 | 24 | src = NULL; |
chris215 | 3:20f8faf2ad18 | 25 | } |
chris215 | 3:20f8faf2ad18 | 26 | |
chris215 | 3:20f8faf2ad18 | 27 | return ret; |
chris215 | 3:20f8faf2ad18 | 28 | } |
chris215 | 3:20f8faf2ad18 | 29 | #endif |