def get_link_device(): global link_device if not link_device: devs = nm.get_wifi_devices() link_device = get_ap_device() if dual_enabled(): for dev in devs: if dev.Interface != link_device.Interface: link_device = dev return link_device return link_device
def get_ap_device(): global ap_device if not ap_device: devs = nm.get_wifi_devices() spec = get_conf().primary_wifi_device if spec: for dev in devs: if dev.Interface == spec: ap_device = dev if not ap_device: ap_device = devs[0] return ap_device
def get_mode(): if len(nm.get_wifi_devices()) > 1 and dual_enabled(): return MULTI_MODE else: return SINGLE_MODE