|
From: | Jeff Long |
Subject: | Re: Question on making OOT Tag Stream modules |
Date: | Sun, 21 Jun 2020 21:20:29 -0400 |
Hi Jeff,Another quick question!Within a tagged stream Block, do you know how the value of the tag stream is accessed? In my_crc8_impl.cc file, the tagged stream method let you input the tagged streamed key (which I entered as the string "packet_len". In my signal processing, I need access to the tag value that goes with this input stream of data. Based on your latest material, I know I had it wrong because I felt it was named packet_len (like the key string name). Based on what you send, I have a fuzzy idea of how to extract it, but it is FUZZY. This is my idea:if (tag.key == "packet_len"):pack_length = tag.valueMy problem is: what is what do I write in the place of "tag"????Thanks for the help.Regards,GeorgeThank you!Regards,GeorgeOn Sun, Jun 21, 2020 at 6:15 PM George Edwards <gedwards.eng@gmail.com> wrote:Hello Jeff,Thanks! Will look at these resources.Regards,GeorgeOn Sun, Jun 21, 2020 at 6:06 PM Jeff Long <willcode4@gmail.com> wrote:George - please reply to the list, not individuals. You'll get your problem solved faster that way, too.You can try out your block with a vector source in GRC https://wiki.gnuradio.org/index.php/Vector_Source.Also, the existing QA code for the vector source should give you an idea how to use it in Python. Most of the QA code is written in Python rather than C++.On Sun, Jun 21, 2020 at 7:48 PM George Edwards <gedwards.eng@gmail.com> wrote:Hi Jeff,Thanks for the response. Please bear with me a little because of my newness to gnuradio.I looked up vector source and tagging and found the following for a tagged list: [int offset, pmt key, pmt value, pmt srcid]In my case my input vector is:: src_data = array([1, 0, 1, 0,...1,,1]) with 10 values. Do I write the syntax as follows for the QA test code:gr::tag_t(int 0, pmt "packet_len", pmt 10, pmt src_data)???Thanks for the help.Regards,GeorgeOn Sun, Jun 21, 2020 at 5:09 PM Jeff Long <willcode4@gmail.com> wrote:If you are trying to create a test vector to feed into a block that needs a tag named "length", you can use a Vector Source. That block allows you to define a vector of data along with tags.On Sun, Jun 21, 2020 at 6:38 PM George Edwards <gedwards.eng@gmail.com> wrote:Hello,New to gnuradio and I am making an OOT CRC8 module to take a tagged bit stream (1's and 0's) and generate the CRC and attach the CRC to the end of the data and pass it on to the next block. Also, I am encapsulating both the generator and check sum in same block using a boolean variable "check" to determine operation.In QA test I get the following error:gr::log :FATAL: my_crc8_bb0 - Missing a required length tag on port 0 at item #0.thread [thread-per-block[1] < block my crc8_bb(2)>] Missing length tagI modified the QA test vector by writing the length of the input string of 1's and 0's as the first element in the input data array, but it gave the same error as typed above.Questions:Q1. How do I write in the input test vector, or what do I add to what I already have to make the module aware of the tag length?Q2. In the my_crc8_bb_impl.cc file in the tagged stream method, I specified the tag name as "packet_len". In the signal processing in this .cc file, I assume the value of packet_len is available to me for use as a parameter and I used it. Are there some other things I need to do in this "my_crc8_bb_impl.cc file" to make the module more aware of input tagged stream data (maybe I am not binding "packet_len" properly)?I greatly appreciate any help!Regards,George
[Prev in Thread] | Current Thread | [Next in Thread] |