qt-ble: purge pending read data when writing

This should never happen, since our interface is bassically synchronous,
but it could happen with delayed replies that came in just after we
decided to re-transmit a command.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2018-06-20 15:01:35 +09:00 committed by Dirk Hohndel
parent 21d6531e45
commit 98bd303d93

View file

@ -155,6 +155,9 @@ dc_status_t BLEObject::write(const void *data, size_t size, size_t *actual)
if (!receivedPackets.isEmpty()) {
qDebug() << ".. write HIT with still incoming packets in queue";
do {
receivedPackets.takeFirst();
} while (!receivedPackets.isEmpty());
}
QList<QLowEnergyCharacteristic> list = preferredService()->characteristics();