Signal QLowEnergyController::connected/disconnected is not emitted in Qt 6.7
-
I'm migrating an application implementing a BLE Peripheral device using QLowEnergyController from Qt 5.15 to Qt 6.7. The application runs on Linux with BlueZ 5.72.
I observe that the signals QLowEnergyController::connected and QLowEnergyController::disconnected are not emitted on Qt 6.7.
This is also reproducible in the BLE Peripheral example (https://code.qt.io/cgit/qt/qtconnectivity.git/tree/examples/bluetooth/heartrate-server/main.cpp?h=6.7). The "reconnect" lambda is never called. Interestingly, the advertisements restart anyway as soon as the client disconnects.
Is this behavioral change intentional with the new BlueZ-DBus backend introduced in Qt 6.7?
-
I'm migrating an application implementing a BLE Peripheral device using QLowEnergyController from Qt 5.15 to Qt 6.7. The application runs on Linux with BlueZ 5.72.
I observe that the signals QLowEnergyController::connected and QLowEnergyController::disconnected are not emitted on Qt 6.7.
This is also reproducible in the BLE Peripheral example (https://code.qt.io/cgit/qt/qtconnectivity.git/tree/examples/bluetooth/heartrate-server/main.cpp?h=6.7). The "reconnect" lambda is never called. Interestingly, the advertisements restart anyway as soon as the client disconnects.
Is this behavioral change intentional with the new BlueZ-DBus backend introduced in Qt 6.7?
@chitz said in Signal QLowEnergyController::connected/disconnected is not emitted in Qt 6.7:
Is this behavioral change intentional with the new BlueZ-DBus backend introduced in Qt 6.7?
On Linux BlueZ DBus peripheral backend the remote is considered connected when it first reads/writes a characteristic or a descriptor.
(From: https://doc.qt.io/qt-6/qlowenergycontroller.html#connected)
Does this help? It's one of the differences between those two.
-
@chitz said in Signal QLowEnergyController::connected/disconnected is not emitted in Qt 6.7:
Is this behavioral change intentional with the new BlueZ-DBus backend introduced in Qt 6.7?
On Linux BlueZ DBus peripheral backend the remote is considered connected when it first reads/writes a characteristic or a descriptor.
(From: https://doc.qt.io/qt-6/qlowenergycontroller.html#connected)
Does this help? It's one of the differences between those two.
@Pl45m4 said in Signal QLowEnergyController::connected/disconnected is not emitted in Qt 6.7:
On Linux BlueZ DBus peripheral backend the remote is considered connected when it first reads/writes a characteristic or a descriptor.
(From: https://doc.qt.io/qt-6/qlowenergycontroller.html#connected)
Does this help? It's one of the differences between those two.
Based on this I was expecting the
connected()
anddisconnected()
signals to be emitted. But they never are, regardless how many characteristics and/or descriptors I read.I was able to simulate the
connected()
signal through observing thestateChanged()
signal instead. But once the state changes toControllerState::ConnectedState
it never goes back toControllerState::UnconnectedState
. -
@Pl45m4 said in Signal QLowEnergyController::connected/disconnected is not emitted in Qt 6.7:
On Linux BlueZ DBus peripheral backend the remote is considered connected when it first reads/writes a characteristic or a descriptor.
(From: https://doc.qt.io/qt-6/qlowenergycontroller.html#connected)
Does this help? It's one of the differences between those two.
Based on this I was expecting the
connected()
anddisconnected()
signals to be emitted. But they never are, regardless how many characteristics and/or descriptors I read.I was able to simulate the
connected()
signal through observing thestateChanged()
signal instead. But once the state changes toControllerState::ConnectedState
it never goes back toControllerState::UnconnectedState
.@chitz said in Signal QLowEnergyController::connected/disconnected is not emitted in Qt 6.7:
But once the state changes to ControllerState::ConnectedState it never goes back to ControllerState::UnconnectedState.
If you think it's a bug in Qt, you maybe want to file a bug report.
Search the existing bugs first, in case there is already something similar and either provide an example to reproduce it or refer to the Qt example, if it is also not working as expected.