Add daughterboard test
authorjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 12 Mar 2009 17:14:55 +0000 (17:14 +0000)
committerjcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5>
Thu, 12 Mar 2009 17:14:55 +0000 (17:14 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10587 221aa14e-8319-0410-a670-987f0aec2ac5

gnuradio-examples/python/usrp/usrp_wfm_rcv.py
gnuradio-examples/python/usrp2/usrp2_wfm_rcv.py

index 5655d19b50103a2a2a1205235992931d57bb3c3e..098897cfe2345d73bf745b03419ab3b67b3272b0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2006,2007 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -93,7 +93,14 @@ class wfm_rx_block (stdgui2.std_top_block):
         self.u.set_mux(usrp.determine_rx_mux_value(self.u, options.rx_subdev_spec))
         self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
         print "Using RX d'board %s" % (self.subdev.side_and_name(),)
-
+        dbid = self.subdev.dbid()
+        if not (dbid == usrp_dbid.BASIC_RX or
+                dbid == usrp_dbid.TV_RX or
+                dbid == usrp_dbid.TV_RX_REV_2 or
+                dbid == usrp_dbid.TV_RX_REV_3):
+            print "This daughterboard does not cover the required frequency range"
+            print "for this application.  Please use a BasicRX or TVRX daughterboard."
+            raw_input("Press ENTER to continue anyway, or Ctrl-C to exit.")
 
         chan_filt_coeffs = optfir.low_pass (1,           # gain
                                             usrp_rate,   # sampling rate
index f09e9707902fd141893b3a664a3878262a86c721..8ea5baf574f8f84a489e5886db756b1797d3ed70 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright 2005,2006,2007,2008 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007,2008,2009 Free Software Foundation, Inc.
 # 
 # This file is part of GNU Radio
 # 
@@ -77,7 +77,17 @@ class wfm_rx_block (stdgui2.std_top_block):
         audio_decimation = 10
         audio_rate = demod_rate / audio_decimation  # ~32 kHz
 
-        print "Using RX d'board 0x%04X" % (self.u.daughterboard_id(),)
+        #FIXME: need named constants and text descriptions available to (gr-)usrp2 even
+        #when usrp(1) module is not built.  A usrp_common module, perhaps?
+        dbid = self.u.daughterboard_id()
+        print "Using RX d'board 0x%04X" % (dbid,)
+        if not (dbid == 0x0001 or #usrp_dbid.BASIC_RX
+                dbid == 0x0003 or #usrp_dbid.TV_RX
+                dbid == 0x000c or #usrp_dbid.TV_RX_REV_2
+                dbid == 0x0040):  #usrp_dbid.TV_RX_REV_3    
+            print "This daughterboard does not cover the required frequency range"
+            print "for this application.  Please use a BasicRX or TVRX daughterboard."
+            raw_input("Press ENTER to continue anyway, or Ctrl-C to exit.")
 
         chan_filt_coeffs = optfir.low_pass (1,           # gain
                                             usrp_rate,   # sampling rate