summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/doc/snippets
diff options
context:
space:
mode:
authorAndreas Buhr <andreas@andreasbuhr.de>2021-02-26 14:54:33 +0100
committerAndreas Buhr <andreas@andreasbuhr.de>2021-03-11 13:01:51 +0100
commit66bb9839dbccea311cbb85168da86fb6d4a2d136 (patch)
treec9b535e4de503c0a2e0f998203bb6f94fcddf3ce /src/bluetooth/doc/snippets
parent61e2bab1d06f3f460f382f911bfd23edaef124e7 (diff)
Use scoped enum for constants in QBluetoothUuid
QBluetoothUuid contains enums for ProtocolUuid, ServiceClassUuid, CharacteristicType and DescriptorType. So far, they all put their constants directly into the QBluetoothUuid namespace, making it easy to mix them up. This patch changes those to scoped enums. That way, each enum has its items in its own namespace. Change-Id: I86ea08ff31009dc8073d84cfe678e27920d693f7 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/bluetooth/doc/snippets')
-rw-r--r--src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
index 870f7cdf..a571de32 100644
--- a/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
+++ b/src/bluetooth/doc/snippets/doc_src_qtbluetooth.cpp
@@ -170,8 +170,8 @@ void MyClass::btleSharedData()
// waiting for connection
- first = control.createServiceObject(QBluetoothUuid::BatteryService);
- second = control.createServiceObject(QBluetoothUuid::BatteryService);
+ first = control.createServiceObject(QBluetoothUuid::ServiceClassUuid::BatteryService);
+ second = control.createServiceObject(QBluetoothUuid::ServiceClassUuid::BatteryService);
Q_ASSERT(first->state() == QLowEnergyService::DiscoveryRequired);
Q_ASSERT(first->state() == second->state());
@@ -190,7 +190,7 @@ void MyClass::enableCharNotifications()
control->connectToDevice();
- service = control->createServiceObject(QBluetoothUuid::BatteryService, this);
+ service = control->createServiceObject(QBluetoothUuid::ServiceClassUuid::BatteryService, this);
if (!service)
return;
@@ -201,12 +201,12 @@ void MyClass::enableCharNotifications()
//! [enable_btle_notifications]
//PreCondition: service details already discovered
QLowEnergyCharacteristic batteryLevel = service->characteristic(
- QBluetoothUuid::BatteryLevel);
+ QBluetoothUuid::CharacteristicType::BatteryLevel);
if (!batteryLevel.isValid())
return;
QLowEnergyDescriptor notification = batteryLevel.descriptor(
- QBluetoothUuid::ClientCharacteristicConfiguration);
+ QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration);
if (!notification.isValid())
return;