GNU Radio 3.8 support
https://wiki.gnuradio.org/index.php/GNU_Radio_3.8_OOT_Module_Porting_Guide
Change-Id: I23dd638c8c48ed0a4b50559ce33fbd5e60b7dcbc
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 97cb0a3..f0c984d 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,6 +1,7 @@
# Copyright 2011 Free Software Foundation, Inc.
#
-# This file is part of GNU Radio
+# This file was generated by gr_modtool, a tool from the GNU Radio framework
+# This file is a part of gr-gsm
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -36,7 +37,8 @@
GR_PYTHON_INSTALL(
FILES
- __init__.py DESTINATION ${GR_PYTHON_DIR}/grgsm
+ __init__.py
+ DESTINATION ${GR_PYTHON_DIR}/grgsm
)
########################################################################
diff --git a/python/__init__.py b/python/__init__.py
index e2905e8..8241b01 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -31,9 +31,9 @@
from dl import RTLD_GLOBAL as _RTLD_GLOBAL
except ImportError:
try:
- from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL
+ from DLFCN import RTLD_GLOBAL as _RTLD_GLOBAL
except ImportError:
- pass
+ pass
if _RTLD_GLOBAL != 0:
_dlopenflags = sys.getdlopenflags()
diff --git a/python/misc_utils/fn_time.py b/python/misc_utils/fn_time.py
index 96314b8..17c6295 100644
--- a/python/misc_utils/fn_time.py
+++ b/python/misc_utils/fn_time.py
@@ -83,10 +83,10 @@
fn_delta, time2_precise = fn_time_delta(fn1, time1, fn2, time2_err, ts_x, ts_ref)
time2_precise_cpp = fn_time_delta_cpp(fn1, (int(time1),time1-int(time1)), fn2, (int(time2_err),time2_err-int(time2_err)), ts_x, ts_ref)
if fn_delta != fn2-fn1:
- print "bad fn:", fn2, error#, 'fn_delta:'+str(fn_delta), time2, error, frames_diff_h4, (time2-time1)/(__hyper_frame*__frame_period), time_diff_hint_h4_prev, time_diff_hint
+ print("bad fn:", fn2, error)#, 'fn_delta:'+str(fn_delta), time2, error, frames_diff_h4, (time2-time1)/(__hyper_frame*__frame_period), time_diff_hint_h4_prev, time_diff_hint
# time_diff_hint = time2 - time2_precise
time_diff_hint = time2_precise_cpp[0]+time2_precise_cpp[1] - time2_precise
if abs(time_diff_hint) > 0.0001:
- print "time2_precise_cpp",time2_precise_cpp," time2_precise",time2_precise," time_ref",time1," time_hint",time2_err
- print ""
+ print("time2_precise_cpp",time2_precise_cpp," time2_precise",time2_precise," time_ref",time1," time_hint",time2_err)
+ print("")
diff --git a/python/qa_burst_printer.py b/python/qa_burst_printer.py
index a3d50d5..c1fdfaf 100755
--- a/python/qa_burst_printer.py
+++ b/python/qa_burst_printer.py
@@ -52,7 +52,7 @@
out = ""
for l in expected_lines:
out = out + l + "\n"
- return out
+ return out.encode('utf-8')
def test_001_complete_bursts_prefix (self):
"""
diff --git a/python/qa_message_printer.py b/python/qa_message_printer.py
index 6bc9a20..21e6852 100755
--- a/python/qa_message_printer.py
+++ b/python/qa_message_printer.py
@@ -52,7 +52,7 @@
out = ""
for l in expected_lines:
out = out + l + "\n"
- return out
+ return out.encode('utf-8')
def test_001_no_prefix_no_header (self):
"""
diff --git a/python/receiver/fcch_burst_tagger.py b/python/receiver/fcch_burst_tagger.py
index fc427a7..a460740 100644
--- a/python/receiver/fcch_burst_tagger.py
+++ b/python/receiver/fcch_burst_tagger.py
@@ -81,9 +81,9 @@
# measured_freq = mean(inst_freq[precise_idx:precise_idx+self.processed_block_size])
expected_freq = self.symbol_rate/4
- print "input_items:",len(in0)
- print "coarse_idx",coarse_idx
- print "coarse_idx+precise_idx",coarse_idx+precise_idx
+ print("input_items:",len(in0))
+ print("coarse_idx",coarse_idx)
+ print("coarse_idx+precise_idx",coarse_idx+precise_idx)
zoomed_spectrum = abs(self.zoomfft(in0[coarse_idx+precise_idx:coarse_idx+precise_idx+self.processed_block_size]))
measured_freq = self.f_axis[argmax(zoomed_spectrum)]
@@ -97,9 +97,9 @@
# Some additional plots and prints for debugging
# print "coarse_idx+precise_idx",coarse_idx+precise_idx
# print "offset-self.nitems_written(0):",offset-self.nitems_written(0)
- print offset-self.prev_offset
+ print(offset-self.prev_offset)
self.prev_offset=offset
- print "freq offset", freq_offset
+ print("freq offset", freq_offset)
# freq_offset = measured_freq - expected_freq
# plot(self.f_axis, zoomed_spectrum)
# show()
diff --git a/python/receiver/sch_detector.py b/python/receiver/sch_detector.py
index d3587d1..626e37d 100644
--- a/python/receiver/sch_detector.py
+++ b/python/receiver/sch_detector.py
@@ -57,10 +57,10 @@
correlation_bl = correlation_bl/len(self.sync_seq_msk)
power_bl_mov_avg = uniform_filter1d(abs(correlation_bl)**2,self.L+1,mode='constant',axis=0)
- print "correlation_bl.argmax()",argmax(abs(correlation_bl))
- print "power_bl_mov_avg.argmax()",(power_bl_mov_avg).argmax()
- print 'unravel_index(correlation_bl.argmax(), correlation_bl.shape)',unravel_index(argmax(abs(correlation_bl)), correlation_bl.shape)
- print 'unravel_index(power_bl_mov_avg.argmax(), power_bl_mov_avg.shape)',unravel_index(power_bl_mov_avg.argmax(), power_bl_mov_avg.shape)
+ print("correlation_bl.argmax()",argmax(abs(correlation_bl)))
+ print("power_bl_mov_avg.argmax()",(power_bl_mov_avg).argmax())
+ print('unravel_index(correlation_bl.argmax(), correlation_bl.shape)',unravel_index(argmax(abs(correlation_bl)), correlation_bl.shape))
+ print('unravel_index(power_bl_mov_avg.argmax(), power_bl_mov_avg.shape)',unravel_index(power_bl_mov_avg.argmax(), power_bl_mov_avg.shape))
(r_corrmax, c_corrmax)=unravel_index(argmax(abs(correlation_bl)), correlation_bl.shape)
(r_powmax, c_powmax)=unravel_index(power_bl_mov_avg.argmax(), power_bl_mov_avg.shape)
@@ -79,7 +79,7 @@
# plot(range(ii,len(correlation_bl[:,0])*self.OSR,self.OSR),power_bl_mov_avg[:,ii]*5e6,'r.')
# show()
# figure()
- print 'r_powmax: ',r_powmax
+ print('r_powmax: ',r_powmax)
# plot(abs(correlation_bl[range(r_powmax-(self.L+1)/2+1,r_powmax+(self.L+1)/2+1), c_powmax]),'g')
# hold(True)
# plot(abs(correlation_bl[range(r_corrmax-(self.L+1)/2+1,r_corrmax+(self.L+1)/2+1), c_corrmax]),'r')