Hi every one,
Now I am trying to use gr.buffer. I wrote some very simple codes to
test how to use gr.buffer correctly. The main codes are as below:
create a sin source
#create a buffer by applying gr.buffer
#send buffer volume to the sink
But unfortunately, I got a despondent error reply says: in method
‘buffer’, argument 3 of type ‘gr_block_sptr’. I looked up the gr_buffer
class and found that the so called argument 3 is a link to a block which
writes data to this buffer. As my understanding, the sig_source block
should write data to the buffer so I write self.buf as above way. From
the error hint, I ever thought perhaps the error just comes from the
incorrect type. Because the sin_source object is pointed by the pointer
type of “gr_sin_source_c_sptr”. But how can I get an object that merely
inherited from gr.block class? I tried to construct a class inherits
from gr.block but there exists another error says that "‘module’ object
has no attribute ‘block’ ".
I checked the internet but found nothing helpful. A surprising fact is
that looks no one ever used gr.buffer in gnuradio by adopting python
way. Is there anybody know how to use it correctly?
Your instruction is fairly appreciated.