From 84a479f3a895f366bcebc4f3d8e8c699d10f409d Mon Sep 17 00:00:00 2001
From: Martin Braun <martin.braun@ettus.com>
Date: Fri, 4 Jan 2019 15:30:10 -0800
Subject: uhd: grc: Don't set antenna if no value is given

For some attributes in the GRC bindings, we'd skip the setters at make()
time when no value was given. This also adds this behaviour for the
antenna.
---
 gr-uhd/grc/gen_uhd_usrp_blocks.py | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'gr-uhd/grc/gen_uhd_usrp_blocks.py')

diff --git a/gr-uhd/grc/gen_uhd_usrp_blocks.py b/gr-uhd/grc/gen_uhd_usrp_blocks.py
index 96ba6dbf3f..3139a5e6b3 100644
--- a/gr-uhd/grc/gen_uhd_usrp_blocks.py
+++ b/gr-uhd/grc/gen_uhd_usrp_blocks.py
@@ -175,7 +175,9 @@ templates:
         ${'%'} else:
         self.${'$'}{id}.set_gain(${'$'}{${'gain' + str(n)}}, ${n})
         ${'%'} endif
+        ${'%'} if context.get('ant${n}')():
         self.${'$'}{id}.set_antenna(${'$'}{${'ant' + str(n)}}, ${n})
+        ${'%'} endif
         ${'%'} if context.get('bw${n}')():
         self.${'$'}{id}.set_bandwidth(${'$'}{${'bw' + str(n)}}, ${n})
         ${'%'} endif
-- 
cgit v1.2.3