discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Help to understand "UHD AMsg Source"


From: Jose Torres Diaz
Subject: [Discuss-gnuradio] Help to understand "UHD AMsg Source"
Date: Mon, 15 Oct 2012 09:32:32 +1030

Hi Community,

I would like to ask if someone can give a hand to figure out how "UHD AMsg Source" block works. I mean, I would like to understand in particular how this block can post message using pmt_dict type. The piece of routine that I'm keen on it's this:

void post_async_md(const uhd::async_metadata_t &md){
        pmt::pmt_t value_dict = pmt::pmt_make_dict();
        if (md.has_time_spec){
            pmt::pmt_t timestamp = pmt::pmt_make_tuple(
                pmt::pmt_from_uint64(md.time_spec.get_full_secs()),
                pmt::pmt_from_double(md.time_spec.get_frac_secs())
            );
            pmt::pmt_dict_add(value_dict, TIME_KEY, timestamp);
        }
        pmt::pmt_dict_add(value_dict, CHAN_KEY, pmt::pmt_from_uint64(md.channel));
        pmt::pmt_dict_add(value_dict, EVENT_KEY, pmt::pmt_from_uint64(md.event_code));
        this->post_msg(0, AMSG_KEY, value_dict, _id); // <--Here the message is post downstream, but using pmt_dict
    }

I've tried to create my own block using stream to blob, using pmt_dict. However, it was not possible to do such a post message with a pmt_dict type of variable.

I think I'm missing/misunderstanding something important in this block UHD AMsg source, that allows to post dictionaries downstream. However, I couldn't figure out what it is.

Thanks a lot for your comments and help,

Regards,

Jose

reply via email to

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