diff options
author | Piotr Krysik <ptrkrysik@gmail.com> | 2018-11-16 08:35:38 +0000 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-12-11 14:22:22 -0800 |
commit | 94fddb6371264c79969c0448c19fdb637d6ffc31 (patch) | |
tree | 7120f6a8412fcbc0561742411fcf56244a473f3a /gr-uhd/grc/gen_uhd_usrp_blocks.py | |
parent | 3359d67e02158199d24756155fb58ab43b7b66ef (diff) |
uhd: added asynchronous messages handling to the sink
UHD asynchronous messages are needed in order to obtain information
about issues happening on Tx side (Underflows, Sequence Errors,
Time Errors).
This change adds handling of these messages to the usrp sink by adding
async_event_loop() function executed in a separate thread (_async_event_thread)
where these messages are:
- received from the USRP,
- transformed into PMT messages,
- sent to the new "async_msgs" message output port.
On the top level the output PMT messages are (message_type, content) pairs:
- message_type is always "uhd_async_msg",
- content is a dictionary with key names taken from
uhd::async_metadata_t.
- there is no 'has_time_spec' as in PMT it's not needed.
There just won't be 'time_spec' in the PMT message
when 'has_time_spec' is false.
- there is no 'user_payload' - but it can be easily added in the
future as pmt blob.
Example message from the 'async_msgs' output is below:
(uhd_async_msg (channel . 0) (time_spec 4 . 0.0608192) (event_code burst_ack))
Reviewed-By: Martin Braun <martin.braun@ettus.com>
Diffstat (limited to 'gr-uhd/grc/gen_uhd_usrp_blocks.py')
-rw-r--r-- | gr-uhd/grc/gen_uhd_usrp_blocks.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py index a969ab95d1..40c674b5fa 100644 --- a/gr-uhd/grc/gen_uhd_usrp_blocks.py +++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py @@ -113,15 +113,20 @@ inputs: id: command optional: true hide: ${'$'}{hide_cmd_port} -% if sourk == 'sink': -- domain: stream -% else: +% if sourk == 'source': outputs: -- domain: stream % endif +- domain: stream dtype: ${'$'}{type.type} multiplicity: ${'$'}{nchan} +% if sourk == 'sink': + +outputs: +- domain: message + id: async_msgs + optional: true +% endif templates: imports: |- |