discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Python pass parameter as const *gr_complex?


From: Tom Rondeau
Subject: Re: [Discuss-gnuradio] Python pass parameter as const *gr_complex?
Date: Tue, 20 Jan 2015 09:56:46 -0500

On Wed, Jan 7, 2015 at 7:57 AM, Ludwig Stephan (CR/AEH4) <address@hidden> wrote:
Hi list,
 
I am trying to use the gr::digital::constellation::decision_maker(.) method from python, but I get an error message.
In order to reproduce call in python:
 
import gnuradio.digital
a = gnuradio.digital.constellation_qpsk()
b = complex(1+1j)
a.decision_maker(b)
=> TypeError [..] argument 2 of type ‘gr_complex const*’
The C++-implementation is wrapped by SWIG, where the error occurs.
 
This might be a silly question, but what am I doing wrong?
 
Thanks for any help.
 
Best regards
 
Stephan Ludwig

Hi Stephan,

You're not doing anything wrong per se, but the block isn't really meant to be used that way. SWIG needs to be told how to handle some types of argument formats, and it hasn't been told how to handle this one.

The post 3.7 way we've been handling SWIG is to just include the public .h file as the interface, so all methods are exported into SWIG. A class like this needs that method to be public for use as a contained object in the block that calls it, but it's not really meant for use outside like this. Not that it couldn't be, but you'd have to work with SWIG to let it understand how to call that function with the proper input type.

Tom


reply via email to

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