Skip to content

getTimeFullyResolved helper added #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");
Expand Down
1 change: 1 addition & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ getNanosecond KEYWORD2
getUnixEpoch KEYWORD2
getDateValid KEYWORD2
getTimeValid KEYWORD2
getTimeFullyResolved KEYWORD2
getConfirmedDate KEYWORD2
getConfirmedTime KEYWORD2
getFixType KEYWORD2
Expand Down
15 changes: 15 additions & 0 deletions src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
1 change: 1 addition & 0 deletions src/SparkFun_u-blox_GNSS_Arduino_Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down