commit-gnuradio
[Top][All Lists]
Advanced

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

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


From: gnychis
Subject: [Commit-gnuradio] r5873 - gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband
Date: Thu, 28 Jun 2007 14:56:13 -0600 (MDT)

Author: gnychis
Date: 2007-06-28 14:56:12 -0600 (Thu, 28 Jun 2007)
New Revision: 5873

Modified:
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.h
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
   
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.h
Log:
Work in progress on fake CS subpacket parses so that i can test without the FPGA
code in place... also helps write QA code within GNU Radio.


Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
    2007-06-28 19:46:10 UTC (rev 5872)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.cc
    2007-06-28 20:56:12 UTC (rev 5873)
@@ -44,6 +44,10 @@
 
 bool usrp_rx_stop;
 
+// Used for the fake control packet response code to send the responses back up
+// the RX.  The TX stub dumps responses in to this queue.
+std::queue<transport_pkt> d_defer_queue;
+
 usrp_rx_stub::usrp_rx_stub(mb_runtime *rt, const std::string &instance_name, 
pmt_t user_arg)
   : mb_mblock(rt, instance_name, user_arg),
     d_samples_per_frame((long)(126)),

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.h 
    2007-06-28 19:46:10 UTC (rev 5872)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_rx_stub.h 
    2007-06-28 20:56:12 UTC (rev 5873)
@@ -26,8 +26,13 @@
 #include "usrp_standard.h"
 #include "ui_nco.h"
 #include <fstream>
+#include <queue>
+#include <usrp_inband_usb_packet.h>
 
+typedef usrp_inband_usb_packet transport_pkt;
+
 extern bool usrp_rx_stop;   // used to communicate a 'stop' to the RX stub
+extern std::queue<transport_pkt> d_defer_queue;
 
 /*!
  * \brief Implements the low level usb interface to the USRP

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
    2007-06-28 19:46:10 UTC (rev 5872)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.cc
    2007-06-28 20:56:12 UTC (rev 5873)
@@ -90,13 +90,17 @@
 
   size_t n_bytes;
 
-  if(d_disk_write) {
-    transport_pkt *pkts = (transport_pkt *) 
pmt_u8vector_writeable_elements(v_packets, n_bytes);
-    long n_packets = static_cast<long>(std::ceil(n_bytes / 
(double)transport_pkt::max_pkt_size()));
-    
-    for(long i=0; i<n_packets; i++)  
+  transport_pkt *pkts = (transport_pkt *) 
pmt_u8vector_writeable_elements(v_packets, n_bytes);
+  long n_packets = static_cast<long>(std::ceil(n_bytes / 
(double)transport_pkt::max_pkt_size()));
+  
+  // Parse the packets looking for C/S packets and dump them to a disk if
+  // necessary
+  for(long i=0; i<n_packets; i++) {
+    if(d_disk_write)
       d_ofile.write((const char*) pkts[i].payload(), pkts[i].payload_len());
-    
+
+    if(pkts[i].chan() == 0x1f)
+      parse_cs(pkts[i]);
   }
 
   d_cs->send(s_response_usrp_tx_write,
@@ -105,4 +109,10 @@
   return;
 }
 
+void
+usrp_tx_stub::parse_cs(transport_pkt pkt)
+{
+  return;
+}
+
 REGISTER_MBLOCK_CLASS(usrp_tx_stub);

Modified: 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.h
===================================================================
--- 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.h 
    2007-06-28 19:46:10 UTC (rev 5872)
+++ 
gnuradio/branches/developers/gnychis/inband/usrp/host/lib/inband/usrp_tx_stub.h 
    2007-06-28 20:56:12 UTC (rev 5873)
@@ -25,7 +25,10 @@
 #include <vector>
 #include "usrp_standard.h"
 #include <fstream>
+#include <usrp_inband_usb_packet.h>
 
+typedef usrp_inband_usb_packet transport_pkt;
+
 /*!
  * \brief Implements the low level usb interface to the USRP
  */
@@ -48,6 +51,7 @@
 
  private:
   void write(pmt_t data);
+  void parse_cs(transport_pkt pkt);
  
 };
   





reply via email to

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