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:
parent
21d6531e45
commit
98bd303d93
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user