From 912eb37ac3e560443ef7e72a3646dd9178da2d4f Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 3 Sep 2019 16:26:40 +0200 Subject: [PATCH] Discard the cached BLE packet When using a BLE connection, it's not sufficient to purge the buffers of the underlying I/O stream. The locally cached BLE packet needs to be discarded also. --- src/mares_iconhd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mares_iconhd.c b/src/mares_iconhd.c index bb318e1..2a714a4 100644 --- a/src/mares_iconhd.c +++ b/src/mares_iconhd.c @@ -327,6 +327,8 @@ mares_iconhd_transfer (mares_iconhd_device_t *device, const unsigned char comman // Discard any garbage bytes. dc_iostream_purge (device->iostream, DC_DIRECTION_INPUT); + device->available = 0; + device->offset = 0; } return DC_STATUS_SUCCESS;