def on_start(self): try: iwlist.scan(self._if_name) except TypeError: log.error("failed to start because of TypeError") return False except OSError: log.error("failed to start because of OSError") return False super(IwListSensor, self).on_start()
def on_start(self): try: iwlist.scan(self._if_name) except TypeError: log.error("failed to start because of TypeError") return False except OSError: log.error("failed to start because of OSError") return False super(IWListVirtualSensor, self).on_start()
def Search(self, interface): if interface in self.wirelessModules: try: from iwlib import iwlist endpoints = iwlist.scan(interface) return endpoints except: exception('Wifi search address') return None
from iwlib import iwlist iwlist.scan('eth1') iwlist.scan('eth1')
def scan(self): return iwlist.scan(self._if_name)