Small compatibility improvements for esp32 embedded platforms #741
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a few small compatibility improvements for embedded platforms, specifically for the esp32 family using ESP-IDF, which are based on lwip. With these small modifications and by providing an external
nanosleep
(no need to pollute libmodbus as one can provide it externally in the project) then the library can be used in TCP mode in ESP-IDF.The changes are not enough for using it with serial ports, I may send another PR for that (it will be a little more complicated as there we need to change the init part using the UART library for that system).
Would you be interested to have that in case in the codebase? (of course with a separate
#define
to replace themodbus_rtu_connect
when one chooses that specific platform, a bit like you already have WIN32/Posix differentiation)