diff options
Diffstat (limited to 'gr-uhd')
-rw-r--r-- | gr-uhd/examples/tag_sink_demo.h | 9 | ||||
-rw-r--r-- | gr-uhd/examples/tag_source_demo.h | 1 | ||||
-rw-r--r-- | gr-uhd/lib/gr_uhd_usrp_sink.cc | 19 |
3 files changed, 13 insertions, 16 deletions
diff --git a/gr-uhd/examples/tag_sink_demo.h b/gr-uhd/examples/tag_sink_demo.h index 84baf0a9c..524f0ae0f 100644 --- a/gr-uhd/examples/tag_sink_demo.h +++ b/gr-uhd/examples/tag_sink_demo.h @@ -21,7 +21,6 @@ #include <gr_sync_block.h> #include <gr_io_signature.h> -#include <gr_tag_info.h> #include <boost/foreach.hpp> #include <boost/format.hpp> #include <iostream> @@ -47,13 +46,13 @@ public: ){ //grab all "rx time" tags in this work call const uint64_t samp0_count = this->nitems_read(0); - std::vector<pmt::pmt_t> rx_time_tags; + std::vector<gr_tag_t> rx_time_tags; get_tags_in_range(rx_time_tags, 0, samp0_count, samp0_count + ninput_items, pmt::pmt_string_to_symbol("rx_time")); //print all tags - BOOST_FOREACH(const pmt::pmt_t &rx_time_tag, rx_time_tags){ - const uint64_t count = gr_tags::get_nitems(rx_time_tag); - const pmt::pmt_t &value = gr_tags::get_value(rx_time_tag); + BOOST_FOREACH(const gr_tag_t &rx_time_tag, rx_time_tags){ + const uint64_t count = rx_time_tag.offset; + const pmt::pmt_t &value = rx_time_tag.value; std::cout << boost::format("Full seconds %u, Frac seconds %f") % pmt::pmt_to_uint64(pmt_tuple_ref(value, 0)) diff --git a/gr-uhd/examples/tag_source_demo.h b/gr-uhd/examples/tag_source_demo.h index c7c0884d3..a995762f7 100644 --- a/gr-uhd/examples/tag_source_demo.h +++ b/gr-uhd/examples/tag_source_demo.h @@ -21,7 +21,6 @@ #include <gr_sync_block.h> #include <gr_io_signature.h> -#include <gr_tag_info.h> #include <boost/foreach.hpp> #include <boost/format.hpp> #include <iostream> diff --git a/gr-uhd/lib/gr_uhd_usrp_sink.cc b/gr-uhd/lib/gr_uhd_usrp_sink.cc index a780f0551..1a6595293 100644 --- a/gr-uhd/lib/gr_uhd_usrp_sink.cc +++ b/gr-uhd/lib/gr_uhd_usrp_sink.cc @@ -21,7 +21,6 @@ #include <gr_uhd_usrp_sink.h> #include <gr_io_signature.h> -#include <gr_tag_info.h> #include <stdexcept> static const pmt::pmt_t SOB_KEY = pmt::pmt_string_to_symbol("tx_sob"); @@ -185,7 +184,7 @@ public: gr_vector_void_star &output_items ){ int ninput_items = noutput_items; //cuz its a sync block - + //send a mid-burst packet with time spec _metadata.start_of_burst = false; _metadata.end_of_burst = false; @@ -211,11 +210,11 @@ public: **********************************************************************/ inline void tag_work(int &ninput_items){ //the for loop below assumes tags sorted by count low -> high - std::sort(_tags.begin(), _tags.end(), gr_tags::nitems_compare); + std::sort(_tags.begin(), _tags.end(), gr_tag_t::offset_compare); //extract absolute sample counts - const pmt::pmt_t &tag0 = _tags.front(); - const uint64_t tag0_count = gr_tags::get_nitems(tag0); + const gr_tag_t &tag0 = _tags.front(); + const uint64_t tag0_count = tag0.offset; const uint64_t samp0_count = this->nitems_read(0); //only transmit nsamples from 0 to the first tag @@ -229,10 +228,10 @@ public: _metadata.has_time_spec = false; //process all of the tags found with the same count as tag0 - BOOST_FOREACH(const pmt::pmt_t &my_tag, _tags){ - const uint64_t my_tag_count = gr_tags::get_nitems(my_tag); - const pmt::pmt_t &key = gr_tags::get_key(my_tag); - const pmt::pmt_t &value = gr_tags::get_value(my_tag); + BOOST_FOREACH(const gr_tag_t &my_tag, _tags){ + const uint64_t my_tag_count = my_tag.offset; + const pmt::pmt_t &key = my_tag.key; + const pmt::pmt_t &value = my_tag.value; //determine how many samples to send... //from zero until the next tag or end of work @@ -301,7 +300,7 @@ private: double _sample_rate; //stream tags related stuff - std::vector<pmt::pmt_t> _tags; + std::vector<gr_tag_t> _tags; }; /*********************************************************************** |