diff --git a/utils/minipush.rb b/utils/minipush.rb index e06433a8..3fc78479 100755 --- a/utils/minipush.rb +++ b/utils/minipush.rb @@ -31,12 +31,14 @@ class MiniPush < MiniTerm puts "[#{@name_short}] 🔌 Please power the target now" # Timeout for the request token starts after the first sign of life was received. + chars = [] received = @target_serial.readpartial(4096) Timeout.timeout(10) do loop do raise ProtocolError if received.nil? - if received.chars.last(3) == ["\u{3}", "\u{3}", "\u{3}"] + chars.concat(received.chars) + if chars.last(3) == ["\u{3}", "\u{3}", "\u{3}"] # Print the last chunk minus the request token. print received[0..-4] return