aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPiotr Krysik <ptrkrysik@users.noreply.github.com>2017-09-11 10:07:25 +0200
committerPiotr Krysik <ptrkrysik@users.noreply.github.com>2017-09-11 10:38:40 +0200
commitfcb45b021a1634ef097f16f1bcae79dba7f506db (patch)
tree666d9933ad1fb0e31660d7ddd518281ac0bc26cf /apps
parenta80567f0132bdad08cf3b6ec38328779f7f60845 (diff)
Remove 'band' option from grgsm_decode altogether
Diffstat (limited to 'apps')
-rwxr-xr-xapps/grgsm_decode33
1 files changed, 5 insertions, 28 deletions
diff --git a/apps/grgsm_decode b/apps/grgsm_decode
index dbac386..9c01e66 100755
--- a/apps/grgsm_decode
+++ b/apps/grgsm_decode
@@ -284,12 +284,7 @@ if __name__ == '__main__':
cfile_options.add_option("-f", "--fc", dest="fc", type="eng_float",
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")
- cfile_options.add_option("--band", dest="band",
- help="Specify the GSM band for the frequency.\nAvailable bands are: "
- + ", ".join(grgsm.arfcn.get_bands()) + "."
- + "If no band is specified, it will be determined automatically, defaulting to 0.")
+ help="Set ARFCN instead of frequency (for PCS1900 add 0x8000 (2**15) to the ARFCN number).")
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]")
@@ -347,31 +342,14 @@ if __name__ == '__main__':
arfcn = None
fc = None
if options.arfcn:
- if options.band:
- if options.band not in grgsm.arfcn.get_bands():
- parser.error("Invalid GSM band\n")
- elif not grgsm.arfcn.is_valid_arfcn(options.arfcn):
- parser.error("ARFCN is not valid\n")
- else:
- arfcn = options.arfcn
- fc = grgsm.arfcn.arfcn2downlink(arfcn)
+ if not grgsm.arfcn.is_valid_arfcn(options.arfcn):
+ parser.error("ARFCN is not valid\n")
else:
arfcn = options.arfcn
- grgsm.arfcn.arfcn2downlink(arfcn)
+ fc = grgsm.arfcn.arfcn2downlink(arfcn)
elif options.fc:
fc = options.fc
- if options.band:
- if options.band not in grgsm.arfcn.get_bands():
- parser.error("Invalid GSM band\n")
- elif not grgsm.arfcn.is_valid_downlink(options.fc, options.band):
- parser.error("Frequency is not valid in the specified band\n")
- else:
- arfcn = grgsm.arfcn.downlink2arfcn(options.fc, options.band)
- else:
- for band in grgsm.arfcn.get_bands():
- if grgsm.arfcn.is_valid_downlink(options.fc, band):
- arfcn = grgsm.arfcn.downlink2arfcn(options.fc, band)
- break
+ arfcn = grgsm.arfcn.downlink2arfcn(options.fc)
# instanciate decoder
tb = grgsm_decoder(timeslot=options.timeslot, subslot=options.subslot, chan_mode=options.chan_mode,
@@ -386,4 +364,3 @@ if __name__ == '__main__':
# run
tb.start()
tb.wait()
-