Beispiel #1
0
    def connect_open(self, interface, bss):

        self.notify_Label.emit('Disconnecting from the current network...')
        interface.disconnect()
        time.sleep(2)
        profile_info = Profile()
        profile_info.ssid = bss.ssid
        profile_info.bssid = bss.bssid
        profile_info.akm.append(const.AKM_TYPE_NONE)
        interface.remove_all_network_profiles()
        tmp_profile = interface.add_network_profile(profile_info)
        self.notify_Label.emit("Begin to connect the AP:%s(%s)..." %
                               (bss.ssid, bss.bssid))
        interface.connect(tmp_profile)
Beispiel #2
0
    def connect_encrypt(self, interface, bss, wifi_password):

        self.notify_Label.emit('Disconnecting from the current network...')
        interface.disconnect()
        time.sleep(2)
        profile_info = Profile()
        profile_info.ssid = bss.ssid
        profile_info.bssid = bss.bssid
        profile_info.akm.append(bss.akm[-1])
        profile_info.key = wifi_password
        interface.remove_all_network_profiles()
        tmp_profile = interface.add_network_profile(profile_info)
        self.notify_Label.emit("Begin to connect the AP:%s(%s)..." %
                               (bss.ssid, bss.bssid))
        interface.connect(tmp_profile)
Beispiel #3
0
    def connect_open(self, interface, bss):

        iface_name = interface.name()
        interface.disconnect()
        time.sleep(2)
        profile_info = Profile()
        profile_info.ssid = bss.ssid
        profile_info.bssid = bss.bssid
        profile_info.akm.append(const.AKM_TYPE_NONE)
        interface.remove_all_network_profiles()
        tmp_profile = interface.add_network_profile(profile_info)
        interface.connect(tmp_profile)
        time.sleep(3)
        if interface.status() == const.IFACE_CONNECTED:
            self.TextBrowser_text_signal.emit(
                '%s is connected to %s(%s)' %
                (iface_name, bss.ssid, bss.bssid))
        else:
            self.TextBrowser_text_signal.emit("AP:%s(%s) connect failed!" %
                                              (bss.ssid, bss.bssid))
            self.TextBrowser_text_signal.emit("%s disconnected..." %
                                              iface_name)