Example #1
0
    def GetNetworks(self, essid=None):
        """Get a list of available wireless networks.

        NOTE: the essid parameter is not used here,
        it was added for the iwlist scan for hidden networks.

        Returns:
        A list containing available wireless networks.

        """
        if not IWSCAN_AVAIL:
            # Use the slow version if python-iwscan isn't available.
            return BaseWirelessInterface.GetNetworks(self)

        if not self.scan_iface:
            try:
                self.scan_iface = iwscan.WirelessInterface(self.iface)
            except iwscan.error as e:
                print(("GetNetworks caught an exception: %s" % e))
                return []

        try:
            results = self.scan_iface.Scan()
        except iwscan.error as e:
            print(("ERROR: %s" % e))
            return []
        return [_f for _f in [self._parse_ap(cell) for cell in results] if _f]
Example #2
0
    def GetNetworks(self):
        """ Get a list of available wireless networks.

        Returns:
        A list containing available wireless networks.

        """
        print("IWSCAN_AVAIL {0}".format(IWSCAN_AVAIL))
        if not IWSCAN_AVAIL:
            # Use the slow version if python-iwscan isn't available.
            return BaseWirelessInterface.GetNetworks(self)

        if not self.scan_iface:
            try:
                self.scan_iface = iwscan.WirelessInterface(self.iface)
            except iwscan.error as e:
                print("GetNetworks caught an exception: {0}".format(e))
                return []

        try:
            results = self.scan_iface.Scan()
        except iwscan.error as e:
            print("ERROR: {0}".format(e))
            return []
        print("result {0}".format(results))
        return filter(None, [self._parse_ap(cell) for cell in results])
Example #3
0
    def GetNetworks(self):
        """ Get a list of available wireless networks.

        Returns:
        A list containing available wireless networks.

        """
        if not IWSCAN_AVAIL:
            # Use the slow version if python-iwscan isn't available.
            return BaseWirelessInterface.GetNetworks(self)

        if not self.scan_iface:
            try:
                self.scan_iface = iwscan.WirelessInterface(self.iface)
            except iwscan.error, e:
                print "GetNetworks caught an exception: %s" % e
                return []
Example #4
0
    def GetNetworks(self, essid=None):
        """ Get a list of available wireless networks.
	
        NOTE: the essid parameter is not used here,
        it was added for the iwlist scan for hidden networks.

        Returns:
        A list containing available wireless networks.

        """
        if not IWSCAN_AVAIL:
            # Use the slow version if python-iwscan isn't available.
            return BaseWirelessInterface.GetNetworks(self)

        if not self.scan_iface:
            try:
                self.scan_iface = iwscan.WirelessInterface(self.iface)
            except iwscan.error, e:
                print "GetNetworks caught an exception: %s" % e
                return []