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

functions get_gain_range and get_freq_range should return an array #12

Open
kirat68 opened this issue Oct 21, 2021 · 8 comments
Open

functions get_gain_range and get_freq_range should return an array #12

kirat68 opened this issue Oct 21, 2021 · 8 comments

Comments

@kirat68
Copy link

kirat68 commented Oct 21, 2021

This two functions return a float. Expected an array of 2 values.

@fventuri
Copy link
Owner

@kirat68
no, they return an array of two values.
Take a look at their signatures in the include file rsp.h (please notice the [2] toward the end of each line):

https://github.com/fventuri/gr-sdrplay3/blob/master/include/sdrplay3/rsp.h#L69

    virtual const double (&get_freq_range() const)[2] = 0;

https://github.com/fventuri/gr-sdrplay3/blob/master/include/sdrplay3/rsp.h#L122

    virtual const double (&get_gain_range(const std::string& name) const)[2] = 0;

Franco

@kirat68
Copy link
Author

kirat68 commented Oct 21, 2021

yes I see,
Screenshot_20211021_120838
but I struggle to understand why python is returning just on value.

@kirat68
Copy link
Author

kirat68 commented Oct 21, 2021

Please ignore the warn. Just added in the code to make sure that this function was called.

@kirat68
Copy link
Author

kirat68 commented Oct 21, 2021

Further more if I intentionally put an parameter to make raise an error, I can see this:
Screenshot_20211021_121203
that tells that the returned value is a float.
Any clue ?

@fventuri
Copy link
Owner

@kirat68 - Tarik, muito obrigado for mentioning Python!

From your initial comment I assumed it was C++ that you were referring too, but now I understand the problem is somewhere in the Python bindings with pybind11.

I'll take a look,
Franco

@fventuri
Copy link
Owner

@kirat68 - thanks for your patience!

The issue with the Python bindings for range functions returning a pair of values should now be resolved in the master branch.

Please give it a try and let me know if it works there too.
Franco

@kirat68
Copy link
Author

kirat68 commented Oct 23, 2021

Obrigado !!!

@kirat68
Copy link
Author

kirat68 commented Oct 24, 2021

Ok could check it.
FYI the returned value is not an array but a tuple but still OK for me.

fventuri added a commit that referenced this issue Jun 9, 2024
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

No branches or pull requests

2 participants