bluetooth scan box

This commit is contained in:
cuu 2018-08-21 14:28:36 +08:00
parent da2d61366f
commit ed1a6f3416

View File

@ -482,6 +482,12 @@ class BluetoothPage(Page):
self._PsIndex = 0
def Rescan(self):
if self._Screen._CurrentPage != self:
return
self._Scanning = True
self.ShowBox("Bluetooth scanning...")
proxy_obj = self._Dbus.get_object("org.bluez", "/org/bluez/" + self._ADAPTER_DEV)
adapter_props = dbus.Interface(proxy_obj,"org.freedesktop.DBus.Properties")
discoverying = adapter_props.Get("org.bluez.Adapter1", "Discovering")
@ -550,6 +556,7 @@ class BluetoothPage(Page):
self._Screen.SwapAndShow()
if event.key == CurKeys["X"]:
self.Rescan()
if event.key == CurKeys["Y"]: