diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/osmosdr_device.cc | 4 | ||||
-rw-r--r-- | lib/uhd/uhd_source_c.cc | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/osmosdr_device.cc b/lib/osmosdr_device.cc index e0bd458..11d4c0b 100644 --- a/lib/osmosdr_device.cc +++ b/lib/osmosdr_device.cc @@ -89,7 +89,9 @@ std::string device_t::to_string(void) const std::string value = entry.second; if (value.find(" ") != std::string::npos) value = "'" + value + "'"; - ss << ((count++) ? pairs_delim : "") + entry.first + pair_delim + value; + ss << ((count++) ? pairs_delim : "") + entry.first; + if (value.length()) + ss << pair_delim + value; } return ss.str(); } diff --git a/lib/uhd/uhd_source_c.cc b/lib/uhd/uhd_source_c.cc index 9aa46fa..203caf4 100644 --- a/lib/uhd/uhd_source_c.cc +++ b/lib/uhd/uhd_source_c.cc @@ -43,8 +43,6 @@ uhd_source_c::uhd_source_c(const std::string &args) : args_to_io_signature(args)) { size_t nchan = 1; - std::string arguments = args; - dict_t dict = params_to_dict(args); if (dict.count("nchan")) @@ -53,12 +51,13 @@ uhd_source_c::uhd_source_c(const std::string &args) : if (0 == nchan) nchan = 1; - arguments.clear(); // rebuild argument string without uhd= prefix + std::string arguments; // rebuild argument string without internal arguments BOOST_FOREACH( dict_t::value_type &entry, dict ) { - if ( "uhd" == entry.first ) - arguments += entry.second; - else + if ( "uhd" != entry.first && + "nchan" != entry.first && + "subdev" != entry.first ) { arguments += entry.first + "=" + entry.second + ","; + } } _src = uhd_make_usrp_source( arguments, @@ -82,7 +81,7 @@ std::vector< std::string > uhd_source_c::get_devices() uhd::device_addr_t hint; BOOST_FOREACH(const uhd::device_addr_t &dev, uhd::device::find(hint)) { - std::string args = "uhd=," + dev.to_string(); + std::string args = "uhd," + dev.to_string(); std::string label = "Ettus"; @@ -107,7 +106,7 @@ std::vector< std::string > uhd_source_c::get_devices() } //devices.clear(); - //devices.push_back( "uhd=,type=usrp1,label='Ettus USRP'" ); + //devices.push_back( "uhd,type=usrp1,label='Ettus USRP'" ); return devices; } |