def scan_devices( duration = 10 ):
"""
This causes the bluetooth system to scan for any broadcasting devices. Once found, the devices get added to a
dbus backed database specific for bluetooth for retrieval later.
Args:
duration (int): the amount of time that the scan should run for in seconds.
"""
adapter = DeviceManager().find_adapter()
adapter.StartDiscovery()
mainloop = GObject.MainLoop()
GObject.timeout_add(duration * 1000, quit, mainloop)
mainloop.run()
评论列表
文章目录