Re: Connecting and sending a message in bluetooth using python and PyQt5
David Boddie <[email protected]> Sat, 18 Apr 2020 10:52:59 +0200
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <1908173.j5oxBYigdo@aurora> |
On Sat Apr 18 08:43:13 BST 2020, Jason Friedman wrote: > Thanks for taking the time to answer. No problem. > I found the problem - I was mixing "regular" Bluetooth and QtBluetooth. > > In particular, this line: > self.sock = QtBluetooth.QBluetoothSocket(bluetooth.RFCOMM) > > should have been: > self.sock = QtBluetooth.QBluetoothSocket(QtBluetooth.QBluetoothServiceInfo.RfcommProtocol) Ah, I didn't see the constant. Yes, that would cause problems. > > You are already creating and starting a QApplication instance in your main > > code. Does removing this help at all? > > Now the program works. And after I removed the duplicate calls to > QApplication, it stopped crashing on exit also :) Excellent! David _______________________________________________ PyQt mailing list [email protected] https://www.riverbankcomputing.com/mailman/listinfo/pyqt