rf_soapy: fix auto selection of Soapy device

when the default RF args are used, NULL is passed as argument
to the RF driver. In this case, we should use the previous
SoapySDRDevice_enumerate() and let Soapy pick the device
This commit is contained in:
Andre Puschmann 2020-10-15 17:41:50 +02:00
parent 3994407f46
commit 5a31c5765b
1 changed files with 4 additions and 1 deletions

View File

@ -286,7 +286,10 @@ float rf_soapy_get_rssi(void* h)
int rf_soapy_open_multi(char* args, void** h, uint32_t num_requested_channels)
{
size_t length;
SoapySDRKwargs* soapy_args = SoapySDRDevice_enumerateStrArgs(args, &length);
// Let Soapy pick the device if no arguments are passed
SoapySDRKwargs* soapy_args =
args == NULL ? SoapySDRDevice_enumerate(NULL, &length) : SoapySDRDevice_enumerateStrArgs(args, &length);
if (length == 0) {
printf("No Soapy devices found.\n");