@@ -18,6 +18,9 @@ The _modbus_set_byte_timeout()_ function shall set the timeout interval between
two consecutive bytes of the same message. If the delay between is longer than
the given timeout, an error will be raised.
+If the timeout value has a tv_sec of -1 then this timeout will not be used at
+all. This results in modbus_set_response_timeout governing the entire timeout
+duration of an operation.
RETURN VALUE
------------
@@ -442,7 +442,7 @@ static int receive_msg(modbus_t *ctx, uint8_t *msg, msg_type_t msg_type)
}
- if (length_to_read > 0) {
+ if (length_to_read > 0 && ctx->byte_timeout.tv_sec != -1) {
/* If there is no character in the buffer, the allowed timeout
interval between two consecutive bytes is defined by
byte_timeout */