Skip to content

Commit

Permalink
fix gnuradio plugin unity build
Browse files Browse the repository at this point in the history
  • Loading branch information
rjonaitis committed Sep 7, 2024
1 parent a783d91 commit d738022
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion plugins/gr-limesdr/lib/sink_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ using namespace std::literals::string_literals;

namespace gr {
namespace limesdr {

static const pmt::pmt_t TX_TIME_TAG = pmt::string_to_symbol(std::string("tx_time"));

sink::sptr sink::make(std::string serial,
int channel_mode,
const std::string& filename,
Expand Down Expand Up @@ -220,7 +223,7 @@ void sink_impl::work_tags(int noutput_items)
// Go through the tags
for (tag_t cTag : tags) {
// Found tx_time tag
if (pmt::eq(cTag.key, TIME_TAG)) {
if (pmt::eq(cTag.key, TX_TIME_TAG)) {
// Convert time to sample timestamp
uint64_t secs = pmt::to_uint64(pmt::tuple_ref(cTag.value, 0));
double fracs = pmt::to_double(pmt::tuple_ref(cTag.value, 1));
Expand Down
2 changes: 0 additions & 2 deletions plugins/gr-limesdr/lib/sink_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include <array>
#include <string>

static const pmt::pmt_t TIME_TAG = pmt::string_to_symbol(std::string("tx_time"));

namespace gr {
namespace limesdr {
class sink_impl : public sink
Expand Down
4 changes: 3 additions & 1 deletion plugins/gr-limesdr/lib/source_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ using namespace std::literals::string_literals;
namespace gr {
namespace limesdr {

static const pmt::pmt_t RX_TIME_TAG = pmt::string_to_symbol(std::string("rx_time"));

source::sptr source::make(std::string serial,
int channel_mode,
const std::string& filename,
Expand Down Expand Up @@ -273,7 +275,7 @@ void source_impl::add_time_tag(int channel, lime::StreamMeta meta)
const pmt::pmt_t ID = pmt::string_to_symbol(stored.serial);
const pmt::pmt_t t_val =
pmt::make_tuple(pmt::from_uint64(intpart), pmt::from_double(fracpart));
add_item_tag(channel, nitems_written(channel), TIME_TAG, t_val, ID);
add_item_tag(channel, nitems_written(channel), RX_TIME_TAG, t_val, ID);
}

// Return io_signature to manage module output count
Expand Down

0 comments on commit d738022

Please sign in to comment.