commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 84/148: Replaced rx metadata with vrt expan


From: git
Subject: [Commit-gnuradio] [gnuradio] 84/148: Replaced rx metadata with vrt expanded header. Removed timestamp from tx metadata, changes will be made for vrt.
Date: Mon, 15 Aug 2016 00:47:27 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.

commit ba5c52e32950182a2f4059738d2337bdf6961d04
Author: Josh Blum <address@hidden>
Date:   Tue Dec 15 18:37:49 2009 -0800

    Replaced rx metadata with vrt expanded header.
    Removed timestamp from tx metadata, changes will be made for vrt.
---
 gr-usrp2/src/rx_16sc_handler.h               |  4 ++--
 gr-usrp2/src/rx_32fc_handler.h               |  4 ++--
 gr-usrp2/src/usrp2_sink_16sc.cc              |  1 -
 gr-usrp2/src/usrp2_sink_32fc.cc              |  1 -
 usrp2/host/apps/rx_streaming_samples.cc      |  8 ++++----
 usrp2/host/apps/test_mimo_tx.cc              |  1 -
 usrp2/host/apps/tx_samples.cc                |  1 -
 usrp2/host/include/usrp2/metadata.h          | 23 +----------------------
 usrp2/host/include/usrp2/rx_nop_handler.h    |  2 +-
 usrp2/host/include/usrp2/rx_sample_handler.h |  3 ++-
 usrp2/host/lib/usrp2_impl.cc                 |  5 +----
 11 files changed, 13 insertions(+), 40 deletions(-)

diff --git a/gr-usrp2/src/rx_16sc_handler.h b/gr-usrp2/src/rx_16sc_handler.h
index 9d5b1f2..de4c2c6 100644
--- a/gr-usrp2/src/rx_16sc_handler.h
+++ b/gr-usrp2/src/rx_16sc_handler.h
@@ -45,7 +45,7 @@ public:
   }
 
   // Invoked by USRP2 API when samples are available
-  bool operator()(const uint32_t *items, size_t nitems, const 
usrp2::rx_metadata *metadata)
+  bool operator()(const uint32_t *items, size_t nitems, const 
vrt::expanded_header *vrt_header)
   {
     // Copy/reformat/endian swap USRP2 data to destination buffer
     usrp2::copy_u2_16sc_to_host_16sc(nitems, items, d_dest);
@@ -54,7 +54,7 @@ public:
     // FIXME: do something with metadata
 
     // Call parent to determine if there is room to be called again
-    return rx_nop_handler::operator()(items, nitems, metadata);
+    return rx_nop_handler::operator()(items, nitems, vrt_header);
   }
 
   ~rx_16sc_handler();
diff --git a/gr-usrp2/src/rx_32fc_handler.h b/gr-usrp2/src/rx_32fc_handler.h
index f2ce2b5..151de40 100644
--- a/gr-usrp2/src/rx_32fc_handler.h
+++ b/gr-usrp2/src/rx_32fc_handler.h
@@ -46,7 +46,7 @@ public:
   }
 
   // Invoked by USRP2 API when samples are available
-  bool operator()(const uint32_t *items, size_t nitems, const 
usrp2::rx_metadata *metadata)
+  bool operator()(const uint32_t *items, size_t nitems, const 
vrt::expanded_header *vrt_header)
   {
     // Copy/reformat/endian swap USRP2 data to destination buffer
     usrp2::copy_u2_16sc_to_host_32fc(nitems, items, d_dest);
@@ -55,7 +55,7 @@ public:
     // FIXME: do something with metadata
 
     // Call parent to determine if there is room to be called again
-    return rx_nop_handler::operator()(items, nitems, metadata);
+    return rx_nop_handler::operator()(items, nitems, vrt_header);
   }
 
   ~rx_32fc_handler();
diff --git a/gr-usrp2/src/usrp2_sink_16sc.cc b/gr-usrp2/src/usrp2_sink_16sc.cc
index 1e7c54d..3651a69 100644
--- a/gr-usrp2/src/usrp2_sink_16sc.cc
+++ b/gr-usrp2/src/usrp2_sink_16sc.cc
@@ -67,7 +67,6 @@ usrp2_sink_16sc::work(int noutput_items,
     return 0;
 
   usrp2::tx_metadata metadata;
-  metadata.timestamp = -1;
   metadata.send_now = 1;
   metadata.start_of_burst = 1;
 
diff --git a/gr-usrp2/src/usrp2_sink_32fc.cc b/gr-usrp2/src/usrp2_sink_32fc.cc
index b1e28a8..cf6fd04 100644
--- a/gr-usrp2/src/usrp2_sink_32fc.cc
+++ b/gr-usrp2/src/usrp2_sink_32fc.cc
@@ -67,7 +67,6 @@ usrp2_sink_32fc::work(int noutput_items,
     return 0;
 
   usrp2::tx_metadata metadata;
-  metadata.timestamp = -1;
   metadata.send_now = 1;
   metadata.start_of_burst = 1;
 
diff --git a/usrp2/host/apps/rx_streaming_samples.cc 
b/usrp2/host/apps/rx_streaming_samples.cc
index 8479ae1..06a5ed9 100644
--- a/usrp2/host/apps/rx_streaming_samples.cc
+++ b/usrp2/host/apps/rx_streaming_samples.cc
@@ -83,9 +83,9 @@ public:
   ~file_writer_16sc();
 
   bool 
-  operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata 
*metadata)
+  operator()(const uint32_t *items, size_t nitems, const vrt::expanded_header 
*vrt_header)
   {
-    bool ok = rx_nop_handler::operator()(items, nitems, metadata);
+    bool ok = rx_nop_handler::operator()(items, nitems, vrt_header);
 
     size_t host_nitems = nitems;
     std::complex<int16_t> host_items[host_nitems];
@@ -135,9 +135,9 @@ public:
   ~file_writer_32fc();
 
   bool 
-  operator()(const uint32_t *items, size_t nitems, const usrp2::rx_metadata 
*metadata)
+  operator()(const uint32_t *items, size_t nitems, const vrt::expanded_header 
*vrt_header)
   {
-    bool ok = rx_nop_handler::operator()(items, nitems, metadata);
+    bool ok = rx_nop_handler::operator()(items, nitems, vrt_header);
 
     size_t host_nitems = nitems;
     std::complex<float> host_items[host_nitems];
diff --git a/usrp2/host/apps/test_mimo_tx.cc b/usrp2/host/apps/test_mimo_tx.cc
index f52bfd5..5b49b33 100644
--- a/usrp2/host/apps/test_mimo_tx.cc
+++ b/usrp2/host/apps/test_mimo_tx.cc
@@ -279,7 +279,6 @@ gen_and_send(usrp2::usrp2::sptr u2, int chan,
   std::complex<float>  buf[MAX_SAMPLES];
 
   usrp2::tx_metadata   md;
-  md.timestamp = -1;
   md.start_of_burst = 1;
   md.send_now = 1;
 
diff --git a/usrp2/host/apps/tx_samples.cc b/usrp2/host/apps/tx_samples.cc
index 5c3728f..5f899f6 100644
--- a/usrp2/host/apps/tx_samples.cc
+++ b/usrp2/host/apps/tx_samples.cc
@@ -234,7 +234,6 @@ main(int argc, char **argv)
   }
 
   usrp2::tx_metadata   md;
-  md.timestamp = -1;
   md.start_of_burst = 1;
   md.send_now = 1;
 
diff --git a/usrp2/host/include/usrp2/metadata.h 
b/usrp2/host/include/usrp2/metadata.h
index 8a95c38..17126e6 100644
--- a/usrp2/host/include/usrp2/metadata.h
+++ b/usrp2/host/include/usrp2/metadata.h
@@ -22,39 +22,18 @@
 
 namespace usrp2 {
 
-  //! type of the timestamp returned from the USRP2 FPGA
-  typedef uint32_t     fpga_timestamp;
-
-  /*!
-   * \brief metadata associated with received frames
-   * \ingroup usrp2
-   */
-  struct rx_metadata {
-    uint32_t           word0;                  //< debugging, extensions
-    fpga_timestamp     timestamp;              //< time that first sample of 
frame was received
-    unsigned int       start_of_burst : 1;     //< this frame is the start of 
a burst
-    unsigned int       end_of_burst   : 1;     //< this frame is the end of a 
burst
-    unsigned int       rx_overrun     : 1;     //< An Rx overrun occurred in 
the FPGA
-    // rssi
-    // agc_mode
-
-    rx_metadata() :
-      word0(0), timestamp(0), start_of_burst(0), end_of_burst(0), 
rx_overrun(0) {}
-  };
-
   /*!
    * \brief metadata associated with transmitted frames
    * \ingroup usrp2
    */
   struct tx_metadata {
-    fpga_timestamp     timestamp;              //< time to transmit first 
sample of frame
     unsigned int       send_now       : 1;     //< ignore timestamp, send now
     unsigned int       start_of_burst : 1;     //< this frame is the start of 
a burst
     unsigned int       end_of_burst   : 1;     //< this frame is the end of a 
burst
     // ...
 
     tx_metadata() :
-      timestamp(0), send_now(0), start_of_burst(0), end_of_burst(0) {}
+      send_now(0), start_of_burst(0), end_of_burst(0) {}
   };
 
 }; // usrp2
diff --git a/usrp2/host/include/usrp2/rx_nop_handler.h 
b/usrp2/host/include/usrp2/rx_nop_handler.h
index 68a254f..71a0a69 100644
--- a/usrp2/host/include/usrp2/rx_nop_handler.h
+++ b/usrp2/host/include/usrp2/rx_nop_handler.h
@@ -113,7 +113,7 @@ namespace usrp2 {
      * \returns true if the object wants to be called again with new data;
      * false if no additional data is wanted.
      */
-    virtual bool operator()(const uint32_t *items, size_t nitems, const 
rx_metadata *metadata)
+    virtual bool operator()(const uint32_t *items, size_t nitems, const 
vrt::expanded_header *vrt_header)
     {
       // printf("W0: %08x  TS: %08x\n", metadata->word0, metadata->timestamp);
       // printf("I0: %08x\n", items[0]);
diff --git a/usrp2/host/include/usrp2/rx_sample_handler.h 
b/usrp2/host/include/usrp2/rx_sample_handler.h
index a7fb7b6..00082e5 100644
--- a/usrp2/host/include/usrp2/rx_sample_handler.h
+++ b/usrp2/host/include/usrp2/rx_sample_handler.h
@@ -19,6 +19,7 @@
 #define INCLUDED_USRP2_RX_SAMPLE_HANDLER_H
 
 #include <usrp2/metadata.h>
+#include <vrt/expanded_header.h>
 #include <stddef.h>
 
 
@@ -51,7 +52,7 @@ namespace usrp2 {
      * \returns true if the object wants to be called again with new data;
      * false if no additional data is wanted.
      */
-    virtual bool operator()(const uint32_t *items, size_t nitems, const 
rx_metadata *metadata) = 0;
+    virtual bool operator()(const uint32_t *items, size_t nitems, const 
vrt::expanded_header *vrt_header) = 0;
   };
 
 };
diff --git a/usrp2/host/lib/usrp2_impl.cc b/usrp2/host/lib/usrp2_impl.cc
index eb3d6bc..7c13385 100644
--- a/usrp2/host/lib/usrp2_impl.cc
+++ b/usrp2/host/lib/usrp2_impl.cc
@@ -35,7 +35,6 @@
 #include <stddef.h>
 #include <assert.h>
 #include <string.h>
-#include <vrt/expanded_header.h>
 
 static const int DEFAULT_RX_SCALE = 1024;
 
@@ -149,9 +148,7 @@ namespace usrp2 {
             DEBUG_LOG("!");
             return data_handler::RELEASE;
         }
-        rx_metadata    md;
-        md.timestamp = hdr.fractional_secs; //FIXME temporary until we figure 
out new md for vrt
-        bool want_more = (*d_handler)(payload, n32_bit_words_payload, &md);
+        bool want_more = (*d_handler)(payload, n32_bit_words_payload, &hdr);
         DEBUG_LOG("-"); 
 
         return want_more? data_handler::RELEASE : data_handler::DONE;



reply via email to

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