AssetTrackerRK
Public Member Functions | Friends
TinyGPSTime Struct Reference

Class to hold a time of 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...
 
uint32_t value ()
 Returns the current value and clears the updated flag.
 
void invalidate ()
 Sets the valid flag to false (marks data as invalid) More...
 
uint8_t hour ()
 Gets the hour value 0 <= hour < 24.
 
uint8_t minute ()
 Gets the minute value 0 <= minute < 60.
 
uint8_t second ()
 Gets the second value 0 <= second < 60.
 
uint8_t centisecond ()
 Gets centiseconds 0 <= centisecond < 100.
 
 TinyGPSTime ()
 Constructor.
 

Friends

class TinyGPSPlus
 

Detailed Description

Class to hold a time of day value.

Member Function Documentation

◆ age()

uint32_t TinyGPSTime::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 TinyGPSTime::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 TinyGPSTime::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 TinyGPSTime::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: