Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.14.1
-
None
-
Linux peppy 5.5.4-arch1-1 #1 SMP PREEMPT Sat, 15 Feb 2020 00:36:29 +0000 x86_64 GNU/Linux
python-pyqt5 5.14.1-2
bluez 5.53-1
Description
BLE discovery never stops when lowEnergyDiscoveryTimeout is too low (<535 for me)
Finished signal is emitted, but new devices appear in the bluetoothctl console.
Calling stop() afterwards has no effect.
Suggestion: Please add a way to skip the BLE discovery without setting a timeout.
#!/usr/bin/python3 import sys from PyQt5 import QtWidgets, QtBluetooth class Main(QtWidgets.QMainWindow): def __init__(self, parent): super().__init__() self.agent = QtBluetooth.QBluetoothDeviceDiscoveryAgent(self) self.agent.setLowEnergyDiscoveryTimeout(1) self.agent.deviceDiscovered.connect(self.discovered) self.agent.finished.connect(self.finished) self.agent.start() # self.agent.stop() def discovered(self, dev): name = dev.name() addr = dev.address().toString() print(name, addr) def finished(self): print("done") if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) gui = Main(app) sys.exit(app.exec_())