From 6dc42c7f4375f633c4efda7cf1e88c6c98ac4b54 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Wed, 9 Aug 2017 22:37:00 +0100 Subject: [PATCH] sync: more logging --- lib/sync_long.cc | 1 + lib/sync_short.cc | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/sync_long.cc b/lib/sync_long.cc index 3d795e0..1765d26 100644 --- a/lib/sync_long.cc +++ b/lib/sync_long.cc @@ -104,6 +104,7 @@ int general_work (int noutput, gr_vector_int& ninput_items, if(d_offset == SYNC_LENGTH) { search_frame_start(); + mylog(boost::format("LONG: frame start at %1%") % d_frame_start); d_offset = 0; d_count = 0; d_state = COPY; diff --git a/lib/sync_short.cc b/lib/sync_short.cc index 1754242..dde1401 100644 --- a/lib/sync_short.cc +++ b/lib/sync_short.cc @@ -73,7 +73,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, d_copied = 0; d_freq_offset = arg(in_abs[i]) / 16; d_plateau = 0; - insert_tag(nitems_written(0), d_freq_offset); + insert_tag(nitems_written(0), d_freq_offset, nitems_read(0) + i); dout << "SHORT Frame!" << std::endl; break; } @@ -99,7 +99,7 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, d_copied = 0; d_plateau = 0; d_freq_offset = arg(in_abs[o]) / 16; - insert_tag(nitems_written(0) + o, d_freq_offset); + insert_tag(nitems_written(0) + o, d_freq_offset, nitems_read(0) + o); dout << "SHORT Frame!" << std::endl; break; } @@ -128,8 +128,8 @@ int general_work (int noutput_items, gr_vector_int& ninput_items, return 0; } -void insert_tag(uint64_t item, double freq_offset) { - mylog(boost::format("frame start at %1%") % item); +void insert_tag(uint64_t item, double freq_offset, uint64_t input_item) { + mylog(boost::format("frame start at in: %2% out: %1%") % item % input_item); const pmt::pmt_t key = pmt::string_to_symbol("wifi_start"); const pmt::pmt_t value = pmt::from_double(freq_offset);