Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42519

Bluez: QLowEnergyController::connectToDevice() fails if another instance is already connected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2: Important P2: Important
    • None
    • 5.4.0, 5.5.0
    • None
    • Linux/Bluez

      The following code snippet fails on Linux:

      QBluetoothAddress remote("11:22:33:44:55:66");
      
      QLowEnergyController controlA(remote);
      controlA.connectToDevice();
      QVERIFY(controlA.state == ConnectedState);
      
      QLowEnergyController controlB(remote);
      controlB.connectToDevice();
      QVERIFY(controlB.state == ConnectedState);
      

      The second connectToDevice() fails as long as A maintains its connection. This is due to the fact that only one LLCP connection can be maintained to the remote device. What is required is some form of connection sharing. Presumably with proper Bluez/client API support this could work. However at the time of the implementaiton there was no such API.

      This does work on Android. The tst_QLowEnergyController::tst_concurrentDiscovery() function verifies the current/wrong behavior on Linux.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ablasche Alex Blasche
            ablasche Alex Blasche
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes