From 8cec4d0a420780f11599b53796ebadc5260d8854 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 13 Apr 2012 21:35:33 +0200 Subject: [PATCH] Increase the read timeout to 4 seconds. When the OSTC receives the download dives command, it responds immediately with the preamble bytes. But then it does a linear search through its internal memory to locate the end-of-profile marker. As a result the response time increases when the marker is located near the end of the memory area. In the worst case scenario, the response time can exceed the 3 second read timeout with a few milliseconds. Since the required timeout depends on the total amount of profile memory, this problem was indirectly introduced with firmware v1.91, which doubled the amount of profile memory from 32K to 64K. --- src/hw_ostc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hw_ostc.c b/src/hw_ostc.c index 12f916d..7a2d966 100644 --- a/src/hw_ostc.c +++ b/src/hw_ostc.c @@ -148,8 +148,8 @@ hw_ostc_device_open (device_t **out, const char* name) return DEVICE_STATUS_IO; } - // Set the timeout for receiving data (3000ms). - if (serial_set_timeout (device->port, 3000) == -1) { + // Set the timeout for receiving data. + if (serial_set_timeout (device->port, 4000) == -1) { WARNING ("Failed to set the timeout."); serial_close (device->port); free (device);