Merge pull request #199 from Telecominfraproject/octal_subbranch_ds

Add choice of band when running main
This commit is contained in:
sgmcclellan
2018-11-15 17:31:28 -08:00
committed by GitHub
7 changed files with 41 additions and 15 deletions

View File

@@ -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'):

View File

@@ -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)):

View File

@@ -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]