From 633e8423dc337e440cec563426fe0e510571c325 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Sun, 23 Dec 2012 12:48:49 +0100 Subject: [PATCH] Add a small delay before retrying a packet. If the first attempt fails, that might indicate the device isn't ready yet to service requests. In that case immediately retrying again isn't the right solution. Adding a small delay seems to increase the success rate, so it's a good idea anyway, regardless of the underlying reason. --- src/mares_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mares_common.c b/src/mares_common.c index 419b09a..6e79ae2 100644 --- a/src/mares_common.c +++ b/src/mares_common.c @@ -201,6 +201,7 @@ mares_common_transfer (mares_common_device_t *device, const unsigned char comman return rc; // Discard any garbage bytes. + serial_sleep (device->port, 100); serial_flush (device->port, SERIAL_QUEUE_INPUT); }