|
From: | Marcus Müller |
Subject: | Re: [Discuss-gnuradio] PDU Message Structure |
Date: | Sat, 21 Nov 2015 18:27:43 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
Hi Devin, had to look this up myself: you're right, PDU messages air pmt::pair_t; it's a bit hard to read before, but as soon as you realize car gives you the first element of a pair, and cdr the second, things become clearer: d_curr_meta = pmt::car(msg); d_curr_vect = pmt::cdr(msg); d_curr_len = pmt::length(d_curr_vect); So, the second part is the one containing data in a vector, i.e. what gets copied to the pdu_to_tagged_stream's output as items (see what happens with d_curr_vect in work()). Now, what's the structure of d_curr_meta? Looking at l. 96ff: // Copy tags if (!pmt::eq(d_curr_meta, pmt::PMT_NIL) ) { pmt::pmt_t klist(pmt::dict_keys(d_curr_meta)); for (size_t i = 0; i < pmt::length(klist); i++) { pmt::pmt_t k(pmt::nth(i, klist)); pmt::pmt_t v(pmt::dict_ref(d_curr_meta, k, pmt::PMT_NIL)); add_item_tag(0, nitems_written(0), k, v, alias_pmt()); } } we see that d_curr_meta is treated as a
dictionary, and the key/pair values are added as stream tags.
So, you're probably doing it right: The first part of your pair is the tags you want to have alongside with your samples, but something is wrong with the way you send samples, so: what *is* the second part of your pair? Or am I completely misunderstanding you, and you want to somehow send the contents of your dictionary as stream items ("samples")? Cheers, Marcus On 21.11.2015 16:45, devin kelly wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |