Lines Matching full:self
37 def __init__(self, argument
53 self.serial = serial
54 self.baud = serial_baud or 115200
55 self.platform = platform
56 self.serial_pty = serial_pty
57 self._counter = Value("i", 0)
58 self._available = Value("i", 1)
59 self.connected = connected
60 self.pre_script = pre_script
61 self.id = id
62 self.product = product
63 self.runner = runner
64 self.runner_params = runner_params
65 self.fixtures = []
66 self.post_flash_script = post_flash_script
67 self.post_script = post_script
68 self.pre_script = pre_script
69 self.probe_id = None
70 self.notes = None
71 self.lock = Lock()
72 self.match = False
73 self.flash_timeout = flash_timeout
74 self.flash_with_test = flash_with_test
77 def available(self): argument
78 with self._available.get_lock():
79 return self._available.value
82 def available(self, value): argument
83 with self._available.get_lock():
84 self._available.value = value
87 def counter(self): argument
88 with self._counter.get_lock():
89 return self._counter.value
92 def counter(self, value): argument
93 with self._counter.get_lock():
94 self._counter.value = value
96 def to_dict(self): argument
99 v = vars(self)
106 def __repr__(self): argument
107 return f"<{self.platform} ({self.product}) on {self.serial}>"
145 def __init__(self, env=None): argument
146 self.detected = []
147 self.duts = []
148 self.options = env.options
150 def discover(self): argument
152 if self.options.generate_hardware_map:
153 self.scan(persistent=self.options.persistent_hardware_map)
154 self.save(self.options.generate_hardware_map)
157 if not self.options.device_testing and self.options.hardware_map:
158 self.load(self.options.hardware_map)
160 self.dump(connected_only=True)
163 if self.options.device_testing:
164 if self.options.hardware_map:
165 self.load(self.options.hardware_map)
166 if not self.options.platform:
167 self.options.platform = []
168 for d in self.duts:
170 self.options.platform.append(d.platform)
172 elif self.options.device_serial:
173 self.add_device(self.options.device_serial,
174 self.options.platform[0],
175 self.options.pre_script,
177 baud=self.options.device_serial_baud,
178 flash_timeout=self.options.device_flash_timeout,
179 flash_with_test=self.options.device_flash_with_test
182 elif self.options.device_serial_pty:
183 self.add_device(self.options.device_serial_pty,
184 self.options.platform[0],
185 self.options.pre_script,
187 flash_timeout=self.options.device_flash_timeout,
188 flash_with_test=self.options.device_flash_with_test
192 if self.options.fixture:
193 for d in self.duts:
194 d.fixtures.extend(self.options.fixture)
198 def summary(self, selected_platforms): argument
202 for d in self.duts:
209 …def add_device(self, serial, platform, pre_script, is_pty, baud=None, flash_timeout=60, flash_with… argument
218 self.duts.append(device)
220 def load(self, map_file): argument
221 hwm_schema = scl.yaml_load(self.schema_path)
227 flash_timeout = dut.get('flash_timeout') or self.options.device_flash_timeout
230 flash_with_test = self.options.device_flash_with_test
259 self.duts.append(new_dut)
261 def scan(self, persistent=False): argument
289 if d.manufacturer in self.manufacturer:
306 for runner, _ in self.runner_mapping.items():
307 products = self.runner_mapping.get(runner)
318 self.detected.append(s_dev)
322 def save(self, hwm_file): argument
324 self.detected.sort(key=lambda x: x.serial or '')
336 for _detected in self.detected:
349 new_duts = list(filter(lambda d: not d.match, self.detected))
362 self.load(hwm_file)
364 self.dump()
369 for _connected in self.detected:
387 self.dump(detected=True)
389 def dump(self, filtered=[], header=[], connected_only=False, detected=False): argument
393 to_show = self.detected
395 to_show = self.duts