[Top][All Lists]

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

Re: [Discuss-gnuradio] Creation of a block (PSDU 29 octets) using messag

From: Jose Torres Diaz
Subject: Re: [Discuss-gnuradio] Creation of a block (PSDU 29 octets) using message passing technique
Date: Thu, 20 Sep 2012 09:12:18 +0930

Hi Josh,

I modified in my .h file:

#include <gnuradio/block.h>

and also, I inherit from gnu radio as follows:

//* This uses the preferred technique: subclassing gr_sync_block.
//class asrp_test_temporal : public gr_sync_block
class asrp_test_temporal : public gnuradio::block    // <--Here, I added the inherit
// Definition

Then, in the .cc file I wrote:

: gnuradio::block ("test_temporal",
             gr_make_io_signature(0, 0, 0),
             gr_make_io_signature(0, 0, 0),
             msg_signature(false, 1))

When I compile again, the complain is different. It displays:

asrp_test_temporal.cc:75:26: error: cannot allocate an object of abstract type 'asrp_test_temporal'
./asrp_test_temporal.h:99:7: note:   because the following virtual functions are pure within 'asrp_test_temporal':
/usr/local/include/gnuradio/block.h:236:17: note:     virtual int gnuradio::block::work(const InputItems&, const OutputItems&)
make[2]: *** [asrp_test_temporal.lo] Error 1

According to the instruction in block coding: https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide, I only need to write the msg_signature(#input,#output), but I decided to use the gr_make_io_signature anyway, because I am reading the code for the example of "socket_to_blob.cc".

1. Do I need to use gr_make_io_signature or just msg_signature is enough?.

Many thanks for your kind help,



On Wed, Sep 19, 2012 at 3:33 PM, Josh Blum <address@hidden> wrote:

On 09/19/2012 01:11 AM, Jose Torres Diaz wrote:
> Hi,
> I'm trying to use "message passing" technique in order to create a block
> that generates 29 Octets. Currently, I'm using a block that generates 29
> Octets and then use tag streaming. In the .cc file, IO signature looks like:
> gr_sync_block ("st1_pktsrc_dummy_b",
>            gr_make_io_signature (0, 0, 0),
>            gr_make_io_signature (MIN_OUT, MAX_OUT, sizeof (unsigned char)))
> While, the stream tags looks like this:
> add_item_tag(0, tag_pos,
>              d_burst_start_key,
>              pmt_sob,
>              d_my_unique_id)
> Now, I want to change this approach to message passing as it is explained
> here: https://github.com/guruofquality/grextras/wiki/Blocks-Coding-Guide.
> So, I changed the lines indicated above, for the following:
>  : gr_sync_block ("test_temporal",
>                    gr_make_io_signature(0, 0, 0),
>                    gr_make_io_signature(0, 0, 0),
>                    msg_signature(false, 1))

Careful here, check the coding guide,
you need to  #include <gnuradio/block.h>
and inherit from gnuradio::block


Discuss-gnuradio mailing list

reply via email to

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