Skip to content

Add support for user defined RTS toggle function #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Kwarf
Copy link
Contributor

@Kwarf Kwarf commented Jan 15, 2014

This patch allows users to register a custom callback function to set the RTS pin. This is handy on embedded systems where hardware RTS is not available, allowing the use of GPIO or raw register access instead.

By default it is mapped to call _modbus_rtu_ioctl_rts so it doesn't change the current functionality.

This is more or less a cleaned up version of etactica/libmodbus@306e7ab for which I couldn't find a pull request. This relates to #156 and #23.

@ghost ghost assigned stephane Jan 28, 2014
@stephane
Copy link
Owner

@Kwarf I'm willing to merge your patch but you need to accept the libmodbus CLA first (sent by mail, it will be available on web site soon).

@stephane
Copy link
Owner

Thank you very much. Merged.
a8676b7

@stephane stephane closed this Aug 27, 2015
@stephane stephane modified the milestones: v3.2.0, v3.4.0 Aug 27, 2015
@karlp
Copy link
Contributor

karlp commented Aug 27, 2015

just a note, the docs for this will need updating when ASCII support comes in, as this is a serial setting, not a RTU setting.

@stephane
Copy link
Owner

Good catch it could be a good idea to merge ASCII support for 3.2 to avoid
further api changes later.
Le 27 août 2015 2:16 PM, "Karl Palsson" [email protected] a écrit :

just a note, the docs for this will need updating when ASCII support comes
in, as this is a serial setting, not a RTU setting.


Reply to this email directly or view it on GitHub
#189 (comment).

@noeldum
Copy link

noeldum commented Jul 4, 2016

Jimmy, Thanks a lot for adding that feature. I tried to use the function but only got segfault so far.
Would you have any simple example of use?
I posted this issue a while ago on the google group here.

I seem to get an issue with defining a rts function outside of modbus-rtu.c. If I include that rts function inside modbus-rtu.c all works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants