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

Add conditionnals to detect gpsd API version #188

Merged
merged 1 commit into from Aug 11, 2020

Conversation

mobarre
Copy link
Contributor

@mobarre mobarre commented Aug 9, 2020

Attempted quick fix for issue #187. This will certainly require some testing (don't have a laptop GPS yet, so can't really test this).

@jochym
Copy link
Contributor

jochym commented Aug 9, 2020

Why we cannot make just the definition conditional? In the second change we read the same attribute and compare it with the same constant. I am sure you did it for some reason, I just would like to know that reason. ;)

@mobarre
Copy link
Contributor Author

mobarre commented Aug 9, 2020

No, I have not done this for a reason, and the suggestions are very welcome ! I always make a point of matching any code style policy or coding preferences when contributing, so no problem.

My initial patch was worked out in a few minutes... It probably needs some refining.

@mobarre
Copy link
Contributor Author

mobarre commented Aug 10, 2020

No, I have not done this for a reason, and the suggestions are very welcome ! My initial patch was worked out in a few minutes... It probably needs some refining.
Would this do: a single test in gps_driver.h + a define and ifdefs in the cpp file ? or even better a test through cmake and only ifdefs in gps_driver.cpp ?

@knro knro merged commit a5af4bb into indilib:master Aug 11, 2020
@@ -279,8 +282,11 @@ IPState GPSD::updateGPS()
break;
}


#if GPSD_API_MAJOR_VERSION >= 10
if (gpsFix->status == STATUS_NO_FIX)
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is bogus as the pointer is not initialized anywhere. The status field has indeed moved so the check should be:
if (gpsData->fix.status == STATUS_NO_FIX)

lboclboc pushed a commit to lboclboc/indi-3rdparty that referenced this pull request Sep 13, 2020
Co-authored-by: Marc-Olivier Barre <marc-olivier.barre@intercloud.com>
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