Example #1
0
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
Example #2
0
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
Example #3
0
def get_ap_device() -> "NetworkManager.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]

    if ap_device:
        return ap_device
    else:
        raise
Example #4
0
def get_mode():
    if len(nm.get_wifi_devices()) > 1 and dual_enabled():
        return MULTI_MODE
    else:
        return SINGLE_MODE