discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] problems with a block


From: Brett L. Trotter
Subject: [Discuss-gnuradio] problems with a block
Date: Thu, 26 Feb 2009 17:12:20 -0600
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

I've got a block that I needed to make a gr_io_signature4 for- unless
I've misunderstood something:

gr_io_signature_sptr
gr_make_io_signature4(int min_streams, int max_streams,
                      int sizeof_stream_item1,
                      int sizeof_stream_item2,
                      int sizeof_stream_item3,
                      int sizeof_stream_item4)
{
  std::vector<int> sizeof_items(4);
  sizeof_items[0] = sizeof_stream_item1;
  sizeof_items[1] = sizeof_stream_item2;
  sizeof_items[2] = sizeof_stream_item3;
  sizeof_items[3] = sizeof_stream_item4;
  return gr_make_io_signaturev(min_streams, max_streams, sizeof_items);
}


the class definition looks like this:
myclass::myclass(unsigned int code_length,
                               unsigned int samples_per_chip,
                               unsigned int periods_per_bit,
                               float amplitude)

  : gr_block("myclass",
             gr_make_io_signature4(4, 4, sizeof(char), sizeof(char),
sizeof(gr_complex), sizeof(gr_complex)),
             gr_make_io_signature(1, 1, sizeof(gr_complex)))
{
......snipped.......
}


the block takes two chars' and two complex's and does some work with
them and outputs the one complex.

depending on what order I call the self.connect's in the python, I get
one of two errors:
terminate called after throwing an instance of 'std::invalid_argument'
  what():  port number 2 exceeds max of 1
Aborted

grc was calling connect to 2, then 3, then 1, then 0, if I swapped the
connect line order to connect to 0, 1, 2, 3 that error went away and I got:
terminate called after throwing an instance of 'std::invalid_argument'
  what():  itemsize mismatch: diff_encoder_bb(18):0 using 1,
myclass(12):1 using 8
Aborted


I've now reordered the connections by hand extremely carefully and the
2nd error remains, but the first error may be a GRC bug because it's not
connecting the ports in order and that seems to generate an error.

The diff encoder is 1 byte, and the port it is connected to is 1 byte
(vis a vis the signature above). Any suggestions on resolving the second
error would be great.




reply via email to

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