From cbc8f36e870daf9a103641e54f31bdb001a8e447 Mon Sep 17 00:00:00 2001 From: ArthurKetels Date: Thu, 1 Oct 2020 23:00:01 +0200 Subject: [PATCH] Fix bug in ecx_readIDNmap(), Osize and Isize Osize and Isize where reset to 16 at every new drive number, thus loosing all lower drive mapping data. Changed to add 16 to Osize and Isize. --- soem/ethercatsoe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soem/ethercatsoe.c b/soem/ethercatsoe.c index 1fcc901..ecc9348 100644 --- a/soem/ethercatsoe.c +++ b/soem/ethercatsoe.c @@ -329,7 +329,7 @@ int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize) if ((wkc > 0) && (psize >= 4) && ((entries = etohs(SoEmapping.currentlength) / 2) > 0) && (entries <= EC_SOE_MAXMAPPING)) { /* command word (uint16) is always mapped but not in list */ - *Osize = 16; + *Osize += 16; for (itemcount = 0 ; itemcount < entries ; itemcount++) { psize = sizeof(SoEattribute); @@ -348,7 +348,7 @@ int ecx_readIDNmap(ecx_contextt *context, uint16 slave, int *Osize, int *Isize) if ((wkc > 0) && (psize >= 4) && ((entries = etohs(SoEmapping.currentlength) / 2) > 0) && (entries <= EC_SOE_MAXMAPPING)) { /* status word (uint16) is always mapped but not in list */ - *Isize = 16; + *Isize += 16; for (itemcount = 0 ; itemcount < entries ; itemcount++) { psize = sizeof(SoEattribute);