|
From: | Bogdan Reshetnikov |
Subject: | Message to Var - modify different variables using one ZMQ Sub Message Source |
Date: | Mon, 11 Sep 2023 14:22:44 +0300 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 |
Good day everyone! I hope you are doing well.I am an EE undergrad intern at an RF design company's software department, currently tasked with controlling a HackRF One SDR with a touchscreen display and a Raspberry Pi Zero (flashed with PiSDR because it has gnuradio3.9) running Python 3.9. I am a total beginner in GNU Radio, but I have intermediate knowledge of writing various interfaces in Python.
The RPI runs a threaded script that receives UART a command from the display, parses it, and sends a {"parameter": value} PMT pair through ZMQ PUB socket. It also runs a GNU Radio flowchart script in parallel that receives the packet through ZMQ SUB Message source and passes it onto a Message to Variable block. This setup works great for modifying a single variable that's specified in the MesgToVar block, but it breaks down for multiple variables, since the <name> from the message pair is ignored.
My current idea is to write an Embedded Python Block that would act as a "message multiplexer": it would parse the <name> part and issue a message from an according output port. This would mean updating the EPB code for every new variable, but that doesn't sound problematic.
Does this sound like a nice approach? Are there any better alternatives already present? Let me know what you think. Stay safe!
Bogdan
[Prev in Thread] | Current Thread | [Next in Thread] |