[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r9230 - gnuradio/branches/developers/trondeau/dbs/usrp
From: |
trondeau |
Subject: |
[Commit-gnuradio] r9230 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy |
Date: |
Sun, 10 Aug 2008 16:44:41 -0600 (MDT) |
Author: trondeau
Date: 2008-08-10 16:44:40 -0600 (Sun, 10 Aug 2008)
New Revision: 9230
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
Log:
refactoring db_basic code
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
2008-08-10 22:30:15 UTC (rev 9229)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.cc
2008-08-10 22:44:40 UTC (rev 9230)
@@ -19,13 +19,11 @@
// Boston, MA 02110-1301, USA.
#include <db_basic.h>
-#include <usrp1_base.h>
/**************************************************************************************************/
-
-db_basic_tx::db_basic_tx(usrp1_base *usrp, int which)
+db_basic_tx::db_basic_tx(usrp_basic *usrp, int which)
: db_base(usrp, which, true)
{
// Handler for Basic Tx daughterboards.
@@ -33,6 +31,8 @@
// @param usrp: instance of usrp.source_c
// @param which: which side: 0 or 1 corresponding to TX_A or TX_B
respectively
+ d_tx = true;
+
if(0) {
// Doing this would give us a different default than the historical
values...
std::vector<float> g = gain_range(); // initialize gain
@@ -57,7 +57,7 @@
return f;
}
-std::vector<float>
+struct freq_result_t
db_basic_tx::set_freq(float target_freq)
{
// Set the frequency.
@@ -69,10 +69,9 @@
// ok is True or False and indicates success or failure,
// actual_baseband_freq is the RF frequency that corresponds to DC in the
IF.
- // FIXME: Should I return a struct{bool, float} instead?
- std::vector<float> args(2);
- args[0] = 1; // 1: true
- args[1] = 0.0; // baseband freq
+ struct freq_result_t args = {0, 0};
+ args.ok = true;
+ args.baseband_freq = 0.0;
return args;
}
@@ -116,7 +115,7 @@
/******************************************************************************/
-db_basic_rx::db_basic_rx(usrp1_base *usrp, int which, int subdev)
+db_basic_rx::db_basic_rx(usrp_basic *usrp, int which, int subdev)
: db_base(usrp, which, false)
{
// Handler for Basic Rx daughterboards.
@@ -153,7 +152,7 @@
return f;
}
-std::vector<float>
+struct freq_result_t
db_basic_rx::set_freq(float target_freq)
{
// Set the frequency.
@@ -165,10 +164,9 @@
// ok is True or False and indicates success or failure,
// actual_baseband_freq is the RF frequency that corresponds to DC in the
IF.
- // FIXME: Should I return a struct{bool, float} instead?
- std::vector<float> args(2);
- args[0] = 1; // 1: true
- args[1] = 0.0; // baseband freq
+ struct freq_result_t args = {0, 0};
+ args.ok = true;
+ args.baseband_freq = 0.0;
return args;
}
@@ -213,7 +211,7 @@
/******************************************************************************/
-db_lf_tx::db_lf_tx(usrp1_base *usrp, int which)
+db_lf_tx::db_lf_tx(usrp_basic *usrp, int which)
: db_basic_tx(usrp, which)
{
// Handler for Low Freq Tx daughterboards.
@@ -243,7 +241,7 @@
/******************************************************************************/
-db_lf_rx::db_lf_rx(usrp1_base *usrp, int which, int subdev)
+db_lf_rx::db_lf_rx(usrp_basic *usrp, int which, int subdev)
: db_basic_rx(usrp, which, subdev)
{
// Handler for Low Freq Rx daughterboards.
Modified:
gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
===================================================================
--- gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
2008-08-10 22:30:15 UTC (rev 9229)
+++ gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy/db_basic.h
2008-08-10 22:44:40 UTC (rev 9230)
@@ -23,21 +23,18 @@
#define DB_BASIC_H
#include <db_base.h>
-#include <gr_sync_block.h>
-class usrp1_base;
-
/******************************************************************************/
class db_basic_tx : public db_base
{
public:
- db_basic_tx(usrp1_base *usrp, int which);
+ db_basic_tx(usrp_basic *usrp, int which);
std::vector<float> freq_range();
- std::vector<float> set_freq(float target_freq);
+ struct freq_result_t set_freq(float target_freq);
std::vector<float> gain_range();
bool set_gain(float gain);
bool is_quadrature();
@@ -50,10 +47,10 @@
class db_basic_rx : public db_base
{
public:
- db_basic_rx(usrp1_base *usrp, int which, int subdev);
+ db_basic_rx(usrp_basic *usrp, int which, int subdev);
std::vector<float> freq_range();
- std::vector<float> set_freq(float target_freq);
+ struct freq_result_t set_freq(float target_freq);
std::vector<float> gain_range();
bool set_gain(float gain);
bool is_quadrature();
@@ -69,7 +66,7 @@
class db_lf_rx : public db_basic_rx
{
public:
- db_lf_rx(usrp1_base *usrp, int which, int subdev);
+ db_lf_rx(usrp_basic *usrp, int which, int subdev);
std::vector<float> freq_range();
};
@@ -81,7 +78,7 @@
class db_lf_tx : public db_basic_tx
{
public:
- db_lf_tx(usrp1_base *usrp, int which);
+ db_lf_tx(usrp_basic *usrp, int which);
std::vector<float> freq_range();
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r9230 - gnuradio/branches/developers/trondeau/dbs/usrp/host/lib/legacy,
trondeau <=