Skip to content

Add confirmedDate and confirmedTime helper functions #9

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 2 commits into from
Feb 2, 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
2 changes: 2 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ getMillisecond KEYWORD2
getNanosecond KEYWORD2
getDateValid KEYWORD2
getTimeValid KEYWORD2
getConfirmedDate KEYWORD2
getConfirmedTime KEYWORD2
getFixType KEYWORD2
getGnssFixOk KEYWORD2
getDiffSoln KEYWORD2
Expand Down
28 changes: 28 additions & 0 deletions src/SparkFun_u-blox_GNSS_Arduino_Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8895,6 +8895,34 @@ bool SFE_UBLOX_GNSS::getTimeValid(uint16_t maxWait)
return ((bool)packetUBXNAVPVT->data.valid.bits.validTime);
}

//Get the confirmed date validity
bool SFE_UBLOX_GNSS:: getConfirmedDate(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.confirmedDate == false)
getPVT(maxWait);
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.confirmedDate = 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.flags2.bits.confirmedDate);
}

//Get the confirmed time validity
bool SFE_UBLOX_GNSS:: getConfirmedTime(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.confirmedTime == false)
getPVT(maxWait);
packetUBXNAVPVT->moduleQueried.moduleQueried1.bits.confirmedTime = 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.flags2.bits.confirmedTime);
}

//Get the current fix type
//0=no fix, 1=dead reckoning, 2=2D, 3=3D, 4=GNSS, 5=Time fix
uint8_t SFE_UBLOX_GNSS::getFixType(uint16_t maxWait)
Expand Down
2 changes: 2 additions & 0 deletions src/SparkFun_u-blox_GNSS_Arduino_Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,8 @@ class SFE_UBLOX_GNSS

bool getDateValid(uint16_t maxWait = defaultMaxWait);
bool getTimeValid(uint16_t maxWait = defaultMaxWait);
bool getConfirmedDate(uint16_t maxWait = defaultMaxWait);
bool getConfirmedTime(uint16_t maxWait = defaultMaxWait);

uint8_t getFixType(uint16_t maxWait = defaultMaxWait); //Returns the type of fix: 0=no, 3=3D, 4=GNSS+Deadreckoning

Expand Down