def create(devices, setup_params, refs, duts, monitors): mons = [] mhosts = [] hosts = duts + refs # choose only standalone monitors for monitor in monitors: if monitor not in hosts and monitor != "all": mons.append(monitor) for mon in mons: dev = config.get_device(devices, mon) if dev is None: continue host = Host(host=dev['hostname'], ifname=dev['ifname'], port=dev['port'], name=dev['name']) try: host.execute(["iw", "reg", "set", setup_params['country']]) rutils.setup_hw_host(host, setup_params, True) except: pass mhosts.append(host) return mhosts
def get_host(devices, dev_name): dev = config.get_device(devices, dev_name) host = Host(host=dev['hostname'], ifname=dev['ifname'], port=dev['port'], name=dev['name']) host.dev = dev return host
def create(devices, setup_params, refs, duts, monitors): mons = [] mhosts = [] hosts = duts + refs # choose only standalone monitors for monitor in monitors: if monitor not in hosts and monitor != "all": mons.append(monitor) for mon in mons: word = mon.split(":") dev = config.get_device(devices, word[0]) if dev is None: continue host = Host(host=dev['hostname'], ifname=dev['ifname'], port=dev['port'], name=dev['name']) for iface_param in word[1:]: params = iface_param.split(",") if len(params) > 3: monitor_param = { "freq": rutils.c2f(params[0]), "bw": params[1], "center_freq1": rutils.c2f(params[2]), "center_freq2": rutils.c2f(params[3]) } host.monitor_params.append(monitor_param) try: host.execute(["iw", "reg", "set", setup_params['country']]) rutils.setup_hw_host(host, setup_params, True) except: pass mhosts.append(host) return mhosts