aboutsummaryrefslogtreecommitdiffstats
path: root/lib/fcd
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2012-05-20 12:30:28 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2012-05-20 12:55:52 +0200
commit3ea0b388109bb8086418dbca62337cc18da420d7 (patch)
tree212cd38e0b2debbb5ef37bc400f6a5ac2165ad47 /lib/fcd
parente256bf332e3190d0dba3294698c0855b60ae8bf9 (diff)
introduce device discovery api
This API allows to acquire a list of devices connected to the host and creates an argument string ready to be passed to a source object for cunstruction. Each device_t entry contains a "label" entry, which holds the generic device name which may be shown to the user for device selection. For certain radio hardware extended entries ("name", "serial", "type") may be available to make bijective device addressing possible. The argument string for target types "rtl_tcp" and "file" might be constructed using the osmosdr::device_t class facilities. Example: #include <osmosdr_device.h> #include <osmosdr_source_c.h> osmosdr::devices_t devs = osmosdr::device::find(); BOOST_FOREACH(osmosdr::device_t &dev, devs) // try to create each dev osmosdr_source_c_sptr src = osmosdr_make_source_c(dev.to_string());
Diffstat (limited to 'lib/fcd')
-rw-r--r--lib/fcd/fcd_source.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/fcd/fcd_source.cc b/lib/fcd/fcd_source.cc
index fa6caeb..f590388 100644
--- a/lib/fcd/fcd_source.cc
+++ b/lib/fcd/fcd_source.cc
@@ -38,6 +38,11 @@ fcd_source_sptr make_fcd_source(const std::string &args)
return gnuradio::get_initial_sptr(new fcd_source(args));
}
+/*
+ 2 [V10 ]: USB-Audio - FUNcube Dongle V1.0
+ Hanlincrest Ltd. FUNcube Dongle V1.0 at usb-0000:00:1d.0-2, full speed
+ */
+
static std::vector< std::string > _get_devices()
{
std::vector< std::string > devices;
@@ -102,8 +107,11 @@ std::vector< std::string > fcd_source::get_devices()
int id = 0;
std::vector< std::string > devices;
- BOOST_FOREACH( std::string dev, _get_devices() )
- devices.push_back( "fcd=" + boost::lexical_cast< std::string >( id++ ) );
+ BOOST_FOREACH( std::string dev, _get_devices() ) {
+ std::string args = "fcd=" + boost::lexical_cast< std::string >( id++ );
+ args += ",label='FunCube Dongle'";
+ devices.push_back( args );
+ }
return devices;
}