Gr_add_cc use

Hello,

I am having a problem in trying to add multiple complex filter outputs
using
the gr_add_cc code, I think the solution might be pretty simple but I’m
not
very experienced with GNURadio! (I’m working on it…)

Here is a code snippet:

self.packet_transmitter1 = blks.gmsk2_mod_pkts(fg, spb=self._spb, bt=bt,
msgq_limit=2)
self.packet_transmitter2 = blks.gmsk2_mod_pkts(fg, spb=self._spb, bt=bt,
msgq_limit=2)

self.chan_filt1 = gr.freq_xlating_fir_filter_ccc(sw_interp,
                                                         chan_coeffs,
                                                         freq1,
                                                         sw_interp *
self._spb)

self.chan_filt2 = gr.freq_xlating_fir_filter_ccc(sw_interp,
                                                         chan_coeffs,
                                                         freq2,
                                                         sw_interp *
self._spb)
self.adder = gr.add_cc()

self.amp = gr.multiply_const_cc (self.gain)

fg.connect(self.packet_transmitter1, self.chan_filt1, self.adder)
fg.connect(self.packet_transmitter2, self.chan_filt2, self.adder) (*)
fg.connect(self.adder, self.amp, self.u)
~~~~~~~
When I try to run this code I get a "destination endpoint already in 
use"
error at (*), so what is the correct way to add multiple streams?

Thank you so very much for your help!

Ben

fg.connect(self.packet_transmitter1, self.chan_filt1, self.adder)
fg.connect(self.packet_transmitter2, self.chan_filt2, self.adder) (*)
fg.connect(self.adder, self.amp, self.u)

What is happening here is that you are trying to hook both filt1 and
filt2 to the FIRST input of self.adder. To hook to the second input,
use “(self.adder, 1)” instead of self.adder.

Matt

Only one thing may be connected to an input. You have to choose
different input ports for the adder. Give the connect statement a tuple
of the form (block, port_num). Like so…

fg.connect(self.packet_transmitter1, self.chan_filt1, (self.adder, 0))
fg.connect(self.packet_transmitter2, self.chan_filt2, (self.adder, 1))

Hope this helps. -Josh

It worked perfectly; thanks!

Ben