We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I did error checks for the result of iio_create_context like here https://github.com/analogdevicesinc/libiio/blob/9a82e3757208630886f6aff25f723d9ca95a9501/tests/iio_stresstest.c#L252C1-L268C4
However the problem was, that in case of an error a negative value gets return which was not caught by this 'if(!ctx)'.
I changed my code to
ctx = iio_create_context(NULL, (std::string("ip:") + ip).c_str()); int err = iio_err(ctx); if (err) { std::cerr << "Failed to create libiio context" << std::endl; ctx = nullptr; return; }
and then it worked correctly.
The text was updated successfully, but these errors were encountered:
Thanks, can you send a PR? Since you already have the fix 😬
Sorry, something went wrong.
No branches or pull requests
I did error checks for the result of iio_create_context like here
https://github.com/analogdevicesinc/libiio/blob/9a82e3757208630886f6aff25f723d9ca95a9501/tests/iio_stresstest.c#L252C1-L268C4
However the problem was, that in case of an error a negative value gets return which was not caught by this 'if(!ctx)'.
I changed my code to
and then it worked correctly.
The text was updated successfully, but these errors were encountered: