Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can't connect to bluetooth device after using QBluetoothServer.

Can't connect to bluetooth device after using QBluetoothServer.

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 274 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Piotrrr
    wrote on last edited by Piotrrr
    #1

    Hello.

    I have a problem with Qt bluetooth. In my app I create a QBluetoothServer and call it's listen method to receive upcoming connections from paired devices. But I have some devices that I need to establish connection from the app using QBluetoothSocket and it's connectToService() method. Both methods works but ONLY if I don't use it in the same application. I notice when I create a server and later try to connect with QBluetoothSocket it connects and disconnects after a while. When I comment out the line where I call server->listen(QBluetoothUuid::SerialPort); then the QBluetoothSocket method works normally , I can connect with connectToService(). I need to use both approaches because my app is supposed to receive data from medical devices that tries to connect automatically when they takes measurements (blood pressure, scale) and I have devices that doesn't do that - the user have to manually select the device from the list and click connect.
    I tried to close the server before establishing the connection but it didn't solve the problem. I assume that the running server blocks the QBluetoothSocket from establishing a connection and it's close method is not enough to unlock it. Can I do something to make it work?

    Thanks.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved