discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Type Selectable GRC Blocks


From: Richard Bell
Subject: [Discuss-gnuradio] Type Selectable GRC Blocks
Date: Tue, 7 Jul 2015 15:57:47 -0700

Hi all,

I made a grc block that allows the user to select the input/output type using a drop down box. For a while, it seemed like what I had implemented worked fine. Recently, however, only selecting the complex data type works reliably, the other types sometimes cause the flowgraph to stop immediately with no error output. In some flowgraphs the block runs all types, in others it doesn't.

I looked at the code and noticed that the first thing I do in general_work is the following:

const gr_complex *in = (const gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];

This assumes the input/output types are gr_complex, which makes me think is causing the problems I'm seeing. I tried to look in other built-in blocks to see how they work but it hasn't cleared up my confusion. For example, in 'Stream to Tagged Stream', which lets users select the type, the lines above are declared as follows:

const unsigned char *in = (const unsigned char *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];

Why would this work if the user selects complex type from GRC?

The big question is, how do I properly define the buffer pointer types for user selectable type blocks in the C++ code?

v/r,
Rich

reply via email to

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