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
on 2012-10-15 01:03
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.