[Top][All Lists]

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

[Discuss-gnuradio] Writing own gnuradio Block, optional output port

From: Charles Bridger
Subject: [Discuss-gnuradio] Writing own gnuradio Block, optional output port
Date: Thu, 17 Dec 2015 11:40:21 +1300

I've created a signal source and want to create a second port which outputs the same signal, except one sample behind. The problem I'm having is that I don't know how to make it "optional". If I change the code in the private constructor from:

[Constructor Code}



It still makes me  plug something into the port when I use the block in GRC, even when I don't want to use the second output port.

I don't know if my code in the work method is relevant but I address the tw output ports like this:

float *out0 = (float *) output_items[0];
float *out1 = (float *) output_items[1];

for(int i = 0; i < noutput_items; i++)
    out0[i] = stuff;
    out1[i] = stuff - 1; // <- I want that to be optional when I put the block in GRC.

I've also tried setting the io_signature::make to 1,-1,sizeof(float) but that's less than ideal and doesn't work if in GRC i set number of outputs to 1.

Again thank you all for your time.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]