fventuri/gr-sdrplay3

functions get_gain_range and get_freq_range should return an array

Opened this issue · 8 comments

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

@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

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

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

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 ?

@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

@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

Obrigado !!!

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