Advertisement
Guest User

gr-smartnet_bistromathv0.3.patch

a guest
Jun 9th, 2012
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. root@bt:~# cat gr-smartnet_bistromathv0.3.patch
  2. diff -urN gr-smartnet/Makefile.common gr-smartnet.mod/Makefile.common
  3. --- gr-smartnet/Makefile.common 2012-06-09 03:12:57.164089627 -0400
  4. +++ gr-smartnet.mod/Makefile.common 2012-06-09 03:14:08.148441614 -0400
  5. @@ -35,7 +35,8 @@
  6. STD_DEFINES_AND_INCLUDES = \
  7. $(DEFINES) \
  8. -I$(GNURADIO_CORE_INCLUDEDIR) \
  9. - -I$(GNURADIO_CORE_INCLUDEDIR)/swig
  10. + -I$(GNURADIO_CORE_INCLUDEDIR)/swig \
  11. + -I/usr/local/include/gruel/swig
  12.  
  13. # includes
  14. grincludedir = $(includedir)/gnuradio
  15. diff -urN gr-smartnet/src/lib/smartnet_crc.cc gr-smartnet.mod/src/lib/smartnet_crc.cc
  16. --- gr-smartnet/src/lib/smartnet_crc.cc 2012-06-09 03:12:57.184089726 -0400
  17. +++ gr-smartnet.mod/src/lib/smartnet_crc.cc 2012-06-09 03:14:08.148441614 -0400
  18. @@ -31,6 +31,7 @@
  19. #include <gr_tags.h>
  20. #include <sstream>
  21. #include <smartnet_types.h>
  22. +#include <iostream>
  23.  
  24. #define VERBOSE 0
  25.  
  26. diff -urN gr-smartnet/src/lib/smartnet_deinterleave.cc gr-smartnet.mod/src/lib/smartnet_deinterleave.cc
  27. --- gr-smartnet/src/lib/smartnet_deinterleave.cc 2012-06-09 03:12:57.184089726 -0400
  28. +++ gr-smartnet.mod/src/lib/smartnet_deinterleave.cc 2012-06-09 03:14:08.148441614 -0400
  29. @@ -28,6 +28,7 @@
  30. #include <smartnet_deinterleave.h>
  31. #include <gr_io_signature.h>
  32. #include <gr_tags.h>
  33. +#include <iostream>
  34.  
  35. #define VERBOSE 0
  36.  
  37. diff -urN gr-smartnet/src/python/smartnet2decode.py gr-smartnet.mod/src/python/smartnet2decode.py
  38. --- gr-smartnet/src/python/smartnet2decode.py 2012-06-09 03:12:57.188089753 -0400
  39. +++ gr-smartnet.mod/src/python/smartnet2decode.py 2012-06-09 03:14:10.096451264 -0400
  40. @@ -10,7 +10,8 @@
  41. from gnuradio import gr, gru, blks2, optfir, digital
  42. from gnuradio import audio
  43. from gnuradio import eng_notation
  44. -from gnuradio import uhd
  45. +#from gnuradio import uhd
  46. +from osmosdr import *
  47. from fsk_demod import fsk_demod
  48. from optparse import OptionParser
  49. from gnuradio.eng_option import eng_option
  50. @@ -20,6 +21,8 @@
  51. import gnuradio.gr.gr_threading as _threading
  52. import csv
  53.  
  54. +rtl_rate = 2.4e6
  55. +
  56. class top_block_runner(_threading.Thread):
  57. def __init__(self, tb):
  58. _threading.Thread.__init__(self)
  59. @@ -41,6 +44,7 @@
  60. self.rate = options.rate
  61.  
  62. else:
  63. + '''
  64. self.u = uhd.usrp_source(options.addr,
  65. io_type=uhd.io_type.COMPLEX_FLOAT32,
  66. num_channels=1)
  67. @@ -54,20 +58,27 @@
  68. # Set the antenna
  69. if(options.antenna):
  70. self.u.set_antenna(options.antenna, 0)
  71. + '''
  72. + self.u = source_c()
  73. + self.u.set_sample_rate(rtl_rate)
  74. + self.rate = rtl_rate
  75.  
  76. self.centerfreq = options.centerfreq
  77. print "Tuning to: %fMHz" % (self.centerfreq - options.error)
  78. - if not(self.tune(options.centerfreq - options.error)):
  79. - print "Failed to set initial frequency"
  80.  
  81. +# if not(self.tune(options.centerfreq - options.error)):
  82. + if not(self.u.set_center_freq(options.centerfreq - options.error)):
  83. + print "Failed to set initial frequency"
  84. + '''
  85. if options.gain is None: #set to halfway
  86. g = self.u.get_gain_range()
  87. options.gain = (g.start()+g.stop()) / 2.0
  88. -
  89. + '''
  90. + self.u.set_gain_mode(0)
  91. print "Setting gain to %i" % options.gain
  92. self.u.set_gain(options.gain)
  93.  
  94. - self.u.set_bandwidth(options.bandwidth)
  95. +# self.u.set_bandwidth(options.bandwidth)
  96.  
  97. print "Samples per second is %i" % self.rate
  98.  
  99. @@ -216,6 +227,7 @@
  100. groupflag = bool(groupflag)
  101.  
  102. # print "Command is",command
  103. + print "Command ",hex(command), " address ",hex(address)
  104. if longtglist is not None and longtglist.get(str(lookupaddr), None) is not None:
  105. longname = longtglist[str(lookupaddr)] #the mask is to screen out extra status bits, which we can add in later (see the RadioReference.com wiki on SmartNet Type II)
  106. else:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement