-
Notifications
You must be signed in to change notification settings - Fork 494
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
base: master
Are you sure you want to change the base?
Conversation
add support for fix mode (RMC mikalhart#12) (NMEA 2.3+)
Applied this PR: [support for fix quality and fix mode](mikalhart/TinyGPSPlus#38)
Applied this PR: [support for fix quality and fix mode](mikalhart/TinyGPSPlus#38)
This is must needed feature but not sure why still not merged into main branch. |
@slippyr4 Can you explain the 'store time in location' commit? To my eye this seems unrelated to 'support for fix quality and fix mode'. |
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 }; |
There was a problem hiding this comment.
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; } |
There was a problem hiding this comment.
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'}; |
There was a problem hiding this comment.
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 }; |
There was a problem hiding this comment.
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'}; |
There was a problem hiding this comment.
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?
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! |
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+)