From 5a31c5765b8cafb0ba0483c2c8606f467d3246ee Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 15 Oct 2020 17:41:50 +0200 Subject: [PATCH] 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 --- lib/src/phy/rf/rf_soapy_imp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/phy/rf/rf_soapy_imp.c b/lib/src/phy/rf/rf_soapy_imp.c index 0a8e52264..058bf5c6f 100644 --- a/lib/src/phy/rf/rf_soapy_imp.c +++ b/lib/src/phy/rf/rf_soapy_imp.c @@ -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");