summaryrefslogtreecommitdiffstats
path: root/examples/bluetooth/lowenergyscanner/device.cpp
diff options
context:
space:
mode:
authorNedim Hadzic <nhadzic@blackberry.com>2014-03-20 12:08:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-25 11:46:14 +0100
commitec4aa0bcb592e9668b0767906157a1a51915d76c (patch)
treea3670134427ed8191a247d44031dcdb7135ba212 /examples/bluetooth/lowenergyscanner/device.cpp
parent5c9d111edbdf73a4875bcf9ea02a3057659f7730 (diff)
Added and improved error handling in controller class
Error enums added and implemented together with examples. Change-Id: I912c396080ee9a6b87f41104eb7e41f8c62abf8b Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'examples/bluetooth/lowenergyscanner/device.cpp')
-rw-r--r--examples/bluetooth/lowenergyscanner/device.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/bluetooth/lowenergyscanner/device.cpp b/examples/bluetooth/lowenergyscanner/device.cpp
index 44cd3512..d137fd40 100644
--- a/examples/bluetooth/lowenergyscanner/device.cpp
+++ b/examples/bluetooth/lowenergyscanner/device.cpp
@@ -152,7 +152,8 @@ void Device::scanServices(QString address)
// Connecting signals and slots for connecting to LE services.
info = new QLowEnergyController();
connect(info, SIGNAL(connected(QLowEnergyServiceInfo)), this, SLOT(serviceConnected(QLowEnergyServiceInfo)));
- connect(info, SIGNAL(error(QLowEnergyServiceInfo)), this, SLOT(errorReceived(QLowEnergyServiceInfo)));
+ connect(info, SIGNAL(error(QLowEnergyServiceInfo, QLowEnergyCOntroller::Error)),
+ this, SLOT(errorReceived(QLowEnergyServiceInfo,QLowEnergyCOntroller::Error)));
connect(info, SIGNAL(disconnected(QLowEnergyServiceInfo)), this, SLOT(serviceDisconnected(QLowEnergyServiceInfo)));
}
}
@@ -195,9 +196,9 @@ void Device::serviceConnected(const QLowEnergyServiceInfo &service)
emit characteristicsDone();
}
-void Device::errorReceived(const QLowEnergyServiceInfo &service)
+void Device::errorReceived(const QLowEnergyServiceInfo &service, QLowEnergyController::Error error)
{
- qWarning() << "Error: " << info->errorString() << service.serviceUuid();
+ qWarning() << "Error: " << info->errorString() << service.serviceUuid() << error;
setUpdate(info->errorString());
}