summaryrefslogtreecommitdiff
path: root/gr-uhd/lib
diff options
context:
space:
mode:
Diffstat (limited to 'gr-uhd/lib')
-rw-r--r--gr-uhd/lib/CMakeLists.txt58
-rw-r--r--gr-uhd/lib/gr_uhd_usrp_sink.cc19
2 files changed, 67 insertions, 10 deletions
diff --git a/gr-uhd/lib/CMakeLists.txt b/gr-uhd/lib/CMakeLists.txt
new file mode 100644
index 000000000..fbdca0566
--- /dev/null
+++ b/gr-uhd/lib/CMakeLists.txt
@@ -0,0 +1,58 @@
+# Copyright 2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+# Setup the include and linker paths
+########################################################################
+include_directories(
+ ${GNURADIO_CORE_INCLUDE_DIRS}
+ ${GR_UHD_INCLUDE_DIRS}
+)
+
+include_directories(${UHD_INCLUDE_DIRS})
+link_directories(${UHD_LIBRARY_DIRS})
+
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
+
+########################################################################
+# Setup library
+########################################################################
+list(APPEND gr_uhd_sources
+ gr_uhd_usrp_source.cc
+ gr_uhd_usrp_sink.cc
+ gr_uhd_amsg_source.cc
+)
+
+list(APPEND uhd_libs
+ gnuradio-core
+ ${Boost_LIBRARIES}
+ ${UHD_LIBRARIES}
+)
+
+add_library(gnuradio-uhd SHARED ${gr_uhd_sources})
+target_link_libraries(gnuradio-uhd ${uhd_libs})
+set_target_properties(gnuradio-uhd PROPERTIES DEFINE_SYMBOL "gnuradio_uhd_EXPORTS")
+set_target_properties(gnuradio-uhd PROPERTIES SOVERSION ${LIBVER})
+
+install(TARGETS gnuradio-uhd
+ LIBRARY DESTINATION ${GR_LIBRARY_DIR} COMPONENT "uhd_runtime" # .so/.dylib file
+ ARCHIVE DESTINATION ${GR_LIBRARY_DIR} COMPONENT "uhd_devel" # .lib file
+ RUNTIME DESTINATION ${GR_RUNTIME_DIR} COMPONENT "uhd_runtime" # .dll file
+)
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;
};
/***********************************************************************