summaryrefslogtreecommitdiffstats
path: root/core/qt-ble.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/qt-ble.cpp')
-rw-r--r--core/qt-ble.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/qt-ble.cpp b/core/qt-ble.cpp
index 6ea59cded..3d29c2550 100644
--- a/core/qt-ble.cpp
+++ b/core/qt-ble.cpp
@@ -60,7 +60,6 @@ void BLEObject::characteristcStateChanged(const QLowEnergyCharacteristic &c, con
Q_UNUSED(c)
receivedPackets.append(value);
- waitForPacket.exit();
}
void BLEObject::writeCompleted(const QLowEnergyDescriptor &d, const QByteArray &value)
@@ -155,13 +154,11 @@ dc_status_t BLEObject::read(void *data, size_t size, size_t *actual)
if (list.isEmpty())
return DC_STATUS_IO;
- QTimer timer;
int msec = BLE_TIMEOUT;
- timer.setSingleShot(true);
-
- waitForPacket.connect(&timer, SIGNAL(timeout()), SLOT(quit()));
- timer.start(msec);
- waitForPacket.exec();
+ while (msec > 0 && receivedPackets.isEmpty()) {
+ waitFor(100);
+ msec -= 100;
+ };
}
// Still no packet?