INNER CODE UNIT · Python
parse_mdns_devices
cvet/fonline · BuildTools/android_device.py:167
def parse_mdns_devices(output: str) -> list[MdnsDevice]:
devices: list[MdnsDevice] = []
seen: set[str] = set()
for raw_line in output.splitlines():
line = raw_line.strip()
if not line or line.startswith('List of discovered mdns services'):
continue
if not any(marker in line for marker in MDNS_CONNECT_MARKERS):
continue
tokens = line.split()
endpoint = ''
endpoint_index = -1
for index in range(len(tokens) - 1, -1, -1):
token = tokens[index].rstrip(',;')
if ':' not in token:
continue