26 |
26 |
27 def connect(self): |
27 def connect(self): |
28 if self.connected: |
28 if self.connected: |
29 return True |
29 return True |
30 try: |
30 try: |
31 self.com = serial.Serial(self.device, baudrate=self.speed, |
31 self.com = serial.Serial(self.device, baudrate=self.speed, |
32 xonxoff=0, timeout=0.1) |
32 xonxoff=0, timeout=0.1) |
33 except serial.SerialException, err: |
33 except serial.SerialException, err: |
34 print err |
34 print err |
35 sys.exit(1) |
35 sys.exit(1) |
36 self.connected = True |
36 self.connected = True |