patch from Christian Taedcke <hacking@taedcke.com> : fix-wrong-resetSDOline-for-sdo-timeout.patch
authorfbeaulier
Mon, 29 Aug 2011 17:31:55 +0200
changeset 665 90e6cf84a0d7
parent 664 a03f0aa7d219
child 666 9febdd6fdc71
patch from Christian Taedcke <hacking@taedcke.com> : fix-wrong-resetSDOline-for-sdo-timeout.patch
FIXED: - The sdo line must not be closed at the end of SDOTimeoutAlarm() if the same sdo line is closed and reopened for a new transfer inside the callback. (Patch from Jaroslav Fojtik)
src/sdo.c
--- a/src/sdo.c	Mon Aug 29 16:59:55 2011 +0200
+++ b/src/sdo.c	Mon Aug 29 17:31:55 2011 +0200
@@ -156,10 +156,10 @@
 	if(d->transfers[id].Callback)
 		/*If ther is a callback, it is responsible to close SDO transfer (client)*/
 		(*d->transfers[id].Callback)(d, nodeId);
-
 	/*Reset the line if (whoami == SDO_SERVER) or the callback did not close the line.
 	  Otherwise this sdo transfer would never be closed. */
-	resetSDOline(d, (UNS8)id);
+	if(d->transfers[id].abortCode == SDOABT_TIMED_OUT) 
+		resetSDOline(d, (UNS8)id);
 }
 
 #define StopSDO_TIMER(id) \