Add nomfreq, freqofs, dlt to PDU metadata
Add Nominal Frequency, Carrier Frequency Offset and Data Link Type (DLT) tags to PDU. Signed-off-by: Jonathan Brucker jonathan.brucke@gmail.com
This commit is contained in:
@@ -39,7 +39,8 @@ frame_equalizer_impl::frame_equalizer_impl(Equalizer algo, double freq, double b
|
||||
gr::io_signature::make(1, 1, 64 * sizeof(gr_complex)),
|
||||
gr::io_signature::make(1, 1, 48)),
|
||||
d_current_symbol(0), d_log(log), d_debug(debug), d_equalizer(NULL),
|
||||
d_freq(freq), d_bw(bw), d_frame_bytes(0), d_frame_symbols(0) {
|
||||
d_freq(freq), d_bw(bw), d_frame_bytes(0), d_frame_symbols(0),
|
||||
d_freq_offset_from_synclong(0.0) {
|
||||
|
||||
message_port_register_out(pmt::mp("symbols"));
|
||||
|
||||
@@ -131,6 +132,7 @@ frame_equalizer_impl::general_work (int noutput_items,
|
||||
d_frame_symbols = 0;
|
||||
d_frame_mod = d_bpsk;
|
||||
|
||||
d_freq_offset_from_synclong = pmt::to_double(tags.front().value) * d_bw;
|
||||
d_epsilon0 = pmt::to_double(tags.front().value) * d_bw / (2 * M_PI * d_freq);
|
||||
d_er = 0;
|
||||
|
||||
@@ -207,11 +209,14 @@ frame_equalizer_impl::general_work (int noutput_items,
|
||||
|
||||
if(decode_signal_field(out + o * 48)) {
|
||||
|
||||
// TODO: it would better to use pmt::dict instead of raw list of numbers
|
||||
add_item_tag(0, nitems_written(0) + o,
|
||||
pmt::string_to_symbol("wifi_start"),
|
||||
pmt::make_tuple(pmt::from_uint64(d_frame_bytes),
|
||||
pmt::from_uint64(d_frame_encoding),
|
||||
pmt::from_double(d_equalizer->get_snr())),
|
||||
pmt::from_double(d_equalizer->get_snr()),
|
||||
pmt::from_double(d_freq), // nominal frequency
|
||||
pmt::from_double(d_freq_offset_from_synclong)),
|
||||
pmt::string_to_symbol(name()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user