[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Problem writing custom null sync block
From: |
maiconkist |
Subject: |
[Discuss-gnuradio] Problem writing custom null sync block |
Date: |
Fri, 22 Feb 2013 05:42:51 -0800 (PST) |
Hi list,
I'm writing a custom null sync block called "file_writer". What I want to do
is dump (to file or screen) what my null sync is receiving).
The problem is that if I use the file_writer in a flow graph, after the
"work" function is executed a few times it starts to receive the same input
forever.
I created a simple flow graph in gnuradio-companion that shows the FFT of
the signal received in a USRP source.
When I modify the generated python code and insert the file_writer right
after a stream_to_vector block, the flow graph "hangs" and process the same
data over and over again.
Any suggestions of what is missing ?
Here's the code of my simple block:
####
class file_writer(gr.sync_block):
## CTOR
#
def __init__(self, filename, vec_size):
gr.sync_block.__init__(
self,
"file name block",
in_sig = [np.dtype((np.float32, vec_size))],
out_sig = None
)
self._fd = open(filename, 'w')
self._filename = filename
def work(self, input_items, output_items):
in0 = input_items[0]
print "###### ", len(in0)
print in0
return len(output_items)
--
View this message in context:
http://gnuradio.4.n7.nabble.com/Problem-writing-custom-null-sync-block-tp39796.html
Sent from the GnuRadio mailing list archive at Nabble.com.
- [Discuss-gnuradio] Problem writing custom null sync block,
maiconkist <=