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

QBluetoothServiceDiscoveryAgent returns incorrect non-standard/custom Bluetooth uuid for remote service

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.9.1
    • 5.9.0
    • None
    • Android

    Description

      When running a service discovery on Android and a non-standard Bluetooth UUID is found, the returned UUID is not correct. To take an example, the custom UUID

      e8e10f95-1a70-4b27-9ccf-02010264e9c8

      is used by QtBluetooth's btchat example or the bttestui example. Android version 6.0.1 or above return/discover the following incorrect UUID though:

      c8e96402-0102-cf9c-274b-701a950fe1e8

      The individual bytes have been incorrectly swapped around. This bug is tracked as

      https://issuetracker.google.com/issues/37076498

      This is an Android bug and QtBluetooth can only work around the issue. User code may use the following code to reverse the byte order:

          quint128 buffer = QBluetoothUuid(...).toUInt128();
          quint128 correctedUuid = {};
          for (int i = 0; i < 16; i++)
              correctedUuid.data[15 - i] = buffer.data[i];
          result = QBluetoothUuid(correctedUuid);
      

      The bug does not happen when the service's uuid is a standard UUID derived from the Bluetooth base UUID (00000000-0000-1000-8000-00805F9B34FB).

      Attachments

        Issue Links

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

          Activity

            People

              ablasche Alex Blasche
              ablasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes