I am trying to pass a stream tag down the chain in the OFDM code. As a point of reference, I am using Tom, Matt, and Bob's figure from their SDR08 paper:
What I want to do is in gr.ofdm_sampler, calculate the clock time the preamble was received at the USRP, then pass it on forward all the way to the python code so that every incoming decoded packet has a timestamp associated with it, which is the time the preamble was received.
So, in gr.ofdm_sampler, I calculate the timestamp and create a new stream tag, putting it on port 1 (note: also tried port 0):
At this point, I output:
"--- added sync tag in ofdm_sampler\n"
Then, this stream tag should hit gr.ofdm_frame_acquisition. I do a quick check for it on incoming port 1:
And output:
"--- got sync tag in frame_acq\n"
Next, I make the same check in gr.ofdm_frame_sink for my stream tag (at top of work):
And output:
"--- got sync tag in frame_sink\n"
Finally, I check for the stream tag right before the new gr.message is put in to the queue in gr.ofdm_frame_sink:
If no stream tag is found, I output:
std::cerr << "---- Header received, with no sync timestamp? (" << nread << ")\n"
Now, what I would expect is that when I get an incoming frame, I go down that set of outputs one by one, and then I get the output that I've received a packet. But, that doesn't seem to be the case:
Instead, I typically get this with no output from frame_acq or frame_sink other than frame_sink to tell me it didn't get the stream tag:
--- added sync tag in ofdm_sampler
---- Header received, with no sync timestamp? (181)
ok: True pktno: 156 n_rcvd: 2 n_right: 1 valid_ts: 0
Then after a little while, I get a dump from frame_acq and frame_sink:
--- added sync tag in ofdm_sampler
---- Header received, with no sync timestamp? (509)
ok: True pktno: 174 n_rcvd: 20 n_right: 19 valid_ts: 0
--- added sync tag in ofdm_sampler
--- got sync tag in frame_acq
--- got sync tag in frame_sink
--- got sync tag in frame_acq
--- got sync tag in frame_sink
--- got sync tag in frame_acq
--- got sync tag in frame_sink
The number of those don't correspond to how many frames that I have received, and at some point just stop showing up:
Am i missing something fundamental about how the stream tag is passed forward?
Thanks!
George