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

QBluetoothLocalDevice - connectedDevices is not up to date after disconnect signal is trapped by QLowEnergyController

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 5.11.3
    • None
    • Linux/Other display system

    Description

      Hi,

      After QLowEnergyController as Central detects a disconnect with a ble peripheral, and the call connectedDevices for the QBluetoothLocalDevice object is made, the connectedDevices still has it in his list as connected.

       

      I have made the following code:

      int connected(0); QString objectPath; QString addr;

      for(auto address : connectedDevices())

      {

      addr = address.toString().replace(":", "_");

      objectPath = QString("/org/bluez/hci0/dev_%1").arg(addr); 

      qDebug()<<"Object path = "<<objectPath<<endl;

      OrgBluezDevice1Interface bluez5DeviceInterface(QStringLiteral("org.bluez"), objectPath, QDBusConnection::systemBus()));

       

      if (bluez5DeviceInterface.connected())  ----> will correctly return false

      { connected++; }

      qDebug()<<"Number of connected devices = "<<connectedDevices().size()<<" via Dbus "<<connected<<endl; 

       

      The Dbus call to the connected property will (correctly) no longer see it as connected. 

      Best regards,

      Frank

       

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes