From: razvanm Date: Tue, 17 Mar 2009 19:30:26 +0000 (+0000) Subject: Increase the ack timeout for MIB600 to 0.5s. X-Git-Tag: rc_6_tinyos_2_1_1~451 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=eda477f256ced7862edced90f263e19bd3c29bee Increase the ack timeout for MIB600 to 0.5s. --- diff --git a/support/sdk/python/tos.py b/support/sdk/python/tos.py index a8f008d2..ea140385 100644 --- a/support/sdk/python/tos.py +++ b/support/sdk/python/tos.py @@ -67,15 +67,16 @@ class Timeout(Exception): def getSource(comm): source = comm.split('@') params = source[1].split(':') + debug = '--debug' in sys.argv if source[0] == 'serial': try: - return Serial(params[0], int(params[1]), flush=True, debug=('--debug' in sys.argv)) + return Serial(params[0], int(params[1]), flush=True, debug=debug) except: print "ERROR: Unable to initialize a serial connection to", comm raise Exception elif source[0] == 'network': try: - return SerialMIB600(params[0], int(params[1]), debug=False) + return SerialMIB600(params[0], int(params[1]), debug=debug) except: print "ERROR: Unable to initialize a network connection to", comm print "ERROR:", traceback.format_exc() @@ -122,7 +123,7 @@ class Serial: self._s.timeout = timeout class SerialMIB600: - def __init__(self, host, port=10002, debug=False, readTimeout=None, ackTimeout=0.05): + def __init__(self, host, port=10002, debug=False, readTimeout=None, ackTimeout=0.5): self.debug = debug self.readTimeout = readTimeout self.ackTimeout = ackTimeout