Skip to content

Commit 5101246

Browse files
authored
Merge pull request #41 from UT2UH/TResolved
getTimeFullyResolved helper added - thank you @UT2UH
2 parents 34627a5 + 2102cf2 commit 5101246

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
@@ -428,6 +428,7 @@ getNanosecond KEYWORD2
428428
getUnixEpoch KEYWORD2
429429
getDateValid KEYWORD2
430430
getTimeValid KEYWORD2
431+
getTimeFullyResolved KEYWORD2
431432
getConfirmedDate KEYWORD2
432433
getConfirmedTime KEYWORD2
433434
getFixType KEYWORD2

src/SparkFun_u-blox_GNSS_Arduino_Library.cpp

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

9927+
//Check to see if the UTC time has been fully resolved
9928+
bool SFE_UBLOX_GNSS::getTimeFullyResolved(uint16_t maxWait)
9929+
{
9930+
if (packetUBXNAVPVT == NULL) initPacketUBXNAVPVT(); //Check that RAM has been allocated for the PVT data
9931+
if (packetUBXNAVPVT == NULL) //Bail if the RAM allocation failed
9932+
return (false);
9933+
9934+
if (packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.fullyResolved == false)
9935+
getPVT(maxWait);
9936+
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.fullyResolved = false; //Since we are about to give this to user, mark this data as stale
9937+
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false;
9938+
return ((bool)packetUBXNAVPVT->data.valid.bits.fullyResolved);
9939+
}
9940+
9941+
99279942
//Get the confirmed date validity
99289943
bool SFE_UBLOX_GNSS:: getConfirmedDate(uint16_t maxWait)
99299944
{

src/SparkFun_u-blox_GNSS_Arduino_Library.h

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

10761076
bool getDateValid(uint16_t maxWait = defaultMaxWait);
10771077
bool getTimeValid(uint16_t maxWait = defaultMaxWait);
1078+
bool getTimeFullyResolved(uint16_t maxWait = defaultMaxWait);
10781079
bool getConfirmedDate(uint16_t maxWait = defaultMaxWait);
10791080
bool getConfirmedTime(uint16_t maxWait = defaultMaxWait);
10801081

0 commit comments

Comments
 (0)