diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2013-06-05 20:01:30 -0400 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2013-06-05 20:01:30 -0400 |
commit | 553c06df3dcc913219e6462131861a937acb8b5e (patch) | |
tree | d95a857e435ce1b439432e993d89391d4f76cf90 | |
parent | 4f9badfcf87442d6ef22d6183cb9582e01db00bc (diff) |
blocks: fix missing dynamic tag implementation
-rw-r--r-- | gr-blocks/include/gnuradio/blocks/pdu.h | 1 | ||||
-rw-r--r-- | gr-blocks/lib/tagged_stream_to_pdu_impl.cc | 7 | ||||
-rw-r--r-- | gr-blocks/lib/tagged_stream_to_pdu_impl.h | 1 |
3 files changed, 5 insertions, 4 deletions
diff --git a/gr-blocks/include/gnuradio/blocks/pdu.h b/gr-blocks/include/gnuradio/blocks/pdu.h index decc5e17d0..0ce8615948 100644 --- a/gr-blocks/include/gnuradio/blocks/pdu.h +++ b/gr-blocks/include/gnuradio/blocks/pdu.h @@ -28,7 +28,6 @@ #include <pmt/pmt.h> #define PDU_PORT_ID pmt::mp("pdus") -#define PDU_LENGTH_TAG pmt::mp("pdu_length") namespace gr { namespace blocks { diff --git a/gr-blocks/lib/tagged_stream_to_pdu_impl.cc b/gr-blocks/lib/tagged_stream_to_pdu_impl.cc index 3d6bcc4335..e2ca5ccabb 100644 --- a/gr-blocks/lib/tagged_stream_to_pdu_impl.cc +++ b/gr-blocks/lib/tagged_stream_to_pdu_impl.cc @@ -45,7 +45,8 @@ namespace gr { d_inpdu(false), d_type(type), d_pdu_meta(pmt::PMT_NIL), - d_pdu_vector(pmt::PMT_NIL) + d_pdu_vector(pmt::PMT_NIL), + d_tag(pmt::mp(lengthtagname)) { message_port_register_out(PDU_PORT_ID); } @@ -65,7 +66,7 @@ namespace gr { get_tags_in_range(d_tags, 0, abs_N, abs_N+1); for (d_tags_itr = d_tags.begin(); (d_tags_itr != d_tags.end()) && (!found_length_tag); d_tags_itr++) { - if (pmt::eq((*d_tags_itr).key, PDU_LENGTH_TAG )) { + if (pmt::eq((*d_tags_itr).key, d_tag)) { if ((*d_tags_itr).offset != abs_N ) throw std::runtime_error("expected next pdu length tag on a different item..."); @@ -87,7 +88,7 @@ namespace gr { // copy any tags in this range into our meta object get_tags_in_range(d_tags, 0, abs_N, abs_N+ncopy); for (d_tags_itr = d_tags.begin(); d_tags_itr != d_tags.end(); d_tags_itr++) - if(!pmt::eq((*d_tags_itr).key, PDU_LENGTH_TAG )) + if(!pmt::eq((*d_tags_itr).key, d_tag )) d_pdu_meta = dict_add(d_pdu_meta, (*d_tags_itr).key, (*d_tags_itr).value); // copy samples for this vector into either a pmt or our save buffer diff --git a/gr-blocks/lib/tagged_stream_to_pdu_impl.h b/gr-blocks/lib/tagged_stream_to_pdu_impl.h index 259393dbff..9620778a91 100644 --- a/gr-blocks/lib/tagged_stream_to_pdu_impl.h +++ b/gr-blocks/lib/tagged_stream_to_pdu_impl.h @@ -39,6 +39,7 @@ namespace gr { pmt::pmt_t d_pdu_meta; pmt::pmt_t d_pdu_vector; + pmt::pmt_t d_tag; std::vector<tag_t>::iterator d_tags_itr; std::vector<tag_t> d_tags; |