From caa7741d0907a00701e54446f61fae13679956ce Mon Sep 17 00:00:00 2001 From: leommxj Date: Sun, 10 Sep 2017 14:49:03 +0800 Subject: delete some useless code after the change of is_valid_arfcn(...) and arfcn2downlink(...) --- apps/grgsm_decode | 7 ++----- apps/helpers/grgsm_capture | 15 +++------------ 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/apps/grgsm_decode b/apps/grgsm_decode index 70cd284..dbac386 100755 --- a/apps/grgsm_decode +++ b/apps/grgsm_decode @@ -351,16 +351,13 @@ if __name__ == '__main__': 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 in the specified band\n") + parser.error("ARFCN is not valid\n") else: arfcn = options.arfcn fc = grgsm.arfcn.arfcn2downlink(arfcn) else: arfcn = options.arfcn - for band in grgsm.arfcn.get_bands(): - if grgsm.arfcn.is_valid_arfcn(arfcn): - fc = grgsm.arfcn.arfcn2downlink(arfcn) - break + grgsm.arfcn.arfcn2downlink(arfcn) elif options.fc: fc = options.fc if options.band: diff --git a/apps/helpers/grgsm_capture b/apps/helpers/grgsm_capture index 8b10c61..0c96df1 100755 --- a/apps/helpers/grgsm_capture +++ b/apps/helpers/grgsm_capture @@ -138,13 +138,7 @@ class grgsm_capture(gr.top_block): self.arfcn = arfcn if self.verbose or self.burst_file: self.gsm_receiver.set_cell_allocation([self.arfcn]) - if options.band: - new_freq = grgsm.arfcn.arfcn2downlink(self.arfcn) - else: - for band in grgsm.arfcn.get_bands(): - if grgsm.arfcn.is_valid_arfcn(arfcn): - new_freq = grgsm.arfcn.arfcn2downlink(arfcn) - break + new_freq = grgsm.arfcn.arfcn2downlink(self.arfcn) self.set_fc(new_freq) def get_gain(self): @@ -233,16 +227,13 @@ if __name__ == '__main__': 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 in the specified band\n") + parser.error("ARFCN is not valid\n") else: arfcn = options.arfcn fc = grgsm.arfcn.arfcn2downlink(arfcn) else: arfcn = options.arfcn - for band in grgsm.arfcn.get_bands(): - if grgsm.arfcn.is_valid_arfcn(arfcn): - fc = grgsm.arfcn.arfcn2downlink(arfcn) - break + fc = grgsm.arfcn.arfcn2downlink(arfcn) elif options.fc: fc = options.fc if options.band: -- cgit v1.2.3