aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Tucker <ryan.tucker@nuand.com>2017-06-26 18:22:17 -0400
committerDimitri Stolnikov <horiz0n@gmx.net>2018-08-15 19:52:57 +0200
commit3523097e0071b8c745d4d5d2a0143cdc3f7ffea1 (patch)
treee887a9b625562ecf0c5e8a51a91170c5389ea919
parent855ac41c126c3b074873471c3bb1bd38f5fca6ca (diff)
bladeRF: fix identification of channels
-rw-r--r--lib/bladerf/bladerf_sink_c.cc30
-rw-r--r--lib/bladerf/bladerf_source_c.cc29
2 files changed, 30 insertions, 29 deletions
diff --git a/lib/bladerf/bladerf_sink_c.cc b/lib/bladerf/bladerf_sink_c.cc
index 232c29b..93a7267 100644
--- a/lib/bladerf/bladerf_sink_c.cc
+++ b/lib/bladerf/bladerf_sink_c.cc
@@ -310,23 +310,23 @@ double bladerf_sink_c::get_sample_rate()
osmosdr::freq_range_t bladerf_sink_c::get_freq_range(size_t chan)
{
- return bladerf_common::get_freq_range(chan);
+ return bladerf_common::get_freq_range(BLADERF_CHANNEL_TX(chan));
}
double bladerf_sink_c::set_center_freq(double freq, size_t chan)
{
- return bladerf_common::set_center_freq(freq, chan);
+ return bladerf_common::set_center_freq(freq, BLADERF_CHANNEL_TX(chan));
}
double bladerf_sink_c::get_center_freq(size_t chan)
{
- return bladerf_common::get_center_freq(chan);
+ return bladerf_common::get_center_freq(BLADERF_CHANNEL_TX(chan));
}
double bladerf_sink_c::set_freq_corr( double ppm, size_t chan )
{
/* TODO: Write the VCTCXO with a correction value (also changes RX ppm value!) */
- return get_freq_corr( chan );
+ return get_freq_corr( BLADERF_CHANNEL_TX(chan) );
}
double bladerf_sink_c::get_freq_corr( size_t chan )
@@ -337,50 +337,49 @@ double bladerf_sink_c::get_freq_corr( size_t chan )
std::vector<std::string> bladerf_sink_c::get_gain_names( size_t chan )
{
- return bladerf_common::get_gain_names(chan);
+ return bladerf_common::get_gain_names(BLADERF_CHANNEL_TX(chan));
}
osmosdr::gain_range_t bladerf_sink_c::get_gain_range( size_t chan )
{
- return bladerf_common::get_gain_range(chan);
+ return bladerf_common::get_gain_range(BLADERF_CHANNEL_TX(chan));
}
osmosdr::gain_range_t bladerf_sink_c::get_gain_range( const std::string & name, size_t chan )
{
- return bladerf_common::get_gain_range(name, chan);
+ return bladerf_common::get_gain_range(name, BLADERF_CHANNEL_TX(chan));
}
bool bladerf_sink_c::set_gain_mode( bool automatic, size_t chan )
{
- return bladerf_common::set_gain_mode(automatic, chan);
+ return bladerf_common::set_gain_mode(automatic, BLADERF_CHANNEL_TX(chan));
}
bool bladerf_sink_c::get_gain_mode( size_t chan )
{
- return bladerf_common::get_gain_mode(chan);
+ return bladerf_common::get_gain_mode(BLADERF_CHANNEL_TX(chan));
}
double bladerf_sink_c::set_gain( double gain, size_t chan )
{
- return bladerf_common::set_gain(gain, chan);
+ return bladerf_common::set_gain(gain, BLADERF_CHANNEL_TX(chan));
}
double bladerf_sink_c::set_gain( double gain, const std::string & name, size_t chan)
{
- return bladerf_common::set_gain(gain, name, chan);
+ return bladerf_common::set_gain(gain, name, BLADERF_CHANNEL_TX(chan));
}
double bladerf_sink_c::get_gain( size_t chan )
{
- return bladerf_common::get_gain(chan);
+ return bladerf_common::get_gain(BLADERF_CHANNEL_TX(chan));
}
double bladerf_sink_c::get_gain( const std::string & name, size_t chan )
{
- return bladerf_common::get_gain(name, chan);
+ return bladerf_common::get_gain(name, BLADERF_CHANNEL_TX(chan));
}
-
std::vector< std::string > bladerf_sink_c::get_antennas( size_t chan )
{
std::vector< std::string > antennas;
@@ -396,12 +395,13 @@ std::vector< std::string > bladerf_sink_c::get_antennas( size_t chan )
std::string bladerf_sink_c::set_antenna( const std::string & antenna, size_t chan )
{
- return get_antenna( chan );
+ return get_antenna( BLADERF_CHANNEL_TX(chan) );
}
std::string bladerf_sink_c::get_antenna( size_t chan )
{
/* We only have a single transmit antenna here */
+ // TODO: the above is a lie
return "TX0";
}
diff --git a/lib/bladerf/bladerf_source_c.cc b/lib/bladerf/bladerf_source_c.cc
index 92f0d98..cfa30ce 100644
--- a/lib/bladerf/bladerf_source_c.cc
+++ b/lib/bladerf/bladerf_source_c.cc
@@ -208,23 +208,23 @@ double bladerf_source_c::get_sample_rate()
osmosdr::freq_range_t bladerf_source_c::get_freq_range(size_t chan)
{
- return bladerf_common::get_freq_range(chan);
+ return bladerf_common::get_freq_range(BLADERF_CHANNEL_RX(chan));
}
double bladerf_source_c::set_center_freq(double freq, size_t chan)
{
- return bladerf_common::set_center_freq(freq, chan);
+ return bladerf_common::set_center_freq(freq, BLADERF_CHANNEL_RX(chan));
}
double bladerf_source_c::get_center_freq(size_t chan)
{
- return bladerf_common::get_center_freq(chan);
+ return bladerf_common::get_center_freq(BLADERF_CHANNEL_RX(chan));
}
double bladerf_source_c::set_freq_corr( double ppm, size_t chan )
{
/* TODO: Write the VCTCXO with a correction value (also changes TX ppm value!) */
- return get_freq_corr( chan );
+ return get_freq_corr( BLADERF_CHANNEL_RX(chan) );
}
double bladerf_source_c::get_freq_corr( size_t chan )
@@ -235,47 +235,47 @@ double bladerf_source_c::get_freq_corr( size_t chan )
std::vector<std::string> bladerf_source_c::get_gain_names( size_t chan )
{
- return bladerf_common::get_gain_names(chan);
+ return bladerf_common::get_gain_names(BLADERF_CHANNEL_RX(chan));
}
osmosdr::gain_range_t bladerf_source_c::get_gain_range( size_t chan )
{
- return bladerf_common::get_gain_range(chan);
+ return bladerf_common::get_gain_range(BLADERF_CHANNEL_RX(chan));
}
osmosdr::gain_range_t bladerf_source_c::get_gain_range( const std::string & name, size_t chan )
{
- return bladerf_common::get_gain_range(name, chan);
+ return bladerf_common::get_gain_range(name, BLADERF_CHANNEL_RX(chan));
}
bool bladerf_source_c::set_gain_mode( bool automatic, size_t chan )
{
- return bladerf_common::set_gain_mode(automatic, chan);
+ return bladerf_common::set_gain_mode(automatic, BLADERF_CHANNEL_RX(chan));
}
bool bladerf_source_c::get_gain_mode( size_t chan )
{
- return bladerf_common::get_gain_mode(chan);
+ return bladerf_common::get_gain_mode(BLADERF_CHANNEL_RX(chan));
}
double bladerf_source_c::set_gain( double gain, size_t chan )
{
- return bladerf_common::set_gain(gain, chan);
+ return bladerf_common::set_gain(gain, BLADERF_CHANNEL_RX(chan));
}
double bladerf_source_c::set_gain( double gain, const std::string & name, size_t chan)
{
- return bladerf_common::set_gain(gain, name, chan);
+ return bladerf_common::set_gain(gain, name, BLADERF_CHANNEL_RX(chan));
}
double bladerf_source_c::get_gain( size_t chan )
{
- return bladerf_common::get_gain(chan);
+ return bladerf_common::get_gain(BLADERF_CHANNEL_RX(chan));
}
double bladerf_source_c::get_gain( const std::string & name, size_t chan )
{
- return bladerf_common::get_gain(name, chan);
+ return bladerf_common::get_gain(name, BLADERF_CHANNEL_RX(chan));
}
std::vector< std::string > bladerf_source_c::get_antennas( size_t chan )
@@ -293,12 +293,13 @@ std::vector< std::string > bladerf_source_c::get_antennas( size_t chan )
std::string bladerf_source_c::set_antenna( const std::string & antenna, size_t chan )
{
- return get_antenna( chan );
+ return get_antenna( BLADERF_CHANNEL_RX(chan) );
}
std::string bladerf_source_c::get_antenna( size_t chan )
{
/* We only have a single receive antenna here */
+ // TODO: this is a lie
return "RX0";
}