我通过serailport向设备发送“top”,然后读取top info
之后,我不知道如何停止“top”!
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