diff --git a/octal/cavium_env/rf_card_cal_tip/main.py b/octal/cavium_env/rf_card_cal_tip/main.py index 7a75644dc3..1009d6cf61 100644 --- a/octal/cavium_env/rf_card_cal_tip/main.py +++ b/octal/cavium_env/rf_card_cal_tip/main.py @@ -100,6 +100,7 @@ class rfCardCal(): self.retest_num = 3 self.telnet_retry = 20 self.cfg = test_config.EnbConfig() + if self.cfg.read_cal_channel() < 0 : sys.exit() self.enb = enodeb_ctrl.enodeB_Ctrl() def create_new_eeprom_record(self): @@ -428,7 +429,7 @@ class rfCardCal(): pass def set_initial_frequency(self): - + if (self.cfg.cal_freq_arr[0][0] == 0) and (self.cfg.cal_freq_arr[0][1] == 0): mb = eutra_bands.BandFactory.newBand(test_config.band) test_config.dl_freq = mb.dl_freq()[1] @@ -436,7 +437,8 @@ class rfCardCal(): else: test_config.dl_freq = self.cfg.cal_freq_arr[0][0] test_config.ul_freq = self.cfg.cal_freq_arr[0][1] - + + print "Band " + str(test_config.band) print "DL freq. " + str(test_config.dl_freq) + " MHz" print "UL freq. " + str(test_config.ul_freq) + " MHz" print "" @@ -699,8 +701,8 @@ class rfCardCal(): print "End of RSSI calibration" #del om - elif (self.mod == '3'): - + elif (self.mod == '3'): + self.find_eeprom_record(); if (self.cfg.test_set == 'agilent'): diff --git a/octal/cavium_env/rf_card_cal_tip/test_config.py b/octal/cavium_env/rf_card_cal_tip/test_config.py index e14af49322..60cac3f6b5 100644 --- a/octal/cavium_env/rf_card_cal_tip/test_config.py +++ b/octal/cavium_env/rf_card_cal_tip/test_config.py @@ -18,7 +18,7 @@ wr_var_to_uboot = False # T: write variable to uboot; F: don't write class EnbConfig(): def __init__(self): - + self.num_cal_channel = 0 # number of calibration channels self.dl_freq_arr = [] # list of downlink frequencies self.ul_freq_arr = [] # list of uplink frequencies @@ -99,7 +99,8 @@ class EnbConfig(): self.bb_pingip = '10.18.104.240' if self.check_cfg_file() < 0: sys.exit() - if self.read_cal_channel() < 0: sys.exit() + # only running read_cal_channel once during the call from main, not every init of EnbConfig + # if self.read_cal_channel() < 0: sys.exit() self.read_config() self.select_rf_drv_init() @@ -119,18 +120,33 @@ class EnbConfig(): return 0 def read_cal_channel(self): - + + se = raw_input("Which band are you running?(3/5/28):") + if (se == "3"): + band_suffix = "_3" + elif (se == "5"): + band_suffix = "_5" + elif (se == "28"): + band_suffix = "_28" + else: + print se + " is not a supported band" + return -1 + + band_name = "band" + band_suffix + dl_freq = "dl_freq" + band_suffix + ul_freq = "ul_freq" + band_suffix + for cl in self.cfgln: par, val = self.read_line(cl) - - if (par == "band"): + + if (par == band_name): global band band = int(val) elif (par == "num_cal_channel"): self.num_cal_channel = int(val) - elif (par == "dl_freq"): + elif (par == dl_freq): self.dl_freq_arr.append(float(val)) - elif (par == "ul_freq"): + elif (par == ul_freq): self.ul_freq_arr.append(float(val)) if (len(self.dl_freq_arr) != len(self.ul_freq_arr)): diff --git a/octal/cavium_env/rf_card_cal_tip/test_config.txt b/octal/cavium_env/rf_card_cal_tip/test_config.txt index ccec403b99..972d2d417e 100644 --- a/octal/cavium_env/rf_card_cal_tip/test_config.txt +++ b/octal/cavium_env/rf_card_cal_tip/test_config.txt @@ -3,11 +3,19 @@ # 1. the 1st dl_freq & ul_freq calibration results will write into u-boot environment variables # 2. leave the 1st dl_freq & ul_freq to zero for default(center) frequencies -num_cal_channel=1 # number of calibration channels -band=3 # enodeB band -dl_freq=1840 # downlink frequency -ul_freq=1745 # uplink frequency +num_cal_channel=1 # number of calibration channels +band_3=3 # enodeB band +dl_freq_3=1840 # downlink frequency +ul_freq_3=1745 # uplink frequency + +band_5=5 # enodeB band +dl_freq_5=875 # downlink frequency +ul_freq_5=830 # uplink frequency + +band_28=28 # enodeB band +dl_freq_28=790 # downlink frequency +ul_freq_28=735 # uplink frequency # environment setting board_typ='zen_ad' # board type [zen_ad] diff --git a/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170319.txt b/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170319.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170652.txt b/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170652.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170714.txt b/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170714.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170734.txt b/octal/cavium_env/rf_card_cal_tip/test_report/test_20181115_170734.txt new file mode 100644 index 0000000000..e69de29bb2