aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Csete <oz9aec@gmail.com>2015-07-29 23:08:21 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2015-12-10 20:54:26 +0100
commit7cec4c0f517144f271630f78dd6acd1f26f6b1f7 (patch)
tree5b9f19bac7d5f303e51924c04e00535c03767248
parent2ca720cfee7d12541aa84be96a0076fc8820f5ab (diff)
rfspace: Add basic Cloud-IQ support.
Cloud-IQ uses essentially the NetSDR protocol with different sample rates and product ID.
-rw-r--r--lib/rfspace/rfspace_source_c.cc46
-rw-r--r--lib/rfspace/rfspace_source_c.h3
-rw-r--r--lib/source_impl.cc4
3 files changed, 47 insertions, 6 deletions
diff --git a/lib/rfspace/rfspace_source_c.cc b/lib/rfspace/rfspace_source_c.cc
index 7cba493..93d645d 100644
--- a/lib/rfspace/rfspace_source_c.cc
+++ b/lib/rfspace/rfspace_source_c.cc
@@ -134,6 +134,9 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
if ( dict.count("netsdr") )
dict["rfspace"] = dict["netsdr"];
+ if ( dict.count("cloudiq") )
+ dict["rfspace"] = dict["cloudiq"];
+
if ( dict.count("rfspace") )
{
std::string value = dict["rfspace"];
@@ -155,6 +158,9 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
if ( first.count("netsdr") )
value = first["netsdr"];
+ if ( first.count("cloudiq") )
+ value = first["cloudiq"];
+
dict["rfspace"] = value;
dict["label"] = first["label"];
}
@@ -366,6 +372,8 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
_radio = RFSPACE_SDR_IP;
else if ( 0x53445204 == product_id ) /* NETSDR 4.1.6 Product ID */
_radio = RFSPACE_NETSDR;
+ else if ( 0x434C4951 == product_id ) /* CloudIQ Product ID */
+ _radio = RFSPACE_CLOUDIQ;
else
std::cerr << "UNKNOWN ";
}
@@ -403,14 +411,16 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
std::cerr << "FW " << *((uint16_t *)&response[sizeof(firmver)]) << " ";
if ( RFSPACE_NETSDR == _radio ||
- RFSPACE_SDR_IP == _radio )
+ RFSPACE_SDR_IP == _radio ||
+ RFSPACE_CLOUDIQ == _radio)
{
unsigned char hardver[] = { 0x05, 0x20, 0x04, 0x00, 0x02 };
if ( transaction( hardver, sizeof(hardver), response ) )
std::cerr << "HW " << *((uint16_t *)&response[sizeof(hardver)]) << " ";
}
- if ( RFSPACE_NETSDR == _radio )
+ if ( RFSPACE_NETSDR == _radio ||
+ RFSPACE_CLOUDIQ == _radio)
{
unsigned char fpgaver[] = { 0x05, 0x20, 0x04, 0x00, 0x03 };
if ( transaction( fpgaver, sizeof(fpgaver), response ) )
@@ -459,6 +469,11 @@ rfspace_source_c::rfspace_source_c (const std::string &args)
set_bandwidth( 0 ); /* switch to automatic filter selection by default */
}
+ else if ( RFSPACE_CLOUDIQ == _radio)
+ {
+ set_sample_rate( 240000 );
+ set_bandwidth( 0 );
+ }
#if 0
std::cerr << "sample_rates: " << get_sample_rates().to_pp_string() << std::endl;
std::cerr << "sample rate: " << (uint32_t)get_sample_rate() << std::endl;
@@ -1280,6 +1295,9 @@ std::vector<std::string> rfspace_source_c::get_devices( bool fake )
devices += str(boost::format("netsdr=%s:%d,label='RFSPACE NetSDR Receiver'")
% DEFAULT_HOST % DEFAULT_PORT);
+
+ devices += str(boost::format("cloudiq=%s:%d,label='RFSPACE Cloud-IQ Receiver'")
+ % DEFAULT_HOST % DEFAULT_PORT);
}
return devices;
@@ -1337,6 +1355,25 @@ osmosdr::meta_range_t rfspace_source_c::get_sample_rates()
range += osmosdr::range_t( rate );
}
}
+ else if ( RFSPACE_CLOUDIQ == _radio )
+ {
+ /* CloudIQ supports 122.88 MHz / 4*N for N = 17 ... 3072, but lets limit
+ * ourselves to the ones available in SpectraVue (plus a few)
+ */
+ range += osmosdr::range_t( 48000 );
+ range += osmosdr::range_t( 61440 );
+ range += osmosdr::range_t( 96000 );
+ range += osmosdr::range_t( 122880 );
+ range += osmosdr::range_t( 240000 );
+ range += osmosdr::range_t( 256000 );
+ range += osmosdr::range_t( 370120 );
+ range += osmosdr::range_t( 495483 );
+ range += osmosdr::range_t( 512000 );
+ range += osmosdr::range_t( 614400 );
+ range += osmosdr::range_t( 1024000 );
+ range += osmosdr::range_t( 1228800 );
+ range += osmosdr::range_t( 1807058 );
+ }
return range;
}
@@ -1516,7 +1553,7 @@ osmosdr::gain_range_t rfspace_source_c::get_gain_range( size_t chan )
{
if ( RFSPACE_SDR_IQ == _radio )
return osmosdr::gain_range_t(-20, 10, 10);
- else /* SDR-IP & NETSDR */
+ else /* SDR-IP, NETSDR and Cloud-IQ */
return osmosdr::gain_range_t(-30, 0, 10);
}
@@ -1633,7 +1670,8 @@ std::string rfspace_source_c::get_antenna( size_t chan )
double rfspace_source_c::set_bandwidth( double bandwidth, size_t chan )
{
- if ( RFSPACE_SDR_IQ == _radio ) /* not supported by SDR-IQ */
+ if ( RFSPACE_SDR_IQ == _radio ||
+ RFSPACE_CLOUDIQ == _radio) /* not supported by SDR-IQ or Cloud-IQ */
return 0.0f;
/* SDR-IP 4.2.5 RF Filter Selection */
diff --git a/lib/rfspace/rfspace_source_c.h b/lib/rfspace/rfspace_source_c.h
index 51b1449..7d89ddc 100644
--- a/lib/rfspace/rfspace_source_c.h
+++ b/lib/rfspace/rfspace_source_c.h
@@ -136,7 +136,8 @@ private: /* members */
RADIO_UNKNOWN = 0,
RFSPACE_SDR_IQ,
RFSPACE_SDR_IP,
- RFSPACE_NETSDR
+ RFSPACE_NETSDR,
+ RFSPACE_CLOUDIQ
};
radio_type _radio;
diff --git a/lib/source_impl.cc b/lib/source_impl.cc
index 5d7d305..9b81dde 100644
--- a/lib/source_impl.cc
+++ b/lib/source_impl.cc
@@ -168,6 +168,7 @@ source_impl::source_impl( const std::string &args )
dev_types.push_back("sdr-iq"); /* additional aliases for rfspace backend */
dev_types.push_back("sdr-ip");
dev_types.push_back("netsdr");
+ dev_types.push_back("cloudiq");
#endif
BOOST_FOREACH(std::string arg, arg_list) {
@@ -324,7 +325,8 @@ source_impl::source_impl( const std::string &args )
if ( dict.count("rfspace") ||
dict.count("sdr-iq") ||
dict.count("sdr-ip") ||
- dict.count("netsdr") ) {
+ dict.count("netsdr") ||
+ dict.count("cloudiq") ) {
rfspace_source_c_sptr src = make_rfspace_source_c( arg );
block = src; iface = src.get();
}