AssetTrackerRK
Public Member Functions | Friends
TinyGPSDate Struct Reference

Class to hold a date (year, month, day) value. More...

#include <TinyGPS++.h>

Public Member Functions

bool isValid () const
 Returns true if the data is valid. More...
 
bool isUpdated () const
 Returns true if the value has been updated. More...
 
uint32_t age () const
 Returns the age of the value in milliseconds. More...
 
void invalidate ()
 Sets the valid flag to false (marks data as invalid) More...
 
uint32_t value ()
 Returns the current value and clears the updated flag.
 
uint16_t year ()
 Gets the year (4-digit, like 2019)
 
uint8_t month ()
 Gets the month 1 <= month <= 12.
 
uint8_t day ()
 Gets the day of month 1 <= day <= 31.
 
 TinyGPSDate ()
 Constructor.
 

Friends

class TinyGPSPlus
 

Detailed Description

Class to hold a date (year, month, day) value.

Member Function Documentation

◆ age()

uint32_t TinyGPSDate::age ( ) const
inline

Returns the age of the value in milliseconds.

If the value is not valid, then ULONG_MAX is returned.

You might check to see if age is < 10000 to make sure the value has been retrieved in the last 10 seconds, for example.

◆ invalidate()

void TinyGPSDate::invalidate ( )
inline

Sets the valid flag to false (marks data as invalid)

This is used internally when we get a valid GPS sentence that does not have a fix. It can be checked by using the isValid() method.

◆ isUpdated()

bool TinyGPSDate::isUpdated ( ) const
inline

Returns true if the value has been updated.

Getting the value clears the updated flag, and commiting a change sets it.

◆ isValid()

bool TinyGPSDate::isValid ( ) const
inline

Returns true if the data is valid.

The valid flag will be false if the GPS loses its fix, but will not be invalidated if the GPS stops returning data. If that is a possibility, you should also check the age.


The documentation for this struct was generated from the following files: