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

QBluetoothDeviceInfo.serviceUuids() always returns empty QList

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.5.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Android 5.1.1 on a Nexus 5

      Description

      In my experience, the serviceUuids() function returns an empty QList even when I know (from using a a packet sniffer) that the advertising packets from the device includes at least one UUID in a field such as the Complete List of 16 bit Service UUIDs field.

      For example, consider his packet:

      AdvData=0x02 01 06 03 03 0D 18 03 19 40 03 02 0A FE 0E 09 43 53 52 20 48 52 20 53 65 6E 73 6F 72
      02 01 06 = Flags, LE General Discoverable Mode, BR/EDR Not Supported
      03 03 0D 18 = complete list of 16 bit UUIDs = 0x180D = Heart Rate Service
      03 19 40 03 = Appearance = Generic Heart rate Sensor
      02 0A FE = TX Power Level = 254 = -2 (signed char)
      0E 09 43 53 52 20 48 52 20 53 65 6E 73 6F 72 = Local name = CSR HR Sensor

      Note the 0x180D service UUID.

      Qt code (added to the example heartlistener app)....

      // BUG? serviceUuids always seems to return an empty list even when I know the AD packets contain service UUIDs
      QList<QBluetoothUuid> uuids = device.serviceUuids();
      qDebug() << "# service UUIDs=" << uuids.length();

      ...and yields the following log output:

      W/libheartlistener.so(30652): ../heartlistener/heartrate.cpp:83 (void HeartRate::addDevice(const QBluetoothDeviceInfo&)): Discovered LE Device name: "CSR HR Sensor" Address: "00:02:5B:00:15:10"
      D/libheartlistener.so(30652): ../heartlistener/heartrate.cpp:87 (void HeartRate::addDevice(const QBluetoothDeviceInfo&)): UUIDs:
      D/libheartlistener.so(30652): ../heartlistener/heartrate.cpp:90 (void HeartRate::addDevice(const QBluetoothDeviceInfo&)): # service UUIDs= 0

        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:
              bluetooth_mdw Martin Woolley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes