discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Adding command port to OFDM Allocator Block


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Adding command port to OFDM Allocator Block
Date: Wed, 5 Apr 2017 14:13:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Hi,

did you add the message port to the .xml file describing the block in python?

Greetings,

Marcus


On 05.04.2017 00:41, Qurat-Ul-Ann Akbar wrote:
Hi,

I am trying to add a command port to the OFDM Allocator block in GNURadio. The goal is for this command port to take a message every 1 ms to change the amplitude of the complex pilot symbols. However, I can not see the port appearing in GRC.

I just wrote some test code to see if the port is appearing. The changes I made are given below:

1) I added this line here:
 ofdm_carrier_allocator_cvc_impl::ofdm_carrier_allocator_cvc_impl
{int fft_len,
 const std::vector<std::vector<int> > &occupied_carriers,
 const std::vector<std::vector<int> > &pilot_carriers,
 const std::vector<std::vector<gr_complex> > &pilot_symbols,
 const std::vector<std::vector<gr_complex> > &sync_words,
 const std::string &len_tag_key,
 const bool output_is_shifted
    ) : tagged_stream_block("ofdm_carrier_allocator_cvc",
  io_signature::make(1, 1, sizeof (gr_complex)),
  io_signature::make(1, 1, sizeof (gr_complex) * fft_len), len_tag_key),
d_fft_len(fft_len),
d_occupied_carriers(occupied_carriers),
d_pilot_carriers(pilot_carriers),
d_pilot_symbols(pilot_symbols),
d_sync_words(sync_words),
d_symbols_per_set(0),
d_output_is_shifted(output_is_shifted)
{
   //MY_CHANGES
    message_port_register_in(pmt::mp("test"));
    set_msg_handler(pmt::mp("test"), boost::bind(&mac_impl::test_in, this, _1));


2) And then the function test_in is just a function printing out the message "TESTER"

//MY_CHANGES
void test_in (pmt::pmt_t msg) {
// this must be a pair
int count = 0;
if (!pmt::is_blob(pmt::cdr(msg))) {
throw std::runtime_error("PMT must be blob");
}

if(pmt::is_symbol(msg)) {
throw std::runtime_error("#############TESTER#########");
}
}

3) I uninstalled everything and built again. But I cant see anything in the block. I don't see this port at the input of the block.

Can anyone please tell me what am I doing wrong ?





_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

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