Skip to content

Commit 2102cf2

Browse files
committed
getTimeFullyResolved helper added
1 parent 37a9283 commit 2102cf2

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

examples/Example24_GetUnixEpochAndMicros/Example24_GetUnixEpochAndMicros.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ void loop()
9191
Serial.print(myGNSS.getSecond());
9292

9393
Serial.print(" Time is ");
94+
if (myGNSS.getTimeFullyResolved() == false)
95+
{
96+
Serial.print("not fully resolved but ");
97+
} else {
98+
Serial.print("fully resolved and ");
99+
}
94100
if (myGNSS.getTimeValid() == false)
95101
{
96102
Serial.print("not ");

keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ getNanosecond KEYWORD2
425425
getUnixEpoch KEYWORD2
426426
getDateValid KEYWORD2
427427
getTimeValid KEYWORD2
428+
getTimeFullyResolved KEYWORD2
428429
getConfirmedDate KEYWORD2
429430
getConfirmedTime KEYWORD2
430431
getFixType KEYWORD2

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9782,6 +9782,21 @@ bool SFE_UBLOX_GNSS::getTimeValid(uint16_t maxWait)
97829782
return ((bool)packetUBXNAVPVT->data.valid.bits.validTime);
97839783
}
97849784

9785+
//Check to see if the UTC time has been fully resolved
9786+
bool SFE_UBLOX_GNSS::getTimeFullyResolved(uint16_t maxWait)
9787+
{
9788+
if (packetUBXNAVPVT == NULL) initPacketUBXNAVPVT(); //Check that RAM has been allocated for the PVT data
9789+
if (packetUBXNAVPVT == NULL) //Bail if the RAM allocation failed
9790+
return (false);
9791+
9792+
if (packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.fullyResolved == false)
9793+
getPVT(maxWait);
9794+
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.fullyResolved = false; //Since we are about to give this to user, mark this data as stale
9795+
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
9796+
return ((bool)packetUBXNAVPVT->data.valid.bits.fullyResolved);
9797+
}
9798+
9799+
97859800
//Get the confirmed date validity
97869801
bool SFE_UBLOX_GNSS:: getConfirmedDate(uint16_t maxWait)
97879802
{

src/SparkFun_u-blox_GNSS_Arduino_Library.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ class SFE_UBLOX_GNSS
10611061

10621062
bool getDateValid(uint16_t maxWait = defaultMaxWait);
10631063
bool getTimeValid(uint16_t maxWait = defaultMaxWait);
1064+
bool getTimeFullyResolved(uint16_t maxWait = defaultMaxWait);
10641065
bool getConfirmedDate(uint16_t maxWait = defaultMaxWait);
10651066
bool getConfirmedTime(uint16_t maxWait = defaultMaxWait);
10661067

0 commit comments

Comments
 (0)