Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[checkbox-ce-oem] Enhance serial test to be more stable (Bugfix) #1682

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ def recv(self) -> bytes:
if rcv:
logging.info("Received: {}".format(rcv.decode()))
except Exception:
logging.exception("Received unmanageable string format")
raise SystemExit(1)
logging.exception(
"Received unmanageable string format {}".format(rcv)
)
return None
return rcv


Expand Down Expand Up @@ -157,7 +159,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():
continue
ser.send(random_string.encode())
for i in range(1, 6):
logging.info("Attempting receive string... {} time".format(i))
Expand Down
Loading