def __init__(self, type='process', name='process', config=None, params=None): Dut.__init__(self, name=name, params=params) GenericProcess.__init__(self, self.name, logger=self.logger) self.disable_io_prints() # because those are printed in Dut object self.proc = False self.type = type self.config = config if config else {} self.dutinformation = DutInformation(self.type, self.resource_id if self.resource_id else "", index=None, build=None) self.command = None
def __init__(self, name='serial', port=None, baudrate=460800, config=None, ch_mode_config=None, serial_config=None, params=None): Dut.__init__(self, name=name, params=params) ch_mode_config = ch_mode_config if ch_mode_config is not None else {} serial_config = serial_config if serial_config is not None else {} self.readthread = None self.port = False self.comport = port self.type = 'serial' self.name = port self.platform = '' self.serialparams = SerialParams( timeout=serial_config.get("serial_timeout", 0.01), xonxoff=serial_config.get("serial_xonxoff", False), rtscts=serial_config.get("serial_rtscts", False), baudrate=baudrate) self.chunkmodeparams = ChunkModeParams( on=ch_mode_config.get("ch_mode", False), size=ch_mode_config.get("ch_mode_chunk_size", 1), chunk_delay=ch_mode_config.get("ch_mode_ch_delay", 0.01), start_delay=ch_mode_config.get("ch_mode_start_delay", 0)) self.input_queue = deque() # Input queue self.daemon = True # Allow Python to stop us self.keep_reading = False if config: self.config.update(config) self.device = config.get("allocated", None) init_cli_cmds = None if "init_cli_cmds" in config["application"]: init_cli_cmds = config["application"]["init_cli_cmds"] if init_cli_cmds is not None: self.set_init_cli_cmds(init_cli_cmds) post_cli_cmds = None if "post_cli_cmds" in config["application"]: post_cli_cmds = config["application"]["post_cli_cmds"] if post_cli_cmds is not None: self.set_post_cli_cmds(post_cli_cmds) tid = self.config.get('allocated', {}).get('target_id', "unknown") self.dutinformation = DutInformation("serial", tid, index=self.index, build=self.build)
def __init__(self, name='tcp'): Dut.__init__(self, name=name) self.port = None self.type = 'socket'