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

BLE - discovery filter configuration is limited to transport method only

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Linux, BlueZ 5
    • Platform/s:
      All

      Description

      With BlueZ, it is possible (using bluetoothctl) to type the following sequence of commands to configure the Bluetooth device discovery:

      $ bluetoothctl
      [bluetooth]# menu scan
      [bluetooth]# uuids AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE
      [bluetooth]# transport le
      [bluetooth]# rssi XYZ
      [bluetooth]# duplicate-data XYZ
      [bluetooth]# rssi XYZ
      ...

      We can achieve the same thing using the BlueZ's D-Bus interface. In fact, Qt is already doing it, but ONLY for the transport setting (from qbluetoothdevicediscoveryagent_bluez.cpp, lines 262-272):

      QVariantMap map;
      if (methods == (QBluetoothDeviceDiscoveryAgent::LowEnergyMethod|QBluetoothDeviceDiscoveryAgent::ClassicMethod))
          map.insert(QStringLiteral("Transport"), QStringLiteral("auto"));
      else if (methods & QBluetoothDeviceDiscoveryAgent::LowEnergyMethod)
          map.insert(QStringLiteral("Transport"), QStringLiteral("le"));
      else
          map.insert(QStringLiteral("Transport"), QStringLiteral("bredr"));
      
      // older BlueZ 5.x versions don't have this function
      // filterReply returns UnknownMethod which we ignore
      QDBusPendingReply<> filterReply = adapterBluez5->SetDiscoveryFilter(map);
      

      We would like to set the vendor-specific 128 bit UUID to the discovery filter, so only devices with this UUID are discovered. Qt's Bluetooth discovery filter shall include this feature - without it, we can't use a large part of the Qt's Bluetooth stack, and have to implement our own D-Bus interface, because connecting to each device in range to read the "GenericAccess" and "DeviceInformation" services is very time consuming.

       

       

        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:
            pohlondrej Ondřej Pohl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes