pothosware / SoapySDR

Vendor and platform neutral SDR support library.
https://github.com/pothosware/SoapySDR/wiki
Boost Software License 1.0
1.12k stars 178 forks source link

reading settings option list (getSettingInfo) fails using C if no option names set #377

Closed ahopper closed 1 year ago

ahopper commented 1 year ago

if the settings optionNames is not populated this https://github.com/pothosware/SoapySDR/blob/f8c17833126397af933237babbcaa14925259eb6/lib/TypeHelpers.hpp#L140 resets the numOptions to 0 so the C api cannot see the options.

the lime driver has an example of not setting optionNames

https://github.com/myriadrf/LimeSuite/blob/e829d3ede6222c1c0fc0e90dcd2050e50569e33d/SoapyLMS7/Settings.cpp#L802-L807

zuckschwerdt commented 1 year ago

Just swappig the toStrArray() call order for out.options and out.optionNames should work right? With options last it will take precedence over the result from optionNames -- a comment to the intention is then also needed ;) Do you want to PR this change?

ahopper commented 1 year ago

Yep that should work, I'm happy to create a PR.