Merge branch 'master' into development
diff --git a/.travis.yml b/.travis.yml
index 0c84262..a612c1a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,7 @@
 env:
   #- DOCKERFILE=tests/dockerfiles/Debian_Jessie.docker IMGNAME=debjess-grgsm
   #- DOCKERFILE=tests/dockerfiles/Ubuntu_15_04.docker IMGNAME=ubu15.04-grgsm
-  #- DOCKERFILE=tests/dockerfiles/Debian_testing.docker IMGNAME=debtest-grgsm
+  - DOCKERFILE=tests/dockerfiles/Debian_testing.docker IMGNAME=debtest-grgsm
   - DOCKERFILE=tests/dockerfiles/Ubuntu_16_04.docker IMGNAME=ubu16.04-grgsm
 
 services:
@@ -17,4 +17,3 @@
 script:
   - docker run -it --rm $IMGNAME sh -c 'cd /src/build;make test'
   - docker run -it --rm $IMGNAME /src/tests/scripts/decode.sh
-
diff --git a/apps/grgsm_decode b/apps/grgsm_decode
index 968c1da..da99719 100755
--- a/apps/grgsm_decode
+++ b/apps/grgsm_decode
@@ -36,11 +36,11 @@
 
     def __init__(self, timeslot=0, subslot=None, chan_mode='BCCH',
                  burst_file=None,
-                 cfile=None, fc=939.4e6, samp_rate=2e6, 
+                 cfile=None, fc=None, samp_rate=2e6, 
                  a5=1, a5_kc=None,
                  speech_file=None, speech_codec=None,
                  verbose=False,
-                 print_bursts=False):
+                 print_bursts=False, ppm=0):
 
         gr.top_block.__init__(self, "Gr-gsm Decode")
 
@@ -73,10 +73,10 @@
             self.file_source = blocks.file_source(gr.sizeof_gr_complex*1, self.cfile, False)
             self.receiver = grgsm.receiver(4, ([0]), ([]))
             if self.fc is not None:
-                self.input_adapter = grgsm.gsm_input(ppm=0, osr=4, fc=self.fc, samp_rate_in=samp_rate)
+                self.input_adapter = grgsm.gsm_input(ppm=ppm, osr=4, fc=self.fc, samp_rate_in=samp_rate)
                 self.offset_control = grgsm.clock_offset_control(self.fc, self.samp_rate)
             else:
-                self.input_adapter = grgsm.gsm_input(ppm=0, osr=4, samp_rate_in=samp_rate)
+                self.input_adapter = grgsm.gsm_input(ppm=ppm, osr=4, samp_rate_in=samp_rate)
 
         self.dummy_burst_filter = grgsm.dummy_burst_filter()
         self.timeslot_filter = grgsm.burst_timeslot_filter(self.timeslot)
@@ -274,7 +274,7 @@
         parser, 'Cfile Options', 'Options for decoding cfile input.',
     )
     cfile_options.add_option("-f", "--fc", dest="fc", type="eng_float",
-                             help="Frequency of cfile capture [default=eng_notation.num_to_str(939.4e6)]")
+                             help="Frequency of cfile capture")
     cfile_options.add_option("-a", "--arfcn", dest="arfcn", type="intx",
                              help="Set ARFCN instead of frequency. "
                                   "In some cases you may have to provide the GSM band also")
@@ -285,6 +285,9 @@
     cfile_options.add_option("-s", "--samp-rate", dest="samp_rate", type="eng_float",
                              default=eng_notation.num_to_str(1e6),
                              help="Sample rate of cfile capture [default=%default]")
+    cfile_options.add_option("--ppm", dest="ppm", type="float", default=0,
+                             help="Set frequency offset correction [default=%default]")
+
     parser.add_option_group(cfile_options)
 
     # group decryption options
@@ -327,12 +330,12 @@
     if options.a5 < 0 or options.a5 > 3:
         parser.error("Invalid A5 version\n")
 
-    if options.cfile and (options.fc is None and options.arfcn is None) or (options.fc is not None and options.arfcn is not None):
+    if options.cfile and (options.fc is None and options.arfcn is None):
         print("You haven't provided a frequency or an ARFCN - working without automatic frequency offset correction.\n")
 
     # handle frequency / arfcn input
-    arfcn = 0
-    fc = 939.4e6
+    arfcn = None
+    fc = None
     if options.arfcn:
         if options.band:
             if options.band not in grgsm.arfcn.get_bands():
@@ -363,10 +366,6 @@
                     arfcn = grgsm.arfcn.downlink2arfcn(options.fc, band)
                     break
 
-    # open udp port 4729 to avoid icmp messages
-    #sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
-    #sock.bind(("localhost", 4729))
-
     # instanciate decoder
     tb = grgsm_decoder(timeslot=options.timeslot, subslot=options.subslot, chan_mode=options.chan_mode,
                           burst_file=options.burst_file,
@@ -374,11 +373,9 @@
                           a5=options.a5, a5_kc=kc,
                           speech_file=options.speech_output_file, speech_codec=tch_codecs.get(options.speech_codec),
                           verbose=options.verbose,
-                          print_bursts=options.print_bursts)
+                          print_bursts=options.print_bursts, ppm=options.ppm)
 
     # run
     tb.start()
     tb.wait()
 
-    # we are done, close socket
-    #sock.close()