From 8a4098b8642b13456ac73b7644e0cb66addc08b5 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Thu, 19 Jan 2023 22:36:54 +0100 Subject: [PATCH] work in progress --- devicefinder.cpp | 4 ++-- devicehandler.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/devicefinder.cpp b/devicefinder.cpp index e48c778..bf9daab 100644 --- a/devicefinder.cpp +++ b/devicefinder.cpp @@ -12,8 +12,8 @@ DeviceFinder::DeviceFinder(QObject *parent): { m_deviceDiscoveryAgent.setLowEnergyDiscoveryTimeout(5000); - connect(&m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &DeviceFinder::addDevice); - connect(&m_deviceDiscoveryAgent, qOverload(&QBluetoothDeviceDiscoveryAgent::error), + connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &DeviceFinder::addDevice); + connect(m_deviceDiscoveryAgent, static_cast(&QBluetoothDeviceDiscoveryAgent::errorOccurred), this, &DeviceFinder::scanError); connect(&m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished, this, &DeviceFinder::scanFinished); diff --git a/devicehandler.cpp b/devicehandler.cpp index 432168a..365bc0d 100644 --- a/devicehandler.cpp +++ b/devicehandler.cpp @@ -52,7 +52,7 @@ void DeviceHandler::setDevice(const QBluetoothDeviceInfo &device) connect(m_control, &QLowEnergyController::discoveryFinished, this, &DeviceHandler::serviceScanDone); - connect(m_control, static_cast(&QLowEnergyController::error), + connect(m_control, static_cast(&QLowEnergyController::errorOccurred), this, [this](QLowEnergyController::Error error) { Q_UNUSED(error); setError("Cannot connect to remote device."); @@ -228,7 +228,7 @@ void DeviceHandler::serviceStateChanged(QLowEnergyService::ServiceState s) switch (s) { - case QLowEnergyService::DiscoveringServices: + case QLowEnergyService::RemoteServiceDiscovering: setInfo(tr("Discovering services...")); break; case QLowEnergyService::ServiceDiscovered: @@ -237,7 +237,7 @@ void DeviceHandler::serviceStateChanged(QLowEnergyService::ServiceState s) if (const QLowEnergyCharacteristic hrChar = m_service->characteristic(livestatsCharacUuid); hrChar.isValid()) { - m_notificationDescLivestats = hrChar.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration); + m_notificationDescLivestats = hrChar.descriptor(QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration); if (m_notificationDescLivestats.isValid()) m_service->writeDescriptor(m_notificationDescLivestats, QByteArray::fromHex("0100")); }