summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner/device.cpp
diff options
context:
space:
mode:
authorAndreas Buhr <andreas@andreasbuhr.de>2021-03-18 09:57:18 +0100
committerAndreas Buhr <andreas.buhr@qt.io>2021-04-08 16:57:19 +0200
commit62cc018b3cad685414b50a9c489d3dc9e45970e7 (patch)
treee05232b34aab869dbf4c3e65c1b21aa2d62a9964 /examples/bluetooth/lowenergyscanner/device.cpp
parent2dab70c2ec3675f767cd37f196fdc14d078e649c (diff)
Change QLowEnergyService::ServiceState enum to reflect future changes
In the future, discoverDetails() should become optional. The state of a QLowEnergyService after its creation should have a name which does not imply it is not functional yet. This patch changes the name of the initial state from "DiscoveryRequired" to the neutral "RemoteService". Task-number: QTBUG-75340 Change-Id: Ib407e60f5fc7264a04a124561dacbcebb01bf252 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples/bluetooth/lowenergyscanner/device.cpp')
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index be3f3103..22c475e4 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -252,7 +252,7 @@ void Device::connectToService(const QString &uuid)
m_characteristics.clear();
emit characteristicsUpdated();
- if (service->state() == QLowEnergyService::DiscoveryRequired) {
+ if (service->state() == QLowEnergyService::RemoteService) {
//! [les-service-3]
connect(service, &QLowEnergyService::stateChanged,
this, &Device::serviceDetailsDiscovered);
@@ -314,12 +314,12 @@ void Device::deviceDisconnected()
void Device::serviceDetailsDiscovered(QLowEnergyService::ServiceState newState)
{
- if (newState != QLowEnergyService::ServiceDiscovered) {
+ if (newState != QLowEnergyService::RemoteServiceDiscovered) {
// do not hang in "Scanning for characteristics" mode forever
// in case the service discovery failed
// We have to queue the signal up to give UI time to even enter
// the above mode
- if (newState != QLowEnergyService::DiscoveringService) {
+ if (newState != QLowEnergyService::RemoteServiceDiscovering) {
QMetaObject::invokeMethod(this, "characteristicsUpdated",
Qt::QueuedConnection);
}