put serial_port in blocking read

This commit is contained in:
Aart van Halteren
2013-07-17 12:44:26 +02:00
parent fa4dc7d31c
commit 8e7fd64701
2 changed files with 5 additions and 0 deletions

View File

@@ -24,6 +24,9 @@ if __FILE__ == $0
sp = SerialPort.new(port_str, baud_rate, data_bits, stop_bits, parity)
# Make reading blocking
sp.read_timeout = 0
#just read forever
while true do
printf("%c", sp.getc)