'\" t
.\" Title: modbus_rtu_set_custom_rts
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 10/15/2022
.\" Manual: libmodbus Manual
.\" Source: libmodbus v3.1.6
.\" Language: English
.\"
.TH "MODBUS_RTU_SET_CUSTO" "3" "10/15/2022" "libmodbus v3\&.1\&.6" "libmodbus Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
modbus_rtu_set_custom_rts \- set a function to be used for custom RTS implementation
.SH "SYNOPSIS"
.sp
\fBint modbus_rtu_set_custom_rts(modbus_t *\fR\fB\fIctx\fR\fR\fB, void (\fR\fIset_rts\fR) (modbus_t \fBctx, int on))\fR
.SH "DESCRIPTION"
.sp
The \fImodbus_rtu_set_custom_rts()\fR function shall set a custom function to be called when the RTS pin is to be set before and after a transmission\&. By default this is set to an internal function that toggles the RTS pin using an ioctl call\&.
.sp
Note that this function adheres to the RTS mode, the values MODBUS_RTU_RTS_UP or MODBUS_RTU_RTS_DOWN must be used for the function to be called\&.
.sp
This function can only be used with a context using a RTU backend\&.
.SH "RETURN VALUE"
.sp
The \fImodbus_rtu_set_custom_rts()\fR function shall return 0 if successful\&. Otherwise it shall return \-1 and set errno to one of the values defined below\&.
.SH "ERRORS"
.PP
\fBEINVAL\fR
.RS 4
The libmodbus backend is not RTU\&.
.RE
.SH "AUTHORS"
.sp
Jimmy Bergström
.sp
The libmodbus documentation was written by Stéphane Raimbault