discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Trouble creating simple custom Sink (Python): Una


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Trouble creating simple custom Sink (Python): Unable to coerce endpoint
Date: Mon, 03 Aug 2015 20:15:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Hi M4RL0V,

a sink is typically built as a sync block, simply because it's easier
(and still works), since you don't have to implement a general_work (and
a forecast).

So your problem here is that logically, connecting happens in the
top_block, not in the block itself; have a look at python code that the
GNU Radio Companion generates when connecting two blocks. It simply
happens outside any constructor as tb.connect(source,sink).

Generally, I don't know whether that actually is the problem here. You
forgot to actually include information on what goes wrong, and any
relevant errors (if any). It's hard to help you like this :) Here's a
link having a few tips on how to ask good questions on the mailing list:
https://gnuradio.org/redmine/projects/gnuradio/wiki/ReportingErrors

Best regards,
Marcus

On 08/03/2015 08:05 PM, address@hidden wrote:
> I'd like to implement a simple custom sink block in Python.
>
> AFAIK, a sink is a 1:0 basic block, with one input port, and no output
> port.
>
> I define it as a class:
>
> class MySink(gr.basic_block):
>     def __init__(self, src_block):
>     gr.basic_block.__init__(self, name='MySink',
> in_sig=[numpy.float32], out_sig=None)
>     gr.top_block().connect(src_block, self)
>
> Then, in the top block constructor:
>     # ....
>     self.gsm_fcch_detector_0 = grgsm.fcch_detector(4)
>     # Line bellow raises an 'Unable to coerce endpoint' exception
>     self.my_sink = MySink(self.gsm_fcch_detector_0)
>
> As you may already have guessed, I'm a newcomer here, and I'm sure I
> miss something obvious.
> I thought the connect line should wire the FCCH detector output port
> to my custom sink input port, but instead it raises an exception.
>
> I will really appreciate any direction, as I'm a bit stuck here: could
> someone point me toward what I clearly misunderstand ?
>
> Thanks in advance.
>
> _______________________________________________
> 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]