Skip to content
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

support for fix quality and fix mode #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

slippyr4
Copy link

I think these belong inside the core API rather than only via use of custom; the lib as it stands is lacking in built in support for assessing fix quality.

add support for fix quality (GGA #6)
add support for fix mode (RMC #12) (NMEA 2.3+)

add support for fix mode (RMC mikalhart#12) (NMEA 2.3+)
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Dec 18, 2018
Applied this PR:
[support for fix quality and fix mode](mikalhart/TinyGPSPlus#38)
TD-er added a commit to TD-er/ESPEasy that referenced this pull request Dec 21, 2018
Applied this PR:
[support for fix quality and fix mode](mikalhart/TinyGPSPlus#38)
@iharshadec
Copy link

This is must needed feature but not sure why still not merged into main branch.

@mikalhart
Copy link
Owner

@slippyr4 Can you explain the 'store time in location' commit? To my eye this seems unrelated to 'support for fix quality and fix mode'.

@mikalhart
Copy link
Owner

mikalhart commented Nov 11, 2023

Good add. Will add to new version soon. (But without the new "Time" field in Location object... discuss?)

@@ -50,6 +50,35 @@ struct RawDegrees
{}
};

enum FixQuality { Invalid = 0, GPS = 1, DGPS = 2, PPS = 3, RTK = 4, FloatRTK = 5, Estimated = 6, Manual = 7, Simulated = 8 };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum class allows stronger typechecking than the old C style: https://en.cppreference.com/w/cpp/language/enum

double lat();
double lng();
FixQuality Quality() { updated = false; return fixQuality; }
FixMode Mode() { updated = false; return fixMode; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should return an std::optional

@@ -50,6 +50,35 @@ struct RawDegrees
{}
};

enum FixQuality { Invalid = 0, GPS = 1, DGPS = 2, PPS = 3, RTK = 4, FloatRTK = 5, Estimated = 6, Manual = 7, Simulated = 8 };
enum FixMode { N = 'N', A = 'A', D = 'D', E = 'E'};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. Consider an 'inivalid'.

@@ -50,6 +50,35 @@ struct RawDegrees
{}
};

enum FixQuality { Invalid = 0, GPS = 1, DGPS = 2, PPS = 3, RTK = 4, FloatRTK = 5, Estimated = 6, Manual = 7, Simulated = 8 };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider enum class.

@@ -50,6 +50,35 @@ struct RawDegrees
{}
};

enum FixQuality { Invalid = 0, GPS = 1, DGPS = 2, PPS = 3, RTK = 4, FloatRTK = 5, Estimated = 6, Manual = 7, Simulated = 8 };
enum FixMode { N = 'N', A = 'A', D = 'D', E = 'E'};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. Consider an Invalid member.
Should anything returning either of these also be a return of an std::optional?

@robertlipe
Copy link

I like the direction here, but just a few quality issues from the peanut gallery.

Even though I'm not a reviewer here, thanx for making free software better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants