802.15.4 how to forward a parameter to a c++ block

Hi,

I’m currently using the UCLA ZigBee PHY implementation posted on:
https://www.cgran.org/wiki/UCLAZigBee
with gnuradio.

My question is the following:
How can I forward a parameter from: src/python/ieee802_15_4_pkt.py
… e.g. from the “send_pkt(…)” function (or any other)
to the c++ block in : src/lib/ucla_symbols_to_chips_bi.cc ?

Or more generally speaking: How can I forward a parameter from a
python application to the c++ processing block?
If possible it would be great to use the io_signatures…

best regards and thanks a lot for your help,
Björn

On Tue, May 25, 2010 at 10:16 AM, [email protected] wrote:

Or more generally speaking: How can I forward a parameter from a python
application to the c++ processing block?
If possible it would be great to use the io_signatures…

during instantiation of the block or during runtime? If it’s during
instantiation, you can use a parameter to the constructor of your C++
block. But, if you want something during runtime I do not think it is
possible given the current architecture. You do not explicitly call the
work() function where the processing is done, this is done within the
GNU
Radio framework.

  • George

Radio framework.

  • George

Well I’d need it during runtime.
What about using a shared memory block between the python and the c++
block? Or what about calling a function from within the c++ block,
which would get the parameter from the python block or a specific
memory block

Thanks for the help!

  • Bjoern

Radio framework.

  • Bjoern

Or how could I extend “ucla_symbols_to_chips_bi” to have more inputs,
such that I could have one more stream forwarded from
“ieee_802_15_4.py” to “ucla_symbols_to_chips_bi”?
This then could be used within the work() function, wouldn’t it?

many thanks to all!
-Björn

  • Bjoern

Or how could I extend “ucla_symbols_to_chips_bi” to have more inputs,
such that I could have one more stream forwarded from
“ieee_802_15_4.py” to “ucla_symbols_to_chips_bi”?

For that you need to change the io_signature.

gr_make_io_signature (1, -1, sizeof (unsigned char)),
to
gr_make_io_signature (2, -1, sizeof (unsigned char)),

Ah, great, thanks a lot!
But where can I find that new stream to fill!? In other words:
-how can I generate a new variable / stream and
-where do I submit it, such that it is forwarded to the corresponding
c++ block, and
-how can I access it from within the c++ block!?

thanks a lot
best,
Bjoern

  • Bjoern

Or how could I extend “ucla_symbols_to_chips_bi” to have more inputs,
such that I could have one more stream forwarded from
“ieee_802_15_4.py” to “ucla_symbols_to_chips_bi”?

For that you need to change the io_signature.

gr_make_io_signature (1, -1, sizeof (unsigned char)),
to
gr_make_io_signature (2, -1, sizeof (unsigned char)),

This then could be used within the work() function, wouldn’t it?

many thanks to all!
-Björn


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


ATTENTION: NEW TELEPHONE EXTENSION!
Dipl.-Ing. Markus Becker
Communication Networks
Mobile Research Center
TZI - Center for Computing Technologies
University Bremen
Germany

Ah, great, thanks a lot!
But where can I find that new stream to fill!? In other words:
-how can I generate a new variable / stream and
-where do I submit it, such that it is forwarded to the corresponding
c++ block, and
-how can I access it from within the c++ block!?

See message_source and message_sink blocks. The message blocks get data
in and out of the c++ realm using message queues so you can directly
manipulate the gnuradio streams in python.

-Josh

Zitat von “Markus Becker” [email protected]:

  • Bjoern
    self.connect(self.fmdemod, (self.sub, 0))
    self.connect(self.fmdemod, self.freq_offset, (self.sub, 1))

try playing around with the gnuradio companion grc and look at the created
python code. then the connection between io_signature and block connections
becomes clear.

Thanks for replying!! I tried that using the GRC, but unfortunately I
can’t get to the level of io_signatures!? Isn’t there a way to
uniquely identify , which the streams are that are passed between the
c++ and the python blocks? such that one of them could be duplicated
in order to forward one more stream?

SO main question is how to identify the streams uniquely
and
how to generate one more!?

then to make a block accept more than one signature i have to change
the entry:
gr_make_io_signature (2, -1, sizeof (unsigned char)),
Anything else? Probably the parameters of the work() function within
the c++ block, right?

Thanks a lot in advanced for your help,
best
Björn

On Thu, May 27, 2010 at 09:45:44AM +0200, [email protected] wrote:

to
gr_make_io_signature (2, -1, sizeof (unsigned char)),

Ah, great, thanks a lot!
But where can I find that new stream to fill!? In other words:
-how can I generate a new variable / stream and
-where do I submit it, such that it is forwarded to the corresponding
c++ block, and
-how can I access it from within the c++ block!?

Björn,

If you haven’t already please take a look at this document:

http://www.gnu.org/software/gnuradio/doc/howto-write-a-block.html

It’s a bit out of date, but the fundamentals are the correct.
It explains how io_signatures and work methods relate, as well as
some other “good to know” stuff.

Eric