Skip to content

Commit

Permalink
Merge branch 'gr-cariboulite_tag_samples'
Browse files Browse the repository at this point in the history
  • Loading branch information
alon committed Apr 14, 2024
2 parents 211e5a3 + 3705017 commit 8d80e83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 14 additions & 5 deletions software/gr-caribouLite/lib/caribouLiteSource_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ namespace gr {
_radio->StartReceiving();
}

uint64_t caribouLiteSource_impl::getHandle() const
{
return (uint64_t)((void*)(_radio));
}

// virtual destructor
//-------------------------------------------------------------------------------------------------------------
caribouLiteSource_impl::~caribouLiteSource_impl()
Expand All @@ -100,13 +105,17 @@ namespace gr {
{
auto out_samples = static_cast<gr_complex*>(output_items[0]);
auto out_meta = _provide_meta == true ? static_cast<uint8_t*>(output_items[1]) : (uint8_t*) NULL ;
int ret = _radio->ReadSamples(out_samples, static_cast<size_t>(noutput_items), out_meta);

if (ret <= 0)
int read_samples = _radio->ReadSamples(out_samples, static_cast<size_t>(noutput_items), out_meta);
if (read_samples <= 0) { return 0;}

for (int i = 0; i < read_samples; i++)
{
return 0;
if (out_meta[i] == 1) {
add_item_tag(0, i, pmt::string_to_symbol("pps") ,pmt::from_bool(true));
}
}
return ret;

return read_samples;
}

} /* namespace caribouLite */
Expand Down
2 changes: 2 additions & 0 deletions software/gr-caribouLite/lib/caribouLiteSource_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ namespace gr
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items
);

uint64_t caribouLiteSource_impl::getHandle() const;
};

} // namespace caribouLite
Expand Down

0 comments on commit 8d80e83

Please sign in to comment.