summaryrefslogtreecommitdiffstats
path: root/tradeshow/iot-sensortag/bluetoothdevice.cpp
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2017-02-15 10:04:02 +0100
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2017-02-16 13:35:53 +0000
commit70d32b0ef01d7fd445c8173b8d0a19e8831e4609 (patch)
tree28a2c276515dbcd08ff8502822483ebc627df8dd /tradeshow/iot-sensortag/bluetoothdevice.cpp
parent7053af71846706006ec58afbb829291909726c7a (diff)
iot-sensortag: BluetoothDevice: Remove unused members
Change-Id: I6b3467541950df284f37d3b823c9fdfb535593ce Reviewed-by: Titta Heikkala <titta.heikkala@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/bluetoothdevice.cpp')
-rw-r--r--tradeshow/iot-sensortag/bluetoothdevice.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/tradeshow/iot-sensortag/bluetoothdevice.cpp b/tradeshow/iot-sensortag/bluetoothdevice.cpp
index 2ae28ef..83a2091 100644
--- a/tradeshow/iot-sensortag/bluetoothdevice.cpp
+++ b/tradeshow/iot-sensortag/bluetoothdevice.cpp
@@ -74,15 +74,13 @@ typedef struct {
} movement_data_t;
BluetoothDevice::BluetoothDevice()
- : discoveryAgent(0)
- , controller(0)
+ : controller(0)
, irTemperatureService(0)
, baroService(0)
, humidityService(0)
, lightService(0)
, motionService(0)
, m_deviceState(DeviceState::Disconnected)
- , randomAddress(false)
{
lastMilliseconds = QDateTime::currentMSecsSinceEpoch();
statusUpdated("Device created");
@@ -96,7 +94,6 @@ BluetoothDevice::BluetoothDevice(const QBluetoothDeviceInfo &d)
BluetoothDevice::~BluetoothDevice()
{
- delete discoveryAgent;
delete controller;
}
QString BluetoothDevice::getAddress() const
@@ -117,15 +114,8 @@ QString BluetoothDevice::getName() const
void BluetoothDevice::scanServices()
{
- statusUpdated("(Connecting to device...)");
-
- if (controller && m_previousAddress != getAddress()) {
- controller->disconnectFromDevice();
- delete controller;
- controller = 0;
- }
-
if (!controller) {
+ statusUpdated("(Connecting to device...)");
// Connecting signals and slots for connecting to LE services.
controller = new QLowEnergyController(m_deviceInfo);
connect(controller, SIGNAL(connected()),
@@ -138,13 +128,10 @@ void BluetoothDevice::scanServices()
this, SLOT(addLowEnergyService(QBluetoothUuid)));
connect(controller, SIGNAL(discoveryFinished()),
this, SLOT(serviceScanDone()));
- }
- if (randomAddress)
- controller->setRemoteAddressType(QLowEnergyController::RandomAddress);
- else
controller->setRemoteAddressType(QLowEnergyController::PublicAddress);
- controller->connectToDevice();
+ controller->connectToDevice();
+ }
}
void BluetoothDevice::addLowEnergyService(const QBluetoothUuid &serviceUuid)
@@ -222,8 +209,6 @@ void BluetoothDevice::serviceScanDone()
if (!motionService)
qCDebug(boot2QtDemos) << "Motion service not found.";
-
- attitudeChangeInterval.restart();
}
void BluetoothDevice::temperatureDetailsDiscovered(QLowEnergyService::ServiceState newstate)