Guest User

gr-smartnet_bistromathv0.2.patch

a guest
Jun 8th, 2012
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. For more info see: http://www.reddit.com/r/RTLSDR/comments/us3yo/rtlsdr_smartnet/
  2.  
  3. root@bt:~# cat gr-smartnet_bistromathv0.2.patch
  4. diff -urN gr-smartnet/Makefile.common gr-smartnet-dev/Makefile.common
  5. --- gr-smartnet/Makefile.common 2012-06-08 16:24:01.177020928 -0400
  6. +++ gr-smartnet-dev/Makefile.common 2012-06-08 16:22:03.908439403 -0400
  7. @@ -35,7 +35,8 @@
  8. STD_DEFINES_AND_INCLUDES = \
  9. $(DEFINES) \
  10. -I$(GNURADIO_CORE_INCLUDEDIR) \
  11. - -I$(GNURADIO_CORE_INCLUDEDIR)/swig
  12. + -I$(GNURADIO_CORE_INCLUDEDIR)/swig \
  13. + -I/usr/local/include/gruel/swig
  14.  
  15. # includes
  16. grincludedir = $(includedir)/gnuradio
  17. diff -urN gr-smartnet/src/lib/smartnet_crc.cc gr-smartnet-dev/src/lib/smartnet_crc.cc
  18. --- gr-smartnet/src/lib/smartnet_crc.cc 2012-06-08 16:24:01.197021024 -0400
  19. +++ gr-smartnet-dev/src/lib/smartnet_crc.cc 2012-06-08 16:22:31.764577578 -0400
  20. @@ -31,6 +31,7 @@
  21. #include <gr_tags.h>
  22. #include <sstream>
  23. #include <smartnet_types.h>
  24. +#include <iostream>
  25.  
  26. #define VERBOSE 0
  27.  
  28. diff -urN gr-smartnet/src/lib/smartnet_deinterleave.cc gr-smartnet-dev/src/lib/smartnet_deinterleave.cc
  29. --- gr-smartnet/src/lib/smartnet_deinterleave.cc 2012-06-08 16:24:01.197021024 -0400
  30. +++ gr-smartnet-dev/src/lib/smartnet_deinterleave.cc 2012-06-08 16:22:53.140683555 -0400
  31. @@ -28,6 +28,7 @@
  32. #include <smartnet_deinterleave.h>
  33. #include <gr_io_signature.h>
  34. #include <gr_tags.h>
  35. +#include <iostream>
  36.  
  37. #define VERBOSE 0
  38.  
  39. diff -urN gr-smartnet/src/python/fsk_demod.py gr-smartnet-dev/src/python/fsk_demod.py
  40. --- gr-smartnet/src/python/fsk_demod.py 2012-06-08 16:26:03.613628054 -0400
  41. +++ gr-smartnet-dev/src/python/fsk_demod.py 2012-06-08 16:23:29.740865046 -0400
  42. @@ -7,8 +7,7 @@
  43. from gnuradio import gr, gru, blks2, digital, window
  44. from gnuradio import eng_notation
  45. from gnuradio.gr import firdes
  46. -#import gr_ais
  47. -from gnuradio import ais
  48. +import gr_ais
  49. from math import pi
  50.  
  51. class fsk_demod(gr.hier_block2):
  52. diff -urN gr-smartnet/src/python/smartnet2decode.py gr-smartnet-dev/src/python/smartnet2decode.py
  53. --- gr-smartnet/src/python/smartnet2decode.py 2012-06-08 16:26:29.437756120 -0400
  54. +++ gr-smartnet-dev/src/python/smartnet2decode.py 2012-06-08 16:23:38.356907765 -0400
  55. @@ -10,8 +10,7 @@
  56. from gnuradio import gr, gru, blks2, optfir, digital
  57. from gnuradio import audio
  58. from gnuradio import eng_notation
  59. -#from gnuradio import uhd
  60. -from osmosdr import *
  61. +from gnuradio import uhd
  62. from fsk_demod import fsk_demod
  63. from optparse import OptionParser
  64. from gnuradio.eng_option import eng_option
  65. @@ -21,8 +20,6 @@
  66. import gnuradio.gr.gr_threading as _threading
  67. import csv
  68.  
  69. -rtl_rate = 2.4e6
  70. -
  71. class top_block_runner(_threading.Thread):
  72. def __init__(self, tb):
  73. _threading.Thread.__init__(self)
  74. @@ -44,7 +41,6 @@
  75. self.rate = options.rate
  76.  
  77. else:
  78. - '''
  79. self.u = uhd.usrp_source(options.addr,
  80. io_type=uhd.io_type.COMPLEX_FLOAT32,
  81. num_channels=1)
  82. @@ -58,27 +54,20 @@
  83. # Set the antenna
  84. if(options.antenna):
  85. self.u.set_antenna(options.antenna, 0)
  86. - '''
  87. - self.u = source_c()
  88. - self.u.set_sample_rate(rtl_rate)
  89. - self.rate = rtl_rate
  90.  
  91. self.centerfreq = options.centerfreq
  92. print "Tuning to: %fMHz" % (self.centerfreq - options.error)
  93. -
  94. -# if not(self.tune(options.centerfreq - options.error)):
  95. - if not(self.u.set_center_freq(options.centerfreq - options.error)):
  96. + if not(self.tune(options.centerfreq - options.error)):
  97. print "Failed to set initial frequency"
  98. - '''
  99. +
  100. if options.gain is None: #set to halfway
  101. g = self.u.get_gain_range()
  102. options.gain = (g.start()+g.stop()) / 2.0
  103. - '''
  104. - self.u.set_gain_mode(0)
  105. +
  106. print "Setting gain to %i" % options.gain
  107. self.u.set_gain(options.gain)
  108.  
  109. -# self.u.set_bandwidth(options.bandwidth)
  110. + self.u.set_bandwidth(options.bandwidth)
  111.  
  112. print "Samples per second is %i" % self.rate
  113.  
  114. @@ -227,7 +216,6 @@
  115. groupflag = bool(groupflag)
  116.  
  117. # print "Command is",command
  118. - print "Command ",hex(command), " address ",hex(address)
  119. if longtglist is not None and longtglist.get(str(lookupaddr), None) is not None:
  120. 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)
  121. else:
Add Comment
Please, Sign In to add comment