mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue