diff options
author | Martin Braun <martin.braun@ettus.com> | 2014-01-27 15:52:18 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2014-01-30 16:50:00 +0100 |
commit | 3e47151377cf7ee05a574ea2da044078f2a26ff7 (patch) | |
tree | d0f77c64eebf41861da6de646f6d40adb299697b | |
parent | 3e054cb93ccd2eb55ff040f9bc72532ea5b0b954 (diff) |
digital: HPD consume-behaviour adapted to allow for trigger jitter
-rw-r--r-- | gr-digital/include/gnuradio/digital/header_payload_demux.h | 3 | ||||
-rw-r--r-- | gr-digital/lib/header_payload_demux_impl.cc | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gr-digital/include/gnuradio/digital/header_payload_demux.h b/gr-digital/include/gnuradio/digital/header_payload_demux.h index 4fd3f8c2f2..d68c4ab9f3 100644 --- a/gr-digital/include/gnuradio/digital/header_payload_demux.h +++ b/gr-digital/include/gnuradio/digital/header_payload_demux.h @@ -58,6 +58,9 @@ namespace gr { * should go on the payload. * A special case are tags on items that make up the guard interval. These are copied * to the first item of the following symbol. + * If a tag is situated very close to the end of the payload, it might be unclear if + * it belongs to this packet or the following. In this case, the tag might be propagated + * twice. * * Tags outside of packets are generally discarded. If this information is important, * there are two additional mechanisms to preserve the tags: diff --git a/gr-digital/lib/header_payload_demux_impl.cc b/gr-digital/lib/header_payload_demux_impl.cc index 406d59e246..15308c0be1 100644 --- a/gr-digital/lib/header_payload_demux_impl.cc +++ b/gr-digital/lib/header_payload_demux_impl.cc @@ -266,10 +266,11 @@ namespace gr { case STATE_PAYLOAD: if (check_items_available(d_curr_payload_len, ninput_items, noutput_items, nread)) { - update_special_tags(0, d_curr_payload_len * (d_items_per_symbol + d_gi)); + // The -1 because we won't consume the last item, it might hold the next trigger. + update_special_tags(0, (d_curr_payload_len - 1) * (d_items_per_symbol + d_gi)); copy_n_symbols(in, out_payload, PORT_PAYLOAD, d_curr_payload_len); produce(PORT_PAYLOAD, d_curr_payload_len * (d_output_symbols ? 1 : d_items_per_symbol)); - consume_each (d_curr_payload_len * (d_items_per_symbol + d_gi)); + consume_each ((d_curr_payload_len - 1) * (d_items_per_symbol + d_gi)); // Same here set_min_noutput_items(d_output_symbols ? 1 : (d_items_per_symbol + d_gi)); d_state = STATE_FIND_TRIGGER; } |