diff options
author | Tom Rondeau | 2011-12-14 22:23:50 -0500 |
---|---|---|
committer | Tom Rondeau | 2011-12-14 22:23:50 -0500 |
commit | e4cf0d1b51b7bc9843e76e8d6e35097664b6f2b3 (patch) | |
tree | f9a6452c60bd030b8f9b1d198abf304d78b67d0e /gr-digital | |
parent | aa0cca173047fc268eb3acfcb7cc8cbb2d8c7581 (diff) | |
download | gnuradio-e4cf0d1b51b7bc9843e76e8d6e35097664b6f2b3.tar.gz gnuradio-e4cf0d1b51b7bc9843e76e8d6e35097664b6f2b3.tar.bz2 gnuradio-e4cf0d1b51b7bc9843e76e8d6e35097664b6f2b3.zip |
uhd: fixes to instantiating UHD devices to set the antenna and subdevice properly (patch from Sam Bretheim).
Diffstat (limited to 'gr-digital')
-rw-r--r-- | gr-digital/examples/narrowband/uhd_interface.py | 16 | ||||
-rw-r--r-- | gr-digital/examples/ofdm/uhd_interface.py | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/gr-digital/examples/narrowband/uhd_interface.py b/gr-digital/examples/narrowband/uhd_interface.py index 27e370911..fe022c731 100644 --- a/gr-digital/examples/narrowband/uhd_interface.py +++ b/gr-digital/examples/narrowband/uhd_interface.py @@ -50,14 +50,6 @@ class uhd_interface: else: self.u = uhd.usrp_source(device_addr=args, stream_args=uhd.stream_args('fc32')) - self._args = args - self._ant = antenna - self._spec = spec - self._gain = self.set_gain(gain) - self._freq = self.set_freq(freq) - - self._rate, self._sps = self.set_sample_rate(sym_rate, sps) - # Set the subdevice spec if(spec): self.u.set_subdev_spec(spec, 0) @@ -66,6 +58,14 @@ class uhd_interface: if(antenna): self.u.set_antenna(antenna, 0) + self._args = args + self._ant = antenna + self._spec = spec + self._gain = self.set_gain(gain) + self._freq = self.set_freq(freq) + + self._rate, self._sps = self.set_sample_rate(sym_rate, sps) + def set_sample_rate(self, sym_rate, req_sps): start_sps = req_sps while(True): diff --git a/gr-digital/examples/ofdm/uhd_interface.py b/gr-digital/examples/ofdm/uhd_interface.py index 14a542b0f..e4b13955d 100644 --- a/gr-digital/examples/ofdm/uhd_interface.py +++ b/gr-digital/examples/ofdm/uhd_interface.py @@ -50,14 +50,6 @@ class uhd_interface: else: self.u = uhd.usrp_source(device_addr=args, stream_args=uhd.stream_args('fc32')) - self._args = args - self._ant = antenna - self._spec = spec - self._gain = self.set_gain(gain) - self._freq = self.set_freq(freq) - - self._rate = self.set_sample_rate(bandwidth) - # Set the subdevice spec if(spec): self.u.set_subdev_spec(spec, 0) @@ -66,6 +58,14 @@ class uhd_interface: if(antenna): self.u.set_antenna(antenna, 0) + self._args = args + self._ant = antenna + self._spec = spec + self._gain = self.set_gain(gain) + self._freq = self.set_freq(freq) + + self._rate = self.set_sample_rate(bandwidth) + def set_sample_rate(self, bandwidth): self.u.set_samp_rate(bandwidth) actual_bw = self.u.get_samp_rate() |