Hi all,
I just did my first steps developing a embedded-python block for GR: a
block to generate the data bitstream for sending pocsag paging messages.
See here: https://github.com/on1arf/gr-pocsag
(.grc-file, just look at the embedded-python block for the python code).
(the rest of the flow-graph is shamelessly stolen from the author of
gr-mixalot).
After trying out some code, I managed to get something "kind-of
working", but probably not implemented the correct way. Can somebody
please help me with a couple of things I do not yet understand:
- Can somebody explain how to implement a source-block using
embedded-python?
In the code I have now, it is implemented as a sync-block, taking in a
signal from a signal-generator block, but that is probably (surely!) not
the correct way to do this.
I did notice that the signal-generator blocks that exists in GRC do have
a input-port that is greyed-out and not connected. I probably need to
implement something simular.
- is it possible to define a variable in a embedded-python block that
can only have a predefined number of possible values (e.g. "bitrate" can
only be 512, 1200 or 2400, "inverted" can be true or false)?
Or do you allow the user to insert just any value and throw a ValueError
in the python block if the value is not correct?
- How do you interface your embedded-python code with variables that
change during run-time? (e.g. a variable mapped to a GUI slider).
How does the embedded-python program known when a variable has changed?
- Basically, a pocsag paging-message is a packet, not a continuous stream.
It is possible to create a source-block that creates a stream of a
limited length and then stop the execution of the graph?
(so, in essence, a GRC
Also, I've found a couple of presentations online concerning stream-tags.
Are there any examples of how to use the stream-tags API inside a
embedded-python block?
- Anycase, (not strickly speaking not GR-related) ... how do you
actually switch a hackRF between RX and TX mode?
Thanks in advance for any help.
Kristoff - ON1ARF
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio