diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-06-05 19:58:16 +0200 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-06-05 19:58:16 +0200 |
commit | eaec4c5acc93d327f598771bc48c756f7ffe9be0 (patch) | |
tree | a8a2378313d365372d01385d415e7c857123440c /apps/osmocom_spectrum_sense | |
parent | ba5c6c8da6dde55c2ad4095692f4c2058204eff3 (diff) |
apps: check for sample rate availability
Diffstat (limited to 'apps/osmocom_spectrum_sense')
-rwxr-xr-x | apps/osmocom_spectrum_sense | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/osmocom_spectrum_sense b/apps/osmocom_spectrum_sense index a13f64b..7096ba1 100755 --- a/apps/osmocom_spectrum_sense +++ b/apps/osmocom_spectrum_sense @@ -149,6 +149,12 @@ class my_top_block(gr.top_block): # build graph self.u = osmosdr.source_c(options.args) + try: + self.u.get_sample_rates().start() + except RuntimeError: + print "Source has no sample rates (wrong device arguments?)." + sys.exit(1) + # Set the antenna if(options.antenna): self.u.set_antenna(options.antenna, 0) |