Revision 300 trunk/swipe/pingTest.py

View differences:

pingTest.py
25 25
sys.path.append('../common')
26 26
import common
27 27

  
28
common.initBus(sys.argv[1])
28
common.initBus(sys.argv[1], timeout=0.2)
29 29

  
30 30
def ping(t):
31 31
    common.sendMessage(t, common.TT_PING, "")
......
33 33

  
34 34
acks = []
35 35

  
36
for i in range(256):
37
    if ping(i):
38
        acks.append(i)
39

  
40
print "\n\ndone pinging, responses from:"
41
print acks
36
try:
37
    for i in range(256):
38
        while ping(i):
39
            acks.append(i)
40
    print "\n\ndone pinging"
41
finally:
42
    print "responses from:"
43
    print acks

Also available in: Unified diff