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: Marcus Müller
Subject: Re: [Discuss-gnuradio] Question about the "ninput_items"
Date: Thu, 09 Jul 2015 15:48:30 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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]