diff options
-rw-r--r-- | grc/data/platforms/python/blocks/usrp2_probe.xml | 2 | ||||
-rw-r--r-- | grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml | 16 | ||||
-rw-r--r-- | grc/data/platforms/python/blocks/usrp2_source_xxxx.xml | 16 | ||||
-rwxr-xr-x | grc/scripts/usrp2_probe | 5 |
4 files changed, 27 insertions, 12 deletions
diff --git a/grc/data/platforms/python/blocks/usrp2_probe.xml b/grc/data/platforms/python/blocks/usrp2_probe.xml index afe5cf4f4..cc3f9c2fd 100644 --- a/grc/data/platforms/python/blocks/usrp2_probe.xml +++ b/grc/data/platforms/python/blocks/usrp2_probe.xml @@ -12,7 +12,7 @@ <param> <name>Interface</name> <key>interface</key> - <value>eth0</value> + <value></value> <type>string</type> </param> <param> diff --git a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml index d8aef1fa6..352fe4ce0 100644 --- a/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_sink_xxxx.xml @@ -8,9 +8,15 @@ <name>USRP2 Sink</name> <key>usrp2_sink_xxxx</key> <import>from gnuradio import usrp2</import> - <make>usrp2.sink_$(type.fcn)($interface, $mac_addr) -self.$(id).set_interp_rate($interpolation) -self.$(id).set_frequency($frequency) + <make>#if not $interface.eval and not $mac_addr.eval +usrp2.sink_$(type.fcn)() +#elif not $mac_addr.eval +usrp2.sink_$(type.fcn)($interface) +#else +usrp2.sink_$(type.fcn)($interface, $mac_addr) +#end if +self.$(id).set_interp($interpolation) +self.$(id).set_center_freq($frequency) self.$(id).set_gain($gain) #if $auto_tr.eval self.$(id).set_auto_tr($auto_tr) @@ -19,8 +25,8 @@ self.$(id).set_auto_tr($auto_tr) self.$(id).set_enable($tx_enb) #end if </make> - <callback>set_interp_rate($interpolation)</callback> - <callback>set_frequency($frequency)</callback> + <callback>set_interp($interpolation)</callback> + <callback>set_center_freq($frequency)</callback> <callback>set_gain($gain)</callback> <param> <name>Output Type</name> diff --git a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml index 5ba4d3f64..548baa8d9 100644 --- a/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml +++ b/grc/data/platforms/python/blocks/usrp2_source_xxxx.xml @@ -8,9 +8,15 @@ <name>USRP2 Source</name> <key>usrp2_source_xxxx</key> <import>from gnuradio import usrp2</import> - <make>usrp2.source_$(type.fcn)($interface, $mac_addr) -self.$(id).set_decim_rate($decimation) -self.$(id).set_frequency($frequency) + <make>#if not $interface.eval and not $mac_addr.eval +usrp2.source_$(type.fcn)() +#elif not $mac_addr.eval +usrp2.source_$(type.fcn)($interface) +#else +usrp2.source_$(type.fcn)($interface, $mac_addr) +#end if +self.$(id).set_decim($decimation) +self.$(id).set_center_freq($frequency) self.$(id).set_gain($gain) #if $auto_tr.eval self.$(id).set_auto_tr($auto_tr) @@ -19,8 +25,8 @@ self.$(id).set_auto_tr($auto_tr) self.$(id).select_rx_antenna($rx_ant) #end if </make> - <callback>set_decim_rate($decimation)</callback> - <callback>set_frequency($frequency)</callback> + <callback>set_decim($decimation)</callback> + <callback>set_center_freq($frequency)</callback> <callback>set_gain($gain)</callback> <param> <name>Output Type</name> diff --git a/grc/scripts/usrp2_probe b/grc/scripts/usrp2_probe index ba47907d3..baf44a479 100755 --- a/grc/scripts/usrp2_probe +++ b/grc/scripts/usrp2_probe @@ -135,8 +135,11 @@ class USRP2ProbeWindow(gtk.Window): 'rx': (usrp2.source_32fc, 'adc_rate'), 'tx': (usrp2.sink_32fc, 'dac_rate'), }[usrp_type_param.evaluate()] + interface = usrp_interface_param.evaluate() try: - u = make(usrp_interface_param.evaluate(), mac_addr) + if not interface and not mac_addr: u = make() + elif not mac_addr: u = make(interface) + else: u = make(interface, mac_addr) msg = ">>> USRP2 Probe\n" msg = "%s\nMAC Addr:\n\t%s\n"%(msg, u.mac_addr()) msg = "%s\nName (ID):\n\t%s\n"%(msg, u.daughterboard_id()) |