我发送" top"通过serailport到设备,然后阅读顶部信息
在那之后,我不知道如何停止"顶部"!
require 'serialport'
port = 2
args ={"baud"=>57600, "data_bits"=>8,"stop_bits"=>1,"parity"=>SerialPort::NONE}
serial_obj = SerialPort.new(port, args)
serial_obj.read_timeout=1000
serial_obj.write("top\n")
print serial_obj.read