Skip to content

Using serialport prevents puts from writing to terminal? #67

@sjalloq

Description

@sjalloq

Hi,

I've only just started playing with this but have been confused for an hour or so after trying to print debug information to the terminal I'm running my script from. When using any of the IO.read* methods, I don't get any output to my terminal when trying to print/puts.

I've setup a simple echo server with a virtual terminal and the script is working but fails to print anything to the terminal. What's going on?

require 'serialport'

NONE = 0

s = SerialPort.new(3,9600,8,1,NONE)

puts "Read timeout is set to '#{s.read_timeout}'"
puts "SerialPort params are: #{s.get_modem_params}"

while true do
  c = s.readline("\n")
  s.printf(c)
  puts c
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions