Index: sources/bluetooth/BluetoothInterface.cpp =================================================================== diff -u -rf2e4eba6e85c5d36537be782926f23cc9dc01037 -r57ea732311e6f4c746974f5a52316f63dec23ca8 --- sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision f2e4eba6e85c5d36537be782926f23cc9dc01037) +++ sources/bluetooth/BluetoothInterface.cpp (.../BluetoothInterface.cpp) (revision 57ea732311e6f4c746974f5a52316f63dec23ca8) @@ -672,7 +672,7 @@ void BluetoothInterface::onServiceCharacteristicChanged (const QLowEnergyCharacteristic &vCharacteristic, const QByteArray &vValue) { QLowEnergyService *service = reinterpret_cast(sender()); NOTIFY_DETAILS_CHANGE - if (vCharacteristic.uuid() == QBluetoothUuid(QBluetoothUuid::BloodPressureMeasurement)) + if (vCharacteristic.uuid() == QBluetoothUuid(QBluetoothUuid::CharacteristicType::BloodPressureMeasurement)) { interpretBloodPressure(vValue); } @@ -731,7 +731,7 @@ void BluetoothInterface::onServiceDescriptorWritten (const QLowEnergyDescriptor &vDescriptor , const QByteArray &vValue) { QLowEnergyService *service = reinterpret_cast(sender()); NOTIFY_CONFIG_WRITE - if ( vDescriptor.uuid() == QBluetoothUuid(QBluetoothUuid::ClientCharacteristicConfiguration) && vValue == _bloodPressureNotifyValue ) { + if ( vDescriptor.uuid() == QBluetoothUuid(QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration) && vValue == _bloodPressureNotifyValue ) { _reconnectionActive = true; } } @@ -756,20 +756,20 @@ if ( ! sender() ) return; QLowEnergyService *service = reinterpret_cast(sender()); switch (vState) { - case QLowEnergyService::ServiceDiscovered : { + case QLowEnergyService::RemoteServiceDiscovered : { NOTIFY_SERVICE_DETAILS_DONE - switch( service->serviceUuid().toUInt32() ) { - case QBluetoothUuid::BloodPressure: + switch( QBluetoothUuid::ServiceClassUuid(service->serviceUuid().toUInt32()) ) { + case QBluetoothUuid::ServiceClassUuid::BloodPressure: enableNotify(); break; - case QBluetoothUuid::DeviceInformation: + case QBluetoothUuid::ServiceClassUuid::DeviceInformation: interpretInformation(); break; - case QBluetoothUuid::BatteryService : { + case QBluetoothUuid::ServiceClassUuid::BatteryService : { int index = 0; - QByteArray data = service->characteristic(QBluetoothUuid::BatteryLevel).value(); + QByteArray data = service->characteristic(QBluetoothUuid::CharacteristicType::BatteryLevel).value(); Types::U08 batteryLevel; if (GetValue(data, index, batteryLevel)) { _tempBatt = batteryLevel.value; @@ -940,7 +940,7 @@ * \return true if the name provided starts with one of the supported keywords mentioned in the Omron documentation */ bool BluetoothInterface::isDeviceSupported( const QString &vName ) { - for (const QString &name : qAsConst(_supportedDeviceKeywords) ) + for (const QString &name : std::as_const(_supportedDeviceKeywords) ) if ( vName.startsWith(name) ) return true; return false; @@ -995,6 +995,7 @@ switch(_device->state()) { case QLowEnergyController::ConnectingState : SKIPPER_TRY; + Q_FALLTHROUGH(); // FALLTHROUGH case QLowEnergyController::DiscoveredState : @@ -1082,22 +1083,22 @@ */ void BluetoothInterface::makeServices(const QBluetoothUuid &vService) { - if (vService == QBluetoothUuid (QBluetoothUuid::DeviceInformation )) { + if (vService == QBluetoothUuid (QBluetoothUuid::ServiceClassUuid::DeviceInformation )) { _serviceDeviceInformation = _device->createServiceObject(vService, this); initConnectionsService (_serviceDeviceInformation ); return; } - if (vService == QBluetoothUuid (QBluetoothUuid::CurrentTimeService )) { + if (vService == QBluetoothUuid (QBluetoothUuid::ServiceClassUuid::CurrentTimeService )) { _serviceCurrentTime = _device->createServiceObject(vService, this); initConnectionsService (_serviceCurrentTime ); return; } - if (vService == QBluetoothUuid (QBluetoothUuid::BloodPressure )) { + if (vService == QBluetoothUuid (QBluetoothUuid::ServiceClassUuid::BloodPressure )) { _serviceBloodPressure = _device->createServiceObject(vService, this); initConnectionsService (_serviceBloodPressure ); return; } - if (vService == QBluetoothUuid (QBluetoothUuid::BatteryService )) { + if (vService == QBluetoothUuid (QBluetoothUuid::ServiceClassUuid::BatteryService )) { _serviceBattery = _device->createServiceObject(vService, this); initConnectionsService (_serviceBattery ); return; @@ -1174,8 +1175,8 @@ } // blood pressure measurements - const QLowEnergyCharacteristic detailBPMeas = _serviceBloodPressure->characteristic(QBluetoothUuid(QBluetoothUuid::BloodPressureMeasurement)); - QLowEnergyDescriptor configBPMeas = detailBPMeas.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration); + const QLowEnergyCharacteristic detailBPMeas = _serviceBloodPressure->characteristic(QBluetoothUuid(QBluetoothUuid::CharacteristicType::BloodPressureMeasurement)); + const QLowEnergyDescriptor configBPMeas = detailBPMeas.descriptor(QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration); if (configBPMeas.isValid()) _serviceBloodPressure->writeDescriptor(configBPMeas, _bloodPressureNotifyValue); } @@ -1253,7 +1254,7 @@ return; } // blood pressure feature - const QLowEnergyCharacteristic detailBPFeat = _serviceBloodPressure->characteristic(QBluetoothUuid(QBluetoothUuid::BloodPressureFeature)); + const QLowEnergyCharacteristic detailBPFeat = _serviceBloodPressure->characteristic(QBluetoothUuid(QBluetoothUuid::CharacteristicType::BloodPressureFeature)); if (!detailBPFeat.isValid()) { qDebug() << "Blood pressure feature not found."; return; @@ -1285,7 +1286,7 @@ return; } // battery level percent - const QLowEnergyCharacteristic detail = _serviceBloodPressure->characteristic(QBluetoothUuid(QBluetoothUuid::BatteryLevel)); + const QLowEnergyCharacteristic detail = _serviceBloodPressure->characteristic(QBluetoothUuid(QBluetoothUuid::CharacteristicType::BatteryLevel)); if (!detail.isValid()) { qDebug() << "Battery level not found."; return;