--- /dev/null
+<?xml version="1.0"?>
+<!--
+###################################################
+##USRP2 Sink
+###################################################
+ -->
+<block>
+ <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)
+self.$(id).set_gain($gain)
+#if $auto_tr.eval
+self.$(id).set_auto_tr($auto_tr)
+#end if
+#if $tx_enb.eval
+self.$(id).set_enable($tx_enb)
+#end if
+</make>
+ <callback>set_interp_rate($interpolation)</callback>
+ <callback>set_frequency($frequency)</callback>
+ <callback>set_gain($gain)</callback>
+ <param>
+ <name>Output Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex</key>
+ <opt>fcn:32fc</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>fcn:16sc</opt>
+ </option>
+ </param>
+ <param>
+ <name>Interface</name>
+ <key>interface</key>
+ <value>eth0</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>MAC Addr</name>
+ <key>mac_addr</key>
+ <value>00:50:C2:85:3x:xx</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>Frequency</name>
+ <key>frequency</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Interpolation</name>
+ <key>interpolation</key>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Gain</name>
+ <key>gain</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Auto T/R</name>
+ <key>auto_tr</key>
+ <value></value>
+ <type>enum</type>
+ <hide>$auto_tr.hide</hide>
+ <option>
+ <name>Ignore</name>
+ <key></key>
+ <opt>hide:part</opt>
+ </option>
+ <option>
+ <name>Enable</name>
+ <key>True</key>
+ <opt>hide:none</opt>
+ </option>
+ <option>
+ <name>Disable</name>
+ <key>False</key>
+ <opt>hide:none</opt>
+ </option>
+ </param>
+ <param>
+ <name>TX Enable</name>
+ <key>tx_enb</key>
+ <value></value>
+ <type>enum</type>
+ <hide>$tx_enb.hide</hide>
+ <option>
+ <name>Ignore</name>
+ <key></key>
+ <opt>hide:part</opt>
+ </option>
+ <option>
+ <name>Enable</name>
+ <key>True</key>
+ <opt>hide:none</opt>
+ </option>
+ <option>
+ <name>Disable</name>
+ <key>False</key>
+ <opt>hide:none</opt>
+ </option>
+ </param>
+ <sink>
+ <name>in</name>
+ <type>$type</type>
+ </sink>
+ <doc>
+The USRP2 sink inputs 100 Megasamples per second / interpolation.
+
+--- Flex RF specific ---
+The "Auto TR" and "TX Enable" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board.
+
+If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \
+By default, "Auto TR" is disabled.
+
+The "Transmit Enable" configures the transmitter to be on or off. \
+Do not leave this unconfigured.
+ </doc>
+</block>
--- /dev/null
+<?xml version="1.0"?>
+<!--
+###################################################
+##USRP2 Source
+###################################################
+ -->
+<block>
+ <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)
+self.$(id).set_gain($gain)
+#if $auto_tr.eval
+self.$(id).set_auto_tr($auto_tr)
+#end if
+#if $rx_ant.eval
+self.$(id).select_rx_antenna($rx_ant)
+#end if
+</make>
+ <callback>set_decim_rate($decimation)</callback>
+ <callback>set_frequency($frequency)</callback>
+ <callback>set_gain($gain)</callback>
+ <param>
+ <name>Output Type</name>
+ <key>type</key>
+ <type>enum</type>
+ <option>
+ <name>Complex</name>
+ <key>complex</key>
+ <opt>fcn:32fc</opt>
+ </option>
+ <option>
+ <name>Short</name>
+ <key>short</key>
+ <opt>fcn:16sc</opt>
+ </option>
+ </param>
+ <param>
+ <name>Interface</name>
+ <key>interface</key>
+ <value>eth0</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>MAC Addr</name>
+ <key>mac_addr</key>
+ <value>00:50:C2:85:3x:xx</value>
+ <type>string</type>
+ </param>
+ <param>
+ <name>Frequency</name>
+ <key>frequency</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Decimation</name>
+ <key>decimation</key>
+ <type>int</type>
+ </param>
+ <param>
+ <name>Gain</name>
+ <key>gain</key>
+ <type>real</type>
+ </param>
+ <param>
+ <name>Auto T/R</name>
+ <key>auto_tr</key>
+ <value></value>
+ <type>enum</type>
+ <hide>$auto_tr.hide</hide>
+ <option>
+ <name>Ignore</name>
+ <key></key>
+ <opt>hide:part</opt>
+ </option>
+ <option>
+ <name>Enable</name>
+ <key>True</key>
+ <opt>hide:none</opt>
+ </option>
+ <option>
+ <name>Disable</name>
+ <key>False</key>
+ <opt>hide:none</opt>
+ </option>
+ </param>
+ <param>
+ <name>RX Antenna</name>
+ <key>rx_ant</key>
+ <value></value>
+ <type>enum</type>
+ <hide>$rx_ant.hide</hide>
+ <option>
+ <name>Ignore</name>
+ <key></key>
+ <opt>hide:part</opt>
+ </option>
+ <option>
+ <name>TX/RX</name>
+ <key>'TX/RX'</key>
+ <opt>hide:none</opt>
+ </option>
+ <option>
+ <name>RX2</name>
+ <key>'RX2'</key>
+ <opt>hide:none</opt>
+ </option>
+ </param>
+ <source>
+ <name>out</name>
+ <type>$type</type>
+ </source>
+ <doc>
+The USRP2 source outputs 100 Megasamples per second / decimation.
+
+--- Flex RF specific ---
+The "Auto TR" and "RX Antenna" settings are flex rf specific and should be left at "Ignore" unless this is a flex rf board.
+
+If enabled, "Auto Transmit/Receive Switching" handles the preference for transmit packets vs receive packets. \
+By default, "Auto TR" is disabled.
+
+The "Receive Antenna Setting" selects one of the SMA connectors as the data source. \
+By default, 'TX/RX' is selected.
+ </doc>
+</block>
class _simple_source(gr.hier_block2, _simple_usrp):
"""A single usrp source of IO type short or complex."""
- def __init__(self, number, subdev_spec, frequency, decimation, gain, mux=None, auto_tr=None, rx_ant=None):
+ def __init__(self, number, subdev_spec, frequency, decimation, gain, mux=0x0, auto_tr=None, rx_ant=None):
"""
USRP simple source contructor.
@param number the unit number
u = self.constructor[0](number, nchan=1)
if subdev_spec is None: subdev_spec = usrp.pick_rx_subdevice(u)
u.set_decim_rate(decimation)
- if mux is None: mux = usrp.determine_rx_mux_value(u, subdev_spec)
+ if not mux: mux = usrp.determine_rx_mux_value(u, subdev_spec)
u.set_mux(mux)
subdev = _setup_rx_subdev(u, subdev_spec, 0, gain, frequency, auto_tr, rx_ant)
_simple_usrp.__init__(self, u, subdev, 0)
class _simple_sink(gr.hier_block2, _simple_usrp):
"""A single usrp sink of IO type short or complex."""
- def __init__(self, number, subdev_spec, frequency, interpolation, gain, mux=None, auto_tr=None, tx_enb=None):
+ def __init__(self, number, subdev_spec, frequency, interpolation, gain, mux=0x0, auto_tr=None, tx_enb=None):
"""
USRP simple sink contructor.
@param number the unit number
u = self.constructor[0](number, nchan=1)
if subdev_spec is None: subdev_spec = usrp.pick_tx_subdevice(u)
u.set_interp_rate(interpolation)
- if mux is None: mux = usrp.determine_tx_mux_value(u, subdev_spec)
+ if not mux: mux = usrp.determine_tx_mux_value(u, subdev_spec)
u.set_mux(mux)
subdev = _setup_tx_subdev(u, subdev_spec, gain, frequency, auto_tr, tx_enb)
_simple_usrp.__init__(self, u, subdev, subdev.which())
class _dual_source(gr.hier_block2, _dual_usrp):
"""A dual usrp source of IO type short or complex."""
- def __init__(self, number, frequency_a, frequency_b, decimation, gain_a, gain_b, mux=0x3210, auto_tr=None, rx_ant_a=None, rx_ant_b=None):
+ def __init__(self, number, frequency_a, frequency_b, decimation, gain_a, gain_b, mux=0x0, auto_tr=None, rx_ant_a=None, rx_ant_b=None):
"""
USRP dual source contructor.
@param number the unit number
#create usrp object
u = self.constructor[0](number, nchan=2)
u.set_decim_rate(decimation)
+ if not mux: mux = 0x3210
u.set_mux(mux)
subdev_a = _setup_rx_subdev(u, (0, 0), 0, gain_a, frequency_a, auto_tr, rx_ant_a)
subdev_b = _setup_rx_subdev(u, (1, 0), 1, gain_b, frequency_b, auto_tr, rx_ant_b)
class _dual_sink(gr.hier_block2, _dual_usrp):
"""A dual usrp sink of IO type short or complex."""
- def __init__(self, number, frequency_a, frequency_b, interpolation, gain_a, gain_b, mux=0xba98, auto_tr=None, tx_enb_a=None, tx_enb_b=None):
+ def __init__(self, number, frequency_a, frequency_b, interpolation, gain_a, gain_b, mux=0x0, auto_tr=None, tx_enb_a=None, tx_enb_b=None):
"""
USRP dual sink contructor.
@param number the unit number
#create usrp object
u = self.constructor[0](number, nchan=2)
u.set_interp_rate(interpolation)
+ if not mux: mux = 0xba98
u.set_mux(mux)
subdev_a = _setup_tx_subdev(u, (0, 0), gain_a, frequency_a, auto_tr, tx_enb_a)
subdev_b = _setup_tx_subdev(u, (1, 0), gain_b, frequency_b, auto_tr, tx_enb_b)