[Top][All Lists]

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

Re: [Discuss-gnuradio] makefiles trouble

From: Eric Blossom
Subject: Re: [Discuss-gnuradio] makefiles trouble
Date: Mon, 6 Aug 2007 13:06:30 -0700
User-agent: Mutt/1.5.9i

On Mon, Aug 06, 2007 at 12:13:51PM -0700, Hans Glitsch wrote:
> Hello,
> Please help me.  I'm having a lot of trouble understanding the make files 
> to build gnuradio and the makefiles I use to build my own gnuradio blocks. 
> Also, swig hates me and I hate it.  So far I've had no trouble building 
> gnuradio and building my own blocks by delicately modifying an example 
> build tree, but now I want to do something a little different.
> I want the python code to make an instance of the usrp1.source_c object and 
> pass it into C++ by calling this function:
> void run_radio( usrp1_source_c_sptr usrp );
> I added this function and it's definition to one of my cc files and added 
> the declaration to the swig i file for my blocks, and everything builds 
> properly.
> In the python I create the usrp object with:
> adc = usrp.source_c(0,250, fpga_filename="std_4rx_0tx.rbf")

> then later call the new function with:
> sm.run_radio( adc._u )
> When python executes the last line it throws an exception:
> "TypeError: in method 'run_radio', argument 1 of type 'usrp1_source_sptr'"

> My question is, what type should the parameter be in the run_radio 
> function? How do I get swig to correctly marshal this smart pointer back to 
> c++?

I think it should be:


I think your sm.i file will need to:

%import "usrp1.i"         // N.B., not %include

to pick up the right types.

There's a chance you'll have to add the following three lines in
front of the %import, but I'm not sure off the top of my head.

#include "usrp1_source_c.h"

> Thanks for the help,
> Hans

You're welcome!


reply via email to

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