commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: gnychis
Subject: [Commit-gnuradio] r5814 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Sat, 23 Jun 2007 08:55:23 -0600 (MDT)

Author: gnychis
Date: 2007-06-23 08:55:22 -0600 (Sat, 23 Jun 2007)
New Revision: 5814

Modified:
   gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
Log:
Fixing bug in host code which makes the real RX side work over the air

The PMT needs to be created within the loop such that each packet has its own 
memory, else the memory keeps getting overwritten by new packets before they 
can even be reported back to the application.


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc
===================================================================
--- gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc 
2007-06-22 23:02:29 UTC (rev 5813)
+++ gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx.cc 
2007-06-23 14:55:22 UTC (rev 5814)
@@ -97,15 +97,16 @@
   d_urx = 
     boost::any_cast<usrp_standard_rx *>(pmt_any_ref(pmt_nth(1, data)));
 
-  pmt_t v_pkt = pmt_make_u8vector(pkt_size, 0);
-  transport_pkt *pkt = 
-    (transport_pkt *) pmt_u8vector_writeable_elements(v_pkt, ignore);
-
   if(verbose)
     std::cout << "[usrp_rx] Waiting for packets..\n";
 
   // Read by 512 which is packet size and send them back up
   while(1) {
+
+    pmt_t v_pkt = pmt_make_u8vector(pkt_size, 0);
+    transport_pkt *pkt = 
+      (transport_pkt *) pmt_u8vector_writeable_elements(v_pkt, ignore);
+
     n_read = d_urx->read(pkt, pkt_size, &underrun);
 
     if(n_read != pkt_size) {





reply via email to

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