Hi Rich,
two cases here:
a) Either the block doesn't actually do the casting (ie. it doesn't care
for the data type), and the drop down menu just selects a item size
(useful for things that just memcpy things over etc), or
b) the dropdown menu actually selects one of multiple different blocks.
Cheers,
Marcus
On 21.07.2015 01:35, Richard Bell wrote:
So, the first line of work and general_work functions is usually
something of the form
const unsigned char *in = (const unsigned char *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
or
gr_complex *in = (gr_complex *) input_items[0];
gr_complex *out = (gr_complex *) output_items[0];
or other input/output types.
The confusion comes when I make blocks that have user selectable types
through GRC. I see from built-ins that developers use the unsigned
char pointers for this usually. What I can't figure out is how this
works when a user selects gr_complex as an input/output type. It seems
to me that these pointers to unsigned chars should fail dramatically.
But they don't! In fact, I can use either of the two forms I presented
above and my flow graph "works", quotes because there maybe a fail
case I haven't found yet, so far they just work either way.
Rich
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio