Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FileManager GPSGms6 SDFileSystem mbed
Fork of 2545_SD_Card by
Diff: GPSGms6.cpp
- Revision:
- 9:4d0c81290638
- Parent:
- 6:a05ec997c496
--- a/GPSGms6.cpp Mon May 09 10:33:40 2016 +0000 +++ b/GPSGms6.cpp Mon May 09 11:38:22 2016 +0000 @@ -150,4 +150,29 @@ bool GPSGms6::available() { return (m_available); +} +tm GPSGms6::UTCTime() +{ + struct tm t; + if (m_gprmc.date[0] != ' ' && m_gprmc.time[0] != ' ' ) + { + char str[3]; + + memcpy( str, &m_gprmc.time[4], 2 ); + t.tm_sec = atoi(str); + memcpy( str, &m_gprmc.time[2], 2 ); + t.tm_min = atoi(str); + memcpy( str, &m_gprmc.time[0], 2 ); + t.tm_hour = atoi(str); + + memcpy( str, &m_gprmc.date[0], 2 ); + t.tm_mday = atoi(str); + + memcpy( str, &m_gprmc.date[2], 2 ); + t.tm_mon = atoi(str); + + memcpy( str, &m_gprmc.date[4], 2 ); + t.tm_year = atoi(str); + } + return (t); } \ No newline at end of file