Sha256: 287e558ac1f17acb6b0854061545407358397660d6ae7b7ba35c804b1075e9ea
Contents?: true
Size: 428 Bytes
Versions: 26
Compression:
Stored size: 428 Bytes
Contents
require "../serialport.so" if ARGV.size < 4 STDERR.print <<EOF Usage: ruby #{$0} num_port bps nbits stopb EOF exit(1) end sp = SerialPort.new(ARGV[0].to_i, ARGV[1].to_i, ARGV[2].to_i, ARGV[3].to_i, SerialPort::NONE) open("/dev/tty", "r+") { |tty| tty.sync = true Thread.new { while true do tty.printf("%c", sp.getc) end } while (l = tty.gets) do sp.write(l.sub("\n", "\r")) end } sp.close
Version data entries
26 entries across 26 versions & 11 rubygems