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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.4.0, 5.5.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Linux/Bluez

      Description

      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.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              ablasche Alex Blasche
              Reporter:
              ablasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes