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

Bluez peripheral connection update request doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2
    • None
    • Linux/X11

    Description

      The QLowEnergyController:: requestConnectionUpdate can be used to request BT LE connection parameters. A bluetooth LE device can be in a peripheral or central role. It seems the connection update request on Bluez peripheral does not work properly.

      On Linux the bluetooth stack is Bluez and it does not support requesting connection parameter updates when in peripheral role. This can be observed for example with the "hcitool lecup" command line utility. Due to this Bluez limitation Qt has implemented a workaround in which the update request is wrapped in an ACL command.

      It seems that something has changed and this workaround generates a side-effect which renders the lc2pSocket unusable. The connection parameter update request itself works fine; the "request" and the "accept" from the remote central can be seen on the wire. However after this configuration, the socket used for sending data no longer sends data from the peripheral device.

      The socket appears to be in a working condition and the socket ::write() succeeds fine. However the data never leaves the device. There are no obvious errors or warnings visible. If one keeps on writing to the socket on the peripheral side, eventually the buffers will get full and writes start to fail. It is not clear why this happens and on what exact level.

      There are some possible workarounds by configuring the parameters on the Bluez itself, outside of Qt. This way there is no need for runtime connection update requests.

      Possible workaround 1

      If the HCI kernel filesystem interface is configured, configure by setting values in
      /sys/kernel/debug/bluetooth/hciX/conn_*
      Whether or not this is possible (exposed by the kernel) depends on the kernel configuration.

      Possible workaround 2

      With more recent Bluez versions (tested with 5.60) the parameters are configurable in the conf file.
      As an example one can set:

      /etc/bluetooth/main.conf
      [LE]
      MinConnectionInterval=30
      MaxConnectionInterval=30
      ConnectionLatency=0
      ConnectionSupervisionTimeout=5000
      

      Attachments

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

        Activity

          People

            ablasche Alex Blasche
            vuokko Juha Vuolle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes