Skip to content

Commit f5713b3

Browse files
@FIR-756: Removed the echo of command in flask output (#19)
1 parent d733056 commit f5713b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/flaskIfc/serial_script.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def send_serial_command(port, baudrate, command):
88
ser.write((command + '\n').encode()) # Send command with newline
99
# Wait to read the serial port
1010
data = '\0'
11+
first_time = 1
1112
while True:
1213
try:
1314
# read byte by byte to find either a new line character or a prompt marker
@@ -22,7 +23,10 @@ def send_serial_command(port, baudrate, command):
2223
read_next_line = line.decode('utf-8')
2324
if ("run-platform-done" in read_next_line.strip()) or ("@agilex7_dk_si_agf014ea" in read_next_line.strip()) or ("imx8mpevk" in read_next_line.strip()):
2425
break
25-
data += read_next_line # Keep the line as-is with newline
26+
if (first_time == 1) :
27+
first_time = 0
28+
else:
29+
data += read_next_line # Keep the line as-is with newline
2630
else:
2731
break # Exit loop if no data is received
2832
except serial.SerialException as e:

0 commit comments

Comments
 (0)