def __init__(self, device_id): assert is_device_connected(device_id) self.device_id = device_id logger.info('searching a usable port ...') self.port = self._get_port() logger.info('device {} bind to port {}'.format(device_id, self.port)) # check minitouch self.installer = MNTInstaller(device_id) # keep minitouch alive self._forward_port() self.mnt_process = None self._start_mnt() # make sure it's up time.sleep(1) assert self.heartbeat(), 'minitouch did not work. Try to install it by yourself?'
def __init__(self, device_id): assert is_device_connected(device_id) self.device_id = device_id logger.info("searching a usable port ...") self.port = self._get_port() logger.info("device {} bind to port {}".format(device_id, self.port)) # check minitouch self.installer = MNTInstaller(device_id) # keep minitouch alive self._forward_port() self.mnt_process = None self._start_mnt() # make sure it's up time.sleep(1) assert ( self.heartbeat() ), "minitouch did not work. see https://github.com/williamfzc/pyminitouch/issues/11"