From 1817b8b4fec10c66e4d97de73302ebe496bb82ce Mon Sep 17 00:00:00 2001 From: nakarlsson Date: Wed, 6 Dec 2023 19:54:05 +0100 Subject: [PATCH] Allow FoE write of 0byte file (#769) If FoE write of a file is done, no check of incoming size is performed. If the file is 0byte, a FoE Write Request is sent but no ACK since dofinalzero is initialized to FALSE. fixes #766 Co-authored-by: Andreas Karlsson --- soem/ethercatfoe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soem/ethercatfoe.c b/soem/ethercatfoe.c index 573cfc0..f0473ba 100644 --- a/soem/ethercatfoe.c +++ b/soem/ethercatfoe.c @@ -214,7 +214,7 @@ int ecx_FOEwrite(ecx_contextt *context, uint16 slave, char *filename, uint32 pas ec_clearmbx(&MbxOut); aFOEp = (ec_FOEt *)&MbxIn; FOEp = (ec_FOEt *)&MbxOut; - dofinalzero = FALSE; + dofinalzero = TRUE; fnsize = (uint16)strlen(filename); maxdata = context->slavelist[slave].mbx_l - 12; if (fnsize > maxdata)