def init_port(self):
try:
self._serialPort = serial.Serial(self._COMPort, 57600, timeout=0.5, parity=serial.PARITY_EVEN, rtscts=1)
if (self.get_info().find("CANBus Triple")) != -1:
self.dprint(1, "Port found: " + self._COMPort)
return 1
else:
self.dprint(1, "Device not found: " + self._COMPort)
self._serialPort.close()
return 0
except:
self.dprint(0, 'Error opening port: ' + self._COMPort)
return 0
评论列表
文章目录