X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=support%2Fsdk%2Fpython%2Ftos.py;h=330df0c2a4c66b29f6790805e70b8a947eda2188;hb=e3b86016fda95d4e54e2909f05dba41ca8461e16;hp=ea140385938ecca4e2e5a93a7802a93ea2687ba9;hpb=32ad8ba62489a61e6575b48323602ba8260f1bd0;p=tinyos-2.x.git diff --git a/support/sdk/python/tos.py b/support/sdk/python/tos.py index ea140385..330df0c2 100644 --- a/support/sdk/python/tos.py +++ b/support/sdk/python/tos.py @@ -90,6 +90,11 @@ class Serial: self.ackTimeout = ackTimeout self._ts = None + if port.startswith('COM') or port.startswith('com'): + port = int(port[3:]) - 1 + elif port.isdigit(): + port = int(port) - 1 + self._s = serial.Serial(port, int(baudrate), rtscts=0, timeout=0.5) self._s.flushInput() if flush: