discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Question about the "ninput_items"


From: zs
Subject: Re: [Discuss-gnuradio] Question about the "ninput_items"
Date: Thu, 9 Jul 2015 22:14:13 +0800 (CST)


Hi Marcus:
    Thank you so much.

   1.How did the system know how many items I can consume in a work call?
  
   2.Do you means that every times call the block,the block will throw the ninput_items[0] items?
     For example,the input steam 0 item is 1,2,3,4,5...  and the ninput_items[0]=2.
    The first time call the block, 1 2 is removed.
    The second time call the block,3 4 is removed.Is my understanding right?Just to confirm it.

   3.I add two files before and after "Stream CRC 32" block respectively.Namely file1.dat and file2.dat.The type is "Byte".Can I use the read_char_binary.m in matlab to look at the data?Or use other m file provided by the gnuradio?Thank you.

Best regards,
zswx




At 2015-07-09 21:48:30, "Marcus Müller" <address@hidden> wrote:
Hi Zswx,

ninput_items[0] is really the number of items that you can consume in a work call (on input stream 0). It's usually > 1.

Best regards,
Marcus

On 07/09/2015 03:29 PM, zs wrote:
Hi,

    Thank you in advance.I have a question about the "ninput_items".I find the meaning of it is "vector of items available on all input buffers".

    When I read the source code of "crc32_bb_impl.cc",I see the code below,

"
int
 65     crc32_bb_impl::work (int noutput_items,
 66                        gr_vector_int &ninput_items,
 67                        gr_vector_const_void_star &input_items,
 68                        gr_vector_void_star &output_items)
 69     {
 70       const unsigned char *in = (const unsigned char *) input_items[0];
 71       unsigned char *out = (unsigned char *) output_items[0];
 72       long packet_length = ninput_items[0];
"
I think the ninput_items[0]=1,because the item input is 1 every times.But when I write the code "std::cout<<ninput_items[0]<<std::endl;",It display the packet_length.I think the ninput_items[0]=1 no matter what pack_length is.Why I'm wrong?


Thank you.
Best regards,
zswx




_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

[Prev in Thread] Current Thread [Next in Thread]