Add support for user defined RTS toggle function#189
Add support for user defined RTS toggle function#189Kwarf wants to merge 1 commit intostephane:masterfrom
Conversation
|
@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). |
|
Thank you very much. Merged. |
|
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. |
|
Good catch it could be a good idea to merge ASCII support for 3.2 to avoid
|
|
Jimmy, Thanks a lot for adding that feature. I tried to use the function but only got segfault so far. 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. |
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.