From 5c2bd55bf7a76194da4ab27fc225ef488e8a8d05 Mon Sep 17 00:00:00 2001 From: Takumasa Sakao Date: Mon, 4 Jan 2021 22:24:44 +0900 Subject: [PATCH] Fix bug of minipush --- utils/minipush.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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