From cef6e9622e6a0a02f141b311692bf8582ccfb65e Mon Sep 17 00:00:00 2001 From: cuu Date: Tue, 21 Aug 2018 15:03:17 +0800 Subject: [PATCH] bluetooth --- Menu/GameShell/10_Settings/Bluetooth/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Menu/GameShell/10_Settings/Bluetooth/__init__.py b/Menu/GameShell/10_Settings/Bluetooth/__init__.py index 3198362..f6abc78 100644 --- a/Menu/GameShell/10_Settings/Bluetooth/__init__.py +++ b/Menu/GameShell/10_Settings/Bluetooth/__init__.py @@ -468,6 +468,16 @@ class BluetoothPage(Page): def CheckIfBluetoothConnecting(self): return True + + def RefreshDevices(self): + global devices + proxy_obj = bus.get_object("org.bluez", "/") + manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager") + objects = manager.GetManagedObjects() + for path, interfaces in objects.iteritems(): + if "org.bluez.Device1" in interfaces: + devices[path] = interfaces["org.bluez.Device1"] ## like /org/bluez/hci0/dev_xx_xx_xx_yy_yy_yy + def GenNetworkList(self): self._WirelessList = [] @@ -514,6 +524,8 @@ class BluetoothPage(Page): print(str(e)) def OnLoadCb(self): + self.RefreshDevices() + self.GenNetworkList() def ScrollUp(self):