Skip to content

Instantly share code, notes, and snippets.

@TakehikoShimojima
Created October 15, 2018 02:18
Show Gist options
  • Select an option

  • Save TakehikoShimojima/24cdcd720f5e3bf64c9d841fc0807cc4 to your computer and use it in GitHub Desktop.

Select an option

Save TakehikoShimojima/24cdcd720f5e3bf64c9d841fc0807cc4 to your computer and use it in GitHub Desktop.
class ScanDelegate(DefaultDelegate):
def handleDiscovery(self, scanEntry, isNewDev, isNewData):
print(strftime("%Y-%m-%d %H:%M:%S", gmtime()), scanEntry.addr, scanEntry.getScanData())
sys.stdout.flush()
scanner = Scanner().withDelegate(ScanDelegate())
scanner.scan(10.0, passive=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment