<div dir="ltr">Hi to all,<br><br>I've read the official tutorial of QBluetooth C++ on <a href="https://doc.qt.io/qt-5/qtbluetooth-btchat-example.html">https://doc.qt.io/qt-5/qtbluetooth-btchat-example.html</a>, I tested it on my PC and it works very. I would like to adapt that code to PyQT to test a Bluetooth Server, after digging in the PyQT Docs I have figure out that class <b>QBluetoothServiceInfo::Sequence</b> doesn't exist. This class is defined for configure the PublicBrowseGroup and protocolDescriptorList parameters.<br><br>While there isn't enough info about BT Server on PyQT, I've tried to adapt the code in my way but I haven't got success to connect my Phone to my PC like the C++ code does while I haven't had a Python or qt.bluetooth.bluez error. If I can find my error, I will implement this code inside a Thread on a GUI.<br><br>I wonder if PyQT has full support for QBluetooth or Am I doing something wrong?<br><br>Thanks for your time for reading this, any reply is appreciated. <div><br></div><div>Sincerely, <br><br></div><div>José Jácome<br><br></div><div>There is the class I'm testing<br></div><div><br></div><div>[CODE]<br>#!/usr/bin/env python3<br><br>from PyQt5.QtBluetooth import *<br>from PyQt5.QtCore import *<br><br>class BTServer():<br>    '''<br>        Class based on: <a href="https://doc.qt.io/qt-5/qtbluetooth-btchat-example.html">https://doc.qt.io/qt-5/qtbluetooth-btchat-example.html</a><br>    '''<br>    def __init__(self):<br>        self.startServer()<br>    def startServer(self, localAdapter=QBluetoothAddress()):<br>        self.rfcommServer = QBluetoothServer(QBluetoothServiceInfo.RfcommProtocol)<br>        self.rfcommServer.newConnection.connect(self.clientConnected)<br>        self.result = self.rfcommServer.listen(localAdapter)<br>        self.clientSockets = []<br>        if not self.result:<br>            print("Cannot bind chat server to: " + localAdapter.toString())<br>        self.serviceInfo = QBluetoothServiceInfo()<br>        self.serviceInfo.setAttribute(QBluetoothServiceInfo.ServiceName, "Bt Chat Server")<br>        self.serviceInfo.setAttribute(QBluetoothServiceInfo.ServiceDescription,<br>                         "Example bluetooth chat server")<br>        self.serviceInfo.setAttribute(QBluetoothServiceInfo.ServiceProvider, "<a href="http://qt-project.org">qt-project.org</a>")<br>        self.serviceUuid = QBluetoothUuid("e8e10f95-1a70-4b27-9ccf-02010264e9c8")<br>        self.serviceInfo.setServiceUuid(QBluetoothUuid(self.serviceUuid))<br>        self.PublicBrowseGroup = [QVariant(QBluetoothUuid(QBluetoothUuid.PublicBrowseGroup))]<br>        self.serviceInfo.setAttribute(QBluetoothServiceInfo.BrowseGroupList, self.PublicBrowseGroup)<br>        self.protocolDescriptorList = [QBluetoothUuid(QBluetoothUuid.L2cap),<br>                                       QBluetoothUuid(QBluetoothUuid.Rfcomm),<br>                                       int(self.rfcommServer.serverPort())]<br>        print(self.protocolDescriptorList)<br>        self.serviceInfo.setAttribute(QBluetoothServiceInfo.ProtocolDescriptorList,<br>                         self.protocolDescriptorList);<br>        self.serviceInfo.registerService(localAdapter)<br><br>    def clientConnected(self):<br>        self.socket = self.rfcommServer.nextPendingConnection()<br>        if not self.socket:<br>            return<br>        self.rfcommServer.readyRead.connect(self.readSocket)<br>        self.rfcommServer.disconnected.connect(self.clientDisconnected)<br>        self.clientSockets.append(self.socketBT)<br>        print(self.socketBT.peerName())<br>    def readSocket(self):<br>        print("Socket data")<br>    def clientDisconnected(self):<br>        print("Client Disconected")<br></div><div>[/CODE]<br></div><div><b></b></div></div>