rename minmea_getdate -> minmea_getdatetime
This commit is contained in:
parent
8e243e5310
commit
77d5410c68
4
minmea.c
4
minmea.c
@ -612,7 +612,7 @@ bool minmea_parse_zda(struct minmea_sentence_zda *frame, const char *sentence)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int minmea_getdate(struct tm *tm, const struct minmea_date *date, const struct minmea_time *time_)
|
int minmea_getdatetime(struct tm *tm, const struct minmea_date *date, const struct minmea_time *time_)
|
||||||
{
|
{
|
||||||
if (date->year == -1 || time_->hours == -1)
|
if (date->year == -1 || time_->hours == -1)
|
||||||
return -1;
|
return -1;
|
||||||
@ -637,7 +637,7 @@ int minmea_getdate(struct tm *tm, const struct minmea_date *date, const struct m
|
|||||||
int minmea_gettime(struct timespec *ts, const struct minmea_date *date, const struct minmea_time *time_)
|
int minmea_gettime(struct timespec *ts, const struct minmea_date *date, const struct minmea_time *time_)
|
||||||
{
|
{
|
||||||
struct tm tm;
|
struct tm tm;
|
||||||
if (minmea_getdate(&tm, date, time_))
|
if (minmea_getdatetime(&tm, date, time_))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */
|
time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */
|
||||||
|
2
minmea.h
2
minmea.h
@ -211,7 +211,7 @@ bool minmea_parse_zda(struct minmea_sentence_zda *frame, const char *sentence);
|
|||||||
/**
|
/**
|
||||||
* Convert GPS UTC date/time representation to a UNIX calendar time.
|
* Convert GPS UTC date/time representation to a UNIX calendar time.
|
||||||
*/
|
*/
|
||||||
int minmea_getdate(struct tm *tm, const struct minmea_date *date, const struct minmea_time *time_);
|
int minmea_getdatetime(struct tm *tm, const struct minmea_date *date, const struct minmea_time *time_);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert GPS UTC date/time representation to a UNIX timestamp.
|
* Convert GPS UTC date/time representation to a UNIX timestamp.
|
||||||
|
Loading…
Reference in New Issue
Block a user