Skip to content

Commit

Permalink
Update --info command (it now shows more relevant informations like f…
Browse files Browse the repository at this point in the history
…requency range and gain range)
  • Loading branch information
xmikos committed Mar 24, 2017
1 parent f95aa5b commit 35adfbb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Maintainer: Michal Krenek (Mikos) <[email protected]>
pkgname=soapy_power
pkgver=1.5.0
pkgver=1.6.0
pkgrel=1
pkgdesc="Obtain power spectrum from SoapySDR devices (RTL-SDR, Airspy, SDRplay, HackRF, bladeRF, USRP, LimeSDR, etc.)"
arch=('any')
url="https://github.com/xmikos/soapy_power"
license=('MIT')
depends=('python' 'python-numpy' 'simplesoapy>=1.3.0' 'simplespectral')
depends=('python' 'python-numpy' 'simplesoapy>=1.4.0' 'simplespectral')
makedepends=('python-setuptools')
optdepends=(
'soapyrtlsdr-git: support for RTL-SDR (RTL2832U) dongles'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
install_requires=[
'numpy',
'simplesoapy>=1.3.0',
'simplesoapy>=1.4.0',
'simplespectral'
],
classifiers=[
Expand Down
18 changes: 17 additions & 1 deletion soapypower/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,26 @@ def device_info(soapy_args=''):
text.append(' Available device settings:')
for key, s in device.list_settings().items():
text.append(wrap('{} ... {} - {} (default: {})'.format(key, s['name'], s['description'], s['value'])))
text.append(' Available stream arguments:')
for key, s in device.list_stream_args().items():
text.append(wrap('{} ... {} - {} (default: {})'.format(key, s['name'], s['description'], s['value'])))
text.append(' Allowed gain range [dB]:')
text.append(' {:.2f} - {:.2f}'.format(*device.get_gain_range()))
text.append(' Allowed frequency range [MHz]:')
text.append(' {:.2f} - {:.2f}'.format(*[x / 1e6 for x in device.get_frequency_range()]))
text.append(' Allowed sample rates [MHz]:')
text.append(wrap(', '.join('{:.2f}'.format(x / 1e6) for x in device.list_sample_rates())))
text.append(' Allowed bandwidths [MHz]:')
text.append(wrap(', '.join('{:.2f}'.format(x / 1e6) for x in device.list_bandwidths())))
bandwidths = []
for b in device.list_bandwidths():
if b[0] == b[1]:
bandwidths.append('{:.2f}'.format(b[0] / 1e6))
else:
bandwidths.append('{:.2f} - {:.2f}'.format(b[0] / 1e6, b[1] / 1e6))
if bandwidths:
text.append(wrap(', '.join(bandwidths)))
else:
text.append(' N/A')
except RuntimeError:
device = None
text.append('No devices found!')
Expand Down
2 changes: 1 addition & 1 deletion soapypower/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.5.0'
__version__ = '1.6.0'

0 comments on commit 35adfbb

Please sign in to comment.