Feature/modbus serial with generic transport (EPROT-74) - #180
Open
MrS-E wants to merge 5 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds an opt-in generic RTU transport factory API for ESP-Modbus serial controllers.
mbc_slave_create_serial_with_transport()andmbc_master_create_serial_with_transport().mb_trans_base_tthrough a documented factory callback forMB_RTUmode.mbc_*_create_serial()behavior by using the stock transport when no factory is supplied;Motivation: I ran into a similar problem to issue #176 while integrating a custom serial transport, so I added a small, generic serial factory for custom RTU transports.
Related
Related issue: #176
This change provides an RTU transport-factory extension point for custom
communication and routing implementations, supporting the issue's goal of
reusing ESP-Modbus protocol/controller logic with application-provided I/O.
Testing
I tested it using my own transport implementation (I can't disclose here) that is wired to the esp-modbus component (via managed components) that is pinned to commit e74eeaa.
The wiring looks kinda like:
Additionally, I tested it shortly by using the slave example.
I did not test the master.
Checklist
Before submitting a Pull Request, please ensure the following: