Method: SerialPort#read_timeout=

Defined in:
ext/native/serialport.c

#read_timeout=(val) ⇒ Integer

Note:

Read timeouts don’t mix well with multi-threading

Set the timeout value (in milliseconds) for reading. A negative read timeout will return all the available data without waiting, a zero read timeout will not return until at least one byte is available, and a positive read timeout returns when the requested number of bytes is available or the interval between the arrival of two bytes exceeds the timeout value.

Parameters:

  • the read timeout in milliseconds

Returns:

  • the original timeout parameter



192
193
194
195
# File 'ext/native/serialport.c', line 192

static VALUE sp_set_read_timeout(VALUE self, VALUE val)
{
   return sp_set_read_timeout_impl(self, val);
}