I'm trying to use QBluetoothDeviceDiscoveryAgent via PyQt5.
There is a signal name error
. I have been able to successfully connect it (like this: self.error.connect(self.on_error)
) and confirm that it is working.
However, there is also a method named error
. How can you call this method in Python?
I was expecting something like error_
, but I don't see anything in dir(QBluetoothDeviceDiscoveryAgent)
that looks useful:
['DiscoveryMethod', 'DiscoveryMethods', 'Error', 'GeneralUnlimitedInquiry', 'InputOutputError', 'InquiryType', 'InvalidBluetoothAdapterError', 'LimitedInquiry', 'NoError', 'PoweredOffError', 'UnknownError', 'UnsupportedDiscoveryMethod', 'UnsupportedPlatformError', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'blockSignals', 'canceled', 'childEvent', 'children', 'connectNotify', 'customEvent', 'deleteLater', 'destroyed', 'deviceDiscovered', 'disconnect', 'disconnectNotify', 'discoveredDevices', 'dumpObjectInfo', 'dumpObjectTree', 'dynamicPropertyNames', 'error', 'errorString', 'event', 'eventFilter', 'findChild', 'findChildren', 'finished', 'inherits', 'inquiryType', 'installEventFilter', 'isActive', 'isSignalConnected', 'isWidgetType', 'isWindowType', 'killTimer', 'lowEnergyDiscoveryTimeout', 'metaObject', 'moveToThread', 'objectName', 'objectNameChanged', 'on_deviceDiscovered', 'on_error', 'on_finished', 'parent', 'property', 'pyqtConfigure', 'receivers', 'removeEventFilter', 'sender', 'senderSignalIndex', 'setInquiryType', 'setLowEnergyDiscoveryTimeout', 'setObjectName', 'setParent', 'setProperty', 'signalsBlocked', 'start', 'startTimer', 'staticMetaObject', 'stop', 'supportedDiscoveryMethods','thread', 'timerEvent', 'tr']
You have to call the function directly:
This will return a number that corresponds to the following table:
If you want to get the most readable text then use: