Monday, July 6, 2015

Re: [Discuss-gnuradio] Suppressing UHD prints

On 07/06/2015 07:25 PM, Jared Dulmage wrote:
> @Sebastion "Even if ' uhd::msg::register_handler' would be exposed to python, you
> still can't drop-in your own null-handler. Swig doesn't support
> callbacks in the target language (python)."
>
> This seems precisely what I have observed working with my example from my question on 7/2/2015 "message passing: strobe or _post?" I use a Python method as a callback given to <block>.set_msg_handler. This is certainly called when I use the message strobe to input a message to the block, but not when using _post. Is this some new feature? Or am I wrong that the operation is the same?

Well SWIG not supporting it (see [1]) doesn't mean one can't write
custom code to run Python from the C end. Python blocks are implemented
via a gateway [2] to do this.

Sebastian

[1] http://www.swig.org/Doc3.0/SWIGDocumentation.html#SWIG_nn30
[2]
https://github.com/gnuradio/gnuradio/blob/master/gnuradio-runtime/lib/block_gateway_impl.cc

--
Karlsruhe Institute of Technology (KIT)
Communications Engineering Lab (CEL)

Dipl.-Ing. Sebastian Koslowski
Research Associate

Kaiserstraße 12
Building 05.01
76131 Karlsruhe, Germany

Phone: +49 721 608-46275
Fax: +49 721 608-46071
Email: sebastian.koslowski@kit.edu
Web: http://www.cel.kit.edu/

KIT – University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association



_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment