diff --git a/examples/Example24_GetUnixEpochAndMicros/Example24_GetUnixEpochAndMicros.ino b/examples/Example24_GetUnixEpochAndMicros/Example24_GetUnixEpochAndMicros.ino index 2ebdc2a..8080f1a 100644 --- a/examples/Example24_GetUnixEpochAndMicros/Example24_GetUnixEpochAndMicros.ino +++ b/examples/Example24_GetUnixEpochAndMicros/Example24_GetUnixEpochAndMicros.ino @@ -91,6 +91,12 @@ void loop() Serial.print(myGNSS.getSecond()); Serial.print(" Time is "); + if (myGNSS.getTimeFullyResolved() == false) + { + Serial.print("not fully resolved but "); + } else { + Serial.print("fully resolved and "); + } if (myGNSS.getTimeValid() == false) { Serial.print("not "); diff --git a/keywords.txt b/keywords.txt index b2b7cab..3fad190 100644 --- a/keywords.txt +++ b/keywords.txt @@ -425,6 +425,7 @@ getNanosecond KEYWORD2 getUnixEpoch KEYWORD2 getDateValid KEYWORD2 getTimeValid KEYWORD2 +getTimeFullyResolved KEYWORD2 getConfirmedDate KEYWORD2 getConfirmedTime KEYWORD2 getFixType KEYWORD2 diff --git a/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp b/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp index bc45a0c..799a009 100644 --- a/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp +++ b/src/SparkFun_u-blox_GNSS_Arduino_Library.cpp @@ -9782,6 +9782,21 @@ bool SFE_UBLOX_GNSS::getTimeValid(uint16_t maxWait) return ((bool)packetUBXNAVPVT->data.valid.bits.validTime); } +//Check to see if the UTC time has been fully resolved +bool SFE_UBLOX_GNSS::getTimeFullyResolved(uint16_t maxWait) +{ + if (packetUBXNAVPVT == NULL) initPacketUBXNAVPVT(); //Check that RAM has been allocated for the PVT data + if (packetUBXNAVPVT == NULL) //Bail if the RAM allocation failed + return (false); + + if (packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.fullyResolved == false) + getPVT(maxWait); + packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.fullyResolved = false; //Since we are about to give this to user, mark this data as stale + packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.all = false; + return ((bool)packetUBXNAVPVT->data.valid.bits.fullyResolved); +} + + //Get the confirmed date validity bool SFE_UBLOX_GNSS:: getConfirmedDate(uint16_t maxWait) { diff --git a/src/SparkFun_u-blox_GNSS_Arduino_Library.h b/src/SparkFun_u-blox_GNSS_Arduino_Library.h index 42e72eb..b8b7e4f 100644 --- a/src/SparkFun_u-blox_GNSS_Arduino_Library.h +++ b/src/SparkFun_u-blox_GNSS_Arduino_Library.h @@ -1061,6 +1061,7 @@ class SFE_UBLOX_GNSS bool getDateValid(uint16_t maxWait = defaultMaxWait); bool getTimeValid(uint16_t maxWait = defaultMaxWait); + bool getTimeFullyResolved(uint16_t maxWait = defaultMaxWait); bool getConfirmedDate(uint16_t maxWait = defaultMaxWait); bool getConfirmedTime(uint16_t maxWait = defaultMaxWait);