Python Forum
QtDBus: how to call GetManagedObjects from bluez
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QtDBus: how to call GetManagedObjects from bluez
#1
I want to list and extract all trusted bluetooth device by using QtDbus. With the qdbusviewer tool, I can see and call the method GetManagedObjects() just fine. Then I tried to do it in python, but the method cannot be found. The script below output ['Method "GetManagedObjects" with signature "" on interface "org.freedesktop.DBus.ObjectManager" doesn\'t exist']. What am I doing wrong?

#!/usr/bin/python3
import sys
from PyQt5 import QtWidgets, QtDBus

class Main(QtWidgets.QMainWindow):
    def __init__(self):
        super().__init__()
        bus = QtDBus.QDBusConnection.systemBus()
        interface = QtDBus.QDBusInterface("org.bluez", "/org/bluez", "org.freedesktop.DBus.ObjectManager", bus)
        result = interface.call("GetManagedObjects")
        print(result.arguments())


if __name__== '__main__':
    app = QtWidgets.QApplication([])
    gui = Main()
    sys.exit(app.exec_())
Reply


Messages In This Thread
QtDBus: how to call GetManagedObjects from bluez - by Alfalfa - Jul-15-2018, 05:24 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020