Lucy Luz / Mbed 2 deprecated RwSDCard_Xml_GPS

Dependencies:   FileManager GPSGms6 SDFileSystem mbed

Fork of 2545_SD_Card by Craig Evans

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