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

SW-307: serialTester with pseudo-tty-USB #175

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
18 changes: 14 additions & 4 deletions software/openvisualizer/openvisualizer/moteProbe/moteProbe.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,25 @@ def findSerialPorts(isIotMotes=False):
tester = SerialTester(probe.portname)
tester.setNumTestPkt(1)
tester.setTimeout(2)
tester.test(blocking=True)
if tester.getStats()['numOk'] >= 1:
mote_ports.append((port[0],BAUDRATE_LOCAL_BOARD));
# stop the test as soon as a packet is ok
test=0
while True:
tester.test(blocking=True)

if tester.getStats()['numOk'] >= 1:
mote_ports.append((port[0],BAUDRATE_LOCAL_BOARD));
break
#at most 3 retries
if (test>5):
break;
test = test + 1

probe.close()
probe.join()

# log
log.info("discovered following COM port: {0}".format(['{0}@{1}'.format(s[0],s[1]) for s in mote_ports]))

return mote_ports

#============================ class ===========================================
Expand Down