|
From: | Merlo, Jason |
Subject: | Passing Message Input Index to |
Date: | Wed, 29 Jun 2022 16:53:07 +0000 |
Hi All, I'm currently working on an asynchronous message multiplexing block using Python and I'm having difficulty determining from which input on my block a specific message came from in the message handler function. The issue is that the multiplicity of inputs is user configurable, so I need the number of inputs to be reconfigurable at initialization, thus I can't have a separate hard-coded callback for each input.
For reference, the "input" section
The idea is the My challenge is determining from which input a message came. A separate function can be registered for each input, however I would need to dynamically generate functions based on the number of inputs a user has configured, which has been giving me trouble. Ideally, the function handler callback would provide auxiliary arguments to pass to the callback function as arguments that can be bound at instantiation (such as index), but I don't think this is possible.
Presently, I've looked into the functools package
But I have not been able to get this approach to work successfully; currently I’m still arguing with Python to get this to run, but it seems like there should be a more elegant approach. Does anyone know of another way to pass the input index of a multiple input to the message handler function, either via GNU Radio methods, or via Python? Thanks!
Jason
|
[Prev in Thread] | Current Thread | [Next in Thread] |