'\" t
.\" Title: modbus_get_response_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_GET_RESPONSE_" "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_get_response_timeout \- get timeout for response
.SH "SYNOPSIS"
.sp
\fBint modbus_get_response_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_get_response_timeout()\fR function shall return the timeout interval used to wait for a response in the \fIto_sec\fR and \fIto_usec\fR arguments\&.
.SH "RETURN VALUE"
.sp
The function shall return 0 if successful\&. Otherwise it shall return \-1 and set errno\&.
.SH "EXAMPLE"
.sp
.if n \{\
.RS 4
.\}
.nf
uint32_t old_response_to_sec;
uint32_t old_response_to_usec;
/* Save original timeout */
modbus_get_response_timeout(ctx, &old_response_to_sec, &old_response_to_usec);
/* Define a new and too short timeout! */
modbus_set_response_timeout(ctx, 0, 0);
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp
\fBmodbus_set_response_timeout\fR(3) \fBmodbus_get_byte_timeout\fR(3) \fBmodbus_set_byte_timeout\fR(3)
.SH "AUTHORS"
.sp
The libmodbus documentation was written by Stéphane Raimbault