commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r6009 - in gnuradio/branches/developers/gnychis/inband


From: gnychis
Subject: [Commit-gnuradio] r6009 - in gnuradio/branches/developers/gnychis/inband/usrp/host: apps lib/inband
Date: Tue, 17 Jul 2007 20:27:05 -0600 (MDT)

Author: gnychis
Date: 2007-07-17 20:27:04 -0600 (Tue, 17 Jul 2007)
New Revision: 6009

Modified:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.h
Log:
adding ability to change rf center freq via parameter


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
   2007-07-17 22:56:40 UTC (rev 6008)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_tx.cc
   2007-07-18 02:27:04 UTC (rev 6009)
@@ -131,6 +131,10 @@
   pmt_dict_set(usrp_dict,
                pmt_intern("interp-rx"),
                pmt_from_long(16));
+  
+  pmt_dict_set(usrp_dict,
+               pmt_intern("rf-freq"),
+               pmt_from_long(24e8));
 
   define_component("server", "usrp_server", usrp_dict);
 

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
      2007-07-17 22:56:40 UTC (rev 6008)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.cc
      2007-07-18 02:27:04 UTC (rev 6009)
@@ -52,6 +52,7 @@
   d_fake_usrp(false),
   d_interp_tx(16),
   d_interp_rx(16),
+  d_rf_freq(10e6),
   d_rbf("inband_tx_rx.rbf")
 {
   // Dictionary for arguments to all of the components
@@ -97,6 +98,14 @@
       if(!pmt_eqv(rbf, PMT_NIL)) 
         d_rbf = pmt_symbol_to_string(rbf);
     }
+
+    // The RF center frequency
+    if(pmt_t rf_freq = pmt_dict_ref(usrp_dict, 
+                                pmt_intern("rf-freq"), 
+                                PMT_NIL)) {
+      if(!pmt_eqv(rf_freq, PMT_NIL)) 
+        d_rf_freq = pmt_to_long(rf_freq);
+    }
   }
   
   if (verbose) {
@@ -275,7 +284,7 @@
     return;
   }
 
-  if(!d_utx->set_tx_freq (0,10e6)) {  // try setting center freq to 0
+  if(!d_utx->set_tx_freq (0,d_rf_freq)) {  // try setting center freq to 0
     if (verbose)
       std::cout << "[USRP_USB_INTERFACE] Failed to set center frequency on 
TX\n";
     reply_data = pmt_list2(invocation_handle, PMT_F);
@@ -306,7 +315,7 @@
     return;
   }
 
-  if(!d_urx->set_rx_freq (0, 10e6)) {
+  if(!d_urx->set_rx_freq (0, d_rf_freq)) {
     if (verbose)
       std::cout << "[usrp_server] Failed to set center frequency on RX\n";
     reply_data = pmt_list2(invocation_handle, PMT_F);

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.h
       2007-07-17 22:56:40 UTC (rev 6008)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_usb_interface.h
       2007-07-18 02:27:04 UTC (rev 6009)
@@ -49,6 +49,8 @@
   long d_interp_tx;
   long d_interp_rx;
 
+  long d_rf_freq;
+
   std::string d_rbf;
 
  public:





reply via email to

[Prev in Thread] Current Thread [Next in Thread]