commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5702 - gnuradio/branches/developers/gnychis/inband/us


From: gnychis
Subject: [Commit-gnuradio] r5702 - gnuradio/branches/developers/gnychis/inband/usrp/host/apps
Date: Tue, 5 Jun 2007 21:43:52 -0600 (MDT)

Author: gnychis
Date: 2007-06-05 21:43:51 -0600 (Tue, 05 Jun 2007)
New Revision: 5702

Modified:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_rx.cc
Log:
Cleaned up the RX test code, the RX side now successfully receives and decodes 
packets from the USB bus.

To test the code, the RX stub generates a sine wave, generating full sized 
packets from the samples and passing them up to the usrp_usb_interface m-block.

The usrp_usb_interface relay's it to usrp_server who decodes the packets, 
strips the samples out of the payload, and sends them to the application.

The code has not been fully tested for all sorts of corner cases yet, but it is 
at least working from the bottom up in a standard case.


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_rx.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_rx.cc
   2007-06-06 03:37:54 UTC (rev 5701)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/apps/test_usrp_inband_rx.cc
   2007-06-06 03:43:51 UTC (rev 5702)
@@ -34,7 +34,6 @@
 #include <mb_msg_accepter.h>
 #include <mb_class_registry.h>
 #include <pmt.h>
-#include <ui_nco.h>
 #include <stdio.h>
 #include <string.h>
 #include <iostream>
@@ -81,16 +80,7 @@
   };
 
   state_t      d_state;
-  long         d_nsamples_to_send;
-  long         d_nsamples_recvd;
-  long         d_nframes_recvd;
-  long         d_samples_per_frame;
-  bool         d_done_sending;
 
-  // for generating sine wave output
-  ui_nco<float,float>  d_nco;
-  double               d_amplitude;
-
   std::ofstream d_ofile;
 
  public:
@@ -111,14 +101,7 @@
 };
 
 test_usrp_rx::test_usrp_rx(mb_runtime *runtime, const std::string 
&instance_name, pmt_t user_arg)
-  : mb_mblock(runtime, instance_name, user_arg),
-    d_state(INIT), d_nsamples_to_send((long) 40e6),
-    d_nsamples_recvd(0),
-    d_nframes_recvd(0),
-    d_samples_per_frame((long)(126 * 3.5)),    // non-full packet
-    //d_samples_per_frame((long)(126 * 4)),    // full packet
-    d_done_sending(false),
-    d_amplitude(16384)
+  : mb_mblock(runtime, instance_name, user_arg)
 { 
   
   d_rx = define_port("rx0", "usrp-rx", false, mb_port::INTERNAL);
@@ -142,15 +125,6 @@
   connect("self", "rx0", "server", "rx0");
   connect("self", "cs", "server", "cs");
 
-  // initialize NCO
-  double freq = 100e3;
-  int interp = 32;                         // 32 -> 4MS/s
-  double sample_rate = 128e6 / interp; 
-  d_nco.set_freq(2*M_PI * freq/sample_rate);
-
-  // FIXME need to somehow set the interp rate in the USRP.
-  // for now, we'll have the low-level code hardwire it.
-
   d_ofile.open("pdump_rx.dat",std::ios::binary|std::ios::out);
 }
 
@@ -296,7 +270,6 @@
 test_usrp_rx::enter_receiving()
 {
   d_state = RECEIVING;
-  d_nsamples_recvd = 0;
 
   d_rx->send(s_cmd_start_recv_raw_samples,
              pmt_list2(PMT_F,
@@ -317,7 +290,6 @@
   const char *samples = (const char *) pmt_uniform_vector_elements(v_samples, 
n_bytes);
   d_ofile.write(samples, n_bytes);
   std::cout << ".";
-  d_nsamples_recvd++;
 }
 
 void





reply via email to

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