spiralray gps decoder
Dependents: SakuraIO_Evaluation_Board_Standard SakuraIO_Evalution_Board_Standard sakuraio_plus_rental_server
Diff: gps.cpp
- Revision:
- 2:fc3ce3241d89
- Parent:
- 1:f949d6d3a7e7
- Child:
- 4:82d2fced184b
--- a/gps.cpp Wed Nov 29 05:57:39 2017 +0000 +++ b/gps.cpp Wed Nov 29 06:23:34 2017 +0000 @@ -130,6 +130,19 @@ return cnt; } +time_t GPSDecoder::get_unixtime() +{ + struct tm t; + t.tm_sec = sec; + t.tm_min = min; + t.tm_hour = hour; + t.tm_mday = day; + t.tm_mon = month - 1; + t.tm_year = year - 1900; + + return mktime(&t); +} + void GPSDecoder::dump_info(char *buf) { sprintf(buf, "%d/%02d/%02d %02d:%02d:%02d.%03d (UTC)\r\n", year, month, day, hour, min, sec, msec);