Forum: GNU Radio problems with a block

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Brett L. Trotter (Guest)
on 2009-02-27 01:13
(Received via mailing list)
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.
Johnathan C. (Guest)
on 2009-02-27 01:44
(Received via mailing list)
On Thu, 2009-02-26 at 17:12 -0600, Brett L. Trotter wrote:

> Any suggestions on resolving the second
> error would be great.

I got your email, but can't look at it until tomorrow.

Johnathan
This topic is locked and can not be replied to.