Skip to content

Commit

Permalink
fix the clean up couldn't work issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhsuan committed Jan 15, 2025
1 parent 8184134 commit 584dc32
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ def client_mode(ser: Serial, data_size: int = 1024):
running on port /dev/ttymxc1 as a client
$ sudo ./serial_test.py /dev/ttymxc1 --mode client --type RS485
"""

random_string = generate_random_string(data_size)

# clean up the garbage in the serial before test
while ser.recv() is not None:
while ser.recv() :
continue
random_string = generate_random_string(data_size)
ser.send(random_string.encode())
for i in range(1, 6):
logging.info("Attempting receive string... {} time".format(i))
Expand Down

0 comments on commit 584dc32

Please sign in to comment.