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

Bluetooth (Linux bluez) fails to connectToService

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11
    • Commits:
      fb03b1e921e641a106722f8f3d59861ce7e6789e (qt/qtconnectivity/5.12)

      Description

      Existing code base suddenly fails on a QBluetoothSocket::connectToService() call after upgrading to Qt 5.12.0. The core is basically nothing more than:

      socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
      socket->connectToService(remoteDeviceAddress, 1, QIODevice::ReadWrite | QIODevice::Unbuffered);
      

      This results in a message in the console: Connecting to port is not supported (Uuid required) . Up to now, I did not find any documentation telling that this is not supported any more. This, I consider part 1) of this issue.

      Ok, then I adapted the above code to use an uuid. No service scan is done (we know what to connect to), and the used uuid is the well known Bluetooth SSP one. Running this fails immediately with the message:

      QDBusPendingReply: type ManagedObjectList is not registered with QtDBus. I verified this in Qt's source code, and see that the

      qDBusRegisterMetaType<ManagedObjectList>();
      

      call is only in the file bluez5_helper.cpp in the function

      bool isBluez5()
      

      Verified that in this scenario (no scan for BT addresses or services), indeed the ManagedObjectList is not registered, so the console message is valid. Further, when I force a scan for BT addresses I see that the ManagedObjectList is properly registered, and a subsequent connectToService() succeeds. When this is intended behavior, this needs to be documented, but this does not feel like intended behavior to me. This, I consider part 2) of this issue.

        Attachments

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

          Activity

            People

            Assignee:
            ablasche Alex Blasche
            Reporter:
            jlm Jan Mulder
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes