summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/plugins/sensors/sensortag/sensortagbase.cpp14
2 files changed, 8 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13f1bb9d..230ad6a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@ project(QtSensors
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core)
find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS
- Xml Gui Widgets Quick Qml Svg DBus Multimedia
+ Xml Gui Widgets Quick Qml Svg DBus Multimedia Bluetooth
)
qt_build_repo()
diff --git a/src/plugins/sensors/sensortag/sensortagbase.cpp b/src/plugins/sensors/sensortag/sensortagbase.cpp
index 322a86d7..f873c8d3 100644
--- a/src/plugins/sensors/sensortag/sensortagbase.cpp
+++ b/src/plugins/sensors/sensortag/sensortagbase.cpp
@@ -59,7 +59,7 @@ void SensorTagBasePrivate::deviceSearch()
connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::deviceDiscovered,
this, &SensorTagBasePrivate::deviceFound);
- connect(m_deviceDiscoveryAgent, QOverload<QBluetoothDeviceDiscoveryAgent::Error>::of(&QBluetoothDeviceDiscoveryAgent::error),
+ connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::errorOccurred,
this, &SensorTagBasePrivate::deviceScanError);
connect(m_deviceDiscoveryAgent, &QBluetoothDeviceDiscoveryAgent::finished,
this, &SensorTagBasePrivate::scanFinished);
@@ -85,23 +85,23 @@ void SensorTagBasePrivate::deviceFound(const QBluetoothDeviceInfo &device)
//mac uses deviceUuid
const QUuid watchForId(idString);
- bool ok;
+ bool ok(false);
if ((!watchForAddress.isNull() && watchForAddress == device.address()) ||
- (!watchForId.isNull() && watchForId == device.deviceUuid())) {
+ (!watchForId.isNull() && QBluetoothUuid(watchForId) == device.deviceUuid())) {
ok = true;
}
if (ok || device.name().contains("SensorTag")) {
m_deviceDiscoveryAgent->stop();
- m_control = new QLowEnergyController(device.address(), this);
+ m_control = QLowEnergyController::createCentral(device, this);
connect(m_control, &QLowEnergyController::discoveryFinished,
this, &SensorTagBasePrivate::serviceDiscoveryFinished);
connect(m_control, &QLowEnergyController::serviceDiscovered,
this, &SensorTagBasePrivate::serviceDiscovered);
- connect(m_control, QOverload<QLowEnergyController::Error>::of(&QLowEnergyController::error),
+ connect(m_control, &QLowEnergyController::errorOccurred,
this, &SensorTagBasePrivate::controllerError);
connect(m_control, &QLowEnergyController::connected,
this, &SensorTagBasePrivate::sensortagDeviceConnected);
@@ -218,7 +218,7 @@ void SensorTagBasePrivate::doConnections(QLowEnergyService *service)
connect(service,SIGNAL(error(QLowEnergyService::ServiceError)),
this,SLOT(serviceError(QLowEnergyService::ServiceError)));
- if (service->state() == QLowEnergyService::DiscoveryRequired) {
+ if (service->state() == QLowEnergyService::RemoteService) {
service->discoverDetails();
} else if (!enabledServiceUuids.isEmpty()
&& enabledServiceUuids.contains(service->serviceUuid())) {
@@ -229,7 +229,7 @@ void SensorTagBasePrivate::doConnections(QLowEnergyService *service)
void SensorTagBasePrivate::serviceStateChanged(QLowEnergyService::ServiceState newState)
{
- if (newState != QLowEnergyService::ServiceDiscovered)
+ if (newState != QLowEnergyService::RemoteServiceDiscovered)
return;
QLowEnergyService *m_service = qobject_cast<QLowEnergyService *>(sender());