'\" t .\" Title: modbus_set_byte_timeout .\" 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_SET_BYTE_TIME" "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_set_byte_timeout \- set timeout between bytes .SH "SYNOPSIS" .sp \fBvoid modbus_set_byte_timeout(modbus_t *\fR\fB\fIctx\fR\fR\fB, uint32_t \fR\fB\fIto_sec\fR\fR\fB, uint32_t \fR\fB\fIto_usec\fR\fR\fB);\fR .SH "DESCRIPTION" .sp The \fBmodbus_set_byte_timeout()\fR function shall set the timeout interval between two consecutive bytes of the same message\&. The timeout is an upper bound on the amount of time elapsed before \fBselect()\fR returns, if the time elapsed is longer than the defined timeout, an ETIMEDOUT error will be raised by the function waiting for a response\&. .sp The value of \fIto_usec\fR argument must be in the range 0 to 999999\&. .sp If both \fIto_sec\fR and \fIto_usec\fR are zero, this timeout will not be used at all\&. In this case, \fBmodbus_set_response_timeout()\fR governs the entire handling of the response, the full confirmation response must be received before expiration of the response timeout\&. When a byte timeout is set, the response timeout is only used to wait for until the first byte of the response\&. .SH "RETURN VALUE" .sp The function shall return 0 if successful\&. Otherwise it shall return \-1 and set errno\&. .SH "ERRORS" .PP \fBEINVAL\fR .RS 4 The argument \fIctx\fR is NULL or \fIto_usec\fR is larger than 1000000\&. .RE .SH "SEE ALSO" .sp \fBmodbus_get_byte_timeout\fR(3) \fBmodbus_get_response_timeout\fR(3) \fBmodbus_set_response_timeout\fR(3) .SH "AUTHORS" .sp The libmodbus documentation was written by Stéphane Raimbault