From cd543b92bd3dcafceedc6c1b2d4b2494c0bf31f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Thu, 30 Jul 2015 08:55:41 +0200 Subject: [PATCH] ensure serial settings (weird bug) --- mitm.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mitm.rb b/mitm.rb index 813513a..288ce5f 100755 --- a/mitm.rb +++ b/mitm.rb @@ -7,6 +7,10 @@ require './telegram' pc_serial = SerialPort.open("/dev/ttyUSB0",{ baud: 57600, databits: 8, parity: SerialPort::ODD, stop_bit: 1, flow_control: SerialPort::NONE}) ps_serial = SerialPort.open("/dev/ttyACM0",{ baud: 115200, databits: 8, parity: SerialPort::ODD, stop_bit: 1, flow_control: SerialPort::NONE}) +# ensure serial settings (weird bug) +pc_serial.baud = 57600 +pc_serial.parity = SerialPort::ODD + while true activities = IO.select([pc_serial,ps_serial]) activities[0].each do |activity|