mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2026-01-07 20:41:28 +00:00
added "enable txo" option
This commit is contained in:
@@ -33,6 +33,7 @@ class CreateStation(Realm):
|
||||
_proxy_str=None,
|
||||
_debug_on=False,
|
||||
_up=True,
|
||||
_set_txo_data=None,
|
||||
_exit_on_error=False,
|
||||
_exit_on_fail=False):
|
||||
super().__init__(_host,
|
||||
@@ -48,6 +49,7 @@ class CreateStation(Realm):
|
||||
self.number_template = _number_template
|
||||
self.debug = _debug_on
|
||||
self.up = _up
|
||||
self.set_txo_data = _set_txo_data
|
||||
self.station_profile = self.new_station_profile()
|
||||
self.station_profile.lfclient_url = self.lfclient_url
|
||||
self.station_profile.ssid = self.ssid
|
||||
@@ -60,7 +62,6 @@ class CreateStation(Realm):
|
||||
pprint.pprint(self.sta_list)
|
||||
print("---- ~Station List ----- ----- ----- ----- ----- ----- \n")
|
||||
|
||||
|
||||
def build(self):
|
||||
# Build stations
|
||||
self.station_profile.use_security(self.security, self.ssid, self.password)
|
||||
@@ -70,6 +71,15 @@ class CreateStation(Realm):
|
||||
self.station_profile.set_command_flag("add_sta", "create_admin_down", 1)
|
||||
self.station_profile.set_command_param("set_port", "report_timer", 1500)
|
||||
self.station_profile.set_command_flag("set_port", "rpt_timer", 1)
|
||||
if self.set_txo_data is not None:
|
||||
self.station_profile.set_wifi_txo(txo_ena=self.set_txo_data["txo_enable"],
|
||||
tx_power=self.set_txo_data["txpower"],
|
||||
pream=self.set_txo_data["pream"],
|
||||
mcs=self.set_txo_data["mcs"],
|
||||
nss=self.set_txo_data["nss"],
|
||||
bw=self.set_txo_data["bw"],
|
||||
retries=self.set_txo_data["retries"],
|
||||
sgi=self.set_txo_data["sgi"], )
|
||||
self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug)
|
||||
if self.up:
|
||||
self.station_profile.admin_up()
|
||||
@@ -98,14 +108,14 @@ Command example:
|
||||
--debug
|
||||
''')
|
||||
required = parser.add_argument_group('required arguments')
|
||||
#required.add_argument('--security', help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True)
|
||||
# required.add_argument('--security', help='WiFi Security protocol: < open | wep | wpa | wpa2 | wpa3 >', required=True)
|
||||
|
||||
args = parser.parse_args()
|
||||
#if args.debug:
|
||||
# if args.debug:
|
||||
# pprint.pprint(args)
|
||||
# time.sleep(5)
|
||||
if (args.radio is None):
|
||||
raise ValueError("--radio required")
|
||||
raise ValueError("--radio required")
|
||||
|
||||
num_sta = 2
|
||||
if (args.num_stations is not None) and (int(args.num_stations) > 0):
|
||||
@@ -113,20 +123,31 @@ Command example:
|
||||
num_sta = num_stations_converted
|
||||
|
||||
station_list = LFUtils.port_name_series(prefix="sta",
|
||||
start_id=0,
|
||||
end_id=num_sta-1,
|
||||
padding_number=10000,
|
||||
radio=args.radio)
|
||||
start_id=0,
|
||||
end_id=num_sta - 1,
|
||||
padding_number=10000,
|
||||
radio=args.radio)
|
||||
set_txo_data={
|
||||
"txo_enable": 1,
|
||||
"txpower": 255,
|
||||
"pream": 0,
|
||||
"mcs": 0,
|
||||
"nss": 0,
|
||||
"bw": 3,
|
||||
"retries": 1,
|
||||
"sgi": 0
|
||||
}
|
||||
|
||||
create_station = CreateStation(_host=args.mgr,
|
||||
_port=args.mgr_port,
|
||||
_ssid=args.ssid,
|
||||
_password=args.passwd,
|
||||
_security=args.security,
|
||||
_sta_list=station_list,
|
||||
_radio=args.radio,
|
||||
_proxy_str=args.proxy,
|
||||
_debug_on=args.debug)
|
||||
_port=args.mgr_port,
|
||||
_ssid=args.ssid,
|
||||
_password=args.passwd,
|
||||
_security=args.security,
|
||||
_sta_list=station_list,
|
||||
_radio=args.radio,
|
||||
_set_txo_data=None,
|
||||
_proxy_str=args.proxy,
|
||||
_debug_on=args.debug)
|
||||
|
||||
create_station.build()
|
||||
print('Created %s stations' % num_sta)
|
||||
|
||||
Reference in New Issue
Block a user