discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] I have a trouble with new types in python!


From: Activecat
Subject: Re: [Discuss-gnuradio] I have a trouble with new types in python!
Date: Thu, 8 May 2014 20:14:38 +0800


On Thu, May 8, 2014 at 12:53 AM, Mostafa Alizadeh <address@hidden> wrote:

Hi Marcus, 
I actually have a deep, really deep,  problem with data types!!!! As you see I have a preprocessor definition which is 32 bit number. I wanna pass it to the make!!! how could I? If I use the gnuradio type " gr_uint32", after turning my c++-written blocks, the GRC tells me: 

TypeError: in method 'xxxx_make', argument 1 of type 'gr_uint32' 

I put an option to the xml file : 

<option>
        <name>CRC16</name>
        <key>gr_uint32</key>
        <opt>CRC_type:0x00011021</opt>
</option>

I know that this is not true, but I want to pass a 32-bit number to the "make". How could I do? 



Anyone correct me if I am wrong.

In xml file we use the Python data types.
In usual case Python doesn't distinguish among "unsigned" or "signed" integer, this is different from c++.
The casting will be intelligently handled by swig.

Hence, for your case, just pass "gr_uint32" to the make() assuming your block is coded in c++. Then use "<type>int</type>" in the xml file.  This solves your problem.

Meanwhile, C preprocessor does not know types or C keywords.

reply via email to

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