I’m working on a system with packet headers. I want to use the message
decoded by the Packet Header Parser to update a variable.
I knew the message can be stored in a message debug block, and be
by using the “get_message” function. So I can define a get function to
the message in the flowgraph class, and call this get function in “main”
set this value to the variable I want to update. For example, I wrote a
function like this:
self.num_msg = self.msg_debug.num_messages()
self.msg = pmt.to_python(self.msg_debug.get_message(self.num_msg-1))
self.type = self.msg.get(‘type_tag’)
and call this get function in “main”
type = tb.get_type()
But as far as I know, the get function can only be called once in
the variable can only be updated once. Since we want to update the
every time we decoded a message, I’m wondering is there a way in the grc
change a variable
by the message?
I actually have a idea in mind. Like the Header/Payload Demux block used
rx_ofdm, I can write a block that taking message as input, reading the
dictionary to get the value we want, and output the value. Then the
variable can be updated by connecting the output of my designed block to
But this function probe only probes the port in a certain frequency,
can not catch all the updates. So I’m wondering if there is a way to
a predefined variable through a block every time.
Any suggestions will be valued.
View this message in context:
Sent from the GnuRadio mailing list archive at Nabble.com.