Hello everyone,
here is a patch for libmcip. I tried to use the library for sending larger
messages (over 8000 bytes) and failed miserably.
After much trial and error, I figured that libmcip file-pointer arithmetic
must be flawed: mcip_remove_telegram() with "SEARCH_NEXT_STARTBYTE"
returned a position that was bogus: it was somewhere in the middle of the
telegram, not _after_ the telegram according to the length specified.
To fix this, I did the following: all pointers to the payload were changed
from char to uint8_t. This fixed the issue.
However, to hide this change in the API, I opted for the following
approach: I changed all char pointers to void pointers, which are then cast
to uint8_t in the function body. That way, users can continue to use the
API as they did before.
Best regards
Jean-Christophe Zeus
|