discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Fwd: c++ flowgraph


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] Fwd: c++ flowgraph
Date: Mon, 4 Apr 2016 15:02:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

Hi Havard,

try the in-tree QA tests, for example gnuradio/gr-blocks/lib/qa_gr_block.cc.

In essence:

#include <gnuradio/top_block.h>
//Include all the headers you'll need, e.g. other blocks' headers
#include <gnuradio/blocks/null_source.h> 
#include <gnuradio/blocks/null_sink.h> 

int main()
{
  gr::block_sptr src1(gr::blocks::null_source::make(sizeof (int)));
  gr::block_sptr dst1 (gr::blocks::null_sink::make (sizeof (int)));

  gr::top_block_sptr tb(gr::make_top_block("mytopblock"));
  tb->connect(src1, 0, dst1, 0); 
  tb->start();
  tb->stop();
  tb->wait();
}

Use gr_modtool so you have a ready-to-build framework; just add yout Cpp
file to the apps directory and edit apps/CMakeLists.txt as necessary.

Best regards,
Marcus

On 04.04.2016 08:58, Havard wrote:
> Hi and thanks for the answer.
> I understand that this means "hand coding", but that is not a problem..
>
> Does anyone have a small working example of C++ flowgraph? or a link
> pointing at such thing?
>
> Best Havard
>
> Den 2016-04-04 08:48, skrev Jan Krämer:
>> Hi,
>>
>> yes you can do that. But just not with GRC so you would have to code
>> your flowgraph "by hand". But you have to be aware that this also
>> requires a tiny bit more work with some of the blocks as they are
>> embedded in python hierarchical blocks (polyphase filterbank based
>> blocks for example). Not 100% sure but I think there are also
>> python-only blocks in mainline GNURadio.
>>
>> But yes it is possible to do C++ flowgraphs.
>>
>> Cheers,
>> Jan
>>
>> 2016-04-04 8:36 GMT+02:00 Havard <address@hidden>:
>>
>>> Dear List
>>> I wonder if there is possible and if so, does anyone have a woring
>>> example of creating a flowgrpaph in C++ ?
>>> I need to create and compile a flowgprah that could be used stand
>>> alone and not be depended on python to run..
>>> I have the version 3.7.2
>>>
>>> Best regards
>>> Havard Austad
>>>
>>> _______________________________________________
>>> Discuss-gnuradio mailing list
>>> address@hidden
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>
> _______________________________________________
> Discuss-gnuradio mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio




reply via email to

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