jacketizer / libnmea

Lightweight C library for parsing NMEA 0183 sentences
MIT License
264 stars 93 forks source link

time and date not being parsed correctly on ESP-IDF #48

Closed stephenaa closed 3 years ago

stephenaa commented 3 years ago

The newlib strptime() implementation on that platform is a bit too crude, and thus will parse all content into the first argument. I have a simple fix that copies the date or time string into a token separated string that the newlib strptime() can parse correctly. However, that seems a bit messy and considering that a similar problem can occur on other platforms I was wondering if another solution would be preferable? Such as a simpler implementation not using strptime() but instead parsing the time and date fields itself?

igrr commented 3 years ago

Yes, this is a known issue. Please have a look at https://github.com/jacketizer/libnmea/pull/35 (typo) https://github.com/jacketizer/libnmea/pull/34 which may fix this. If you can test it or propose changes based on the fix you did, that would be appreciated!

jacketizer commented 3 years ago

I merged #34, but if writing a custom parsing implementation is better then I'm up for that :-)

igrr commented 3 years ago

Thanks, I'll update https://github.com/igrr/libnmea-esp32 to include the latest version of libnmea. Probably this issue can be closed.