commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 05/08: channels: provide CSI via message po


From: git
Subject: [Commit-gnuradio] [gnuradio] 05/08: channels: provide CSI via message ports optionally
Date: Fri, 10 Jun 2016 20:45:12 +0000 (UTC)

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

jcorgan pushed a commit to branch next
in repository gnuradio.

commit bf470011ec6458836d6879d4d4a4bf9ebab3e269
Author: Tim O'Shea <address@hidden>
Date:   Sat Jun 4 09:17:35 2016 -0400

    channels: provide CSI via message ports optionally
---
 gr-channels/grc/channels_selective_fading_model2.xml | 5 +++++
 gr-channels/lib/selective_fading_model2_impl.cc      | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/gr-channels/grc/channels_selective_fading_model2.xml 
b/gr-channels/grc/channels_selective_fading_model2.xml
index 7df09a7..1e1ea3a 100644
--- a/gr-channels/grc/channels_selective_fading_model2.xml
+++ b/gr-channels/grc/channels_selective_fading_model2.xml
@@ -89,6 +89,11 @@
                <name>out</name>
                <type>complex</type>
        </source>
+       <source>
+               <name>taps</name>
+               <type>message</type>
+        <optional>1</optional>
+       </source>
     <doc>
     int d_N=8;          // number of sinusoids used to simulate gain on each 
ray
     float d_fDTs=0.01   // normalized maximum doppler frequency (f_doppler / 
f_samprate)
diff --git a/gr-channels/lib/selective_fading_model2_impl.cc 
b/gr-channels/lib/selective_fading_model2_impl.cc
index 7ae5041..c9b9d62 100644
--- a/gr-channels/lib/selective_fading_model2_impl.cc
+++ b/gr-channels/lib/selective_fading_model2_impl.cc
@@ -77,6 +77,9 @@ namespace gr {
         if(ntaps < 1){ throw std::runtime_error("ntaps must be >= 1"); }
         set_history(1+ntaps);
         d_taps.resize(ntaps, gr_complex(0,0));
+
+        // set up message port
+        message_port_register_out(pmt::mp("taps"));
     }
 
     selective_fading_model2_impl::~selective_fading_model2_impl()
@@ -134,6 +137,12 @@ namespace gr {
 
             // assign output
             out[i] = sum;
+
+        }
+
+        if(pmt::length(message_subscribers(pmt::mp("taps"))) > 0){
+            pmt::pmt_t pdu( pmt::cons( pmt::PMT_NIL, 
pmt::init_c32vector(d_taps.size(), d_taps) ));
+            message_port_pub(pmt::mp("taps"), pdu);
         }
 
         // return all outputs



reply via email to

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