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

QBluetoothServiceInfo::setAttribute() with signed int values writes incorrect XML output on BlueZ.

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/Wayland, Linux/X11
    • Commits:
      1b19d7981610c2a9587544da654b4ca783e1bf6b (qt/qtconnectivity/5.12)

      Description

      The XML output writes signed ints in hex format but w/out the "0x" prefix. So (as I understand it) SDP tries to parse them as base-10 values. E.g. using sdptool to view the resulting service record will show the attribute is ignored entirely when a hex letter (a-f) is present, or wrong when the base 10 value doesn't correspond to the base 16 value. See the code here (qbluetoothserviceinfo_bluez.cpp::writeAttribute where it handles Char/Short/Int types).

      Unsigned ints are written properly.

      I'm not sure how many attributes actually use signed values... so that's probably why this was never noticed. I only noticed by accident when I didn't properly QVariant::fromValue() my signed ints.

      Thanks,
      -Max

        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:
              mpaperno Maxim Paperno
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes