[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Execute python code when tag detected
From: |
Lukas Haase |
Subject: |
Execute python code when tag detected |
Date: |
Fri, 13 Dec 2019 21:19:09 +0100 |
Hi,
Is there a standard way/block in GRC to execute python code when a block
receives a certain tag, if possible (without writing a complete block from
scratch)?
Two days ago I have asked about the best way to implement frequency hopping. In
absence of advice I am unfortunately still heavily struggling with this. I have
played around a lot with "Probe Signal" and "Probe Function" but this doesn't
seem to be reliable at all (and I found Marcus Mueller saying that this
approach would be the wrong one most of the time).
Now I am playing with tags. My idea is to generate tags at the hop rate using
"Tags Strobe":
https://paste.pics/413ea9ea71991af42c0c86bc91ccb34b
I am looking for a way to execute the following code when such a tag is
received downstream:
1.) Update the "Value (PMT)" to reflect the next hopping frequency. I think of
having my hop pattern as vector, the tag value
pmt.from_float(frequencies[idx]) and whenever the tag is detected downstream,
execute "idx = mod(idx+1,frequencies.length())"
2.) Create a tune request and update USRP Source/Sink to reflect new center
frequency. I am aware that it is possible to use messages to change center
frequencies of USRP objects. However, I need TX/RX to be fully coherent, so I
need to use timed commands and integer mode PLL in order to.
Furthermore: Is there a standard way to "convert" a tag to a message? I.e.,
create a message event whenever a certain tag is detected in the stream?
Thanks,
Luke
- Execute python code when tag detected,
Lukas Haase <=