1 Commits

Author SHA1 Message Date
8a4098b864 work in progress 2023-01-19 22:38:37 +01:00
2 changed files with 5 additions and 5 deletions

View File

@ -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>(&QBluetoothDeviceDiscoveryAgent::error),
connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered, this, &DeviceFinder::addDevice);
connect(m_deviceDiscoveryAgent, static_cast<void (QBluetoothDeviceDiscoveryAgent::*)(QBluetoothDeviceDiscoveryAgent::Error)>(&QBluetoothDeviceDiscoveryAgent::errorOccurred),
this, &DeviceFinder::scanError);
connect(&m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished, this, &DeviceFinder::scanFinished);

View File

@ -52,7 +52,7 @@ void DeviceHandler::setDevice(const QBluetoothDeviceInfo &device)
connect(m_control, &QLowEnergyController::discoveryFinished,
this, &DeviceHandler::serviceScanDone);
connect(m_control, static_cast<void (QLowEnergyController::*)(QLowEnergyController::Error)>(&QLowEnergyController::error),
connect(m_control, static_cast<void (QLowEnergyController::*)(QLowEnergyController::Error)>(&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"));
}