Example code for reading from a serial GPS unit & parsing an RMC GPS string to a struct.
Fork of mbed_blinky by
Revision 19:cbacec32ae4b, committed 2017-03-09
- Comitter:
- HackerLabATTKit01
- Date:
- Thu Mar 09 22:31:06 2017 +0000
- Parent:
- 18:7ba014531492
- Child:
- 20:a728f1075fb1
- Commit message:
- Fixed decimal issue in parsing
Changed in this revision
GPRMCSentence.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/GPRMCSentence.h Thu Mar 09 21:57:29 2017 +0000 +++ b/GPRMCSentence.h Thu Mar 09 22:31:06 2017 +0000 @@ -105,7 +105,7 @@ (gprmcstr[5] == 'C') && (gprmcstr[6] == ',')) { pos = parseStringToGPRMCStructEntry(gprmcstr,gprmstruct->time,pos,TIMEMAX); - //pos = parseStringToGPRMCStructEntry(gprmcstr,devnull,pos,DEVNULMAX); // to get rid of time decimal, needed for some gps modules + if (gprmcstr[pos] != ',') pos = parseStringToGPRMCStructEntry(gprmcstr,devnull,pos,DEVNULMAX); // to get rid of time decimal, needed for some gps modules if (gprmcstr[pos] != ',') {gprmstruct->status = gprmcstr[pos];pos++;} else gprmstruct->status = '\0'; pos++;