Make metadata pipeline more uniform and GR-like.
The Frame Equalizer used to propagate metadata as a dictionary stored in a single tag. Now it instead propagates each entry as a separate tag, which is more in line with how standard GNU Radio blocks do it (see for example PDU to Tagged Stream block). This is also how the Extract CSI block does it. This modification also removes a lot of unnecessary variables and type conversions (from and to pmt types) in the Decode MAC block.
This commit is contained in:
committed by
Bastian Bloessl
parent
4f069d6518
commit
e620d48c81
@@ -224,7 +224,7 @@ int frame_equalizer_impl::general_work(int noutput_items,
|
||||
dict, pmt::mp("encoding"), pmt::from_uint64(d_frame_encoding));
|
||||
dict = pmt::dict_add(
|
||||
dict, pmt::mp("snr"), pmt::from_double(d_equalizer->get_snr()));
|
||||
dict = pmt::dict_add(dict, pmt::mp("freq"), pmt::from_double(d_freq));
|
||||
dict = pmt::dict_add(dict, pmt::mp("nom_freq"), pmt::from_double(d_freq));
|
||||
dict = pmt::dict_add(dict,
|
||||
pmt::mp("freq_offset"),
|
||||
pmt::from_double(d_freq_offset_from_synclong));
|
||||
@@ -234,11 +234,16 @@ int frame_equalizer_impl::general_work(int noutput_items,
|
||||
dict = pmt::dict_add(
|
||||
dict, pmt::mp("csi"), pmt::init_c32vector(csi.size(), csi));
|
||||
|
||||
add_item_tag(0,
|
||||
nitems_written(0) + o,
|
||||
pmt::string_to_symbol("wifi_start"),
|
||||
dict,
|
||||
pmt::string_to_symbol(alias()));
|
||||
pmt::pmt_t pairs = pmt::dict_items(dict);
|
||||
for (int i = 0; i < pmt::length(pairs); i++) {
|
||||
pmt::pmt_t pair = pmt::nth(i, pairs);
|
||||
add_item_tag(0,
|
||||
nitems_written(0) + o,
|
||||
pmt::car(pair),
|
||||
pmt::cdr(pair),
|
||||
alias_pmt());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user